- modify status of image button when receive 'changeEmulatorRunningStatus' event
Change-Id: I8e2a45d2edd790fe9e6ceea3671d7fc9b702f50c
Signed-off-by: jihye424.kim <jihye424.kim@samsung.com>
topViewPage.redraw();
}
+ public void changeEmulatorStatus() {
+ topViewPage.changeEmulatorStatus();
+ }
+
public void setFocus(boolean setFocus) {
if (isModifyMode) {
modifyView.setFocus(setFocus);
mainView.layout(true, true);
}
+ public void changeEmulatorStatus() {
+ TopListView.changeEmulatorStatus();
+ }
+
public void close() {
itemButton.dispose();
treeButton.dispose();
import org.tizen.emulator.manager.vms.EmulatorVMList;
import org.tizen.emulator.manager.vms.VMProperty;
import org.tizen.emulator.manager.vms.VMPropertyValue;
+import org.tizen.emulator.manager.vms.helper.CheckingRunningEmulator;
+import org.tizen.emulator.manager.vms.helper.EmulatorStatusListener;
import org.tizen.emulator.manager.vms.helper.VMLauncherException;
import org.tizen.emulator.manager.vms.helper.VMWorkerException;
return view;
}
- private VMsMainView() {}
+ private VMsMainView() {
+ CheckingRunningEmulator.addRunningEmulatorListener(new EmulatorStatusListener() {
+
+ @Override
+ public void changeEmulatorRunningStatus(final VMProperty prop) {
+ Display.getDefault().asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ changeEmulatorStatus();
+ }
+ });
+ }
+ });
+ }
public Composite getComposite() {
return mainView;
detailView.redraw();
}
+ public void changeEmulatorStatus() {
+ listView.changeEmulatorStatus();
+ detailView.changeEmulatorStatus();
+ }
+
public boolean isCreateMode() {
return isCreateMode;
}
}
reloadProperty();
- redraw();
}
public boolean createEmulator(VMPropertyValue newValue) {
}
public abstract int checkItemCount();
+ public abstract void changeEmulatorStatus();
protected final StackLayout stackLayout = new StackLayout();
public DetailViewPage(VMsDetailView parent, int style) {
public void redraw() {
// TODO Auto-generated method stub
}
+
+ @Override
+ public void changeEmulatorStatus() {
+ // TODO Auto-generated method stub
+ }
}
@Override
public void redraw() {
+ // TODO
// redraw button
+ // redraw detail item
+ }
+
+ @Override
+ public void changeEmulatorStatus() {
VMProperty property = VMsMainView.getInstance().getCurrentProperty();
if (property != null) {
settingButtonStatus(property);
}
-
- // redraw detail item
- // TODO
}
}
public void redraw() {
// TODO Auto-generated method stub
}
+
+ @Override
+ public void changeEmulatorStatus() {
+ // TODO Auto-generated method stub
+ }
}
class ModifyViewItemList extends ViewItemList{
public abstract void close();
public abstract void setSize(int width, int height);
public abstract Point getSize();
+ public abstract void changeEmulatorStatus();
public Composite getComposite() {
return listView;
}
}
}
}
+
+ @Override
+ public void changeEmulatorStatus() {
+ for (VMButton button : VMButtonFactory.getButtonList()) {
+ button.changeLaunchButtonState();
+ }
+ }
}
vmsTree.deselectAll();
}
}
+
+ @Override
+ public void changeEmulatorStatus() {
+ for (TreeItem item : vmsTree.getItems()) {
+ if (item.getData() instanceof PropertyContent) {
+ PropertyContent content = (PropertyContent)item.getData();
+ content.setImage();
+ }
+ }
+ }
}
}
if (button.getProperty() != null) {
- if (button.getProperty().isRunning()
- || !button.getProperty().isAvailable()) {
- if (button.getLaunchButton().isEnabled()) {
- button.getLaunchButton().setEnabled(false);
- }
- } else {
- if (!button.getLaunchButton().isEnabled()) {
- button.getLaunchButton().setEnabled(true);
- }
- }
-
// If VM is custom,
if (!button.getProperty().getPropertyValue().baseImage.isStandard()) {
if (state == WSTATE.HOVER || state == WSTATE.SELECTED_HOVER) {
// TODO Auto-generated method stub
}
});
+ changeLaunchButtonState();
}
return title_x;
}
+ public void changeLaunchButtonState() {
+ if (property == null) {
+ return;
+ }
+
+ if (launchButton == null) {
+ return;
+ }
+
+ if (property.isRunning() && launchButton.isEnabled()) {
+ launchButton.setEnabled(false);
+ } else if (!property.isRunning() && !launchButton.isEnabled()){
+ launchButton.setEnabled(true);
+ }
+ }
+
private PaintListener VMButtonPaintListener = new PaintListener() {
private int W_OFFSET = 2;
private int H_OFFSET = 3;
gc.drawString(Messages.getString("VMButton.FailedToLoad.1"), X_POINT, Y_POINT + Y_GAP, true); //$NON-NLS-1$
gc.drawString(Messages.getString("VMButton.FailedToLoad.2"), X_POINT, Y_POINT + Y_GAP * 2, true); //$NON-NLS-1$
}
-
};
-
private Listener mouseListener = new Listener() {
@Override