Require-Bundle: org.eclipse.core.runtime,
org.eclipse.ui
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
-Export-Package: org.tizen.dynamicanalyzer.common.model,
+Export-Package: org.tizen.dynamicanalyzer.common.callback,
org.tizen.dynamicanalyzer.common.path,
org.tizen.dynamicanalyzer.util,
org.tizen.dynamicanalyzer.workbench;
-package org.tizen.dynamicanalyzer.common.model;
+package org.tizen.dynamicanalyzer.common.callback;
import java.util.ArrayList;
import java.util.List;
-package org.tizen.dynamicanalyzer.common.model;
+package org.tizen.dynamicanalyzer.common.callback;
public interface IExecutionCallback {
// constant related to path
public static final String TIZEN_SDK_DATA = "tizen-sdk-data";//$NON-NLS-1$
- public static final String INSTALL = "tizensdkpath"; //$NON-NLS-1$
+ public static final String INSTALLATION_INFO = "tizensdkpath"; //$NON-NLS-1$
public static final String TIZEN_FOLDER_ROOTSTRAPS = "rootstraps"; //$NON-NLS-1$
public static final String TIZEN_FOLDER_USR = "usr"; //$NON-NLS-1$
public static final String TIZEN_FOLDER_INCLUDE = "include"; //$NON-NLS-1$
public static final String WIN_INSTALL_KEY = "Local AppData"; //$NON-NLS-1$
public static final String LINUX_INSTALL_ENV = "HOME";//$NON-NLS-1$
+ // window activator
+ public static final String WINDOW_ACTIVATOR_LINUX = "windowactivator.sh";//$NON-NLS-1$
+ public static final String WINDOW_ACTIVATOR_WINDOWS = "windowactivator.bat";//$NON-NLS-1$
+ public static final String WINDOW_ACTIVATOR_MACOS = "macoswindowactivator.sh";//$NON-NLS-1$
+
// paths
public static final String DA_REMOTE_PROBE_PATH = "/home/developer/sdk_tools/da/"; //$NON-NLS-1$
public static final String DA_REMOTE_PATH = "/home/developer/sdk_tools/da/"; //$NON-NLS-1$
public static final String DA_DAEMON_LOG_PATH = "/tmp/daemonlog.da"; //$NON-NLS-1$
public static final String DA_API_MAP_PATH = "/usr/lib/da_api_map"; //$NON-NLS-1$
+ // for debug
+ public static final String DA_STDOUT_TO_FILE = "logtofile";
}
import org.eclipse.core.runtime.Platform;
import org.tizen.dynamicanalyzer.util.CommonUtil;
+// All paths of PathManager should not be ended with File.separater
public class PathManager {
private static String logPostFix = null;
- /* paths */
+ private static final String SDK_INFO_RELATIVE_PATH = "../../sdk.info"; //$NON-NLS-1$
+
+ // tizen paths
public static final String TIZEN_SDK_DATA_PATH = getTizenSdkDataPath();
- public static final String TIZEN_ROOT_PATH = getDefaultRoot();
- public static final String DYNAMIC_ANALYZER_INSTALL_PATH = getInstallPath();
- public static final String DYNAMIC_ANALYZER_SAVE_PATH = getSavePath();
- public static final String DYNAMIC_ANALYZER_SETTING_PATH = getBinarySettingPath();
- public static final String DYNAMIC_ANALYZER_RPM_PATH = getRPMPath();
- public static final String DYNAMIC_ANALYZER_AUTOTEST_PATH = TIZEN_SDK_DATA_PATH
- + File.separator
- + "test"
- + File.separator
+ public static final String TIZEN_SDK_INSTALL_PATH = getTizenSdkInstallPath();
+
+ // sdb path
+ public static final String SDB_PATH = TIZEN_SDK_INSTALL_PATH
+ + File.separator + PathConstants.TOOLS_FOLDER_NAME + File.separator
+ + "sdb"; //$NON-NLS-1$
+
+ // dynamic analyzer paths
+ public static final String DA_DATA_PATH = TIZEN_SDK_DATA_PATH
+ + File.separator + PathConstants.DYNAMIC_ANALYZER_FOLDER_NAME;
+ public static final String DA_INSTALL_PATH = TIZEN_SDK_INSTALL_PATH
+ + File.separator + PathConstants.TOOLS_FOLDER_NAME + File.separator
+ + PathConstants.DYNAMIC_ANALYZER_FOLDER_NAME;
+ public static final String DA_AUTOTEST_PATH = TIZEN_SDK_DATA_PATH
+ + File.separator + "test" + File.separator
+ PathConstants.DYNAMIC_ANALYZER_FOLDER_NAME;
- public static final String DA_DEBUG_DATA_CHANNEL_LOG_PATH = TIZEN_SDK_DATA_PATH
- + File.separator + "data.log";
- public static final String DA_DEBUG_CONTROL_CHANNEL_LOG_PATH = TIZEN_SDK_DATA_PATH
- + File.separator + "control.log";
- public static final String TOOL_FOLDER_PATH = DYNAMIC_ANALYZER_INSTALL_PATH
+ public static final String DA_READELF_PATH = DA_INSTALL_PATH
+ + File.separator + PathConstants.TARGET_FOLDER_NAME;
+
+ public static final String DA_LOG_PATH = DA_DATA_PATH + File.separator
+ + PathConstants.LOGS_FOLDER_NAME;
+ public static final String DA_SAVE_PATH = DA_DATA_PATH + File.separator
+ + PathConstants.SAVE_FOLDER_NAME;
+ public static final String DA_SETTING_PATH = DA_DATA_PATH + File.separator
+ + PathConstants.SETTING_FOLDER_NAME;
+ public static final String DA_RPM_PATH = DA_DATA_PATH + File.separator
+ + PathConstants.RPM_FOLDER_NAME;
+ public static final String DA_CONFIG_FOLDER_PATH = DA_INSTALL_PATH
+ + File.separator + PathConstants.CONFIG_FOLDER_NAME;
+ public static final String DA_TOOL_FOLDER_PATH = DA_INSTALL_PATH
+ File.separator + PathConstants.TOOL_FOLDER_NAME;
- public static final String TEMP_FOLDER_PATH = DYNAMIC_ANALYZER_SAVE_PATH
+
+ public static final String DA_DEBUG_DATA_CHANNEL_LOG_FILE = DA_LOG_PATH
+ + File.separator + "data.log"; //$NON-NLS-1$
+ public static final String DA_DEBUG_CONTROL_CHANNEL_LOG_FILE = DA_LOG_PATH
+ + File.separator + "control.log"; //$NON-NLS-1$
+ public static final String DA_TEMP_FOLDER_PATH = DA_SAVE_PATH
+ File.separator + PathConstants.TEMP_FOLDER_NAME;
- public static final String CONFIG_FOLDER_PATH = getConfigFolderPath();
- public static final String WORKBENCH_FOLDER_PATH = getWorkbenchPath();
- public static final String ABOUT_FILE_PATH = getAboutPath();
- public static final String SDB_PATH = getSdbPath();
- public static final String READELF_PATH = DYNAMIC_ANALYZER_INSTALL_PATH
- + File.separator + PathConstants.TARGET_FOLDER_NAME
- + File.separator;
+ public static final String DA_BINARY_AUTO_SAVE_FILE = DA_SAVE_PATH
+ + File.separator + "BinarySettings.save";
- public static final String DA_SINGLETON_FILE_PATH = getSavePath()
+ public static final String DA_SINGLETON_FILE_PATH = DA_SAVE_PATH
+ File.separator + "active_da"; //$NON-NLS-1$
- public static final String IDE_ACTIVE_PORT_PATH = getSavePath()
+ public static final String IDE_ACTIVE_PORT_PATH = DA_SAVE_PATH
+ File.separator + "active_da_plugin"; //$NON-NLS-1$
- public static final String IDE_ACTIVE_SAVE_PORT_PATH = getSavePath()
+ public static final String IDE_ACTIVE_SAVE_PORT_PATH = DA_SAVE_PATH
+ File.separator + "current_active_ide_port"; //$NON-NLS-1$
- public static final String WINDOW_ACTIVATOR_LINUX_PATH = TIZEN_ROOT_PATH
- + "/tools/dynamic-analyzer/tool/windowactivator.sh";//$NON-NLS-1$
- public static final String WINDOW_ACTIVATOR_WIDOWS_PATH = TIZEN_ROOT_PATH
- + "/tools/dynamic-analyzer/tool/windowactivator.bat";//$NON-NLS-1$
- public static final String WINDOW_ACTIVATOR_MACOS_PATH = TIZEN_ROOT_PATH
- + "/tools/dynamic-analyzer/tool/macoswindowactivator.sh";//$NON-NLS-1$
-
- /* Name & Path */
- public static final String SBI_COMMAND = TIZEN_ROOT_PATH + File.separator
- + PathConstants.TOOLS_FOLDER_NAME + File.separator
- + "smart-build-interface" + File.separator + "bin" + File.separator
- + "sbi";
-
- public static final String SDK_INFO_RELATIVE_PATH = "../../sdk.info"; //$NON-NLS-1$
- public static final String BINARY_AUTO_SAVE_PATH = getSavePath()
- + File.separator + "BinarySettings.save";
+ public static final String WORKBENCH_FOLDER_PATH = getWorkbenchPath();
+ public static final String ABOUT_FILE_PATH = getAboutPath();
+
+ public static boolean checkTizenPathValidation() {
+ if (TIZEN_SDK_DATA_PATH == null || TIZEN_SDK_INSTALL_PATH == null) {
+ return false;
+ } else {
+ return true;
+ }
+ }
public static void setLogPostFix(String postFix) {
logPostFix = postFix;
return logPostFix;
}
- public static String getRegistryValue(String node, String key) {
+ private static String getRegistryValue(String node, String key) {
BufferedReader br = null;
String value = "";
return value;
}
- public static String getTizenSdkDataPath() {
- String defaultPath = null;
-
- // case 1 : sdk.info
- defaultPath = getPathFromSdkInfoFile(true);
-
- if (null == defaultPath) {
- if (CommonUtil.isLinux()) {
- defaultPath = System.getenv(PathConstants.LINUX_INSTALL_ENV)
- + File.separator + PathConstants.TIZEN_SDK_DATA;
- } else if (CommonUtil.isWin()) {
- defaultPath = getRegistryValue(PathConstants.WIN_INSTALL_NODE,
- PathConstants.WIN_INSTALL_KEY)
- + File.separator
- + PathConstants.TIZEN_SDK_DATA;
- } else if (CommonUtil.isMac()) {
- defaultPath = System.getenv(PathConstants.LINUX_INSTALL_ENV)
- + File.separator + PathConstants.TIZEN_SDK_DATA;
- } else {
- defaultPath = "";
- }
- }
-
- return defaultPath;
- }
-
private static String getPathFromSdkInfoFile(boolean isDataPath) {
String retPath = null;
BufferedReader br = null;
- String line = null;
- // case 1 : sdk.info
+
try {
- String path = null;
- path = Platform.getInstallLocation().getURL().getPath();
- if (null != path && !path.isEmpty()) {
- String infoPath = path + SDK_INFO_RELATIVE_PATH;
- File infoFile = new File(infoPath);
- if (infoFile.exists() && infoFile.isFile()) {
+ String curpath = null;
+ curpath = Platform.getInstallLocation().getURL().getPath();
+ if (null != curpath && !curpath.isEmpty()) {
+ String sdkinfoPath = curpath + SDK_INFO_RELATIVE_PATH;
+ File sdkinfoFile = new File(sdkinfoPath);
+ if (sdkinfoFile.exists() && sdkinfoFile.isFile()) {
br = new BufferedReader(new InputStreamReader(
- new FileInputStream(infoFile)));
- line = br.readLine(); // sdkpath
+ new FileInputStream(sdkinfoFile)));
+
+ String line = br.readLine(); // sdk install path
if (isDataPath) {
line = br.readLine(); // sdk data path
}
}
}
}
+
return retPath;
}
- public static String getDefaultRoot() {
- String rootPath = null;
+ public static String getTizenSdkDataPath() {
+ String defaultPath = null;
+
+ // case 1 : read from sdk.info
+ defaultPath = getPathFromSdkInfoFile(true);
+
+ // case 2 : get default install directory
+ if (null == defaultPath) {
+ if (CommonUtil.isLinux()) {
+ defaultPath = System.getenv(PathConstants.LINUX_INSTALL_ENV)
+ + File.separator + PathConstants.TIZEN_SDK_DATA;
+ } else if (CommonUtil.isWin()) {
+ defaultPath = getRegistryValue(PathConstants.WIN_INSTALL_NODE,
+ PathConstants.WIN_INSTALL_KEY)
+ + File.separator
+ + PathConstants.TIZEN_SDK_DATA;
+ } else if (CommonUtil.isMac()) {
+ defaultPath = System.getenv(PathConstants.LINUX_INSTALL_ENV)
+ + File.separator + PathConstants.TIZEN_SDK_DATA;
+ } else {
+ defaultPath = "";
+ }
+ }
+
+ File file = new File(defaultPath);
+ if (file == null || !file.exists()) {
+ defaultPath = null;
+ }
+
+ return defaultPath;
+ }
+
+ public static String getTizenSdkInstallPath() {
+ String retPath = null;
BufferedReader br = null;
- String line = null;
// case 1 : sdk.info
- rootPath = getPathFromSdkInfoFile(false);
- if (null == rootPath) {
+ retPath = getPathFromSdkInfoFile(false);
+
+ // case 2 : tizensdkpath in tizen-sdk-data directory
+ if (null == retPath) {
try {
- // case 2 : tizensdkpath
- rootPath = TIZEN_SDK_DATA_PATH + File.separator
- + PathConstants.INSTALL;
- File file = new File(rootPath);
- if (!file.isFile()) {
- return null;
- }
- br = new BufferedReader(new InputStreamReader(
- new FileInputStream(file)));
- line = br.readLine();
- if (null == line) {
- return null;
- } else {
- return line.substring(line.indexOf("=") + 1);
+ String infoPath = TIZEN_SDK_DATA_PATH + File.separator
+ + PathConstants.INSTALLATION_INFO;
+ File file = new File(infoPath);
+ if (file.exists() && file.isFile()) {
+ br = new BufferedReader(new InputStreamReader(
+ new FileInputStream(file)));
+ String line = br.readLine();
+ if (null != line) {
+ retPath = line.substring(line.indexOf("=") + 1);
+ }
}
-
} catch (IOException e) {
e.printStackTrace();
} finally {
}
}
- return rootPath;
+ return retPath;
}
public static String getTizenHeaderSouecePath(boolean isArm, String platform) {
String tizenHeaderSouecePath = "";
if (platform != null) {
- String tempPath = TIZEN_ROOT_PATH;
+ String tempPath = TIZEN_SDK_INSTALL_PATH;
if (null != tempPath) {
tempPath += File.separator + PathConstants.PLATFORM_FOLDER_NAME
+ File.separator + platform + File.separator
return tizenHeaderSouecePath;
}
- public static String getInstallPath() {
- String installPath = TIZEN_ROOT_PATH;
- if (null != installPath) {
- installPath += File.separator + PathConstants.TOOLS_FOLDER_NAME
- + File.separator
- + PathConstants.DYNAMIC_ANALYZER_FOLDER_NAME;
- }
- return installPath;
- }
-
- public static String getSavePath() {
- String savePath = TIZEN_SDK_DATA_PATH;
- if (null != savePath) {
- savePath += File.separator
- + PathConstants.DYNAMIC_ANALYZER_FOLDER_NAME
- + File.separator + PathConstants.SAVE_FOLDER_NAME;
- }
- return savePath;
- }
-
- public static String getBinarySettingPath() {
- String settingPath = TIZEN_SDK_DATA_PATH;
- if (null != settingPath) {
- settingPath += File.separator
- + PathConstants.DYNAMIC_ANALYZER_FOLDER_NAME
- + File.separator + PathConstants.SETTING_FOLDER_NAME;
- }
- return settingPath;
- }
-
- public static String getRPMPath() {
- String rpmPath = TIZEN_SDK_DATA_PATH;
- if (null != rpmPath) {
- rpmPath += File.separator
- + PathConstants.DYNAMIC_ANALYZER_FOLDER_NAME
- + File.separator + PathConstants.RPM_FOLDER_NAME;
- }
- return rpmPath;
- }
-
- public static String getLogPath() {
- String logPath = TIZEN_SDK_DATA_PATH;
- if (null != logPath) {
- logPath += File.separator
- + PathConstants.DYNAMIC_ANALYZER_FOLDER_NAME
- + File.separator + PathConstants.LOGS_FOLDER_NAME;
- }
- return logPath;
- }
-
- public static String getSdbPath() {
- String path = TIZEN_ROOT_PATH;
- if (null != path) {
- path += File.separator + PathConstants.TOOLS_FOLDER_NAME
- + File.separator + "sdb"; //$NON-NLS-1$
- }
- return path;
- }
-
public static String getTargetPath(String platform) {
if (null != platform && !platform.isEmpty()) {
- return TIZEN_ROOT_PATH + File.separator
+ return TIZEN_SDK_INSTALL_PATH + File.separator
+ PathConstants.PLATFORM_FOLDER_NAME + File.separator
+ platform + File.separator
+ PathConstants.DYNAMIC_ANALYZER_FOLDER_NAME
+ File.separator;
} else {
- return DYNAMIC_ANALYZER_INSTALL_PATH + File.separator
+ return DA_INSTALL_PATH + File.separator
+ PathConstants.TARGET_FOLDER_NAME + File.separator;
}
}
public static String getProjectInfoFile(String projectSavePath) {
StringBuffer projectInfoSaveFile = new StringBuffer("");
- if (!getSavePath().equals("")) {
+ if (!DA_SAVE_PATH.equals("")) {
projectInfoSaveFile.append(projectSavePath);
projectInfoSaveFile.append(File.separator).append(
PathConstants.PROJECT_INFO_FILE_NAME);
}
- public static String getConfigFolderPath() {
- String configFolderPath = DYNAMIC_ANALYZER_INSTALL_PATH;
- if (null != configFolderPath) {
- configFolderPath += File.separator
- + PathConstants.CONFIG_FOLDER_NAME;
- }
- return configFolderPath;
- }
-
- public static String getConfigFilePath() {
- String configFilePath = CONFIG_FOLDER_PATH;
-
- if (null != configFilePath) {
- configFilePath += File.separator + PathConstants.CONFIG_FILE_NAME;
- }
- return configFilePath;
- }
-
public static String getAboutPath() {
- String aboutFolderPath = TIZEN_ROOT_PATH;
- if (null == aboutFolderPath) {
- return null;
- }
+ String aboutFolderPath = TIZEN_SDK_INSTALL_PATH;
aboutFolderPath += (File.separator
+ PathConstants.ABOUT_IDE_FOLDER_NAME + File.separator + PathConstants.ABOUT_PLUGINS_FOLDER_NAME);
@Override
public boolean accept(File dir, String name) {
- // TODO Auto-generated method stub
return name
.contains(PathConstants.ABOUT_BASE_PLATFORM_FOLDER_NAME);
}
}
public static String getWorkbenchPath() {
- String aboutFolderPath = TIZEN_ROOT_PATH;
+ String aboutFolderPath = TIZEN_SDK_INSTALL_PATH;
if (null == aboutFolderPath) {
return null;
}
@Override
public boolean accept(File dir, String name) {
- // TODO Auto-generated method stub
return name
.contains(PathConstants.ABOUT_WORKBENCH_FOLDER_NAME);
}
public static String getRootStrapsPath(String platform) {
if (platform != null) {
- return TIZEN_ROOT_PATH + File.separator + "platforms"
+ return TIZEN_SDK_INSTALL_PATH + File.separator + "platforms"
+ File.separator + platform + File.separator + "rootstraps";
} else {
return "";
}
}
+
+ public static String getWindowActivatorPath() {
+ String returnstr;
+
+ if (CommonUtil.isWin()) {
+ returnstr = DA_TOOL_FOLDER_PATH + File.separator
+ + PathConstants.WINDOW_ACTIVATOR_WINDOWS;
+ } else if (CommonUtil.isMac()) {
+ returnstr = DA_TOOL_FOLDER_PATH + File.separator
+ + PathConstants.WINDOW_ACTIVATOR_MACOS;
+ } else if (CommonUtil.isLinux()) {
+ returnstr = DA_TOOL_FOLDER_PATH + File.separator
+ + PathConstants.WINDOW_ACTIVATOR_LINUX;
+ } else {
+ returnstr = null;
+ }
+
+ return returnstr;
+ }
}
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.PlatformUI;
+import org.tizen.dynamicanalyzer.common.path.PathConstants;
import org.tizen.dynamicanalyzer.common.path.PathManager;
import org.tizen.dynamicanalyzer.util.FileUtil;
public class Application implements IApplication {
- private boolean STDOUT_TO_FILE = false;
private static final String LOG_PREFIX = "da_log_";
- private static final int LOG_COUNT = 3;
+ private static final int MAX_LOG_COUNT = 3;
@Override
public Object start(IApplicationContext context) throws Exception {
Display display = PlatformUI.createDisplay();
- // set workspace directory for dynamic analyzer
- Location instanceLoc = Platform.getInstanceLocation();
- String path = PathManager.DYNAMIC_ANALYZER_INSTALL_PATH
- + File.separator;
- instanceLoc.set(new URL("file", null, path), false);
-
- // create log file of dynamic analyzer
- SimpleDateFormat format = new SimpleDateFormat("yyyy_MM_dd_HH-mm-ss", //$NON-NLS-1$
- Locale.KOREA);
- Date date = new Date();
- String logPostFix = format.format(date);
- PathManager.setLogPostFix(logPostFix);
- if (STDOUT_TO_FILE) {
- String logPath = PathManager.getLogPath();
- File logs = new File(logPath);
- boolean success = true;
- if (!logs.exists()) {
- if (!logs.mkdirs()) {
+ // check for tizen sdk installation
+ boolean pathValidness = PathManager.checkTizenPathValidation();
+
+ if (pathValidness) {
+
+ // set workspace directory for dynamic analyzer
+ Location instanceLoc = Platform.getInstanceLocation();
+ String path = PathManager.DA_INSTALL_PATH + File.separator;
+ instanceLoc.set(new URL("file", null, path), false);
+
+ // set log postfix
+ SimpleDateFormat format = new SimpleDateFormat(
+ "yyyy_MM_dd_HH-mm-ss", //$NON-NLS-1$
+ Locale.KOREA);
+ Date date = new Date();
+ String logPostFix = format.format(date);
+ PathManager.setLogPostFix(logPostFix);
+
+ // check for log to file
+ String logtofile = PathManager.DA_DATA_PATH + File.separator
+ + PathConstants.DA_STDOUT_TO_FILE;
+ File ltofile = new File(logtofile);
+ if (ltofile != null && ltofile.exists()) {
+ String logPath = PathManager.DA_LOG_PATH;
+ File logs = new File(logPath);
+ if (!logs.exists() && !logs.mkdirs()) {
System.out
.println("Log directory create failed.. log file create failed...");
- success = false;
+ } else {
+ String logFileName = LOG_PREFIX + logPostFix;//$NON-NLS-1$
+ logPath += File.separator + logFileName;
+
+ File logfile = new File(logPath);
+ FileOutputStream fos = new FileOutputStream(logfile);
+ PrintStream ps = new PrintStream(fos);
+ System.setOut(ps);
+ System.setErr(ps);
+
+ checkLogs(logs.getPath());
}
}
- if (success) {
- String logFileName = LOG_PREFIX + logPostFix;//$NON-NLS-1$
- logPath += File.separator + logFileName;
- File file = new File(logPath);
- FileOutputStream fos = new FileOutputStream(file);
- PrintStream ps = new PrintStream(fos);
- System.setOut(ps);
- System.setErr(ps);
-
- checkLogs(logs.getPath());
+ // check for multiple instance of dynamic analyzer
+ if (WorkbenchSingletonFocusManager.checkDASingleton()) {
+ System.out.println("Already DA Running");
+ WorkbenchSingletonFocusManager.setFocusDA();
+ System.exit(-1);
+ } else {
+ System.out.println("The First DA Running");
}
- }
- // check for multiple instance of dynamic analyzer
- if (WorkbenchSingletonFocusManager.checkDASingleton()) {
- System.out.println("Already DA Running");
- WorkbenchSingletonFocusManager.setFocusDA();
- System.exit(-1);
- } else {
- System.out.println("First DA Running");
- }
+ } // end of if (pathValidness)
int returnCode = PlatformUI.createAndRunWorkbench(display,
new ApplicationWorkbenchAdvisor());
});
}
+ // check previous log file and make less or equal than 3 log files
private void checkLogs(String path) {
List<String> logFiles = FileUtil.getFilesInDir(path);
if (null == logFiles) {
return;
}
+
List<String> daLogFiles = new ArrayList<String>();
for (String name : logFiles) {
if (name.contains(LOG_PREFIX)) {
}
}
- if (daLogFiles.size() > 3) {
+ if (daLogFiles.size() > MAX_LOG_COUNT) {
Collections.sort(daLogFiles);
- int to = daLogFiles.size() - LOG_COUNT;
+ int to = daLogFiles.size() - MAX_LOG_COUNT;
for (int i = 0; i < to; i++) {
File deleteFile = new File(path + File.separator
+ daLogFiles.get(i));
import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
import org.eclipse.ui.application.WorkbenchWindowAdvisor;
-import org.tizen.dynamicanalyzer.common.model.ExecutionCallbackManager;
+import org.tizen.dynamicanalyzer.common.callback.ExecutionCallbackManager;
public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor {
((Composite) page).layout(true);
}
}
+
+ public static void setEnabled(boolean enablement) {
+ baseComposite.setEnabled(enablement);
+ }
}
import java.nio.channels.FileLock;
import org.tizen.dynamicanalyzer.common.path.PathManager;
-import org.tizen.dynamicanalyzer.util.CommonUtil;
public class WorkbenchSingletonFocusManager {
private static Runtime runtime;
String[] returnStr = null;
String strPid = getPidFromConfigFile();
+ String activator = PathManager.getWindowActivatorPath();
+
if (null == strPid) {
return returnStr;
}
- if (CommonUtil.isWin()) {
- returnStr = new String[] {
- PathManager.WINDOW_ACTIVATOR_WIDOWS_PATH, strPid };
- } else if (CommonUtil.isMac()) {
- returnStr = new String[] {
- PathManager.WINDOW_ACTIVATOR_MACOS_PATH, strPid };
- } else if (CommonUtil.isLinux()) {
- returnStr = new String[] {
- PathManager.WINDOW_ACTIVATOR_LINUX_PATH, strPid };
+
+ if (activator != null) {
+ returnStr = new String[] { activator, strPid };
} else {
System.out.println("Failed - not Support OS");
}
private static String getPidFromConfigFile() {
String pid = null;
- File configFile = new File(PathManager.DYNAMIC_ANALYZER_INSTALL_PATH
- + File.separator + CONFIG + File.separator + CONFIG);
+ File configFile = new File(PathManager.DA_INSTALL_PATH + File.separator
+ + CONFIG + File.separator + CONFIG);
if (!configFile.isFile()) {
System.out.println("Failed get pid - exist config file");
return "";//$NON-NLS-1$
in.close();
}
} catch (IOException e) {
- // TODO Auto-generated catch block
e.printStackTrace();
}
}
FileLock fileLock = null;
boolean isFileLock = false;
- String saveFolderPath = PathManager.getSavePath();
+ String saveFolderPath = PathManager.DA_SAVE_PATH;
File daSaveFile = new File(saveFolderPath);
if (!daSaveFile.isDirectory()) {
lib/hsqldb.jar,
lib/json-simple-1.1.1.jar,
lib/protobuf.jar
-Export-Package: org.tizen.dynamicanalyzer.common,
- org.tizen.dynamicanalyzer.communicator,
- org.tizen.dynamicanalyzer.error,
- org.tizen.dynamicanalyzer.handlers,
- org.tizen.dynamicanalyzer.ui.toolbar,
- org.tizen.dynamicanalyzer.ui.toolbar.configuration,
- org.tizen.dynamicanalyzer.ui.widgets,
- org.tizen.dynamicanalyzer.utils
Import-Package: junit.framework;version="4.8.2",
org.junit,
org.tizen.common.sdb.command,
import java.util.List;\r
\r
\r
+import org.eclipse.swt.SWT;\r
+import org.eclipse.swt.widgets.Shell;\r
import org.eclipse.ui.IPartService;\r
import org.eclipse.ui.IWorkbench;\r
import org.eclipse.ui.IWorkbenchListener;\r
import org.tizen.dynamicanalyzer.common.path.PathManager;\r
import org.tizen.dynamicanalyzer.listeners.AnalyzerPartListener;\r
import org.tizen.dynamicanalyzer.listeners.AnalyzerPerspectiveListener;\r
+import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;\r
+import org.tizen.dynamicanalyzer.resources.ImageResources;\r
import org.tizen.dynamicanalyzer.sql.SqlManager;\r
+import org.tizen.dynamicanalyzer.ui.widgets.DADialog;\r
+import org.tizen.dynamicanalyzer.util.WorkbenchUtil;\r
import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;\r
\r
public class AnalyzerPlugin extends AbstractUIPlugin {\r
public void start(BundleContext context) throws Exception {\r
super.start(context);\r
plugin = this;\r
+ \r
+ // check for path validness\r
+ if (!PathManager.checkTizenPathValidation()) {\r
+ final Shell shell = WorkbenchUtil.getWorkbenchWindow()\r
+ .getShell();\r
+ DADialog dialog = new DADialog(shell, SWT.NONE); // FIXME\r
+ dialog.setIcon(ImageResources.DIALOG_WARNING_ICON);\r
+ dialog.setMessage(AnalyzerLabels.PATH_WARNING);\r
+ if (dialog.open() == true) {\r
+ System.exit(-1);\r
+ }\r
+ }\r
\r
// Adds workbench listener.\r
IWorkbench workbench = PlatformUI.getWorkbench();\r
**/\r
if (delete) {\r
SqlManager.getInstance().closeConnection();\r
- File tempDir = new File(PathManager.TEMP_FOLDER_PATH);\r
+ File tempDir = new File(PathManager.DA_TEMP_FOLDER_PATH);\r
if (tempDir.isDirectory() && tempDir.exists()) {\r
if (AnalyzerUtil.deleteFile(tempDir)) {\r
System.out.println("Delete temp folder!"); //$NON-NLS-1$\r
IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();\r
window.addPerspectiveListener(new AnalyzerPerspectiveListener());\r
\r
- File saveFolder = new File(PathManager.TEMP_FOLDER_PATH);\r
+ File saveFolder = new File(PathManager.DA_TEMP_FOLDER_PATH);\r
if (saveFolder.exists()) {\r
if (AnalyzerUtil.deleteFile(saveFolder)) {\r
System.out.println("delete temp folder");\r
import org.tizen.dynamicanalyzer.resources.ImageResources;
import org.tizen.dynamicanalyzer.ui.toolbar.ConfigureManager;
import org.tizen.dynamicanalyzer.ui.widgets.DADialog;
-import org.tizen.dynamicanalyzer.util.CommonUtil;
import org.tizen.dynamicanalyzer.util.WorkbenchUtil;
public class DASingletonFocusManager {
String[] returnStr = null;
String strPid = ConfigureManager.getInstance().getValue(
ConfigureLabels.SINGLETON_FOCUS_DA_PID);
+ String activator = PathManager.getWindowActivatorPath();
- if (CommonUtil.isWin()) {
- returnStr = new String[] {
- PathManager.WINDOW_ACTIVATOR_WIDOWS_PATH, strPid };
- } else if (CommonUtil.isMac()) {
- returnStr = new String[] {
- PathManager.WINDOW_ACTIVATOR_MACOS_PATH, strPid };
- } else if (CommonUtil.isLinux()) {
- returnStr = new String[] {
- PathManager.WINDOW_ACTIVATOR_LINUX_PATH, strPid };
+ if (activator != null) {
+ returnStr = new String[] { activator, strPid };
} else {
Shell shell = WorkbenchUtil.getWorkbenchWindow().getShell();
DADialog warning = new DADialog(shell, SWT.NONE);
package org.tizen.dynamicanalyzer.common;
import org.eclipse.swt.widgets.Shell;
-import org.tizen.dynamicanalyzer.common.model.IExecutionCallback;
+import org.tizen.dynamicanalyzer.common.callback.IExecutionCallback;
import org.tizen.dynamicanalyzer.ui.toolbar.configuration.ConfigurationDialogDataManager;
import org.tizen.dynamicanalyzer.ui.toolbar.configuration.WelcomeDialog;
import org.tizen.dynamicanalyzer.util.WorkbenchUtil;
package org.tizen.dynamicanalyzer.common;
-import org.tizen.dynamicanalyzer.common.model.IExecutionCallback;
+import org.tizen.dynamicanalyzer.common.callback.IExecutionCallback;
import org.tizen.dynamicanalyzer.communicator.DACommunicator;
import org.tizen.dynamicanalyzer.handlers.ExitHandler;
import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
public static HostResult uploadReadElf() {
long readelfSize = -1;
- String readelf = PathManager.READELF_PATH;
+ String readelf = PathManager.DA_READELF_PATH + File.separator;
HostResult result = null;
if (isCurrentDeviceArmArch()) {
}
public static List<String> getApiMap(IDevice device) {
- String apiFilePath = PathManager.TEMP_FOLDER_PATH + File.separator
+ String apiFilePath = PathManager.DA_TEMP_FOLDER_PATH + File.separator
+ device.getSerialNumber() + CommonConstants.UNDERBAR
+ AnalyzerConstants.API_NAME_FILE_NAME;
try {
public static void pullDaemonLog() {
final String from = PathConstants.DA_DAEMON_LOG_PATH;
- final String to = PathManager.getLogPath() + File.separator
+ final String to = PathManager.DA_LOG_PATH + File.separator
+ DAEMONLOG_PREFIX + PathManager.getLogPostFix();//$NON-NLS-1$
SyncResult res = CommunicatorUtils.pull(from, to);
if (null != res && res.isOk()) {
System.out.println("Failed to get " + from); //$NON-NLS-1$
}
- AnalyzerUtil.checkLogs(PathManager.getLogPath(), DAEMONLOG_PREFIX,
+ AnalyzerUtil.checkLogs(PathManager.DA_LOG_PATH, DAEMONLOG_PREFIX,
DAEMONLOG_COUNT);
}
DAPageComposite page = AnalyzerManager.getCurrentPage();
page.updatePage();
if (AnalyzerManager.getProject().getSavePath()
- .contains(PathManager.TEMP_FOLDER_PATH)) {
+ .contains(PathManager.DA_TEMP_FOLDER_PATH)) {
ToolbarArea.getInstance().setMainControlEnablement(true);
} else {
ToolbarArea.getInstance().setSaveButtonEnable(false);
import org.tizen.dynamicanalyzer.common.DASingletonFocusManager;
import org.tizen.dynamicanalyzer.common.PostWindowOpenCallback;
import org.tizen.dynamicanalyzer.common.PreWindowShellCloseCallback;
-import org.tizen.dynamicanalyzer.common.model.ExecutionCallbackManager;
+import org.tizen.dynamicanalyzer.common.callback.ExecutionCallbackManager;
import org.tizen.dynamicanalyzer.common.path.PathManager;
import org.tizen.dynamicanalyzer.communicator.DACommunicator;
import org.tizen.dynamicanalyzer.communicator.IDECommunicator;
DACommunicator.updateToolbarDevice();
BinarySettingManager.getInstance().initBinarySettings();
- // path check
- if (null == PathManager.TIZEN_ROOT_PATH) {
- final Shell shell = WorkbenchUtil.getWorkbenchWindow()
- .getShell();
- DADialog dialog = new DADialog(shell, SWT.NONE); // FIXME
- dialog.setIcon(ImageResources.DIALOG_WARNING_ICON);
- dialog.setMessage(AnalyzerLabels.PATH_WARNING);
- if (dialog.open() == true) {
- System.exit(-1);
- }
- }
-
DASingletonFocusManager.setSaveFocusDAPid();
IDECommunicator.startIDECommunicatorThread();
ConfigurationDialogDataManager.getInstance()
if (length > 0) {
tmpAppName = tmpAppName.substring(0, MAX_FILENAME_LENGTH - 1);
}
- setSavePath(PathManager.TEMP_FOLDER_PATH + File.separator
+ setSavePath(PathManager.DA_TEMP_FOLDER_PATH + File.separator
+ tmpAppName + format.format(date));
File imgFolder = new File(getSavePath() + File.separator
+ AnalyzerConstants.IMAGE_FOLDER_NAME);
if(PRINT_CONTROL_LOG_TOFILE) {
File logPath = new File(
- PathManager.DA_DEBUG_CONTROL_CHANNEL_LOG_PATH);
+ PathManager.DA_DEBUG_CONTROL_CHANNEL_LOG_FILE);
if (logPath.exists()) {
logPath.delete();
}
binInfo.setTempBinaryPath(localBinaryPath);
if (splitLocalBinaryPath.length == 0
|| splitLocalBinaryPath.length < 3) {
- localBinaryPath = PathManager.TEMP_FOLDER_PATH
+ localBinaryPath = PathManager.DA_TEMP_FOLDER_PATH
+ File.separator + getFileName(targetPath);
result = pullTheFile(targetPath, localBinaryPath);
if (result.isSuccess()) {
// change binary file path of host
File binFile = new File(localBinaryPath);
if (!binFile.exists()) {
- localBinaryPath = PathManager.TEMP_FOLDER_PATH
+ localBinaryPath = PathManager.DA_TEMP_FOLDER_PATH
+ File.separator + getFileName(targetPath);
result = pullTheFile(targetPath, localBinaryPath);
if (result.isSuccess()) {
String targetHashCode = binInfo.getMd5sumValue();
if (0 != targetHashCode.compareTo(localHashCode)) {
- localBinaryPath = PathManager.TEMP_FOLDER_PATH
+ localBinaryPath = PathManager.DA_TEMP_FOLDER_PATH
+ File.separator + getFileName(targetPath);
result = pullTheFile(targetPath, localBinaryPath);
if (result.isSuccess()) {
String[] splitLocalBinaryPath = localBinaryPath
.split(CommonConstants.SLASH);
if (splitLocalBinaryPath.length <= 0) {
- localBinaryPath = PathManager.TEMP_FOLDER_PATH
+ localBinaryPath = PathManager.DA_TEMP_FOLDER_PATH
+ File.separator + getFileName(binPaths.get(i));
result = pullTheFile(binPaths.get(i), localBinaryPath);
if (result.isSuccess()) {
// change binary file path of host
File binFile = new File(localBinaryPath);
if (!binFile.exists()) {
- localBinaryPath = PathManager.TEMP_FOLDER_PATH
+ localBinaryPath = PathManager.DA_TEMP_FOLDER_PATH
+ File.separator + getFileName(binPaths.get(i));
result = pullTheFile(binPaths.get(i), localBinaryPath);
if (result.isSuccess()) {
String targetHashCode = binInfo.getMd5sumValue();
if (!targetHashCode.equals(localHashCode)) {
- localBinaryPath = PathManager.TEMP_FOLDER_PATH
+ localBinaryPath = PathManager.DA_TEMP_FOLDER_PATH
+ File.separator + getFileName(binPaths.get(i));
result = pullTheFile(binPaths.get(i), localBinaryPath);
if (result.isSuccess()) {
if(PRINT_DATA_LOG_TOFILE) {
File logPath = new File(
- PathManager.DA_DEBUG_DATA_CHANNEL_LOG_PATH);
+ PathManager.DA_DEBUG_DATA_CHANNEL_LOG_FILE);
if (logPath.exists()) {
logPath.delete();
}
153);
dialog.setIcon(ImageResources.DIALOG_WARNING_ICON);
dialog.setMessage(AnalyzerLabels.HEAP_MEMORY_WARNING_PRE
- + PathManager.DYNAMIC_ANALYZER_INSTALL_PATH
+ + PathManager.DA_INSTALL_PATH
+ AnalyzerLabels.HEAP_MEMORY_WARNING_POST);
dialog.open();
}
}
// copy rpm file
- String rpmPath = PathManager.getRPMPath() + File.separator
+ String rpmPath = PathManager.DA_RPM_PATH + File.separator
+ libFullName;
File rpms = new File(rpmPath);
if (!rpms.exists()) {
// extract rpm file exists
if (null != debugRpmPath) {
- String toolPath = PathManager.TOOL_FOLDER_PATH
+ String toolPath = PathManager.DA_TOOL_FOLDER_PATH
+ File.separator + "debuginfo.sh";
String[] command = null;
if (null != debugRpmSourcePath) {
libFullName.length());
String libVersion = libPostFix.substring(4,
libPostFix.length());
- String debugCmd = PathManager.TOOL_FOLDER_PATH
+ String debugCmd = PathManager.DA_TOOL_FOLDER_PATH
+ File.separator + "debuginfo.sh -f " + rpmPath
+ " " + "*" + libPostFix + ".debug";
String debugFilePath = null;
if (null != debugRpmSourcePath
&& !debugRpmSourcePath.isEmpty()) {
String sourceFilePath = null;
- String sourceCmd = PathManager.TOOL_FOLDER_PATH
+ String sourceCmd = PathManager.DA_TOOL_FOLDER_PATH
+ File.separator + "debuginfo.sh -f " + rpmPath
+ " " + "*" + libVersion;
try {
binData.setDebugSourcePath(CommonConstants.EMPTY);
}
} else if (debugFileName.contains("debug-")) {
- String debugCmd = PathManager.TOOL_FOLDER_PATH
+ String debugCmd = PathManager.DA_TOOL_FOLDER_PATH
+ File.separator + "debuginfo.sh -f " + rpmPath
+ CommonConstants.SPACE + libFullName;
String debugFilePath = null;
}
public void initBinarySettings() {
- File saveFile = new File(PathManager.BINARY_AUTO_SAVE_PATH);
+ File saveFile = new File(PathManager.DA_BINARY_AUTO_SAVE_FILE);
BufferedReader br = null;
String content = null;
try {
+ "-debuginfo*.rpm";
// String rootstrapPath = PathManager.getRootStrapsPath();
List<String> lines = new ArrayList<String>();
- String toolPath = PathManager.TOOL_FOLDER_PATH + File.separator
+ String toolPath = PathManager.DA_TOOL_FOLDER_PATH + File.separator
+ "debuginfo.sh";
String[] command = new String[] { toolPath, "-f", rootPath,
debugInfoToken };
return;
}
GridItem selection = selections[0];
- String openPath = PathManager.DYNAMIC_ANALYZER_SETTING_PATH
+ String openPath = PathManager.DA_SETTING_PATH
+ File.separator + selection.getText();
openAction(openPath);
}
GridItem item = items[0];
- String openPath = PathManager.DYNAMIC_ANALYZER_SETTING_PATH
+ String openPath = PathManager.DA_SETTING_PATH
+ File.separator + item.getText();
openAction(openPath);
shell.dispose();
int index = grid.getSelectionIndex();
GridItem item = items[0];
- String openPath = PathManager.DYNAMIC_ANALYZER_SETTING_PATH
+ String openPath = PathManager.DA_SETTING_PATH
+ File.separator + item.getText();
if (AnalyzerUtil.deleteFile(new File(openPath))) {
}
private boolean executeSaveTrace() {
- String targetPath = PathManager.DYNAMIC_ANALYZER_SETTING_PATH
+ String targetPath = PathManager.DA_SETTING_PATH
+ File.separator + saveFileName + ".setting";
File saveFile = new File(targetPath);
FileWriter fileWriter = null;
@Override
protected List<TableInput> makeTableInput() {
List<String> saveFileList = AnalyzerUtil
- .getFiles(PathManager.DYNAMIC_ANALYZER_SETTING_PATH);
+ .getFiles(PathManager.DA_SETTING_PATH);
List<TableInput> input = new ArrayList<TableInput>();
if (null != saveFileList) {
int size = saveFileList.size();
@Override
public void createPartControl(Composite parent) {
-
+ // create toolbar
Composite toolbarComposite = LayoutManager.getToolbarComposite();
ToolbarArea.createInstance(toolbarComposite);
-
+
+ // create tab view in base composite
tabView = new DATabComposite(parent, SWT.DOUBLE_BUFFERED);
tabView.setTabWidth(110);
{
}
private void initConfigDataFromFile() {
- if (null == PathManager.CONFIG_FOLDER_PATH) {
+ if (null == PathManager.DA_CONFIG_FOLDER_PATH) {
return;
}
- File configFolder = new File(PathManager.CONFIG_FOLDER_PATH);
+ File configFolder = new File(PathManager.DA_CONFIG_FOLDER_PATH);
if (!configFolder.isDirectory()) {
if (!configFolder.mkdirs()) {
System.out.println("config directory create failed...");
}
}
- File configFile = new File(configFolder,
- PathConstants.CONFIG_FILE_NAME);
+ File configFile = new File(configFolder, PathConstants.CONFIG_FILE_NAME);
if (!configFile.isFile()) {
try {
configFile.createNewFile();
}
private void setConfigDataToFile() {
- String configFilePath = PathManager.getConfigFilePath();
- if (null == configFilePath) {
- return;
- }
+ String configFilePath = PathManager.DA_CONFIG_FOLDER_PATH
+ + File.separator + PathConstants.CONFIG_FILE_NAME;
File configFile = new File(configFilePath);
FileWriter fileWriter = null;
public int getSamplingPeriod() {
return getValueInt(ConfigureLabels.FUNCTION_PROFILING_SAMPLING_PERIODIC);
}
-
+
public static String getPlatform() {
String platform = ConfigureManager.getInstance().getValue(
ConfigureLabels.PLATFORM);
private String getLicenseString() {
String configFileName = AnalyzerConstants.LICENSE_FILE_NAME;
StringBuffer ret = new StringBuffer(CommonConstants.EMPTY);
- File configFolder = new File(PathManager.CONFIG_FOLDER_PATH);
+ File configFolder = new File(PathManager.DA_CONFIG_FOLDER_PATH);
if (!configFolder.isDirectory()) {
return AnalyzerLabels.LICENSE_DIALOG_NOT_FOUND;
}
private boolean executeSaveTrace() {
Project project = AnalyzerManager.getProject();
String sourcePath = project.getSavePath();
- String targetPath = PathManager.DYNAMIC_ANALYZER_SAVE_PATH
+ String targetPath = PathManager.DA_SAVE_PATH
+ File.separator + saveFileName;
SqlManager.getInstance().closeConnection();
return buttons.get(id);
}
- public void setEnabled(boolean enabled) {
- // TODO : greatim : how to get baseComposite
-// baseComposite.setEnabled(enabled);
- }
-
public void setToolbarStartStopState(final boolean isStop) {
Display.getDefault().syncExec(new Runnable() {
@Override
inputRowHash = BinarySettingManager.getInstance().getInputRowHash();
inputRowList = BinarySettingManager.getInstance().getInputRowList();
- String settingPath = PathManager.DYNAMIC_ANALYZER_SETTING_PATH;
+ String settingPath = PathManager.DA_SETTING_PATH;
File settingFolder = new File(settingPath);
if (!settingFolder.exists() || !settingFolder.isDirectory()) {
if (!settingFolder.mkdirs()) {
}
public void doClose() {
- String targetPath = PathManager.BINARY_AUTO_SAVE_PATH;
+ String targetPath = PathManager.DA_BINARY_AUTO_SAVE_FILE;
File saveFile = new File(targetPath);
FileWriter fileWriter = null;
GridItem selection = selections[0];
String openPath = null;
if ((Integer) selection.getData() == TEMP_FOLDER) {
- openPath = PathManager.TEMP_FOLDER_PATH + File.separator
+ openPath = PathManager.DA_TEMP_FOLDER_PATH + File.separator
+ selection.getText();
} else if ((Integer) selection.getData() == SAVE_FOLDER) {
- openPath = PathManager.DYNAMIC_ANALYZER_SAVE_PATH
+ openPath = PathManager.DA_SAVE_PATH
+ File.separator + selection.getText();
} else {
return;
GridItem item = items[0];
String openPath = null;
if ((Integer) item.getData() == TEMP_FOLDER) {
- openPath = PathManager.TEMP_FOLDER_PATH + File.separator
+ openPath = PathManager.DA_TEMP_FOLDER_PATH + File.separator
+ item.getText();
} else if ((Integer) item.getData() == SAVE_FOLDER) {
- openPath = PathManager.DYNAMIC_ANALYZER_SAVE_PATH
+ openPath = PathManager.DA_SAVE_PATH
+ File.separator + item.getText();
} else {
return;
String openPath = null;
if ((Integer) item.getData() == TEMP_FOLDER) {
- openPath = PathManager.TEMP_FOLDER_PATH + File.separator
+ openPath = PathManager.DA_TEMP_FOLDER_PATH + File.separator
+ item.getText();
} else if ((Integer) item.getData() == SAVE_FOLDER) {
- openPath = PathManager.DYNAMIC_ANALYZER_SAVE_PATH
+ openPath = PathManager.DA_SAVE_PATH
+ File.separator + item.getText();
} else {
return;
String path = null;
if ((Integer) item.getData() == TEMP_FOLDER) {
- path = PathManager.TEMP_FOLDER_PATH + File.separator
+ path = PathManager.DA_TEMP_FOLDER_PATH + File.separator
+ item.getText(0);
} else if ((Integer) item.getData() == SAVE_FOLDER) {
- path = PathManager.DYNAMIC_ANALYZER_SAVE_PATH + File.separator
+ path = PathManager.DA_SAVE_PATH + File.separator
+ item.getText(0);
} else {
return;
@Override
protected List<TableInput> makeTableInput() {
List<String> saveFileList = AnalyzerUtil
- .getDirs(PathManager.DYNAMIC_ANALYZER_SAVE_PATH);
+ .getDirs(PathManager.DA_SAVE_PATH);
List<TableInput> input = new ArrayList<TableInput>();
if (null != saveFileList) {
int size = saveFileList.size();
List<String> text = new ArrayList<String>();
if (!saveFileList.get(i).equals(
PathConstants.TEMP_FOLDER_NAME)) {
- String path = PathManager.DYNAMIC_ANALYZER_SAVE_PATH
+ String path = PathManager.DA_SAVE_PATH
+ File.separator + saveFileList.get(i);
String inputText1 = saveFileList.get(i);
String inputText2 = getCreateTime(path);
} else {
gridItem.setData(OpenTraceDialog.VERSION_KEY,
OpenTraceDialog.VERSION_VALID);
- String path = PathManager.DYNAMIC_ANALYZER_SAVE_PATH
+ String path = PathManager.DA_SAVE_PATH
+ File.separator + text.get(TRACE_NAME_INDEX);
Project project = AnalyzerManager.getProject();
@Override
protected List<TableInput> makeTableInput() {
List<String> tempFileList = AnalyzerUtil
- .getDirs(PathManager.TEMP_FOLDER_PATH);
+ .getDirs(PathManager.DA_TEMP_FOLDER_PATH);
List<TableInput> input = new ArrayList<TableInput>();
if (null != tempFileList) {
int size = tempFileList.size();
List<String> text = new ArrayList<String>();
if (!tempFileList.get(i).equals(
PathConstants.TEMP_FOLDER_NAME)) {
- String path = PathManager.TEMP_FOLDER_PATH
+ String path = PathManager.DA_TEMP_FOLDER_PATH
+ File.separator + tempFileList.get(i);
text.add(tempFileList.get(i));
text.add(getCreateTime(path));
gridItem.setText(index, data);
}
- String path = PathManager.TEMP_FOLDER_PATH + File.separator
+ String path = PathManager.DA_TEMP_FOLDER_PATH + File.separator
+ text.get(TRACE_NAME_INDEX);
Project project = AnalyzerManager.getProject();
if (null != project) {
private boolean executeSaveTrace() {
Project project = AnalyzerManager.getProject();
String sourcePath = project.getSavePath();
- targetPath = PathManager.DYNAMIC_ANALYZER_SAVE_PATH
+ targetPath = PathManager.DA_SAVE_PATH
+ File.separator + saveFileName;
if(AnalyzerManager.getProject().getSavePath().equals(targetPath)){
String uiApiOptionList = null;
;
String configFileName = AnalyzerConstants.USER_INTERFACE_API_LIST_FILE_NAME;
- File configFolder = new File(PathManager.CONFIG_FOLDER_PATH);
+ File configFolder = new File(PathManager.DA_CONFIG_FOLDER_PATH);
if (!configFolder.isDirectory()) {
System.out.println("Not Exist UI API List Option Path ");
return CommonConstants.EMPTY;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Shell;
-import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
import org.tizen.dynamicanalyzer.widgets.helper.ColorResources;
import org.tizen.dynamicanalyzer.widgets.helper.FontResources;
import org.tizen.dynamicanalyzer.widgets.helper.WidgetUtils;
import org.tizen.dynamicanalyzer.widgets.progress.Progress;
+import org.tizen.dynamicanalyzer.workbench.LayoutManager;
public class ProgressDialog {
private Shell shell = null;
public void open() {
shell.open();
- ToolbarArea.getInstance().setEnabled(false);
+ LayoutManager.setEnabled(false);
}
public void close() {
}
shell = null;
}
- ToolbarArea.getInstance().setEnabled(true);
+ LayoutManager.setEnabled(true);
}
public void setProgressMessage(String message) {
// Date time = Calendar.getInstance().getTime();
File autotestPath = new File(
- PathManager.DYNAMIC_ANALYZER_AUTOTEST_PATH);
+ PathManager.DA_AUTOTEST_PATH);
if (!autotestPath.exists()) {
if (!autotestPath.mkdirs()) {
System.out.println("auto test path file create failed...");
}
StringBuilder savePath = new StringBuilder();
- savePath.append(PathManager.DYNAMIC_ANALYZER_AUTOTEST_PATH);
+ savePath.append(PathManager.DA_AUTOTEST_PATH);
savePath.append(File.separator);
savePath.append("DA_Autotest_Result.xsd");