import org.tizen.dynamicanalyzer.ui.toolbar.ConfigureManager;
import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite;
-import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
import org.tizen.dynamicanalyzer.util.DALogger;
+import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
import org.tizen.dynamicanalyzer.widgets.da.base.DAMessageBox;
public class ConfigurationDialogDataManager {
private static ConfigurationDialogDataManager instance = null;
private DAMessageBox configDlg = null;
- private static String[] tableFeaturesName = null;
+
+ private static List<String> featureSystemList = null;
+ private static List<String> featuresList = null;
+ private static List<String> featuresSyscallList = null;
+ private static List<String> includeInsidelList = null;
+
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>();
+ private HashMap<String, Long> featuresValueHashMap = new HashMap<String, Long>();
public synchronized static ConfigurationDialogDataManager getInstance() {
if (null == instance) {
instance = new ConfigurationDialogDataManager();
- tableFeaturesName = new String[] {
-
- ConfigureLabels.FEATURE_SYSTEM_CPU,
- ConfigureLabels.FEATURE_SYSTEM_MEMORY,
- ConfigureLabels.FEATURE_SYSTEM_PROCESSES,
- ConfigureLabels.FEATURE_SYSTEM_DISK,
- ConfigureLabels.FEATURE_SYSTEM_NETWORK,
- ConfigureLabels.FEATURE_SYSTEM_DEVICE,
- ConfigureLabels.FEATURE_SYSTEM_ENERGY,
-
- ConfigureLabels.FEATURE_FUNCTION_PROFILING,
- ConfigureLabels.FEATURE_MEMORY_ALLOCATION,
- ConfigureLabels.FEATURE_THREAD,
- ConfigureLabels.FEATURE_NETWORK,
- // ConfigureLabels.FEATURE_FILE,
- ConfigureLabels.FEATURE_OPENGL,
- // ConfigureLabels.FEATURE_USERINTERFACE,
- ConfigureLabels.FEATURE_SCREENSHOT,
- ConfigureLabels.FEATURE_USER_EVENT,
- ConfigureLabels.FEATURE_RECORDING,
- ConfigureLabels.FEATURE_CONTEXT_SWITCH,
-
-// ConfigureLabels.FEATURE_SYSCALL_FILE,
-// ConfigureLabels.FEATURE_SYSCALL_IPC,
-// ConfigureLabels.FEATURE_SYSCALL_PROCESS,
-// ConfigureLabels.FEATURE_SYSCALL_SIGNAL,
-// ConfigureLabels.FEATURE_SYSCALL_NETWORK,
-// ConfigureLabels.FEATURE_SYSCALL_DESC,
-
- // 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,
- };
+
+ featureSystemList = new ArrayList<String>();
+ featureSystemList.add(ConfigureLabels.FEATURE_SYSTEM_CPU);
+ featureSystemList.add(ConfigureLabels.FEATURE_SYSTEM_MEMORY);
+ featureSystemList.add(ConfigureLabels.FEATURE_SYSTEM_PROCESSES);
+ featureSystemList.add(ConfigureLabels.FEATURE_SYSTEM_DISK);
+ featureSystemList.add(ConfigureLabels.FEATURE_SYSTEM_NETWORK);
+ featureSystemList.add(ConfigureLabels.FEATURE_SYSTEM_DEVICE);
+ featureSystemList.add(ConfigureLabels.FEATURE_SYSTEM_ENERGY);
+
+ featuresList = new ArrayList<String>();
+ featuresList.add(ConfigureLabels.FEATURE_FUNCTION_PROFILING);
+ featuresList.add(ConfigureLabels.FEATURE_MEMORY_ALLOCATION);
+ featuresList.add(ConfigureLabels.FEATURE_THREAD);
+ featuresList.add(ConfigureLabels.FEATURE_NETWORK);
+ featuresList.add(ConfigureLabels.FEATURE_FILE);
+ featuresList.add(ConfigureLabels.FEATURE_OPENGL);
+ featuresList.add(ConfigureLabels.FEATURE_USERINTERFACE);
+ featuresList.add(ConfigureLabels.FEATURE_SCREENSHOT);
+ featuresList.add(ConfigureLabels.FEATURE_USER_EVENT);
+ featuresList.add(ConfigureLabels.FEATURE_RECORDING);
+ featuresList.add(ConfigureLabels.FEATURE_CONTEXT_SWITCH);
+
+ featuresSyscallList = new ArrayList<String>();
+ featuresSyscallList.add(ConfigureLabels.FEATURE_SYSCALL_FILE);
+ featuresSyscallList.add(ConfigureLabels.FEATURE_SYSCALL_IPC);
+ featuresSyscallList.add(ConfigureLabels.FEATURE_SYSCALL_PROCESS);
+ featuresSyscallList.add(ConfigureLabels.FEATURE_SYSCALL_SIGNAL);
+ featuresSyscallList.add(ConfigureLabels.FEATURE_SYSCALL_NETWORK);
+ featuresSyscallList.add(ConfigureLabels.FEATURE_SYSCALL_DESC);
+
+ includeInsidelList = new ArrayList<String>();
+ includeInsidelList.add(ConfigureLabels.INCLUDE_INSIDE_CALL_MEMORY);
+ includeInsidelList.add(ConfigureLabels.INCLUDE_INSIDE_CALL_THREAD);
+ includeInsidelList.add(ConfigureLabels.INCLUDE_INSIDE_CALL_FILE);
+ includeInsidelList.add(ConfigureLabels.INCLUDE_INSIDE_CALL_NETWORK);
+ includeInsidelList.add(ConfigureLabels.INCLUDE_INSIDE_CALL_UI);
+ includeInsidelList.add(ConfigureLabels.INCLUDE_INSIDE_OPENGL);
optionalSettingName = new String[] { ConfigureLabels.SHOW_INITIAL,
ConfigureLabels.AUTO_STOP,
}
public boolean isShowInital() {
- if (featuresValueHashMap.get(ConfigureLabels.SHOW_INITIAL).swapValue > 0) {
+ if (featuresValueHashMap.get(ConfigureLabels.SHOW_INITIAL) > 0) {
return true;
} else {
return false;
}
public boolean isAutoStop() {
- if (featuresValueHashMap.get(ConfigureLabels.AUTO_STOP).swapValue > 0) {
+ if (featuresValueHashMap.get(ConfigureLabels.AUTO_STOP) > 0) {
return true;
} else {
return false;
return mConfig;
}
- public String[] getTableFeature() {
- return tableFeaturesName;
+ public List<String> getAllFeature() {
+ List<String> returnFeaturesList = new ArrayList<String>();
+ returnFeaturesList.addAll(getFeatureSystemList());
+ returnFeaturesList.addAll(getFeatureList());
+ returnFeaturesList.addAll(getFeatureSyscallList());
+ returnFeaturesList.addAll(getIncludeInsideList());
+ return returnFeaturesList;
+ }
+
+ public List<String> getFeatureList() {
+ return featuresList;
+ }
+
+ public List<String> getFeatureSystemList() {
+ return featureSystemList;
+ }
+
+ public List<String> getFeatureSyscallList() {
+ return featuresSyscallList;
+ }
+
+ public List<String> getIncludeInsideList() {
+ return includeInsidelList;
}
public String[] getOptionFeature() {
}
public long getfeatureValue(String features) {
- ConfigurationDialogData configData = featuresValueHashMap.get(features);
- if (null == configData) {
+ if (featuresValueHashMap.get(features) == AnalyzerConstants.FEATURE_OFF) {
return AnalyzerConstants.FEATURE_OFF;
}
- return configData.swapValue;
+ return featuresValueHashMap.get(features);
}
- public void setfeatureValue(String featureName, int value) {
- featuresValueHashMap.put(featureName, new ConfigurationDialogData(
- featureName, value));
+
+ public void setfeatureValue(String featureName, long value) {
+ featuresValueHashMap.put(featureName, value);
}
public boolean hasParentfeature(String featuresName) {
- Boolean hasParrent = featuresValueHashMap.get(featuresName).hasParrentFeature;
- return hasParrent;
+ for (int i = 0; i < getFeatureSystemList().size(); i++) {
+ if (getFeatureSystemList().get(i).equals(featuresName)) {
+ return true;
+ }
+ }
+ for (int i = 0; i < getFeatureSyscallList().size(); i++) {
+ if (getFeatureSyscallList().get(i).equals(featuresName)) {
+ return true;
+ }
+ }
+ for (int i = 0; i < getIncludeInsideList().size(); i++) {
+ if (getIncludeInsideList().get(i).equals(featuresName)) {
+ return true;
+ }
+ }
+ return false;
}
public String getParentFeatureName(String featuresName) {
|| featuresName
.equals(ConfigureLabels.FEATURE_SYSTEM_PROCESSES)
|| featuresName.equals(ConfigureLabels.FEATURE_SYSTEM_MEMORY)
-// || featuresName.equals(ConfigureLabels.FEATURE_SYSTEM_FD)
+ // || featuresName.equals(ConfigureLabels.FEATURE_SYSTEM_FD)
|| featuresName.equals(ConfigureLabels.FEATURE_SYSTEM_THREAD)
|| featuresName.equals(ConfigureLabels.FEATURE_SYSTEM_DISK)
|| featuresName.equals(ConfigureLabels.FEATURE_SYSTEM_NETWORK)
} else if (featuresName
.equals(ConfigureLabels.INCLUDE_INSIDE_CALL_NETWORK)) {
return ConfigureLabels.FEATURE_NETWORK;
- } else if(featuresName.equals(ConfigureLabels.INCLUDE_INSIDE_CALL_UI)) {
- return ConfigureLabels.FEATURE_USERINTERFACE;
+ } else if (featuresName.equals(ConfigureLabels.INCLUDE_INSIDE_CALL_UI)) {
+ return ConfigureLabels.FEATURE_USERINTERFACE;
} else if (featuresName.equals(ConfigureLabels.INCLUDE_INSIDE_OPENGL)) {
return ConfigureLabels.FEATURE_OPENGL;
} else {
|| featureName.equals(ConfigureLabels.FEATURE_SYSTEM_CPU)
|| featureName.equals(ConfigureLabels.FEATURE_SYSTEM_PROCESSES)
|| featureName.equals(ConfigureLabels.FEATURE_SYSTEM_MEMORY)
-// || featureName.equals(ConfigureLabels.FEATURE_SYSTEM_FD)
+ // || featureName.equals(ConfigureLabels.FEATURE_SYSTEM_FD)
|| featureName.equals(ConfigureLabels.FEATURE_SYSTEM_THREAD)
|| featureName.equals(ConfigureLabels.FEATURE_SYSTEM_DISK)
|| featureName.equals(ConfigureLabels.FEATURE_SYSTEM_NETWORK)
} else if (featureName.equals(ConfigureLabels.FEATURE_THREAD)) {
value = AnalyzerConstants.FEATURE_THREAD_API;
featuresValueHashMap.put(ConfigureLabels.FEATURE_SYSTEM_THREAD,
- new ConfigurationDialogData(
- ConfigureLabels.FEATURE_SYSTEM_THREAD,
- AnalyzerConstants.SYSTEM_THREAD_LOAD));
-
- } else if (featureName.equals(ConfigureLabels.FEATURE_USERINTERFACE)) {
+ AnalyzerConstants.SYSTEM_THREAD_LOAD);
+ } else if (featureName
+ .equals(ConfigureLabels.FEATURE_USERINTERFACE)) {
value = AnalyzerConstants.FEATURE_OSP_UI_API;
} else if (featureName.equals(ConfigureLabels.FEATURE_SCREENSHOT)) {
value = AnalyzerConstants.FEATURE_SCREENSHOT;
value = AnalyzerConstants.SYSTEM_MEMORY;
} else if (featureName.equals(ConfigureLabels.FEATURE_SYSTEM_DISK)) {
value = AnalyzerConstants.SYSTEM_DISK;
- }
- else if (featureName.equals(ConfigureLabels.FEATURE_SYSTEM_THREAD)) {
+ } else if (featureName
+ .equals(ConfigureLabels.FEATURE_SYSTEM_THREAD)) {
value = AnalyzerConstants.SYSTEM_THREAD_LOAD;
- }
- else if (featureName
+ } else if (featureName
.equals(ConfigureLabels.FEATURE_SYSTEM_NETWORK)) {
value = AnalyzerConstants.SYSTEM_NETWORK;
} else if (featureName
DA_LOG.debug("undefine feature : " + featureName);
}
}
- featuresValueHashMap.put(featureName, new ConfigurationDialogData(
- featureName, value));
+ featuresValueHashMap.put(featureName, value);
if (featureName.equals(ConfigureLabels.FEATURE_THREAD) && !status) {
featuresValueHashMap.put(ConfigureLabels.FEATURE_SYSTEM_THREAD,
- new ConfigurationDialogData(
- ConfigureLabels.FEATURE_SYSTEM_THREAD, value));
+ value);
}
}
public void updateFeaturesValueFromConfigureManager() {
// Table Feature
- for (String featureName : getTableFeature()) {
+ for (String featureName : getAllFeature()) {
try {
- ConfigurationDialogData data = new ConfigurationDialogData(
- featureName, mConfig.getValueLong(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;
- }
- featuresValueHashMap.put(featureName, data);
+ featuresValueHashMap.put(featureName,
+ mConfig.getValueLong(featureName));
} catch (NumberFormatException e) {
e.printStackTrace();
}
// optional Setting
for (String featureName : getOptionFeature()) {
try {
- ConfigurationDialogData data = new ConfigurationDialogData(
- featureName, mConfig.getValueLong(featureName));
- featuresValueHashMap.put(featureName, data);
+ featuresValueHashMap.put(featureName,
+ mConfig.getValueLong(featureName));
} catch (NumberFormatException e) {
e.printStackTrace();
}
public void saveInitFeaturesValue() {
initFeaturesValueHashMap.clear();
// Table Feature
- for (String featureName : getTableFeature()) {
+ for (String featureName : getAllFeature()) {
initFeaturesValueHashMap.put(featureName,
- featuresValueHashMap.get(featureName).swapValue);
+ featuresValueHashMap.get(featureName));
}
// optional Setting
for (String featureName : getOptionFeature()) {
initFeaturesValueHashMap.put(featureName,
- featuresValueHashMap.get(featureName).swapValue);
+ featuresValueHashMap.get(featureName));
}
}
public void rollbackSettingValueToConfigureManager() {
// Table Feature
- for (String featureName : getTableFeature()) {
+ for (String featureName : getAllFeature()) {
mConfig.setValue(featureName,
Long.toString(initFeaturesValueHashMap.get(featureName)));
}
public void applySettingValueToConfigureManager() {
changedFeatures(true);
// Table Feature
- for (String featureName : getTableFeature()) {
- mConfig.setValue(featureName, Long.toString(featuresValueHashMap
- .get(featureName).swapValue));
+ for (String featureName : getAllFeature()) {
+ mConfig.setValue(featureName,
+ Long.toString(featuresValueHashMap.get(featureName)));
}
- mConfig.setValue(ConfigureLabels.FEATURE_SYSTEM_THREAD, Long.toString(featuresValueHashMap
- .get(ConfigureLabels.FEATURE_SYSTEM_THREAD).swapValue));
-
+ mConfig.setValue(ConfigureLabels.FEATURE_SYSTEM_THREAD, Long
+ .toString(featuresValueHashMap
+ .get(ConfigureLabels.FEATURE_SYSTEM_THREAD)));
+
// optional Setting
for (String featureName : getOptionFeature()) {
- mConfig.setValue(featureName, Long.toString(featuresValueHashMap
- .get(featureName).swapValue));
+ mConfig.setValue(featureName,
+ Long.toString(featuresValueHashMap.get(featureName)));
}
}
public boolean changedFeatures(boolean apply) {
boolean isChangeValue = false;
// Table Feature
- for (String featureName : getTableFeature()) {
- long featuresStatus = featuresValueHashMap.get(featureName).swapValue;
+ for (String featureName : getAllFeature()) {
+ long featuresStatus = featuresValueHashMap.get(featureName);
long configFileStatus = mConfig.getValueLong(featureName);
if (featuresStatus != configFileStatus) {
if (apply) {
}
for (String featureName : getOptionFeature()) {
- long featuresStatus = featuresValueHashMap.get(featureName).swapValue;
+ long featuresStatus = featuresValueHashMap.get(featureName);
long configFileStatus = mConfig.getValueLong(featureName);
if (featuresStatus != configFileStatus) {
if (apply) {