PathManager.pathCheck();
DASingletonFocusManager.setSaveFocusDAPid();
IDECommunicator.startIDECommunicatorThread();
- ConfigurationDialogDataManager.getInstance().setSettingValueFromConfigureManager();
- if (!ConfigurationDialogDataManager.getInstance().isShowInitia()) {
+ ConfigurationDialogDataManager.getInstance().updateFeaturesValueFromConfigureManager();
+ if (!ConfigurationDialogDataManager.getInstance().isShowInital()) {
final Shell shell = AnalyzerUtil.getWorkbenchWindow().getShell();
WelcomeDialog dialog = new WelcomeDialog(shell); // FIXME
dialog.open();
public static String INTERNAL_LOG_LEVEL;
public static String THEME;
+
+ public static String VALUE_IS_EMPTY;
+ public static String YOU_HAVE_TO_SET_CHARACTER;
+ public static String VALUE_SHOULD_BE_IN_RANGE_FROM_1_TO_100;
+ public static String YOU_HAVE_TO_SET_MULTIPLE_OF_10MS;
static {
NLS.initializeMessages(BUNDLE_NAME, ConfigureLabels.class);
SECOND=s
AUTO=auto
SAMPLING=sampling period :
-PERIODIC=period
\ No newline at end of file
+PERIODIC=period
+VALUE_IS_EMPTY=value is empty
+YOU_HAVE_TO_SET_CHARACTER=you have to set character
+VALUE_SHOULD_BE_IN_RANGE_FROM_1_TO_100=value should be in range from 1 to 100
+YOU_HAVE_TO_SET_MULTIPLE_OF_10MS=you have to set multiple of 10ms
\ No newline at end of file
FileData input = (FileData) inputs.get(i);
if (ConfigurationDialogDataManager.getInstance()
- .getfeatureSwapValue(
+ .getfeatureValue(
ConfigureLabels.INCLUDE_INSIDE_CALL_FILE) == 0) {
if (input.isInternal()) {
continue;
NetworkData input = (NetworkData) inputs.get(i);
if (ConfigurationDialogDataManager.getInstance()
- .getfeatureSwapValue(
+ .getfeatureValue(
ConfigureLabels.INCLUDE_INSIDE_CALL_NETWORK) == 0) {
if (input.isInternal()) {
continue;
public static synchronized FunctionUsageProfiler getInstance() {
if (null == instance) {
SAMPLE_TIME = ConfigurationDialogDataManager.getInstance()
- .getfeatureSwapValue(ConfigureLabels
+ .getfeatureValue(ConfigureLabels
.FUNCTION_PROFILING_SAMPLING_PERIODIC);
instance = new FunctionUsageProfiler();
}
public ConfigurationDialog(Shell parent) {
super(parent);
ConfigurationDialogDataManager.getInstance()
- .setSettingValueFromConfigureManager();
+ .updateFeaturesValueFromConfigureManager();
}
private DACustomButtonClickEventListener applyButtonListener = new DACustomButtonClickEventListener() {
Composite selectedComposite = tabView.getTopComposite();
if (!(selectedComposite instanceof BinarySettingsPage)) {
ConfigurationDialogDataManager.getInstance()
- .setSettingValueFromConfigureManager();
+ .updateFeaturesValueFromConfigureManager();
} else {
BinarySettingsPage page = (BinarySettingsPage) selectedComposite;
page.doClose();
public long swapValue = 0;
public boolean hasParrentFeature = false;
public String optionFeaturesName = CommonConstants.EMPTY;
- public int optionfeaturesSwapValue = 0;
public ConfigurationDialogData(String featuresName, long swapValue) {
this.featuresName = featuresName;
import java.util.HashMap;
import java.util.List;
+import org.eclipse.nebula.widgets.grid.Grid;
import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
import org.tizen.dynamicanalyzer.common.CommonConstants;
import org.tizen.dynamicanalyzer.common.HostResult;
private DAMessageBox configDlg = null;
private static String[] tableFeaturesName = null;
- private static String[] optionSettingName = null;
- HashMap<String, ConfigurationDialogData> featuresStatusHashMap = new HashMap<String, ConfigurationDialogData>();
- HashMap<String, Long> savedFeaturesStatusHashMap = new HashMap<String, Long>();
+ private static String[] optionalSettingName = null;
private static ConfigureManager mConfig;
+ private HashMap<String, Long> initFeaturesValueHashMap = new HashMap<String, Long>();
+ private HashMap<String, ConfigurationDialogData> featuresValueHashMap = new HashMap<String, ConfigurationDialogData>();
public synchronized static ConfigurationDialogDataManager getInstance() {
if (null == instance) {
ConfigureLabels.INCLUDE_INSIDE_CALL_UI,
ConfigureLabels.INCLUDE_INSIDE_OPENGL, };
- optionSettingName = new String[] { ConfigureLabels.SHOW_INITIAL,
+ optionalSettingName = new String[] { ConfigureLabels.SHOW_INITIAL,
ConfigureLabels.AUTO_STOP,
ConfigureLabels.SNAPSHOT_PERIODIC,
ConfigureLabels.SNAPSHOT_PERIODIC_AUTO,
return instance;
}
+ public DAMessageBox getConfigDlg() {
+ return configDlg;
+ }
+
+ public void setConfigDlg(DAMessageBox configDlg) {
+ this.configDlg = configDlg;
+ }
+
+ public boolean isShowInital() {
+ if (featuresValueHashMap.get(ConfigureLabels.SHOW_INITIAL).swapValue > 0) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ public boolean isAutoStop() {
+ if (featuresValueHashMap.get(ConfigureLabels.AUTO_STOP).swapValue > 0) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ public ConfigureManager getConfigureManager() {
+ return mConfig;
+ }
+
public String[] getTableFeature() {
return tableFeaturesName;
}
public String[] getOptionFeature() {
- return optionSettingName;
+ return optionalSettingName;
}
- public long getfeatureSwapValue(String featues) {
- long swapValue = featuresStatusHashMap.get(featues).swapValue;
+ public long getfeatureValue(String featues) {
+ long swapValue = featuresValueHashMap.get(featues).swapValue;
return swapValue;
}
- public void setfeatureSwapValue(String featureName, int value) {
- featuresStatusHashMap.put(featureName, new ConfigurationDialogData(
+ public void setfeatureValue(String featureName, int value) {
+ featuresValueHashMap.put(featureName, new ConfigurationDialogData(
featureName, value));
}
- public boolean HasParentfeature(String featues) {
- Boolean hasParrent = featuresStatusHashMap.get(featues).hasParrentFeature;
+ public boolean hasParentfeature(String featuresName) {
+ Boolean hasParrent = featuresValueHashMap.get(featuresName).hasParrentFeature;
return hasParrent;
}
} else if (featureName
.equals(ConfigureLabels.SYSTEM_INFOMATION_SAMPLING_PERIODIC)) {
value = AnalyzerConstants.SYSTEM_INFOMATION_SAMPLING_PERIODIC;
- }
-
- else {
- System.out.println("failed set feature : " + featureName);
+ } else {
+ System.out.println("undefine feature : " + featureName);
}
}
- featuresStatusHashMap.put(featureName, new ConfigurationDialogData(
+ featuresValueHashMap.put(featureName, new ConfigurationDialogData(
featureName, value));
}
- public void setSettingValueFromConfigureManager() {
+ public void updateFeaturesValueFromConfigureManager() {
// Table Feature
for (String featureName : getTableFeature()) {
try {
if (optionFeatureName.equals(CommonConstants.EMPTY)) {
data.optionFeaturesName = optionFeatureName;
}
- featuresStatusHashMap.put(featureName, data);
+ featuresValueHashMap.put(featureName, data);
} catch (NumberFormatException e) {
e.printStackTrace();
}
}
+ // optional Setting
for (String featureName : getOptionFeature()) {
try {
ConfigurationDialogData data = new ConfigurationDialogData(
featureName, mConfig.getValueLong(featureName));
- featuresStatusHashMap.put(featureName, data);
+ featuresValueHashMap.put(featureName, data);
} catch (NumberFormatException e) {
e.printStackTrace();
}
}
- savedSettingValueToConfigureManager();
+ saveInitFeaturesValue();
}
- private void setConfig(long featureStatus, String featureName) {
- mConfig.setValue(featureName, Long.toString(featureStatus));
- System.out.println("featureName : " + featureName + " : "
- + Long.toString(featureStatus));
- }
-
- public void applySettingValueToConfigureManager() {
- changedFeatures(true);
+ public void saveInitFeaturesValue() {
+ initFeaturesValueHashMap.clear();
// Table Feature
for (String featureName : getTableFeature()) {
- setConfig(featuresStatusHashMap.get(featureName).swapValue,
- featureName);
+ initFeaturesValueHashMap.put(featureName,
+ featuresValueHashMap.get(featureName).swapValue);
}
- // Setting
+ // optional Setting
for (String featureName : getOptionFeature()) {
- setConfig(featuresStatusHashMap.get(featureName).swapValue,
- featureName);
+ initFeaturesValueHashMap.put(featureName,
+ featuresValueHashMap.get(featureName).swapValue);
}
}
- public void savedSettingValueToConfigureManager() {
- savedFeaturesStatusHashMap.clear();
+ public void rollbackSettingValueToConfigureManager() {
// Table Feature
for (String featureName : getTableFeature()) {
- savedFeaturesStatusHashMap.put(featureName,
- featuresStatusHashMap.get(featureName).swapValue);
+ mConfig.setValue(featureName,
+ Long.toString(initFeaturesValueHashMap.get(featureName)));
}
- // Setting
+ // optional Setting
for (String featureName : getOptionFeature()) {
- savedFeaturesStatusHashMap.put(featureName,
- featuresStatusHashMap.get(featureName).swapValue);
+ mConfig.setValue(featureName,
+ Long.toString(initFeaturesValueHashMap.get(featureName)));
}
}
- public void rollbackSettingValueToConfigureManager() {
+ public void applySettingValueToConfigureManager() {
+ changedFeatures(true);
// Table Feature
for (String featureName : getTableFeature()) {
- setConfig(savedFeaturesStatusHashMap.get(featureName), featureName);
+ mConfig.setValue(featureName, Long.toString(featuresValueHashMap
+ .get(featureName).swapValue));
}
- // Setting
+ // optional Setting
for (String featureName : getOptionFeature()) {
- setConfig(savedFeaturesStatusHashMap.get(featureName), featureName);
+ mConfig.setValue(featureName, Long.toString(featuresValueHashMap
+ .get(featureName).swapValue));
}
}
}
}
}
-
- }
-
- public DAMessageBox getConfigDlg() {
- return configDlg;
- }
-
- public void setConfigDlg(DAMessageBox configDlg) {
- this.configDlg = configDlg;
}
public boolean changedFeatures(boolean apply) {
boolean isChangeValue = false;
// Table Feature
for (String featureName : getTableFeature()) {
- long featuresStatus = featuresStatusHashMap.get(featureName).swapValue;
+ long featuresStatus = featuresValueHashMap.get(featureName).swapValue;
long configFileStatus = mConfig.getValueLong(featureName);
if (featuresStatus != configFileStatus) {
if (apply) {
- System.out.println("change values : " + featureName);
+ System.out.println("change values : " + featureName);
}
isChangeValue = true;
}
}
for (String featureName : getOptionFeature()) {
- long featuresStatus = featuresStatusHashMap.get(featureName).swapValue;
+ long featuresStatus = featuresValueHashMap.get(featureName).swapValue;
long configFileStatus = mConfig.getValueLong(featureName);
if (featuresStatus != configFileStatus) {
if (apply) {
- System.out.println("change values : " + featureName);
+ System.out.println("change values : " + featureName);
}
isChangeValue = true;
}
return isChangeValue;
}
- 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);
+ public String isCheckFeatue(String featueName) {
+ if (AnalyzerConstants.FEATURE_OFF != getfeatureValue(featueName)) {
+ return ConfigurationDialogFeaturesPage.ITEM_ALL_CHECKED;
+ } else {
+ return CommonConstants.EMPTY;
+ }
+ }
+
+ public String getOptionText(String featureName) {
+ long optionFeatureValue = getfeatureValue(featureName);
+ if (optionFeatureValue == AnalyzerConstants.FEATURE_OFF) {
+ return CommonConstants.EMPTY;
+ }
+
+ StringBuffer optionValue = new StringBuffer();
+ optionValue.append(CommonConstants.SPACE).append(
+ CommonConstants.OPEN_BRACKET);
+
+ if (featureName.equals(ConfigureLabels.SNAPSHOT_PERIODIC)) {
+ if (getfeatureValue(ConfigureLabels.SNAPSHOT_PERIODIC_AUTO) != AnalyzerConstants.FEATURE_OFF) {
+ optionValue.append(ConfigureLabels.AUTO);
+ } else {
+ optionValue.append(ConfigureLabels.SAMPLING
+ + Long.toString(optionFeatureValue));
+ }
+ } else if (featureName
+ .equals(ConfigureLabels.SYSTEM_INFOMATION_SAMPLING_PERIODIC)
+ || featureName
+ .equals(ConfigureLabels.FUNCTION_PROFILING_SAMPLING_PERIODIC)) {
+ optionValue.append(ConfigureLabels.SAMPLING
+ + Long.toString(optionFeatureValue));
+ }
+ optionValue.append(CommonConstants.CLOSE_BRACKET);
+ return optionValue.toString();
+ }
+
+ public void setFeaturesValueFromTableItemsList(Grid table) {
+ for (int i = 0; i < table.getItemCount(); i++) {
+ String featureName = table.getItem(i).getText(0);
+ String optionText = table.getItem(i).getText(1);
boolean isChecked = false;
if (optionText
.contains(ConfigurationDialogFeaturesPage.ITEM_ALL_CHECKED)) {
} else {
isChecked = false;
}
-
- ConfigurationDialogDataManager.getInstance().setFeaturesSwapValue(
- featureName, isChecked);
-
- }
- }
-
- public boolean isShowInitia() {
- if (featuresStatusHashMap.get(ConfigureLabels.SHOW_INITIAL).swapValue > 0) {
- return true;
- } else {
- return false;
- }
- }
-
- public boolean isAutoStop() {
- if (featuresStatusHashMap.get(ConfigureLabels.AUTO_STOP).swapValue > 0) {
- return true;
- } else {
- return false;
+ setFeaturesSwapValue(featureName, isChecked);
}
}
public void applySwapValue(DATableComposite featuresTable) {
- preSwapValue(featuresTable);
+ setFeaturesValueFromTableItemsList(featuresTable.getTable());
+ applySettingValueToConfigureManager();
if (null != DACommunicator.getSelectedDevice()) {
HostResult result = DACommunicator.sendRuntimeMessage(
DACommunicator.MSG_TYPE_CONFIG, null);
DACommunicator.getSelectedDevice().setConfigSuccess(true);
ToolbarArea.getInstance().setStartButtonEnablement(true);
} else {
- applySuccessSwapValue(featuresTable);
+ updateFeaturesValueFromConfigureManager();
+ featuresTable.updateTable();
}
}
}
- public void preSwapValue(DATableComposite featuresTable) {
- setFeaturesStatusFromTableItemsList(featuresTable);
- applySettingValueToConfigureManager();
- }
-
- public void applySuccessSwapValue(DATableComposite featuresTable) {
- setSettingValueFromConfigureManager();
- featuresTable.updateTable();
- }
-
public void applyFailedSwapValue(DATableComposite featuresTable) {
rollbackSettingValueToConfigureManager();
- setSettingValueFromConfigureManager();
+ updateFeaturesValueFromConfigureManager();
featuresTable.updateTable();
}
-
- public ConfigureManager getConfigureManager() {
- return mConfig;
- }
}
}
});
- // Details Title
+ // Detail Title
Label detailLabel = new Label(this, SWT.TRANSPARENT);
detailLabel.setText(ConfigureLabels.FEATURE_DETAIL_SETTING_TITLE);
detailLabel
data.left = new FormAttachment(0, 8);
detailLabel.setLayoutData(data);
- // Setting
detailSettingComp = new Composite(this, SWT.NONE);
FormLayout compLayout = new FormLayout();
detailSettingComp.setLayout(compLayout);
String optionFeatusName = ConfigurationDialogDataManager
.getInstance().getOptionFeatureName(featureName);
long savedValue = ConfigurationDialogDataManager.getInstance()
- .getfeatureSwapValue(optionFeatusName);
+ .getfeatureValue(optionFeatusName);
textBox.setText(Long.toString(savedValue));
textBoxLabel = new Label(detailSettingComp, SWT.TRANSPARENT);
info.setForeground(ColorResources.RED);
info.setFont(FontResources.COMBO);
- if (ConfigurationDialogDataManager
- .getInstance()
- .getfeatureSwapValue(ConfigureLabels.SNAPSHOT_PERIODIC_AUTO) == AnalyzerConstants.FEATURE_OFF) {
+ if (ConfigurationDialogDataManager.getInstance().getfeatureValue(
+ ConfigureLabels.SNAPSHOT_PERIODIC_AUTO) == AnalyzerConstants.FEATURE_OFF) {
detailSettingCheckBox.setChecked(false);
} else {
detailSettingCheckBox.setChecked(true);
}
- if (ConfigurationDialogDataManager.getInstance()
- .getfeatureSwapValue(featureName) == AnalyzerConstants.FEATURE_OFF) {
+ if (ConfigurationDialogDataManager.getInstance().getfeatureValue(
+ featureName) == AnalyzerConstants.FEATURE_OFF) {
detailSettingCheckBox.setEnabled(false);
textBox.getControl().setEnabled(false);
} else {
textBox.getControl().setEnabled(true);
}
- if (ConfigurationDialogDataManager.getInstance()
- .getfeatureSwapValue(featureName) != AnalyzerConstants.FEATURE_OFF
+ if (ConfigurationDialogDataManager.getInstance().getfeatureValue(
+ featureName) != AnalyzerConstants.FEATURE_OFF
&& ConfigurationDialogDataManager.getInstance()
- .getfeatureSwapValue(
+ .getfeatureValue(
ConfigureLabels.SNAPSHOT_PERIODIC_AUTO) == AnalyzerConstants.FEATURE_OFF) {
textBox.getControl().setEnabled(true);
} else {
String optionFeatusName = ConfigurationDialogDataManager
.getInstance().getOptionFeatureName(featureName);
long savedValue = ConfigurationDialogDataManager.getInstance()
- .getfeatureSwapValue(optionFeatusName);
+ .getfeatureValue(optionFeatusName);
textBox.setText(Long.toString(savedValue));
textBoxLabel = new Label(detailSettingComp, SWT.TRANSPARENT);
info.setForeground(ColorResources.RED);
info.setFont(FontResources.COMBO);
- if (ConfigurationDialogDataManager.getInstance()
- .getfeatureSwapValue(featureName) == AnalyzerConstants.FEATURE_OFF) {
+ if (ConfigurationDialogDataManager.getInstance().getfeatureValue(
+ featureName) == AnalyzerConstants.FEATURE_OFF) {
textBox.getControl().setEnabled(false);
} else {
textBox.getControl().setEnabled(true);
}
detailSettingComp.layout(true);
- } else {
-
}
}
if (items.length == 0) {
return;
}
- if (ConfigurationDialogDataManager
- .getInstance()
- .getfeatureSwapValue(ConfigureLabels.SNAPSHOT_PERIODIC_AUTO) == AnalyzerConstants.FEATURE_OFF) {
- ConfigurationDialogDataManager.getInstance()
- .setfeatureSwapValue(
- ConfigureLabels.SNAPSHOT_PERIODIC_AUTO, 1);
+ if (ConfigurationDialogDataManager.getInstance().getfeatureValue(
+ ConfigureLabels.SNAPSHOT_PERIODIC_AUTO) == AnalyzerConstants.FEATURE_OFF) {
+ ConfigurationDialogDataManager.getInstance().setfeatureValue(
+ ConfigureLabels.SNAPSHOT_PERIODIC_AUTO, 1);
detailSettingCheckBox.setChecked(true);
} else {
- ConfigurationDialogDataManager.getInstance()
- .setfeatureSwapValue(
- ConfigureLabels.SNAPSHOT_PERIODIC_AUTO, 0);
+ ConfigurationDialogDataManager.getInstance().setfeatureValue(
+ ConfigureLabels.SNAPSHOT_PERIODIC_AUTO, 0);
detailSettingCheckBox.setChecked(false);
}
updateDetails();
if (checkValidInputText(featureName, textBox.getText())) {
int textBoxData = Integer.parseInt(textBox.getText());
ConfigurationDialogDataManager.getInstance()
- .setfeatureSwapValue(
+ .setfeatureValue(
ConfigurationDialogDataManager.getInstance()
.getOptionFeatureName(featureName),
textBoxData);
private boolean checkValidInputText(String featuresName, String inputText) {
if (inputText.isEmpty()) {
- info.setText("value is empty");//$NON-NLS-1$
+ info.setText(ConfigureLabels.VALUE_IS_EMPTY);
ConfigurationDialogDataManager.getInstance()
.updateSaveButtonStatus(false);
return false;
} else if (!isInteger(textBox.getText())) {
- info.setText("you have to set character");//$NON-NLS-1$
+ info.setText(ConfigureLabels.YOU_HAVE_TO_SET_CHARACTER);
removeInputValue();
return false;
}
int value = Integer.parseInt(textBox.getText());
if (featuresName.equals(ConfigureLabels.FEATURE_FUNCTION_PROFILING)) {
if (value < 0 || 100 < value) {
- info.setText("value should be in range from 1 to 100");//$NON-NLS-1$
+ info.setText(ConfigureLabels.VALUE_SHOULD_BE_IN_RANGE_FROM_1_TO_100);
return false;
}
}
) {
if (value < 0 || 1000 < value) {
- info.setText("value should be in range from 1 to 1000");//$NON-NLS-1$
+ info.setText(ConfigureLabels.VALUE_SHOULD_BE_IN_RANGE_FROM_1_TO_100);
return false;
}
}
|| featuresName.equals(ConfigureLabels.FEATURE_SYSTEM_DEVICE)
|| featuresName.equals(ConfigureLabels.FEATURE_SYSTEM_ENERGY)) {
if (value % 10 != 0) {
- info.setText("you have to set multiple of 10ms");//$NON-NLS-1$
+ info.setText(ConfigureLabels.YOU_HAVE_TO_SET_MULTIPLE_OF_10MS);
ConfigurationDialogDataManager.getInstance()
.updateSaveButtonStatus(false);
return false;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
-import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
import org.tizen.dynamicanalyzer.common.CommonConstants;
import org.tizen.dynamicanalyzer.model.TreeInput;
import org.tizen.dynamicanalyzer.nl.ConfigureLabels;
}
}
- private String isCheckFeatue(String featueName) {
- if (AnalyzerConstants.FEATURE_OFF != ConfigurationDialogDataManager
- .getInstance().getfeatureSwapValue(featueName)) {
- return ConfigurationDialogFeaturesPage.ITEM_ALL_CHECKED;
- } else {
- return CommonConstants.EMPTY;
- }
- }
-
private TreeInput makeInput(String featueName) {
DATableDataFormat tableData = new DATableDataFormat(0);
List<String> text = new ArrayList<String>();
text.add(featueName);
- String optionColumn = isCheckFeatue(featueName);
+ String optionColumn = ConfigurationDialogDataManager.getInstance()
+ .isCheckFeatue(featueName);
String parentFeatureName = ConfigurationDialogDataManager.getInstance()
.getParentFeatureName(featueName);
if (!parentFeatureName.equals(CommonConstants.EMPTY)) {
&& ConfigurationDialogDataManager.getInstance()
.getParentFeatureName(featueName)
.equals(CommonConstants.EMPTY)) {
- optionColumn += (ConfigurationDialogFeaturesPage.FEATURE_OPTION_VALUE + getOptionText(optionFeatureName));
+ optionColumn += (ConfigurationDialogFeaturesPage.FEATURE_OPTION_VALUE + ConfigurationDialogDataManager
+ .getInstance().getOptionText(optionFeatureName));
}
text.add(optionColumn);
for (int i = 0; i < featuresList.length; i++) {
String featuresName = featuresList[i];
TreeInput currentNode = makeInput(featuresName);
- if (!ConfigurationDialogDataManager.getInstance().HasParentfeature(
+ if (!ConfigurationDialogDataManager.getInstance().hasParentfeature(
featuresName)) {
output.add(currentNode);
} else {
if (!optionFeatureName.equals(CommonConstants.EMPTY)) {
text.add(ConfigurationDialogFeaturesPage.FEATURE_OPTION_VALUE
- + getOptionText(optionFeatureName));
+ + ConfigurationDialogDataManager.getInstance()
+ .getOptionText(optionFeatureName));
} else {
text.add(ConfigurationDialogFeaturesPage.ITEM_ALL_CHECKED);
}
final int MOUSE_LEFT = 1;
final int MOUSE_RIGHT = 3;
GridItem item = table.getItem(new Point(event.x, event.y));
-
if (null == item) {
return;
}
}
}
- private String getOptionText(String featureName) {
-
- long optionFeatureValue = ConfigurationDialogDataManager.getInstance()
- .getfeatureSwapValue(featureName);
- if (optionFeatureValue == AnalyzerConstants.FEATURE_OFF) {
- return CommonConstants.EMPTY;
- }
-
- StringBuffer optionValue = new StringBuffer();
- optionValue.append(CommonConstants.SPACE).append(
- CommonConstants.OPEN_BRACKET);
-
- if (featureName.equals(ConfigureLabels.SNAPSHOT_PERIODIC)) {
- if (ConfigurationDialogDataManager
- .getInstance()
- .getfeatureSwapValue(ConfigureLabels.SNAPSHOT_PERIODIC_AUTO) != AnalyzerConstants.FEATURE_OFF) {
- optionValue.append(ConfigureLabels.AUTO);
- } else {
- optionValue.append(ConfigureLabels.SAMPLING
- + Long.toString(optionFeatureValue));
- }
- } else if (featureName
- .equals(ConfigureLabels.SYSTEM_INFOMATION_SAMPLING_PERIODIC)
- || featureName
- .equals(ConfigureLabels.FUNCTION_PROFILING_SAMPLING_PERIODIC)) {
- optionValue.append(ConfigureLabels.SAMPLING
- + Long.toString(optionFeatureValue));
- }
- optionValue.append(CommonConstants.CLOSE_BRACKET);
- return optionValue.toString();
- }
-
private boolean isClickCheckBox(GridItem item, Event event) {
String optionText = item.getText(tableTextOptionColumnIndex);
int checkImgX = 0;
}
private void setConfigurationDialogDataManager(GridItem item, Event event) {
- String featureName = item.getText(0);
- String optionText = item.getText(tableTextOptionColumnIndex);
- if (optionText
- .contains(ConfigurationDialogFeaturesPage.ITEM_ALL_CHECKED)) {
- ConfigurationDialogDataManager.getInstance().setFeaturesSwapValue(
- featureName, true);
- } else {
- ConfigurationDialogDataManager.getInstance().setFeaturesSwapValue(
- featureName, false);
- }
+ ConfigurationDialogDataManager.getInstance()
+ .setFeaturesValueFromTableItemsList(table);
}
private void updateChildCheckBoxByParent(GridItem item, Event event) {
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
+import org.tizen.dynamicanalyzer.common.CommonConstants;
import org.tizen.dynamicanalyzer.resources.FontResources;
import org.tizen.dynamicanalyzer.resources.ImageResources;
String[] optionList = item.getText(1).split(
ConfigurationDialogFeaturesPage.FEATURE_OPTION_VALUE);
if (optionList.length > 1) {
- if (optionList[1].contains(",")) {
- String[] optionList2 = optionList[1].split(",");
+ if (optionList[1].contains(CommonConstants.COMMA)) {
+ String[] optionList2 = optionList[1]
+ .split(CommonConstants.COMMA);
printText += optionList2[0];
} else {
printText += optionList[1];
showInitialCheckBox.setBackground(ColorResources.DIALOG_BG_UPPER);
showInitialCheckBox.setText(ConfigureLabels.SHOW_INITIAL);
showInitialCheckBox.addSelectionListener(showInitiaRadioButtonListener);
- if (ConfigurationDialogDataManager.getInstance().getfeatureSwapValue(
+ if (ConfigurationDialogDataManager.getInstance().getfeatureValue(
ConfigureLabels.SHOW_INITIAL) > 0) {
showInitialCheckBox.setChecked(true);
} else {
autoStopCheckBox.setBackground(ColorResources.DIALOG_BG_UPPER);
autoStopCheckBox.setText(ConfigureLabels.AUTO_STOP);
autoStopCheckBox.addSelectionListener(autoStopRadioButtonListener);
- if (ConfigurationDialogDataManager.getInstance().getfeatureSwapValue(
+ if (ConfigurationDialogDataManager.getInstance().getfeatureValue(
ConfigureLabels.AUTO_STOP) > 0) {
autoStopCheckBox.setChecked(true);
} else {
@Override
public void handleSelectionEvent(DACheckBox checkbox) {
if (ConfigurationDialogDataManager.getInstance()
- .getfeatureSwapValue(ConfigureLabels.SHOW_INITIAL) > 0) {
+ .getfeatureValue(ConfigureLabels.SHOW_INITIAL) > 0) {
ConfigurationDialogDataManager.getInstance()
- .setfeatureSwapValue(ConfigureLabels.SHOW_INITIAL, 0);
+ .setfeatureValue(ConfigureLabels.SHOW_INITIAL, 0);
showInitialCheckBox.setChecked(false);
} else {
ConfigurationDialogDataManager.getInstance()
- .setfeatureSwapValue(ConfigureLabels.SHOW_INITIAL, 1);
+ .setfeatureValue(ConfigureLabels.SHOW_INITIAL, 1);
showInitialCheckBox.setChecked(true);
}
ConfigurationDialogDataManager.getInstance()
@Override
public void handleSelectionEvent(DACheckBox checkbox) {
if (ConfigurationDialogDataManager.getInstance()
- .getfeatureSwapValue(ConfigureLabels.AUTO_STOP) > 0) {
+ .getfeatureValue(ConfigureLabels.AUTO_STOP) > 0) {
ConfigurationDialogDataManager.getInstance()
- .setfeatureSwapValue(ConfigureLabels.AUTO_STOP, 0);
+ .setfeatureValue(ConfigureLabels.AUTO_STOP, 0);
autoStopCheckBox.setChecked(false);
} else {
ConfigurationDialogDataManager.getInstance()
- .setfeatureSwapValue(ConfigureLabels.AUTO_STOP, 1);
+ .setfeatureValue(ConfigureLabels.AUTO_STOP, 1);
autoStopCheckBox.setChecked(true);
}
ConfigurationDialogDataManager.getInstance()
public WelcomeDialog(Shell parent) {
super(parent);
ConfigurationDialogDataManager.getInstance()
- .setSettingValueFromConfigureManager();
+ .updateFeaturesValueFromConfigureManager();
}
private DACustomButtonClickEventListener applyButtonListener = new DACustomButtonClickEventListener() {
private void doBack() {
ConfigurationDialogDataManager.getInstance()
- .setSettingValueFromConfigureManager();
+ .updateFeaturesValueFromConfigureManager();
notifyAutoRun();
}
.setBackground(ColorResources.CONFIGURATION_BUTTON_COVER_BACKGROUND_COLOR);
useAgainCheckButton.setText(ConfigureLabels.WELCONE_ASK_USE_AGAIN);
useAgainCheckButton.addSelectionListener(useAgainCheckbuttonListener);
- if (ConfigurationDialogDataManager.getInstance().getfeatureSwapValue(
+ if (ConfigurationDialogDataManager.getInstance().getfeatureValue(
ConfigureLabels.SHOW_INITIAL) > 0) {
useAgainCheckButton.setChecked(true);
} else {
@Override
public void handleSelectionEvent(DACheckBox checkbox) {
if (ConfigurationDialogDataManager.getInstance()
- .getfeatureSwapValue(ConfigureLabels.SHOW_INITIAL) > 0) {
+ .getfeatureValue(ConfigureLabels.SHOW_INITIAL) > 0) {
ConfigurationDialogDataManager.getInstance()
- .setfeatureSwapValue(ConfigureLabels.SHOW_INITIAL, 0);
+ .setfeatureValue(ConfigureLabels.SHOW_INITIAL, 0);
useAgainCheckButton.setChecked(false);
} else {
ConfigurationDialogDataManager.getInstance()
- .setfeatureSwapValue(ConfigureLabels.SHOW_INITIAL, 1);
+ .setfeatureValue(ConfigureLabels.SHOW_INITIAL, 1);
useAgainCheckButton.setChecked(true);
}
ConfigurationDialogDataManager.getInstance().updateSaveButtonStatus(null);