import org.tizen.dynamicanalyzer.setting.TargetData;
import org.tizen.dynamicanalyzer.setting.Template;
import org.tizen.dynamicanalyzer.setting.TemplateData;
+import org.tizen.dynamicanalyzer.util.CommonUtil;
import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener;
import org.tizen.dynamicanalyzer.widgets.button.toggle.DACustomToggleButton;
import org.tizen.dynamicanalyzer.widgets.da.base.DAButton;
import org.tizen.dynamicanalyzer.widgets.da.view.DAPageComposite;
-public class SettingDialogTemplatePage extends DAPageComposite {
+public class SettingDialogTemplatePage extends DAPageComposite {
private enum ProfileDisplayInfo {
- PROFILE_NAME_MOBILE(0, ConfigureLabels.TARGET_NAME_MOBILE, ImageResources.TARGET_NAME_MOBILE),
+ PROFILE_NAME_MOBILE(0, ConfigureLabels.TARGET_NAME_MOBILE,
+ ImageResources.TARGET_NAME_MOBILE),
PROFILE_NAME_TV(1, ConfigureLabels.TARGET_NAME_TV, ImageResources.TARGET_NAME_TV),
- PROFILE_NAME_WEARABLE(2, ConfigureLabels.TARGET_NAME_WEARABLE, ImageResources.TARGET_NAME_WEARABLE);
-
+ PROFILE_NAME_WEARABLE(2, ConfigureLabels.TARGET_NAME_WEARABLE,
+ ImageResources.TARGET_NAME_WEARABLE);
+
private int id = -1;
private String displayName = null;
private Image image = null;
-
+
private ProfileDisplayInfo(int id, String displayName, Image image) {
this.id = id;
this.displayName = displayName;
this.image = image;
}
-
+
public static Image getImage(String displayName) {
ProfileDisplayInfo[] profiles = ProfileDisplayInfo.values();
for (ProfileDisplayInfo profile : profiles) {
return null;
}
};
-
+
private enum TemplateDisplayInfo {
- TEMPLATE_NAME_BOTTLENECK(0, ConfigureLabels.TEMPLATE_NAME_BOTTLENECK,
+ TEMPLATE_NAME_BOTTLENECK(0, ConfigureLabels.TEMPLATE_NAME_BOTTLENECK,
ImageResources.TEMPLATE_BOTTLENECK_ANALYSIS),
- TEMPLATE_NAME_MEMORY_LEAKS(1, ConfigureLabels.TEMPLATE_NAME_MEMORY_LEAKS,
+ TEMPLATE_NAME_MEMORY_LEAKS(1, ConfigureLabels.TEMPLATE_NAME_MEMORY_LEAKS,
ImageResources.TEMPLATE_MEMORY_LEAK),
- TEMPLATE_NAME_PROCESS_ACTIVITY(2, ConfigureLabels.TEMPLATE_NAME_PROCESS_ACTIVITY,
+ TEMPLATE_NAME_PROCESS_ACTIVITY(2, ConfigureLabels.TEMPLATE_NAME_PROCESS_ACTIVITY,
ImageResources.TEMPLATE_PROCESS_ACTIVITY),
- TEMPLATE_NAME_FILE(3, ConfigureLabels.TEMPLATE_NAME_FILE,
+ TEMPLATE_NAME_FILE(3, ConfigureLabels.TEMPLATE_NAME_FILE,
ImageResources.TEMPLATE_FILE_ANALYSIS),
- TEMPLATE_NAME_THREAD_ACTIVITY(4, ConfigureLabels.TEMPLATE_NAME_THREAD_ACTIVITY,
+ TEMPLATE_NAME_THREAD_ACTIVITY(4, ConfigureLabels.TEMPLATE_NAME_THREAD_ACTIVITY,
ImageResources.TEMPLATE_THREAD_ACTIVITY_ANALYSIS),
- TEMPLATE_NAME_WAIT_STATUS(5, ConfigureLabels.TEMPLATE_NAME_WAIT_STATUS,
+ TEMPLATE_NAME_WAIT_STATUS(5, ConfigureLabels.TEMPLATE_NAME_WAIT_STATUS,
ImageResources.TEMPLATE_WAIT_STATUS_ANALYSIS),
- TEMPLATE_NAME_NETWORK(6, ConfigureLabels.TEMPLATE_NAME_NETWORK,
+ TEMPLATE_NAME_NETWORK(6, ConfigureLabels.TEMPLATE_NAME_NETWORK,
ImageResources.TEMPLATE_NETWORK_ANALYSIS),
- TEMPLATE_NAME_OPEN_GL(7, ConfigureLabels.TEMPLATE_NAME_OPEN_GL,
+ TEMPLATE_NAME_OPEN_GL(7, ConfigureLabels.TEMPLATE_NAME_OPEN_GL,
ImageResources.TEMPLATE_OPEN_GL_ANALYSIS),
- TEMPLATE_NAME_ENERGY(8, ConfigureLabels.TEMPLATE_NAME_ENERGY,
+ TEMPLATE_NAME_ENERGY(8, ConfigureLabels.TEMPLATE_NAME_ENERGY,
ImageResources.TEMPLATE_ENERGY),
- TEMPLATE_NAME_CUSTOM(9, ConfigureLabels.TEMPLATE_NAME_CUSTOM,
+ TEMPLATE_NAME_HIERARCHY_VIEWER(9, ConfigureLabels.TEMPLATE_NAME_UI_HIERARCHY,
+ ImageResources.TEMPLATE_UI_HIERARCHY_ANALYSIS),
+ TEMPLATE_NAME_CUSTOM(10, ConfigureLabels.TEMPLATE_NAME_CUSTOM,
ImageResources.TEMPLATE_CUSTOM);
-
+
private int id = -1;
private String displayName = null;
private Image image = null;
-
+
private TemplateDisplayInfo(int id, String displayName, Image image) {
this.id = id;
this.displayName = displayName;
this.image = image;
}
-
+
public static Image getImage(String displayName) {
TemplateDisplayInfo[] templates = TemplateDisplayInfo.values();
for (TemplateDisplayInfo template : templates) {
compData.top = new FormAttachment(0, 41);
compData.left = new FormAttachment(0, 6);
compData.width = 86;
- compData.height = 373;
+ compData.height = 403;
targetComp.setLayoutData(compData);
targetComp.setBackground(ColorResources.WHITE);
TargetData target = entry.getValue();
DACustomToggleButton toggle = createToggleButton(targetInputComposite,
- ProfileDisplayInfo.getImage(target.getTargetName()), imagePoint,
+ ProfileDisplayInfo.getImage(target.getTargetName()), imagePoint,
target.getTargetName(), fontPoint, 76, 76, topPosition, leftPosition);
targetGroup.addToggleButton(toggle);
}
}
targetComp.layout(true);
+ targetInputComposite.layout();
+ targetScrolledComposite.setMinSize(targetInputComposite.computeSize(SWT.DEFAULT,
+ SWT.DEFAULT));
if (!DAState.isStartable()) {
targetComp.setEnabled(false);
descriptionComp = new Composite(this, SWT.NONE);
descriptionComp.setLayout(new FormLayout());
FormData compData = new FormData();
- compData.top = new FormAttachment(0, 235);
+ compData.top = new FormAttachment(0, 265);
compData.left = new FormAttachment(0, 98);
- compData.width = 504;
+ compData.width = 524;
compData.height = 179;
descriptionComp.setLayoutData(compData);
descriptionComp.setBackground(ColorResources.WHITE);
FormData compData = new FormData();
compData.top = new FormAttachment(0, 41);
compData.left = new FormAttachment(0, 98);
- compData.width = 504;
- compData.height = 188;
+ compData.width = 524;
+ compData.height = 218;
templateComp.setLayoutData(compData);
templateComp.setBackground(ColorResources.WHITE);
e.gc.drawLine(0, 22, rect.width - 1, 22);
e.gc.setBackground(ColorResources.SETTING_TITLE_BACKGROUND);
- e.gc.fillRectangle(1, 1, 502, 21);
+ e.gc.fillRectangle(1, 1, 522, 21);
}
});
DACustomToggleButtonGroup targetGroup = new DACustomToggleButtonGroup();
Point imagePoint = new Point(23, 8);
Point fontPoint = new Point(-1, 60);
+ int defaultLeftPosition = 21; // linux, mac
+ if (CommonUtil.isWin()) {
+ defaultLeftPosition = 13;
+ }
+
int topPosition = 4;
- int leftPosition = 13;
+ int leftPosition = defaultLeftPosition;
TargetData target = SettingDataManager.INSTANCE.getTarget(selectedTarget);
Template selectedTemplate = target.getSelectedTemplate();
if (leftPosition + 96 < 480) {
leftPosition += 96;
} else {
- leftPosition = 13;
+ leftPosition = defaultLeftPosition;
topPosition += 79;
}
}
templateComp.layout(true);
+ inputComposite.layout();
+ scrolledComposite.setMinSize(inputComposite.computeSize(SWT.DEFAULT, SWT.DEFAULT));
if (!DAState.isStartable()) {
templateComp.setEnabled(false);