public enum ColorResources {
WHITE(255, 255, 255),
BLACK(0, 0, 0),
+ RED(255, 0, 0),
// nine patch button
GRAY_BTN_NORMAL(149, 159, 164),
GRAY_BTN_PUSH(100, 110, 144),
GRAY_BTN_DISABLE(208, 208, 208),
- RED(255, 0, 0),
-
MESSAGE_BOX_TITLE_BG(111, 125, 149),
MESSAGE_BOX_TITLE_FONT(255, 255, 255),
MESSAGE_BOX_CONTENTS_BG(255, 255, 255),
MESSAGE_BOX_CONTENTS_FONT(102, 102, 102),
- MESSAGE_BOX_BOTTOM_BG(224, 224, 224),
+ MESSAGE_BOX_BG(224, 224, 224),
MESSAGE_BOX_BUTTON_BG(149, 159, 165),
MESSAGE_BOX_BUTTON_FONT(255, 255, 255);
import org.tizen.emulator.manager.resources.FilePathResources;
import org.tizen.emulator.manager.resources.StringResources;
import org.tizen.emulator.manager.ui.renewal.MainDialog;
-import org.tizen.emulator.manager.ui.renewal.tableviewer.MessageBox;
import org.tizen.emulator.manager.vms.VMProperty;
import org.tizen.emulator.manager.vms.helper.VMLauncherException;
import org.tizen.emulator.manager.vms.helper.VMWorkerException;
if (le.isCritical()) {
EMLogger.getLogger().warning(msg);
msg += StringResources.NEW_LINE + StringResources.NEW_LINE
- + "This virtual machine has problem." + StringResources.NEW_LINE
- + "Do you want to delete this virtual machine?";
+ + "This virtual machine has problem." + StringResources.NEW_LINE
+ + "Do you want to delete this virtual machine?";
int response = openMessageBox(msg, SWT.YES | SWT.NO, false);
if (response == SWT.OK) {
property.getWorker().resetVM();
} catch(VMWorkerException e) {
String errorMsg = "[Failure]"
- + StringResources.NEW_LINE
- + "Failed to reset [ "
- + property.getName() + " ] virtual machine."
- + StringResources.NEW_LINE
- + e.getMessage();
+ + StringResources.NEW_LINE
+ + "Failed to reset [ "
+ + property.getName() + " ] virtual machine."
+ + StringResources.NEW_LINE
+ + e.getMessage();
openMessageBox(errorMsg);
throw e;
}
if (!isRunning.isEmpty()) {
message = message + StringResources.NEW_LINE
+ isRunning + StringResources.NEW_LINE
- + "virtual machines are already running. So, these will be not reset.";
+ + "virtual machines are already running. So, these will be not reset."
+ + StringResources.NEW_LINE;
}
message += StringResources.NEW_LINE
+ "Do you want to be continue?";
dialog.addMessage("[Success]"
+ StringResources.NEW_LINE
+ "'" + prop.getName() + "' virtual machine has been reset."
- + StringResources.NEW_LINE);
+ + StringResources.NEW_LINE + StringResources.NEW_LINE);
} catch(VMWorkerException e) {
dialog.addMessage("[Failure]" + StringResources.NEW_LINE
+ "'" + prop.getName() + "' virtual machine has been failed to reset."
+ StringResources.NEW_LINE);
- dialog.addMessage(e.getMessage() + StringResources.NEW_LINE);
+ dialog.addMessage(e.getMessage() + StringResources.NEW_LINE + StringResources.NEW_LINE);
errorMessage += e.getMessage() + StringResources.NEW_LINE;
if (!isNeedRefresh) {
property.getWorker().deleteVM();
} catch(VMWorkerException e) {
String errorMsg = "[Failure]"
- + StringResources.NEW_LINE
- + "Failed to reset [ "
- + property.getName() + " ] virtual machine."
- + StringResources.NEW_LINE
- + e.getMessage();
+ + StringResources.NEW_LINE
+ + "Failed to delete [ "
+ + property.getName() + " ] virtual machine."
+ + StringResources.NEW_LINE
+ + e.getMessage();
openMessageBox(errorMsg);
throw e;
}
message = message + StringResources.NEW_LINE
+ isRunning + StringResources.NEW_LINE
+ "virtual machines are already running. So, these will be not deleted."
- + StringResources.NEW_LINE
+ + StringResources.NEW_LINE + StringResources.NEW_LINE
+ "Do you want to be continue?";
}
try {
prop.getWorker().deleteVM();
dialog.addMessage("[Success]" + StringResources.NEW_LINE
- + "'" + prop.getName() + "' vm image has been deleted."
- + StringResources.NEW_LINE);
+ + "'" + prop.getName() + "' vm image has been deleted."
+ + StringResources.NEW_LINE + StringResources.NEW_LINE);
} catch(VMWorkerException e) {
dialog.addMessage("[Failure]" + StringResources.NEW_LINE
+ "'" + prop.getName() + "' vm image has been failed to delete."
+ StringResources.NEW_LINE);
- dialog.addMessage(e.getMessage() + StringResources.NEW_LINE);
+ dialog.addMessage(e.getMessage() + StringResources.NEW_LINE + StringResources.NEW_LINE);
errorMessage += e.getMessage() + StringResources.NEW_LINE;
if (!isNeedRefresh) {
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.events.PaintEvent;
-import org.eclipse.swt.events.PaintListener;
-import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
if (isOpen) {
return SWT.NONE;
}
-
isOpen = true;
makeDialog();
makeContentsBox();
// need contentsBox size
- dialog.setBackgroundMode(SWT.INHERIT_FORCE);
+ dialog.setBackground(ColorResources.MESSAGE_BOX_BG.getColor());
dialog.setBounds(computeDialogBounds());
// need dialog size
titleLabel.setBounds(0, 0, width, TITLE_HEIGHT);
scrolledList.setBounds(0, TITLE_HEIGHT, width, height - TITLE_HEIGHT - BOTTOM_HEIGHT);
-
- dialog.addPaintListener(painter);
}
private void makeTitleLabel() {
titleLabel.setForeground(ColorResources.MESSAGE_BOX_TITLE_FONT.getColor());
titleLabel.setFont(FontResources.MESSAGE_BOX_TITLE.getFont());
titleLabel.setLeftMargin(SPACING);
- titleLabel.setTopMargin(10);
+ titleLabel.setTopMargin(7);
}
private void makeContentsBox() {
contentsBox.setFont(FontResources.MESSAGE_BOX_CONTENTS.getFont());
contentsBox.setLeftMargin(SPACING);
contentsBox.setTopMargin(SPACING);
+ contentsBox.setRightMargin(SPACING);
contentsBox.setEnabled(false);
contentsBox.pack();
}
@Override
public void handleEvent(Event event) {
if (event.type == SWT.Selection) {
- returnValue = SWT.OK;
+ returnValue = buttonType;
dispose();
}
}
return result;
}
- private PaintListener painter = new PaintListener() {
- @Override
- public void paintControl(PaintEvent e) {
- GC gc = e.gc;
- Rectangle rect = ((Composite)e.widget).getClientArea();
-
- // Bottom
- Rectangle buttonRect = new Rectangle(0, rect.height - BOTTOM_HEIGHT,
- rect.width, BOTTOM_HEIGHT);
- gc.setClipping(buttonRect);
- gc.setBackground(ColorResources.MESSAGE_BOX_BOTTOM_BG.getColor());
- gc.fillRectangle(buttonRect);
- }
- };
-
public void setTitle(final String title) {
if (title == null) {
SWT.error(SWT.ERROR_NULL_ARGUMENT);
isError = false;
}
+ @Override
public void run() {
//
File file = new File(FilePathResources.getTizenVmsPath()
}
if (vmDirectory.exists()) {
- result = deleteFile(vmDirectory);
+ if (!deleteFile(vmDirectory)) {
+ if (vmDirectory.exists()) {
+ if(!deleteFile(vmDirectory)) {
+ String message = Messages.getString("MessageDialog.RemoveError.0") + property.getName() //$NON-NLS-1$
+ + Messages.getString("MessageDialog.RemoveError.1") //$NON-NLS-1$
+ + Messages.getString("MessageDialog.RemoveError.2") //$NON-NLS-1$
+ + Messages.getString("MessageDialog.RemoveError.3") //$NON-NLS-1$
+ + "[ " + vmDirectory.getAbsolutePath() + " ]";
+ throw new VMWorkerException(message, true);
+ }
+ }
+ }
}
} catch (VMWorkerException e) {
throw e;