if (maxnamelen < namelen) {
maxnamelen = namelen;
}
-
+
GridItem item = new GridItem(table, SWT.NONE);
item.setCheckable(0, false);
item.setText(1, entry.getKey().toString());
- item.setText(2, name);
+
+ // cut needless arguments (ex:"/usr/bin/Xorg :0 -#$%" -> "/usr/bin/Xorg")
+ if(name.contains(" ")){
+ int cut_index = name.indexOf(" ");
+ item.setText(2, name.substring(0, cut_index));
+ }
+ else{
+ item.setText(2, name);
+ }
+
if (initialProcesses != null && initialProcesses.containsKey(entry.getKey())) {
item.setChecked(0, true);
import org.eclipse.swt.widgets.Shell;
import org.tizen.dynamicanalyzer.appearance.DesignConstants;
import org.tizen.dynamicanalyzer.common.Global;
+import org.tizen.dynamicanalyzer.communicator.DACommunicator;
+import org.tizen.dynamicanalyzer.handlers.UIAction;
import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
import org.tizen.dynamicanalyzer.nl.UserErrorWarningLabels;
import org.tizen.dynamicanalyzer.nl.WidgetLabels;
@Override
public void handleClickEvent(DACustomButton button) {
result = explorer.getSelectedProcess();
+
if (null != result) {
+ Boolean process_validation = checkInvalidProcess((Map<Integer, String>) result);
+ if(process_validation){
+ shell.dispose();
+ }
+ else{
+ UIAction.showWarning("Selected Process isn't running. Reselect process");
+ explorer.updateData();
+ }
+ }
+ /// If result is null, close explorer
+ else{
shell.dispose();
}
+
}
});
}
});
}
+
+
+ public Boolean checkInvalidProcess(Map<Integer, String> result){
+ Map<Integer, String> processes = DACommunicator.getProcessList();
+
+ for(Map.Entry<Integer, String> result_entry : result.entrySet()){
+
+ Integer result_key = result_entry.getKey();
+
+ /// don't have selected PID
+ if(!processes.containsKey(result_key) ){
+ return false;
+ }
+ /// don't matched PROCESS_NAME
+ else{
+ String Compare = processes.get(result_key);
+
+ if(!Compare.contains(result_entry.getValue())){
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+
public void setProcessList(Map<Integer, String> proc) {
explorer.setSelectedProcess(proc);
}