--- /dev/null
+package org.tizen.dynamicanalyzer.widgets;
+
+public class DAWidgetConstants {
+ public static final String EMPTY_STRING = "";
+}
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Shell;
+import org.tizen.dynamicanalyzer.widgets.DAWidgetConstants;
import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
import org.tizen.dynamicanalyzer.widgets.helper.ColorResources;
private DACustomButton upArrowButton = null;
private DACustomButton downArrowButton = null;
private int itemIndex = 0;
+ private boolean dirty = false;
private List<String> items;
private List<Rectangle> rects = null;
addPaintListener(comboPaintListener);
setForeground(ColorResources.WHITE);
addListeners();
+ initCombo();
}
public void addListeners() {
popupRenderer = newRenderer;
}
- public void removeAll() {
- getItems().clear();
- }
+// public void removeAll() {
+// getItems().clear();
+// }
public void add(String item) {
- getItems().add(item);
+ if (dirty) {
+ getItems().add(item);
+ } else {
+ getItems().set(0, item);
+ dirty = true;
+ }
}
public void select(int index) {
}
};
+ public boolean isDirty() {
+ return dirty;
+ }
+
+ public void initCombo() {
+ getItems().clear();
+ itemIndex = 0;
+ selection = 0;
+ items.add(DAWidgetConstants.EMPTY_STRING);
+ dirty = false;
+ }
}
// for (String line : lines) {
int size = lines.length;
for (int i = 0; i < size;) {
+ if (i % 2 == 0 && i + 1 >= size) {
+ System.out.println(" bug catch!! " + i);
+ break;
+ }
AppDesktopInfo desktopInfo = new AppDesktopInfo();
String desktopName = AnalyzerLabels.EMPTY_STRING;
for (int ii = 0; ii < 2; ii++) {
desktopInfo.setExecPath(new String(splitName[1]));
}
}
- desktopInfo.setDesktopName(new String(desktopName));
- appDesktopList.add(desktopInfo);
- if (i == size) {
- break;
+ if (null != desktopInfo.getExecPath()
+ && !desktopInfo.getExecPath().isEmpty()) {
+ desktopInfo.setDesktopName(new String(desktopName));
+ appDesktopList.add(desktopInfo);
}
+ // if (i == size) {
+ // break;
+ // }
}
}
};
}\r
\r
private void loadCallStackApis(Project p) {\r
- ResultSet rs = SqlManager.selectAllFromTable("CallStackAPIs"); //$NON-NLS-1$\r
+ ResultSet rs = SqlManager.selectAllFromTable("CallStackUnits"); //$NON-NLS-1$\r
if (null == rs) {\r
return;\r
}\r
// "profiling data" table info block
{
String[] names = { "seq", "name", "exCount", "inCount",
- "callCount", "parent", "key", "exeTime" };
- String[] options = { "not null", "", "", "", "", "", "", "" };
+ "callCount", "parent", "key", "inclExeTime", "exclExeTime" };
+ String[] options = { "not null", "", "", "", "", "", "", "", "" };
String[] types = { "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT",
- "TEXT", "TEXT" };
+ "TEXT", "TEXT", "TEXT" };
DBTableInfo profilingDataTableInfo = new DBTableInfo(
TABLE_NAME_PROFILING_DATA, names, options, types);
tableInfos.set(TABLE_INDEX_PROFILING_DATA, profilingDataTableInfo);
return;
}
- appCombo.removeAll();
+// appCombo.removeAll();
+ appCombo.initCombo();
int size = apps.size();
for (int i = 0; i < size; i++) {
appCombo.add(apps.get(i).getName());
}
public void initToolbarEnablement() {
- deviceCombo.removeAll();
- deviceCombo.add(AnalyzerConstants.EMPTY);
- appCombo.removeAll();
+// deviceCombo.removeAll();
+// deviceCombo.add(AnalyzerConstants.EMPTY);
+ deviceCombo.initCombo();
+// appCombo.removeAll();
+ appCombo.initCombo();
startButton.setEnabled(false);
replayButton.setEnabled(false);
saveTraceButton.setEnabled(false);
}
public void setDeviceComboItems(List<String> items) {
- deviceCombo.removeAll();
+// deviceCombo.removeAll();
+ deviceCombo.initCombo();
if (items.isEmpty()) {
deviceCombo.add(AnalyzerConstants.EMPTY);
deviceCombo.select(0);
- appCombo.removeAll();
- appCombo.add(AnalyzerConstants.EMPTY);
- appCombo.select(0);
+// appCombo.removeAll();
+// appCombo.add(AnalyzerConstants.EMPTY);
+// appCombo.select(0);
+ appCombo.initCombo();
appCombo.setEnabled(false);
setRepalyButtonEnable(false);
return;
}
public void setAppComboItems(List<String> items) {
- appCombo.removeAll();
+// appCombo.removeAll();
+ appCombo.initCombo();
if (null == items) {
- appCombo.add(AnalyzerConstants.EMPTY);
- appCombo.select(0);
+// appCombo.add(AnalyzerConstants.EMPTY);
+// appCombo.select(0);
return;
}
int itemsSize = items.size();
if (0 != itemsSize) {
- appCombo.removeAll();
+// appCombo.removeAll();
+ appCombo.initCombo();
for (int i = 0; i < itemsSize; i++) {
appCombo.add(items.get(i));
}