package org.tizen.dynamicanalyzer.common;
-import org.eclipse.swt.widgets.Display;
import org.tizen.dynamicanalyzer.communicator.DACommunicator;
import org.tizen.dynamicanalyzer.constant.CommonConstants;
+import org.tizen.dynamicanalyzer.handlers.CommandAction;
import org.tizen.dynamicanalyzer.handlers.UIAction;
import org.tizen.dynamicanalyzer.model.DeviceInfo;
import org.tizen.dynamicanalyzer.nl.UserErrorWarningLabels;
PackageInfo pkgInfo = DACommunicator.getPkgInfoByMainAppID(appid);
if (null == pkgInfo) {
- Display.getDefault().syncExec(new Runnable() {
- public void run() {
- String name = appName;
- if (name.length() > APPNAME_LENGTH) {
- name = appName.substring(0, APPNAME_LENGTH - 1) + "...";//$NON-NLS-1$
- }
- UIAction.showWarning(name + CommonConstants.SPACE
- + UserErrorWarningLabels.ERROR_NONEXIST_APPLICATION);
-
- Toolbar.INSTANCE.setAllControlState(true);
- }
- });
+ String name = appName;
+ if (name.length() > APPNAME_LENGTH) {
+ name = appName.substring(0, APPNAME_LENGTH - 1) + "...";//$NON-NLS-1$
+ }
+ UIAction.showWarning(name + CommonConstants.SPACE
+ + UserErrorWarningLabels.ERROR_NONEXIST_APPLICATION);
+
+ Toolbar.INSTANCE.setAllControlState(true);
Logger.debug("invalid application name :" + appid);
return;
}
Toolbar.INSTANCE.setDeviceComboText(deviceName);
Toolbar.INSTANCE.setAppComboText(appLabel);
- Display.getDefault().syncExec(new Runnable() {
- @Override
- public void run() {
- Toolbar.INSTANCE.startTrace();
- }
- });
+ CommandAction.startTrace();
SingletonFocusManager.setFocusToDA();
}
import java.util.Collections;
import java.util.List;
-import org.eclipse.swt.widgets.Display;
import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
import org.tizen.dynamicanalyzer.common.Global;
import org.tizen.dynamicanalyzer.common.DAState;
import org.tizen.dynamicanalyzer.common.path.PathManager;
import org.tizen.dynamicanalyzer.constant.CommonConstants;
+import org.tizen.dynamicanalyzer.handlers.CommandAction;
import org.tizen.dynamicanalyzer.handlers.UIAction;
import org.tizen.dynamicanalyzer.model.DeviceInfo;
import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
final String appLabel = pkgInfo.getMainApp().getLabel();
Logger.debug("IDE recv - deviceName: " + deviceName + " appName : " + appLabel);
- Display.getDefault().syncExec(new Runnable() {
- public void run() {
- Toolbar.INSTANCE.setDeviceComboText(deviceName);
- Toolbar.INSTANCE.setAppComboText(appLabel);
- Toolbar.INSTANCE.startTrace();
- }
- });
+ Toolbar.INSTANCE.setDeviceComboText(deviceName);
+ Toolbar.INSTANCE.setAppComboText(appLabel);
+ CommandAction.startTrace();
SingletonFocusManager.setFocusToDA();
}
}
// change UI state
+ Toolbar.INSTANCE.resetProcessCombo();
Toolbar.INSTANCE.changeUIState(DAState.PREPARE_START);
ShortCutManager.getInstance().setEnabled(false);
Project project = Global.getProject();
if (null != project) {
synchronized (project) {
- project.dispose();
+ project.close();
Global.setProject(null);
}
}
progress.setStageComplete(STAGE.CREATE_DBTABLE);
}
- public void dispose() {
+ public void close() {
// close previous database connection
SqlConnectionManager.closeConnection();
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Shell;
+import org.tizen.dynamicanalyzer.common.DAResult;
import org.tizen.dynamicanalyzer.common.DAState;
+import org.tizen.dynamicanalyzer.handlers.CommandAction;
import org.tizen.dynamicanalyzer.handlers.ReplayManager;
import org.tizen.dynamicanalyzer.ui.file.FilePage;
import org.tizen.dynamicanalyzer.ui.kernel.KernelPage;
// 103 -> g
else if (e.stateMask == CTRL_STATE_MASK && e.keyCode == 103) {
if (DAState.isStartable()) {
- Toolbar.INSTANCE.startTrace();
+ CommandAction.startTrace();
} else if (DAState.isRunning()) {
- Toolbar.INSTANCE.stopTrace();
+ CommandAction.stopTrace(DAResult.SUCCESS, false);
} else {
Logger.error("Wrong shortcut action for starting trace");
}
if (DAState.isStartable()) {
if (Toolbar.INSTANCE.getButtonEnabled(Toolbar.REPLAY_BUTTON)) {
if (ReplayManager.init()) {
- Toolbar.INSTANCE.startTrace();
+ CommandAction.startTrace();
}
}
}
@Override
public void handleClickEvent(DACustomButton button) {
if (DAState.isStartable()) {
- startTrace();
+ CommandAction.startTrace();
} else if (DAState.isRunning()) {
- stopTrace();
+ CommandAction.stopTrace(DAResult.SUCCESS, false);
} else {
Logger.error("Wrong action for start button");
}
public void handleClickEvent(DACustomButton button) {
if (DAState.isStartable()) {
if (ReplayManager.init()) {
- startTrace();
+ CommandAction.startTrace();
}
}
}
});
}
- public void startTrace() {
- resetProcessCombo();
- CommandAction.startTrace();
- }
-
- public void stopTrace() {
- CommandAction.stopTrace(DAResult.SUCCESS, false);
- }
-
private void createToolbar(Composite parent) {
/** Creates control composite **/
}
public void setAppComboTextByAppId(String id) {
- PackageInfo pkgInfo = DACommunicator.getPkgInfoByMainAppID(id);
+ final PackageInfo pkgInfo = DACommunicator.getPkgInfoByMainAppID(id);
if (null != pkgInfo) {
Global.setCurrentApplication(pkgInfo);
Global.getCurrentDeviceInfo().getCommunicator().onAppSelected(pkgInfo);
Global.getCurrentDeviceInfo().setSelectedPackageID(pkgInfo.getPackageId());
- appCombo.setText(pkgInfo.getMainApp().getLabel());
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ appCombo.setText(pkgInfo.getMainApp().getLabel());
+ }
+ });
}
}
initAppCombo();
}
});
-
}
// ============================================================================================
aboutButton.setButtonEnabled(enabled);
}
- private void resetProcessCombo() {
- processCombo.initCombo();
- processCombo.add(ALL_PROCESS);
- processCombo.select(0);
+ public void resetProcessCombo() {
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ processCombo.initCombo();
+ processCombo.add(ALL_PROCESS);
+ processCombo.select(0);
+ }
+ });
}
public boolean isSourceViewEnabled() {