| SYSTEM_MEMORY | SYSTEM_DISK | SYSTEM_NETWORK | SYSTEM_DEVICE;\r
\r
public static final int SYSTEM_ENERGY = 0x4000000;\r
+ \r
+ public static final int MEMORY_API_PROBING_NO_FILTER = 0x10000000;\r
+ public static final int FILE_API_PROBING_NO_FILTER = 0x20000000;\r
+ public static final int THREAD_API_PROBING_NO_FILTER = 0x40000000;\r
+ public static final int OSP_UI_API_PROBING_NO_FILTER = 0x80000000;\r
+ public static final int NETWORK_API_PROBING_NO_FILTER = 0x0000; //must modification\r
+ public static final int OPENGL_API_PROBING_NO_FILTER = 0x0000;//must modification\r
+ public static final int SNAPSHOT_PERIODIC = 1000;//must modification\r
+ public static final int SNAPSHOT_PERIODIC_AUTO = 1;//must modification\r
+ public static final int FUNCTION_PROFILING_SAMPLING_PERIODIC = 1000;//must modification\r
+ public static final int SYSTEM_INFOMATION_SAMPLING_PERIODIC = 1000;//must modification\r
+ \r
\r
/* Message Type */\r
public static final int MSG_APP_INFO = 1; //$NON-NLS-1$\r
public static String FEATURE_TABLE_FEATURE_EMPTY;
public static String FEATURE_TABLE_FEATURE_NAME;
public static String FEATURE_DETAIL_TITLE;
+ public static String FEATURE_DETAIL_SETTING_TITLE;
+
public static String SETTING_TABLE_TITLE;
public static String SETTING_WHITE;
public static String SETTING_CONFIGURATION_TITLE;
public static String WELCONE_ASK_USE_AGAIN;
+
+ public static String INCLUDE_INSIDE_CALL;
+ public static String AUTO;
+ public static String SECOND;
+ public static String MS;
// features name
public static String FEATURE_FUNCTION_PROFILING;
public static String SHOW_INITIAL;
public static String AUTO_STOP;
+
+ public static String INCLUDE_INSIDE_CALL_MEMORY;
+ public static String INCLUDE_INSIDE_CALL_THREAD;
+ public static String INCLUDE_INSIDE_CALL_FILE;
+ public static String INCLUDE_INSIDE_CALL_NETWORK;
+ public static String INCLUDE_INSIDE_CALL_UI;
+ public static String INCLUDE_INSIDE_OPENGL;
+ public static String SNAPSHOT_PERIODIC;
+ public static String SNAPSHOT_PERIODIC_AUTO;
+ public static String FUNCTION_PROFILING_SAMPLING_PERIODIC;
+ public static String SYSTEM_INFOMATION_SAMPLING_PERIODIC;
public static String OFF;
public static String ON;
FEATURE_TABLE_FEATURE_EMPTY=
FEATURE_TABLE_FEATURE_NAME=Name
FEATURE_DETAIL_TITLE=Details
+FEATURE_DETAIL_SETTING_TITLE=Detail Setting
SETTING_TABLE_TITLE=Appearance Settings
SETTING_WHITE=White
INTERNAL_LOG_LEVEL=Internal log level
-THEME=theme
\ No newline at end of file
+THEME=theme
+
+INCLUDE_INSIDE_CALL=Include inside call
+INCLUDE_INSIDE_CALL_MEMORY=Include inside call memory
+INCLUDE_INSIDE_CALL_THREAD=Include inside call thread
+INCLUDE_INSIDE_CALL_FILE=Include inside call file
+INCLUDE_INSIDE_CALL_NETWORK=Include inside call network
+INCLUDE_INSIDE_CALL_UI=Include inside call ui
+INCLUDE_INSIDE_OPENGL=Include inside call openGL
+SNAPSHOT_PERIODIC=Snapshot periodic
+FUNCTION_PROFILING_SAMPLING_PERIODIC=Function profiling sampling periodic
+SYSTEM_INFOMATION_SAMPLING_PERIODIC=System information sampling periodic
+SNAPSHOT_PERIODIC_AUTO=Snapshot periodic auto
+MS=ms
+SECOND=s
+AUTO=auto
\ No newline at end of file
public static final String ID = NetworkDetailInfoView.class.getName();
- // private Canvas canvas = null;
private Composite contents = null;
private Text detailText = null;
private Label labelMessage = null;
private static final int DEFAULT_THEME = 1;
private static final int DEFAULT_NOT_SHOWWELCOME = 0;
- // default value Chart
public static final String CONFIGUREMANAGER_CHART_AVAILABLE_ITEM_LISTS = TimelineChartLabels.CPU_CHART_TITLE
+ CommonConstants.COMMA
+ TimelineChartLabels.CPU_CORE_CHART_TITLE
data.put(ConfigureLabels.AUTO_STOP,
Integer.toString(AnalyzerConstants.FEATURE_OFF));
}
-
+ if (null == data.get(ConfigureLabels.INCLUDE_INSIDE_CALL_MEMORY)) {
+ data.put(ConfigureLabels.INCLUDE_INSIDE_CALL_MEMORY, Integer
+ .toString(AnalyzerConstants.MEMORY_API_PROBING_NO_FILTER));
+ }
+ if (null == data.get(ConfigureLabels.INCLUDE_INSIDE_CALL_FILE)) {
+ data.put(ConfigureLabels.INCLUDE_INSIDE_CALL_FILE, Integer
+ .toString(AnalyzerConstants.FILE_API_PROBING_NO_FILTER));
+ }
+ if (null == data.get(ConfigureLabels.INCLUDE_INSIDE_CALL_THREAD)) {
+ data.put(ConfigureLabels.INCLUDE_INSIDE_CALL_THREAD, Integer
+ .toString(AnalyzerConstants.THREAD_API_PROBING_NO_FILTER));
+ }
+ if (null == data.get(ConfigureLabels.INCLUDE_INSIDE_CALL_UI)) {
+ data.put(ConfigureLabels.INCLUDE_INSIDE_CALL_UI, Integer
+ .toString(AnalyzerConstants.OSP_UI_API_PROBING_NO_FILTER));
+ }
+ if (null == data.get(ConfigureLabels.INCLUDE_INSIDE_CALL_NETWORK)) {
+ data.put(ConfigureLabels.INCLUDE_INSIDE_CALL_NETWORK, Integer
+ .toString(AnalyzerConstants.NETWORK_API_PROBING_NO_FILTER));
+ }
+ if (null == data.get(ConfigureLabels.INCLUDE_INSIDE_OPENGL)) {
+ data.put(ConfigureLabels.INCLUDE_INSIDE_OPENGL, Integer
+ .toString(AnalyzerConstants.OPENGL_API_PROBING_NO_FILTER));
+ }
+ if (null == data.get(ConfigureLabels.SNAPSHOT_PERIODIC)) {
+ data.put(ConfigureLabels.SNAPSHOT_PERIODIC,
+ Integer.toString(AnalyzerConstants.SNAPSHOT_PERIODIC));
+ }
+ if (null == data.get(ConfigureLabels.SNAPSHOT_PERIODIC_AUTO)) {
+ data.put(ConfigureLabels.SNAPSHOT_PERIODIC_AUTO,
+ Integer.toString(AnalyzerConstants.SNAPSHOT_PERIODIC_AUTO));
+ }
+ if (null == data
+ .get(ConfigureLabels.FUNCTION_PROFILING_SAMPLING_PERIODIC)) {
+ data.put(
+ ConfigureLabels.FUNCTION_PROFILING_SAMPLING_PERIODIC,
+ Integer.toString(AnalyzerConstants.FUNCTION_PROFILING_SAMPLING_PERIODIC));
+ }
+ if (null == data
+ .get(ConfigureLabels.SYSTEM_INFOMATION_SAMPLING_PERIODIC)) {
+ data.put(
+ ConfigureLabels.SYSTEM_INFOMATION_SAMPLING_PERIODIC,
+ Integer.toString(AnalyzerConstants.SYSTEM_INFOMATION_SAMPLING_PERIODIC));
+ }
}
private void initConfigDataFromFile() {
private void doApply() {
Composite selectedComposite = tabView.getTopComposite();
if (!(selectedComposite instanceof BinarySettingsPage)) {
- ConfigurationDialogDataManager.getInstance().setTableItemsList(
+ ConfigurationDialogDataManager.getInstance().setFeaturesStatusFromTableItemsList(
featuresTable);
ConfigurationDialogDataManager.getInstance()
.applySettingValueToConfigureManager();
DACommunicator.sendRuntimeMessage(DACommunicator.MSG_TYPE_CONFIG,
null);
+ ConfigurationDialogDataManager.getInstance()
+ .setSettingValueFromConfigureManager();
+ featuresTable.updateTable();
} else {
BinarySettingsPage page = (BinarySettingsPage) selectedComposite;
page.doApply();
package org.tizen.dynamicanalyzer.ui.toolbar.configuration;
+import org.tizen.dynamicanalyzer.common.CommonConstants;
+
public class ConfigurationDialogData {
- public String featuresName ="";
+ public String featuresName = CommonConstants.EMPTY;
public int swapValue = 0;
public boolean hasParrentFeature = false;
-}
+ public String optionFeaturesName = CommonConstants.EMPTY;
+ public int optionfeaturesSwapValue = 0;
+ public ConfigurationDialogData(String featuresName, int swapValue) {
+ this.featuresName = featuresName;
+ this.swapValue = swapValue;
+ }
+}
public class ConfigurationDialogDataManager {
private static ConfigurationDialogDataManager instance = null;
- private static String[] featuresName = null;
+ private static String[] tableFeaturesName = null;
+ private static String[] optionSettingName = null;
HashMap<String, ConfigurationDialogData> featuresStatusHashMap = new HashMap<String, ConfigurationDialogData>();
private static ConfigureManager mConfig;
-// private static final String ON = ConfigureLabels.ON;
-// private static final String OFF = ConfigureLabels.OFF;
public synchronized static ConfigurationDialogDataManager getInstance() {
if (null == instance) {
instance = new ConfigurationDialogDataManager();
- featuresName = new String[] {
- // ConfigureLabels.FEATURE_SYSTEM,
+ tableFeaturesName = new String[] {
+ // ConfigureLabels.FEATURE_SYSTEM,
ConfigureLabels.FEATURE_SYSTEM_CPU,
ConfigureLabels.FEATURE_SYSTEM_PROCESSES,
ConfigureLabels.FEATURE_SYSTEM_MEMORY,
ConfigureLabels.FEATURE_RECORDING,
ConfigureLabels.FEATURE_OPENGL,
ConfigureLabels.FEATURE_NETWORK,
- // ConfigureLabels.FEATURE_SYSCALL,
+ // ConfigureLabels.FEATURE_SYSCALL,
ConfigureLabels.FEATURE_SYSCALL_FILE,
ConfigureLabels.FEATURE_SYSCALL_IPC,
ConfigureLabels.FEATURE_SYSCALL_PROCESS,
ConfigureLabels.FEATURE_SYSCALL_NETWORK,
ConfigureLabels.FEATURE_SYSCALL_DESC,
ConfigureLabels.FEATURE_CONTEXT_SWITCH };
+ optionSettingName = new String[] { ConfigureLabels.SHOW_INITIAL,
+ ConfigureLabels.AUTO_STOP,
+ ConfigureLabels.INCLUDE_INSIDE_CALL_MEMORY,
+ ConfigureLabels.INCLUDE_INSIDE_CALL_THREAD,
+ ConfigureLabels.INCLUDE_INSIDE_CALL_FILE,
+ ConfigureLabels.INCLUDE_INSIDE_CALL_NETWORK,
+ ConfigureLabels.INCLUDE_INSIDE_CALL_UI,
+ ConfigureLabels.INCLUDE_INSIDE_OPENGL,
+ ConfigureLabels.SNAPSHOT_PERIODIC,
+ ConfigureLabels.SNAPSHOT_PERIODIC_AUTO,
+ ConfigureLabels.FUNCTION_PROFILING_SAMPLING_PERIODIC,
+ ConfigureLabels.SYSTEM_INFOMATION_SAMPLING_PERIODIC };
mConfig = ConfigureManager.getInstance();
}
return instance;
}
-
- // Features
- public String[] getFeature() {
- return featuresName;
+ public String[] getTableFeature() {
+ return tableFeaturesName;
+ }
+
+ public String[] getOptionFeature() {
+ return optionSettingName;
}
-
- public int featuresSwapValue(String featues) {
+ public int getfeatureSwapValue(String featues) {
Integer swapValue = featuresStatusHashMap.get(featues).swapValue;
return swapValue;
}
-
+
+ public void setfeatureSwapValue(String featureName, int value) {
+ featuresStatusHashMap.put(featureName, new ConfigurationDialogData(
+ featureName, value));
+ }
+
public boolean HasParentfeature(String featues) {
Boolean hasParrent = featuresStatusHashMap.get(featues).hasParrentFeature;
return hasParrent;
}
-
+
public String getParentFeatureName(String featuresName) {
if (featuresName.equals(ConfigureLabels.FEATURE_SYSCALL_FILE)
|| featuresName.equals(ConfigureLabels.FEATURE_SYSCALL_IPC)
return CommonConstants.EMPTY;
}
+ public String getOptionFeatureName(String featureName) {
+ String optionFeatusName = CommonConstants.EMPTY;
+ if (featureName.equals(ConfigureLabels.FEATURE_MEMORY_ALLOCATION)) {
+ optionFeatusName = ConfigureLabels.INCLUDE_INSIDE_CALL_MEMORY;
+ } else if (featureName.equals(ConfigureLabels.FEATURE_THREAD)) {
+ optionFeatusName = ConfigureLabels.INCLUDE_INSIDE_CALL_THREAD;
+ } else if (featureName.equals(ConfigureLabels.FEATURE_FILE)) {
+ optionFeatusName = ConfigureLabels.INCLUDE_INSIDE_CALL_FILE;
+ } else if (featureName.equals(ConfigureLabels.FEATURE_NETWORK)) {
+ optionFeatusName = ConfigureLabels.INCLUDE_INSIDE_CALL_NETWORK;
+ } else if (featureName.equals(ConfigureLabels.FEATURE_USERINTERFACE)) {
+ optionFeatusName = ConfigureLabels.INCLUDE_INSIDE_CALL_UI;
+ } else if (featureName.equals(ConfigureLabels.FEATURE_OPENGL)) {
+ optionFeatusName = ConfigureLabels.INCLUDE_INSIDE_OPENGL;
+ } else if (featureName.equals(ConfigureLabels.SNAPSHOT_PERIODIC)) {
+ optionFeatusName = ConfigureLabels.SNAPSHOT_PERIODIC_AUTO;
+ } else if (featureName.equals(ConfigureLabels.FEATURE_SCREENSHOT)) {
+ optionFeatusName = ConfigureLabels.SNAPSHOT_PERIODIC;
+ } else if (featureName
+ .equals(ConfigureLabels.FEATURE_FUNCTION_PROFILING)) {
+ optionFeatusName = ConfigureLabels.FUNCTION_PROFILING_SAMPLING_PERIODIC;
+ } else if (featureName.equals(ConfigureLabels.FEATURE_SYSTEM)
+ || featureName.equals(ConfigureLabels.FEATURE_SYSTEM_CPU)
+ || featureName.equals(ConfigureLabels.FEATURE_SYSTEM_PROCESSES)
+ || featureName.equals(ConfigureLabels.FEATURE_SYSTEM_MEMORY)
+ || featureName.equals(ConfigureLabels.FEATURE_SYSTEM_DISK)
+ || featureName.equals(ConfigureLabels.FEATURE_SYSTEM_NETWORK)
+ || featureName.equals(ConfigureLabels.FEATURE_SYSTEM_DEVICE)
+ || featureName.equals(ConfigureLabels.FEATURE_SYSTEM_ENERGY)) {
+ optionFeatusName = ConfigureLabels.SYSTEM_INFOMATION_SAMPLING_PERIODIC;
+ }
+ return optionFeatusName;
+ }
+
- public void setFeaturesChecked(String featureName, boolean status) {
+ public void setFeaturesSwapValue(String featureName, boolean status) {
int value = AnalyzerConstants.FEATURE_OFF;
if (status) {
if (featureName.equals(ConfigureLabels.FEATURE_SYSTEM)) {
} else if (featureName
.equals(ConfigureLabels.FEATURE_SYSTEM_ENERGY)) {
value = AnalyzerConstants.SYSTEM_ENERGY;
- } else {
+ }
+ // option
+ else if (featureName.equals(ConfigureLabels.SHOW_INITIAL)) {
+ value = AnalyzerConstants.FEATURE_OFF;
+ } else if (featureName.equals(ConfigureLabels.AUTO_STOP)) {
+ value = AnalyzerConstants.FEATURE_OFF;
+ } else if (featureName
+ .equals(ConfigureLabels.INCLUDE_INSIDE_CALL_MEMORY)) {
+ value = AnalyzerConstants.MEMORY_API_PROBING_NO_FILTER;
+ } else if (featureName
+ .equals(ConfigureLabels.INCLUDE_INSIDE_CALL_FILE)) {
+ value = AnalyzerConstants.FILE_API_PROBING_NO_FILTER;
+ } else if (featureName
+ .equals(ConfigureLabels.INCLUDE_INSIDE_CALL_THREAD)) {
+ value = AnalyzerConstants.THREAD_API_PROBING_NO_FILTER;
+ } else if (featureName
+ .equals(ConfigureLabels.INCLUDE_INSIDE_CALL_UI)) {
+ value = AnalyzerConstants.OSP_UI_API_PROBING_NO_FILTER;
+ } else if (featureName
+ .equals(ConfigureLabels.INCLUDE_INSIDE_CALL_NETWORK)) {
+ value = AnalyzerConstants.NETWORK_API_PROBING_NO_FILTER;
+ } else if (featureName
+ .equals(ConfigureLabels.INCLUDE_INSIDE_OPENGL)) {
+ value = AnalyzerConstants.OPENGL_API_PROBING_NO_FILTER;
+ } else if (featureName.equals(ConfigureLabels.SNAPSHOT_PERIODIC)) {
+ value = AnalyzerConstants.SNAPSHOT_PERIODIC;
+ } else if (featureName.equals(ConfigureLabels.SNAPSHOT_PERIODIC_AUTO)) {
+ value = AnalyzerConstants.SNAPSHOT_PERIODIC_AUTO;
+ } else if (featureName
+ .equals(ConfigureLabels.FUNCTION_PROFILING_SAMPLING_PERIODIC)) {
+ value = AnalyzerConstants.FUNCTION_PROFILING_SAMPLING_PERIODIC;
+ } else if (featureName
+ .equals(ConfigureLabels.SYSTEM_INFOMATION_SAMPLING_PERIODIC)) {
+ value = AnalyzerConstants.SYSTEM_INFOMATION_SAMPLING_PERIODIC;
+ }
+
+ else {
System.out.println("failed set feature : " + featureName);
}
}
- ConfigurationDialogData data = new ConfigurationDialogData();
- data.featuresName = featureName;
- data.swapValue = value;
- featuresStatusHashMap.put(featureName, data);
+ featuresStatusHashMap.put(featureName, new ConfigurationDialogData(
+ featureName, value));
}
public void setSettingValueFromConfigureManager() {
// Table Feature
- for (String featureName : ConfigurationDialogDataManager.getInstance()
- .getFeature()) {
+ for (String featureName : getTableFeature()) {
try {
- ConfigurationDialogData data = new ConfigurationDialogData();
- data.featuresName = featureName;
- data.swapValue = mConfig.getValueInt(featureName);
+ ConfigurationDialogData data = new ConfigurationDialogData(
+ featureName, mConfig.getValueInt(featureName));
String parentFeaturesName = getParentFeatureName(featureName);
if (parentFeaturesName.equals(CommonConstants.EMPTY)) {
data.hasParrentFeature = false;
} else {
data.hasParrentFeature = true;
}
+ String optionFeatureName = getOptionFeatureName(featureName);
+ if (optionFeatureName.equals(CommonConstants.EMPTY)) {
+ data.optionFeaturesName = optionFeatureName;
+ }
featuresStatusHashMap.put(featureName, data);
} catch (NumberFormatException e) {
e.printStackTrace();
}
}
- // Setting
- ConfigurationDialogData initalData = new ConfigurationDialogData();
- initalData.featuresName = ConfigureLabels.SHOW_INITIAL;
- initalData.swapValue = mConfig.getValueInt(ConfigureLabels.SHOW_INITIAL);
- featuresStatusHashMap.put(ConfigureLabels.SHOW_INITIAL, initalData);
- ConfigurationDialogData autoStopData = new ConfigurationDialogData();
- autoStopData.featuresName = ConfigureLabels.SHOW_INITIAL;
- autoStopData.swapValue = mConfig.getValueInt(ConfigureLabels.SHOW_INITIAL);
- featuresStatusHashMap.put(ConfigureLabels.AUTO_STOP, autoStopData);
+ for (String featureName : getOptionFeature()) {
+ try {
+ ConfigurationDialogData data = new ConfigurationDialogData(
+ featureName, mConfig.getValueInt(featureName));
+ featuresStatusHashMap.put(featureName, data);
+ } catch (NumberFormatException e) {
+ e.printStackTrace();
+ }
+ }
}
private void setConfig(int featureStatus, String featureName) {
changedFeatures();
// Table Feature
- for (String featureName : ConfigurationDialogDataManager.getInstance()
- .getFeature()) {
+ for (String featureName : getTableFeature()) {
setConfig(featuresStatusHashMap.get(featureName).swapValue,
featureName);
}
// Setting
- setConfig(
- featuresStatusHashMap.get(ConfigureLabels.SHOW_INITIAL).swapValue,
- ConfigureLabels.SHOW_INITIAL);
- setConfig(
- featuresStatusHashMap.get(ConfigureLabels.AUTO_STOP).swapValue,
- ConfigureLabels.AUTO_STOP);
+ for (String featureName : getOptionFeature()) {
+ setConfig(featuresStatusHashMap.get(featureName).swapValue,
+ featureName);
+ }
}
private void changedFeatures() {
// Table Feature
- for (String featureName : ConfigurationDialogDataManager.getInstance()
- .getFeature()) {
-
+ for (String featureName : getTableFeature()) {
int featuresStatus = featuresStatusHashMap.get(featureName).swapValue;
int configFileStatus = mConfig.getValueInt(featureName);
if (featuresStatus != configFileStatus) {
}
}
- // Setting
- String showInitialFeaturesStatus = featuresStatusHashMap
- .get(ConfigureLabels.SHOW_INITIAL).featuresName;
- String showInitalConfigFileStatus = mConfig
- .getValue(ConfigureLabels.SHOW_INITIAL);
- if (!showInitialFeaturesStatus.equals(showInitalConfigFileStatus)) {
- System.out.println("change values : "
- + ConfigureLabels.SHOW_INITIAL);
- }
-
- String autoStopStatus = featuresStatusHashMap
- .get(ConfigureLabels.AUTO_STOP).featuresName;
- String autoStopConfigFileStatus = mConfig
- .getValue(ConfigureLabels.AUTO_STOP);
- if (!autoStopStatus.equals(autoStopConfigFileStatus)) {
- System.out.println("change values : " + ConfigureLabels.AUTO_STOP);
+ for (String featureName : getOptionFeature()) {
+ int featuresStatus = featuresStatusHashMap.get(featureName).swapValue;
+ int configFileStatus = mConfig.getValueInt(featureName);
+ if (featuresStatus != configFileStatus) {
+ System.out.println("change values : " + featureName);
+ }
}
}
- public void setTableItemsList(DATableComposite featureComp) {
+ public void setFeaturesStatusFromTableItemsList(DATableComposite featureComp) {
for (int i = 0; i < featureComp.getTable().getItemCount(); i++) {
String featureName = featureComp.getTable().getItem(i).getText(0);
String optionText = featureComp.getTable().getItem(i).getText(1);
isChecked = false;
}
- ConfigurationDialogDataManager.getInstance().setFeaturesChecked(
+ ConfigurationDialogDataManager.getInstance().setFeaturesSwapValue(
featureName, isChecked);
}
}
- // // Configuration
public boolean isShowInitia() {
- if (featuresStatusHashMap.get(ConfigureLabels.SHOW_INITIAL).swapValue == 1) {
+ if (featuresStatusHashMap.get(ConfigureLabels.SHOW_INITIAL).swapValue > 0) {
return true;
} else {
return false;
}
}
- public void setShowInitia(boolean showInitia) {
- ConfigurationDialogData initalData = new ConfigurationDialogData();
- initalData.featuresName = ConfigureLabels.SHOW_INITIAL;
- if (showInitia) {
- initalData.swapValue = 1;
- } else {
- initalData.swapValue = 0;
- }
- featuresStatusHashMap.put(ConfigureLabels.SHOW_INITIAL, initalData);
- }
-
public boolean isAutoStop() {
- if (featuresStatusHashMap.get(ConfigureLabels.AUTO_STOP).swapValue == 1) {
+ if (featuresStatusHashMap.get(ConfigureLabels.AUTO_STOP).swapValue > 0) {
return true;
} else {
return false;
}
- }
- public void setAutoStop(boolean autoStop) {
- ConfigurationDialogData autoStopData = new ConfigurationDialogData();
- autoStopData.featuresName = ConfigureLabels.SHOW_INITIAL;
- if (autoStop) {
- autoStopData.swapValue = 1;
- } else {
- autoStopData.swapValue = 0;
- }
- featuresStatusHashMap.put(ConfigureLabels.AUTO_STOP, autoStopData);
}
-
}
package org.tizen.dynamicanalyzer.ui.toolbar.configuration;
+import org.eclipse.nebula.widgets.grid.GridItem;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ControlEvent;
import org.eclipse.swt.events.ControlListener;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.KeyListener;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.events.MouseListener;
import org.eclipse.swt.events.PaintEvent;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormLayout;
-import org.eclipse.swt.widgets.Canvas;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
-import org.tizen.dynamicanalyzer.common.CommonConstants;
import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
import org.tizen.dynamicanalyzer.nl.ConfigureLabels;
import org.tizen.dynamicanalyzer.resources.ColorResources;
import org.tizen.dynamicanalyzer.ui.page.DAPageComposite;
import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite;
import org.tizen.dynamicanalyzer.ui.widgets.table.DefaultTableComparator;
+import org.tizen.dynamicanalyzer.widgets.button.checkbox.DACheckBox;
+import org.tizen.dynamicanalyzer.widgets.button.checkbox.DACheckboxSelectionListener;
public class ConfigurationDialogFeaturesPage extends DAPageComposite {
public static final String ID = ConfigurationDialogFeaturesPage.class
.getName();
private DATableComposite featuresTable = null;
- private Canvas detail = null;
+ // private Canvas detail = null;
+ private Composite detailSettingComp = null;
int[] sortTypes = { AnalyzerConstants.SORT_TYPE_GRID };
private String[] columnNames = { ConfigureLabels.FEATURE_TABLE_FEATURE_NAME };
private int[] columnSizes = { 571 };
private boolean[] columnVisibility = { true };
- private String detaillMsg = CommonConstants.EMPTY;
+ private Text textBox = null;
+ private Label textBoxLabel = null;
+ private DACheckBox detailSettingCheckBox = null;
public ConfigurationDialogFeaturesPage(Composite parent, int style) {
super(parent, style);
// Details Title
Label detailLabel = new Label(this, SWT.TRANSPARENT);
- detailLabel.setText(ConfigureLabels.FEATURE_DETAIL_TITLE);
+ detailLabel.setText(ConfigureLabels.FEATURE_DETAIL_SETTING_TITLE);
detailLabel
.setBackground(ColorResources.CONFIGURATION_TABLE_COVER_BACKGROUND_COLOR);
detailLabel.setForeground(ColorResources.DEFAULT_FONT_COLOR);
detailLabel.setFont(FontResources.CONFIGURATION_TABLE_TITLE_FONT);
data = new FormData();
- data.top = new FormAttachment(tableComp, 20);
+ data.top = new FormAttachment(tableComp, 15);
data.left = new FormAttachment(0, 8);
detailLabel.setLayoutData(data);
- detail = new Canvas(this, SWT.NONE);
- detail.addPaintListener(detailPaintListener);
- data = new FormData();
- data.top = new FormAttachment(detailLabel, 6);
- data.left = new FormAttachment(0, 5);
- data.height = 35;
- data.width = 592;
- detail.setLayoutData(data);
+ // Setting
+ detailSettingComp = new Composite(this, SWT.NONE);
+ FormLayout compLayout = new FormLayout();
+ detailSettingComp.setLayout(compLayout);
+ detailSettingComp
+ .setBackground(ColorResources.CONFIGURATION_TABLE_COVER_BACKGROUND_COLOR);
+ FormData compData = new FormData();
+ compData.top = new FormAttachment(detailLabel, 5);
+ compData.left = new FormAttachment(0, 5);
+ compData.right = new FormAttachment(100, -5);
+ compData.bottom = new FormAttachment(100, -5);
+ detailSettingComp.setLayoutData(compData);
featuresTable.updateTable();
}
-
- public DATableComposite getFeatureTable(){
+
+ public DATableComposite getFeatureTable() {
return this.featuresTable;
}
@Override
public void widgetSelected(SelectionEvent e) {
- // updateDetails();
+ // TODO Auto-generated method stub
}
@Override
@Override
public void mouseDown(MouseEvent e) {
// TODO Auto-generated method stub
+ updateDetails();
}
@Override
public void mouseDoubleClick(MouseEvent e) {
- // updateDetails();
+ // TODO Auto-generated method stub
}
};
- // private void updateDetails() {
- // GridItem[] items = featuresTable.getTable().getSelection();
- // if (items.length == 0) {
- // return;
- // }
- // GridItem item = items[0];
- // for (String featueName :
- // ConfigurationDialogValues.getInstance().getFeature()) {
- // if( featueName.equals(item.getText(1))){
- // if( featueName.equals(ConfigureLabels.FEATURE_FUNCTION_PROFILING)){
- // detaillMsg = ConfigureLabels.DETAIL_FUNCTIONPROFILING;
- // }else if( featueName.equals(ConfigureLabels.FEATURE_MEMORY_ALLOCATION)){
- // detaillMsg = ConfigureLabels.DETAIL_ALLOCATION;
- // }else if( featueName.equals(ConfigureLabels.FEATURE_FILE)){
- // detaillMsg = ConfigureLabels.DETAIL_FILE;
- // }else if( featueName.equals(ConfigureLabels.FEATURE_THREAD)){
- // detaillMsg = ConfigureLabels.DETAIL_THREAD;
- // }else if( featueName.equals(ConfigureLabels.FEATURE_USERINTERFACE)){
- // detaillMsg = ConfigureLabels.DETAIL_USERINTERFACE;
- // }else if( featueName.equals(ConfigureLabels.FEATURE_SCREENSHOT)){
- // detaillMsg = ConfigureLabels.DETAIL_SNAPSHOT;
- // }else if( featueName.equals(ConfigureLabels.FEATURE_USER_EVENT)){
- // detaillMsg = ConfigureLabels.DETAIL_EVENT;
- // }else{
- // System.out.println("failed undefine features");
- // }
- // }
- // }
- // detail.redraw();
- // }
-
- private PaintListener detailPaintListener = new PaintListener() {
+ private void updateDetails() {
+ GridItem[] items = featuresTable.getTable().getSelection();
+ if (items.length == 0) {
+ return;
+ }
+ if (null != detailSettingCheckBox) {
+ detailSettingCheckBox.dispose();
+ detailSettingCheckBox = null;
+ }
+ if (null != textBox) {
+ textBox.dispose();
+ textBox = null;
+ }
+ if (null != textBoxLabel) {
+ textBoxLabel.dispose();
+ textBoxLabel = null;
+ }
+
+ String featureName = items[0].getText(0);
+ if (featureName.equals(ConfigureLabels.FEATURE_MEMORY_ALLOCATION)
+ || featureName.equals(ConfigureLabels.FEATURE_THREAD)
+ || featureName.equals(ConfigureLabels.FEATURE_FILE)
+ || featureName.equals(ConfigureLabels.FEATURE_NETWORK)
+ || featureName.equals(ConfigureLabels.FEATURE_USERINTERFACE)
+ || featureName.equals(ConfigureLabels.FEATURE_OPENGL)) {
+ detailSettingCheckBox = new DACheckBox(detailSettingComp, SWT.NONE);
+ FormData data = new FormData();
+ data.top = new FormAttachment(0, 10);
+ data.left = new FormAttachment(0, 10);
+ data.height = 20;
+ data.width = 300;
+ detailSettingCheckBox.setLayoutData(data);
+ detailSettingCheckBox.setForeground(ColorResources.BLACK);
+ detailSettingCheckBox
+ .setBackground(ColorResources.CONFIGURATION_TABLE_COVER_BACKGROUND_COLOR);
+ detailSettingCheckBox
+ .setFont(FontResources.CONFIGURATION_TABLE_TITLE_FONT);
+ detailSettingCheckBox.setText(ConfigureLabels.INCLUDE_INSIDE_CALL);
+ detailSettingCheckBox
+ .addSelectionListener(includeInsideCallCheckBoxListener);
+ String optionFeatusName = ConfigurationDialogDataManager
+ .getInstance().getOptionFeatureName(featureName);
+
+ if (ConfigurationDialogDataManager.getInstance()
+ .getfeatureSwapValue(optionFeatusName) > 0) {
+ detailSettingCheckBox.setChecked(true);
+ } else {
+ detailSettingCheckBox.setChecked(false);
+ }
+
+ if (ConfigurationDialogDataManager.getInstance()
+ .getfeatureSwapValue(featureName) > 0) {
+ detailSettingCheckBox.setEnabled(true);
+ } else {
+ detailSettingCheckBox.setEnabled(false);
+ }
+ detailSettingComp.layout(true);
+ } else if (featureName.equals(ConfigureLabels.FEATURE_SCREENSHOT)) {
+ detailSettingCheckBox = new DACheckBox(detailSettingComp, SWT.NONE);
+ FormData data = new FormData();
+ data.top = new FormAttachment(0, 10);
+ data.left = new FormAttachment(0, 10);
+ data.height = 20;
+ data.width = 170;
+ detailSettingCheckBox.setLayoutData(data);
+ detailSettingCheckBox.setForeground(ColorResources.BLACK);
+ detailSettingCheckBox
+ .setBackground(ColorResources.CONFIGURATION_TABLE_COVER_BACKGROUND_COLOR);
+ detailSettingCheckBox
+ .setFont(FontResources.CONFIGURATION_TABLE_TITLE_FONT);
+ detailSettingCheckBox
+ .setText(ConfigureLabels.SNAPSHOT_PERIODIC_AUTO);
+ detailSettingCheckBox
+ .addSelectionListener(snapshotPeriodicAutoCheckBoxListener);
+
+ // if (ConfigurationDialogDataManager
+ // .getInstance()
+ // .getfeatureSwapValue(ConfigureLabels.SNAPSHOT_PERIODIC_AUTO) > 0)
+ // {
+ // detailSettingCheckBox.setChecked(false);
+ // } else {
+ // ConfigurationDialogDataManager.getInstance()
+ // .setfeatureSwapValue(
+ // ConfigureLabels.SNAPSHOT_PERIODIC_AUTO, 1);
+ // detailSettingCheckBox.setChecked(true);
+ // }
+
+ textBox = new Text(detailSettingComp, SWT.SINGLE);
+ data = new FormData();
+ data.top = new FormAttachment(0, 10);
+ data.left = new FormAttachment(0, 200);
+ data.height = 15;
+ data.width = 50;
+ textBox.setLayoutData(data);
+ textBox.setBackground(ColorResources.VIEW_BG_COLOR);
+ textBox.addKeyListener(keyListener);
+ textBox.addPaintListener(new PaintListener() {
+ @Override
+ public void paintControl(PaintEvent e) {
+ e.gc.setForeground(ColorResources.BUTTON_OUTLINE_HOVER_IN_COLOR);
+ Text text = (Text) e.widget;
+ Rectangle rect = text.getClientArea();
+ e.gc.drawRectangle(rect.x, rect.y, rect.width - 1,
+ rect.height - 1);
+ }
+ });
+
+ String optionFeatusName = ConfigurationDialogDataManager
+ .getInstance().getOptionFeatureName(featureName);
+ int savedValue = ConfigurationDialogDataManager.getInstance()
+ .getfeatureSwapValue(optionFeatusName);
+ textBox.setText(Integer.toString(savedValue));
+
+ textBoxLabel = new Label(detailSettingComp, SWT.TRANSPARENT);
+ textBoxLabel.setText(ConfigureLabels.SECOND);
+ textBoxLabel
+ .setBackground(ColorResources.CONFIGURATION_TABLE_COVER_BACKGROUND_COLOR);
+ textBoxLabel.setForeground(ColorResources.DEFAULT_FONT_COLOR);
+ textBoxLabel.setFont(FontResources.CONFIGURATION_TABLE_TITLE_FONT);
+ data = new FormData();
+ data.top = new FormAttachment(0, 13);
+ data.left = new FormAttachment(textBox, 5);
+ textBoxLabel.setLayoutData(data);
+
+ if (ConfigurationDialogDataManager
+ .getInstance()
+ .getfeatureSwapValue(ConfigureLabels.SNAPSHOT_PERIODIC_AUTO) > 0) {
+ detailSettingCheckBox.setChecked(true);
+ } else {
+ detailSettingCheckBox.setChecked(false);
+ }
+
+ if (ConfigurationDialogDataManager.getInstance()
+ .getfeatureSwapValue(featureName) > 0) {
+ detailSettingCheckBox.setEnabled(true);
+ textBox.setEditable(true);
+ } else {
+ detailSettingCheckBox.setEnabled(false);
+ textBox.setEditable(false);
+ }
+
+ if (ConfigurationDialogDataManager.getInstance()
+ .getfeatureSwapValue(featureName) > 0
+ && ConfigurationDialogDataManager.getInstance()
+ .getfeatureSwapValue(
+ ConfigureLabels.SNAPSHOT_PERIODIC_AUTO) < 1) {
+ textBox.setEditable(true);
+ } else {
+ textBox.setEditable(false);
+ }
+ detailSettingComp.layout(true);
+ } else if (featureName
+ .equals(ConfigureLabels.FEATURE_FUNCTION_PROFILING)
+ || featureName.equals(ConfigureLabels.FEATURE_SYSTEM)
+ || featureName.equals(ConfigureLabels.FEATURE_SYSTEM_CPU)
+ || featureName.equals(ConfigureLabels.FEATURE_SYSTEM_PROCESSES)
+ || featureName.equals(ConfigureLabels.FEATURE_SYSTEM_MEMORY)
+ || featureName.equals(ConfigureLabels.FEATURE_SYSTEM_DISK)
+ || featureName.equals(ConfigureLabels.FEATURE_SYSTEM_NETWORK)
+ || featureName.equals(ConfigureLabels.FEATURE_SYSTEM_DEVICE)
+ || featureName.equals(ConfigureLabels.FEATURE_SYSTEM_ENERGY)) {
+ if (featureName.equals(ConfigureLabels.FEATURE_SYSTEM)) {
+ featureName = ConfigureLabels.FEATURE_SYSTEM_CPU;
+ }
+
+ textBox = new Text(detailSettingComp, SWT.SINGLE);
+ FormData data = new FormData();
+ data.top = new FormAttachment(0, 10);
+ data.left = new FormAttachment(0, 10);
+ data.height = 15;
+ data.width = 50;
+ textBox.setLayoutData(data);
+ textBox.setBackground(ColorResources.VIEW_BG_COLOR);
+ textBox.addKeyListener(keyListener);
+ textBox.addPaintListener(new PaintListener() {
+ @Override
+ public void paintControl(PaintEvent e) {
+ e.gc.setForeground(ColorResources.BUTTON_OUTLINE_HOVER_IN_COLOR);
+ Text text = (Text) e.widget;
+ Rectangle rect = text.getClientArea();
+ e.gc.drawRectangle(rect.x, rect.y, rect.width - 1,
+ rect.height - 1);
+ }
+ });
+ String optionFeatusName = ConfigurationDialogDataManager
+ .getInstance().getOptionFeatureName(featureName);
+ int savedValue = ConfigurationDialogDataManager.getInstance()
+ .getfeatureSwapValue(optionFeatusName);
+ textBox.setText(Integer.toString(savedValue));
+
+ textBoxLabel = new Label(detailSettingComp, SWT.TRANSPARENT);
+ textBoxLabel.setText(ConfigureLabels.MS);
+ textBoxLabel
+ .setBackground(ColorResources.CONFIGURATION_TABLE_COVER_BACKGROUND_COLOR);
+ textBoxLabel.setForeground(ColorResources.DEFAULT_FONT_COLOR);
+ textBoxLabel.setFont(FontResources.CONFIGURATION_TABLE_TITLE_FONT);
+ data = new FormData();
+ data.top = new FormAttachment(0, 13);
+ data.left = new FormAttachment(textBox, 5);
+ textBoxLabel.setLayoutData(data);
+
+ if (ConfigurationDialogDataManager.getInstance()
+ .getfeatureSwapValue(featureName) > 0) {
+ textBox.setEditable(true);
+ } else {
+ textBox.setEditable(false);
+ }
+ detailSettingComp.layout(true);
+ } else {
+
+ }
+ }
+
+ public static boolean isInteger(String str) {
+ try {
+ Integer.parseInt(str);
+ return true;
+ } catch (NumberFormatException e) {
+ return false;
+ }
+ }
+
+ private DACheckboxSelectionListener snapshotPeriodicAutoCheckBoxListener = new DACheckboxSelectionListener() {
@Override
- public void paintControl(PaintEvent e) {
- Canvas canvas = (Canvas) e.widget;
- Rectangle rect = canvas.getClientArea();
- e.gc.setBackground(ColorResources.WHITE);
- e.gc.fillRectangle(rect);
- e.gc.setForeground(ColorResources.OPEN_TRACE_TABLE_OUTLINE_COLOR);
- e.gc.drawRectangle(rect.x, rect.y, rect.width - 1, rect.height - 1);
- e.gc.setFont(FontResources.TABLE_CELL_FONT);
- int x = rect.x + 7;
- int y = rect.y + 4;
- e.gc.setForeground(ColorResources.OPEN_TRACE_SAVE_CONTENTS_COLOR);
- e.gc.drawText(detaillMsg, x, y);
+ public void handleSelectionEvent(DACheckBox checkbox) {
+ GridItem[] items = featuresTable.getTable().getSelection();
+ if (items.length == 0) {
+ return;
+ }
+ if (ConfigurationDialogDataManager
+ .getInstance()
+ .getfeatureSwapValue(ConfigureLabels.SNAPSHOT_PERIODIC_AUTO) > 0) {
+ ConfigurationDialogDataManager.getInstance()
+ .setfeatureSwapValue(
+ ConfigureLabels.SNAPSHOT_PERIODIC_AUTO, 0);
+ detailSettingCheckBox.setChecked(false);
+ } else {
+ ConfigurationDialogDataManager.getInstance()
+ .setfeatureSwapValue(
+ ConfigureLabels.SNAPSHOT_PERIODIC_AUTO, 1);
+ detailSettingCheckBox.setChecked(true);
+ }
+ updateDetails();
}
};
+ private DACheckboxSelectionListener includeInsideCallCheckBoxListener = new DACheckboxSelectionListener() {
+ @Override
+ public void handleSelectionEvent(DACheckBox checkbox) {
+ GridItem[] items = featuresTable.getTable().getSelection();
+ if (items.length == 0) {
+ return;
+ }
+ String featureName = items[0].getText(0);
+ String optionFeatusName = ConfigurationDialogDataManager
+ .getInstance().getOptionFeatureName(featureName);
+ if (ConfigurationDialogDataManager.getInstance()
+ .getfeatureSwapValue(optionFeatusName) > 0) {
+ ConfigurationDialogDataManager.getInstance()
+ .setFeaturesSwapValue(optionFeatusName, false);
+ detailSettingCheckBox.setChecked(false);
+ } else {
+ ConfigurationDialogDataManager.getInstance()
+ .setfeatureSwapValue(optionFeatusName, 1);
+ detailSettingCheckBox.setChecked(true);
+ }
+ updateDetails();
+ }
+ };
+
+ private KeyListener keyListener = new KeyListener() {
+
+ @Override
+ public void keyReleased(KeyEvent e) {
+ GridItem[] items = featuresTable.getTable().getSelection();
+ if (items.length == 0) {
+ return;
+ }
+ String featureName = items[0].getText(0);
+ if (isInteger(textBox.getText())) {
+ int textBoxData = Integer.parseInt(textBox.getText());
+ if (textBoxData > 0) {
+ ConfigurationDialogDataManager.getInstance()
+ .setfeatureSwapValue(
+ ConfigurationDialogDataManager
+ .getInstance()
+ .getOptionFeatureName(featureName),
+ textBoxData);
+ } else {
+ ConfigurationDialogDataManager.getInstance()
+ .setFeaturesSwapValue(
+ ConfigurationDialogDataManager
+ .getInstance()
+ .getOptionFeatureName(featureName),
+ false);
+ }
+ }
+ // updateDetails();
+ }
+
+ @Override
+ public void keyPressed(KeyEvent e) {
+
+ }
+ };
}
\ No newline at end of file
import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
import org.tizen.dynamicanalyzer.common.CommonConstants;
import org.tizen.dynamicanalyzer.model.TreeInput;
+import org.tizen.dynamicanalyzer.nl.ConfigureLabels;
import org.tizen.dynamicanalyzer.resources.ImageResources;
import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;
import org.tizen.dynamicanalyzer.ui.widgets.table.DATableHeaderRenderer;
public static final String ITEM_PARENT_FEATURE_NAME_ITEM = ", parent_feature_name_";//$NON-NLS-1$
public static final String ITEM_ALL_CHECKED = ", item_all_checked ";//$NON-NLS-1$
public static final String ITEM_PART_CHECKED = ", item_part_checked ";//$NON-NLS-1$
+ public static final String FEATURE_OPTION_VALUE = ", feature_option_value ";//$NON-NLS-1$
private final int tableTextOptionColumnIndex = 1;
private String isCheckFeatue(String featueName) {
if (AnalyzerConstants.FEATURE_OFF != ConfigurationDialogDataManager
- .getInstance().featuresSwapValue(featueName)) {
+ .getInstance().getfeatureSwapValue(featueName)) {
return ITEM_ALL_CHECKED;
} else {
return CommonConstants.EMPTY;
if (!parentFeatureName.equals(CommonConstants.EMPTY)) {
optionColumn += (ITEM_PARENT_FEATURE_NAME_ITEM + parentFeatureName);
}
+
+ String optionFeatureName = ConfigurationDialogDataManager.getInstance()
+ .getOptionFeatureName(featueName);
+ if (!optionFeatureName.equals(CommonConstants.EMPTY)) {
+ optionColumn += (FEATURE_OPTION_VALUE + getOptionText(optionFeatureName));
+ }
+
text.add(optionColumn);
TreeInput outPut = new TreeInput();
public List<TreeInput> makeTreeInput() {
List<TreeInput> output = new ArrayList<TreeInput>();
String[] featuresList = ConfigurationDialogDataManager.getInstance()
- .getFeature();
+ .getTableFeature();
for (int i = 0; i < featuresList.length; i++) {
String featuresName = featuresList[i];
TreeInput currentNode = makeInput(featuresName);
}
}
+ }
+
+ private String getOptionText(String featureName) {
+
+ int optionFeatureValue = ConfigurationDialogDataManager.getInstance()
+ .getfeatureSwapValue(featureName);
+ if (optionFeatureValue < 1) {
+ return CommonConstants.EMPTY;
+ }
+ StringBuffer optionValue = new StringBuffer();
+ optionValue.append(CommonConstants.SPACE).append(
+ CommonConstants.OPEN_BRACKET);
+
+ if (featureName.equals(ConfigureLabels.INCLUDE_INSIDE_CALL_MEMORY)
+ || featureName
+ .equals(ConfigureLabels.INCLUDE_INSIDE_CALL_THREAD)
+ || featureName.equals(ConfigureLabels.INCLUDE_INSIDE_CALL_FILE)
+ || featureName
+ .equals(ConfigureLabels.INCLUDE_INSIDE_CALL_NETWORK)
+ || featureName.equals(ConfigureLabels.INCLUDE_INSIDE_CALL_UI)
+ || featureName.equals(ConfigureLabels.INCLUDE_INSIDE_OPENGL)) {
+ optionValue.append(ConfigureLabels.INCLUDE_INSIDE_CALL);
+ } else if (featureName.equals(ConfigureLabels.SNAPSHOT_PERIODIC)) {
+ if (ConfigurationDialogDataManager
+ .getInstance()
+ .getfeatureSwapValue(ConfigureLabels.SNAPSHOT_PERIODIC_AUTO) > 0) {
+ optionValue.append(ConfigureLabels.AUTO);
+ } else {
+ optionValue.append("periodic : "
+ + Integer.toString(optionFeatureValue));
+ }
+ } else if (featureName
+ .equals(ConfigureLabels.SYSTEM_INFOMATION_SAMPLING_PERIODIC)
+ || featureName
+ .equals(ConfigureLabels.FUNCTION_PROFILING_SAMPLING_PERIODIC)) {
+ optionValue.append("sampling : "
+ + Integer.toString(optionFeatureValue));
+ }
+ optionValue.append(CommonConstants.CLOSE_BRACKET);
+ return optionValue.toString();
}
private Listener tableMouseListener = new Listener() {
updateCheckBox(item, event);
updateChildCheckBoxByParent(item, event);
updateParentCheckBoxByChild(item, event);
+ setConfigurationDialogDataManager(item, event);
}
break;
}
item.setText(tableTextOptionColumnIndex, optionText);
}
+ private void setConfigurationDialogDataManager(GridItem item, Event event) {
+ String featureName = item.getText(0);
+ String optionText = item.getText(tableTextOptionColumnIndex);
+ if (optionText.contains(ITEM_ALL_CHECKED)) {
+ ConfigurationDialogDataManager.getInstance().setFeaturesSwapValue(
+ featureName, true);
+ } else {
+ ConfigurationDialogDataManager.getInstance().setFeaturesSwapValue(
+ featureName, false);
+ }
+ }
+
private void updateChildCheckBoxByParent(GridItem item, Event event) {
String featureName = item.getText(0);
String optionText = item.getText(tableTextOptionColumnIndex);
} else {
gc.setForeground(ColorResources.TABLE_CONTENTS_FONT_COLOR);
}
- gc.drawText(item.getText(), x, getBounds().y - 2, true);
+
+ String printText = item.getText();
+ if (item.getText(1).contains(
+ ConfigurationDialogFeaturesTable.FEATURE_OPTION_VALUE)) {
+ String[] optionList = item.getText(1).split(
+ ConfigurationDialogFeaturesTable.FEATURE_OPTION_VALUE);
+ if (optionList.length > 1) {
+ printText += optionList[1];
+ }
+ }
+ gc.drawText(printText, x, getBounds().y - 2, true);
} else {
Rectangle r = ImageResources.TREE_OPEN.getBounds();
int offset = (getBounds().width - r.width) / 2;
} else {
gc.setForeground(ColorResources.TABLE_CONTENTS_FONT_COLOR);
}
- gc.drawText(item.getText(), x, getBounds().y -2, true);
+
+ String printText = item.getText();
+ if (item.getText(1).contains(
+ ConfigurationDialogFeaturesTable.FEATURE_OPTION_VALUE)) {
+ String[] optionList = item.getText(1).split(
+ ConfigurationDialogFeaturesTable.FEATURE_OPTION_VALUE);
+ if (optionList.length > 1) {
+ printText += optionList[1];
+ }
+ }
+ gc.drawText(printText, x, getBounds().y - 2, true);
}
}
showInitialCheckBox.setBackground(ColorResources.DIALOG_BG_UPPER);
showInitialCheckBox.setText(ConfigureLabels.SHOW_INITIAL);
showInitialCheckBox.addSelectionListener(showInitiaRadioButtonListener);
- showInitialCheckBox.setChecked(ConfigurationDialogDataManager.getInstance()
- .isShowInitia());
-
+ if (ConfigurationDialogDataManager.getInstance().getfeatureSwapValue(
+ ConfigureLabels.SHOW_INITIAL) > 0) {
+ showInitialCheckBox.setChecked(true);
+ } else {
+ showInitialCheckBox.setChecked(false);
+ }
Label showInitalLabel = new Label(this, SWT.TRANSPARENT);
showInitalLabel.setText(ConfigureLabels.SHOW_INITIAL);
showInitalLabel.setBackground(ColorResources.DIALOG_BG_UPPER);
autoStopCheckBox.setBackground(ColorResources.DIALOG_BG_UPPER);
autoStopCheckBox.setText(ConfigureLabels.AUTO_STOP);
autoStopCheckBox.addSelectionListener(autoStopRadioButtonListener);
- autoStopCheckBox.setChecked(ConfigurationDialogDataManager.getInstance()
- .isAutoStop());
-
+ if (ConfigurationDialogDataManager.getInstance().getfeatureSwapValue(
+ ConfigureLabels.AUTO_STOP) > 0) {
+ autoStopCheckBox.setChecked(true);
+ } else {
+ autoStopCheckBox.setChecked(false);
+ }
Label autoStopLabel = new Label(this, SWT.TRANSPARENT);
autoStopLabel.setText(ConfigureLabels.AUTO_STOP);
autoStopLabel.setBackground(ColorResources.DIALOG_BG_UPPER);
private DACheckboxSelectionListener showInitiaRadioButtonListener = new DACheckboxSelectionListener() {
@Override
public void handleSelectionEvent(DACheckBox checkbox) {
- ConfigurationDialogDataManager.getInstance().setShowInitia(
- !ConfigurationDialogDataManager.getInstance().isShowInitia());
- showInitialCheckBox.setChecked(ConfigurationDialogDataManager
- .getInstance().isShowInitia());
+
+ if (ConfigurationDialogDataManager.getInstance()
+ .getfeatureSwapValue(ConfigureLabels.SHOW_INITIAL) > 0) {
+ ConfigurationDialogDataManager.getInstance()
+ .setfeatureSwapValue(ConfigureLabels.SHOW_INITIAL, 0);
+ showInitialCheckBox.setChecked(false);
+ } else {
+ ConfigurationDialogDataManager.getInstance()
+ .setfeatureSwapValue(ConfigureLabels.SHOW_INITIAL, 1);
+ showInitialCheckBox.setChecked(true);
+ }
}
};
private DACheckboxSelectionListener autoStopRadioButtonListener = new DACheckboxSelectionListener() {
@Override
public void handleSelectionEvent(DACheckBox checkbox) {
- ConfigurationDialogDataManager.getInstance().setAutoStop(
- !ConfigurationDialogDataManager.getInstance().isAutoStop());
- autoStopCheckBox.setChecked(ConfigurationDialogDataManager.getInstance()
- .isAutoStop());
+ if (ConfigurationDialogDataManager.getInstance()
+ .getfeatureSwapValue(ConfigureLabels.AUTO_STOP) > 0) {
+ ConfigurationDialogDataManager.getInstance()
+ .setfeatureSwapValue(ConfigureLabels.AUTO_STOP, 0);
+ autoStopCheckBox.setChecked(false);
+ } else {
+ ConfigurationDialogDataManager.getInstance()
+ .setfeatureSwapValue(ConfigureLabels.AUTO_STOP, 1);
+ autoStopCheckBox.setChecked(true);
+ }
}
};
}
\ No newline at end of file
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
+import org.tizen.dynamicanalyzer.communicator.DACommunicator;
import org.tizen.dynamicanalyzer.communicator.IDECommunicator;
import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
import org.tizen.dynamicanalyzer.nl.ConfigureLabels;
};
private void doApply() {
+
ConfigurationDialogDataManager.getInstance()
- .setTableItemsList(featuresTable);
+ .setFeaturesStatusFromTableItemsList(featuresTable);
ConfigurationDialogDataManager.getInstance()
.applySettingValueToConfigureManager();
+
+ DACommunicator.sendRuntimeMessage(DACommunicator.MSG_TYPE_CONFIG, null);
+ ConfigurationDialogDataManager.getInstance()
+ .setSettingValueFromConfigureManager();
notifyAutoRun();
}
ConfigurationDialogFeaturesPage featuresPage = new ConfigurationDialogFeaturesPage(
contentsComp, SWT.NONE);
+ compData = new FormData();
+ compData = new FormData();
+ compData.top = new FormAttachment(0, 0);
+ compData.left = new FormAttachment(0, 0);
+ compData.right = new FormAttachment(100, 0);
+ compData.bottom = new FormAttachment(100, 0);
+ featuresPage.setLayoutData(compData);
featuresTable = featuresPage.getFeatureTable();
// button
.setBackground(ColorResources.CONFIGURATION_BUTTON_COVER_BACKGROUND_COLOR);
useAgainCheckButton.setText(ConfigureLabels.WELCONE_ASK_USE_AGAIN);
useAgainCheckButton.addSelectionListener(useAgainCheckbuttonListener);
- useAgainCheckButton.setChecked(ConfigurationDialogDataManager.getInstance()
- .isShowInitia());
-
+ if (ConfigurationDialogDataManager.getInstance().getfeatureSwapValue(
+ ConfigureLabels.SHOW_INITIAL) > 0) {
+ useAgainCheckButton.setChecked(true);
+ } else {
+ useAgainCheckButton.setChecked(false);
+ }
Label useAgainLabel = new Label(buttonContentsComp, SWT.TRANSPARENT);
useAgainLabel.setText(ConfigureLabels.WELCONE_ASK_USE_AGAIN);
useAgainLabel
private DACheckboxSelectionListener useAgainCheckbuttonListener = new DACheckboxSelectionListener() {
@Override
public void handleSelectionEvent(DACheckBox checkbox) {
- if (ConfigurationDialogDataManager.getInstance().isShowInitia()) {
- ConfigurationDialogDataManager.getInstance().setShowInitia(false);
+ if (ConfigurationDialogDataManager.getInstance()
+ .getfeatureSwapValue(ConfigureLabels.SHOW_INITIAL) > 0) {
+ ConfigurationDialogDataManager.getInstance()
+ .setfeatureSwapValue(ConfigureLabels.SHOW_INITIAL, 0);
useAgainCheckButton.setChecked(false);
} else {
- ConfigurationDialogDataManager.getInstance().setShowInitia(true);
+ ConfigurationDialogDataManager.getInstance()
+ .setfeatureSwapValue(ConfigureLabels.SHOW_INITIAL, 1);
useAgainCheckButton.setChecked(true);
}
}