Author: jjohnstn
Date: 2010-10-22 15:39:26 -0400 (Fri, 22 Oct 2010)
New Revision: 26008
Added:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/CreateInstanceHandler2.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstance2.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceModel.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage2.java
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.xml
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties
Log:
2010-10-22 Jeff Johnston <jjohnstn(a)redhat.com>
* src/org/jboss/tools/deltacloud/ui/commands/CreateInstanceHandler2.java: New file.
* src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstance2.java: New file.
* src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceModel.java: New file.
* src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage2.java: New file.
* plugin.xml: Add menu item for launching an instance when the selected item(s) are not
images that will require entry of the image id.
* src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties: Add new
messages for NewInstance2 wizard.
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2010-10-22 19:35:39
UTC (rev 26007)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2010-10-22 19:39:26
UTC (rev 26008)
@@ -1,3 +1,14 @@
+2010-10-22 Jeff Johnston <jjohnstn(a)redhat.com>
+
+ * src/org/jboss/tools/deltacloud/ui/commands/CreateInstanceHandler2.java: New file.
+ * src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstance2.java: New file.
+ * src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceModel.java: New file.
+ * src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage2.java: New file.
+ * plugin.xml: Add menu item for launching an instance when the selected item(s) are not
+ images that will require entry of the image id.
+ * src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties: Add new
+ messages for NewInstance2 wizard.
+
2010-10-20 André Dietisheim <adietish(a)redhat.com>
* src/org/jboss/tools/internal/deltacloud/ui/wizards/UrlToCloudTypeConverter.java:
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.xml
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.xml 2010-10-22 19:35:39
UTC (rev 26007)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.xml 2010-10-22 19:39:26
UTC (rev 26008)
@@ -208,6 +208,20 @@
</with>
</activeWhen>
</handler>
+ <handler
+
class="org.jboss.tools.deltacloud.ui.commands.CreateInstanceHandler2"
+ commandId="org.jboss.tools.deltacloud.ui.createinstance2">
+ <activeWhen>
+ <with
+ variable="selection">
+ <iterate>
+ <instanceof
+
value="org.jboss.tools.deltacloud.ui.views.CloudViewElement">
+ </instanceof>
+ </iterate>
+ </with>
+ </activeWhen>
+ </handler>
<!-- image command handlers -->
<handler
class="org.jboss.tools.deltacloud.ui.commands.CreateInstanceHandler"
@@ -406,6 +420,36 @@
</visibleWhen>
</command>
</menuContribution>
+ <menuContribution
+ allPopups="true"
+
locationURI="popup:org.jboss.tools.deltacloud.ui.views.DeltaCloudView?after=images">
+ <!-- image commands -->
+ <command
+ commandId="org.jboss.tools.deltacloud.ui.createinstance2"
+ icon="icons/instance.gif"
+ label="%command.createinstance.label"
+ style="push"
+ tooltip="%command.createinstance.tooltip">
+ <visibleWhen
+ checkEnabled="true">
+ <with
+ variable="selection">
+ <iterate>
+ <and>
+ <instanceof
+
value="org.jboss.tools.deltacloud.ui.views.CloudViewElement">
+ </instanceof>
+ <not>
+ <instanceof
+
value="org.jboss.tools.deltacloud.ui.views.CVImageElement">
+ </instanceof>
+ </not>
+ </and>
+ </iterate>
+ </with>
+ </visibleWhen>
+ </command>
+ </menuContribution>
<menuContribution
allPopups="true"
locationURI="popup:org.jboss.tools.deltacloud.ui.views.DeltaCloudView?after=filters">
@@ -565,6 +609,24 @@
</with>
</visibleWhen>
</command>
+ <command
+ commandId="org.jboss.tools.deltacloud.ui.createinstance2"
+ icon="icons/instance.gif"
+ label="%command.createinstance.label"
+ style="push"
+ tooltip="%command.createinstance.tooltip">
+ <visibleWhen
+ checkEnabled="true">
+ <with
+ variable="selection">
+ <iterate>
+ <instanceof
+
value="org.jboss.tools.deltacloud.ui.views.CloudViewElement">
+ </instanceof>
+ </iterate>
+ </with>
+ </visibleWhen>
+ </command>
<command
commandId="org.jboss.tools.deltacloud.ui.filterimages"
label="%command.filterimages.label"
@@ -614,6 +676,11 @@
id="org.jboss.tools.deltacloud.ui.editconnection"
name="%command.editconnection.name">
</command>
+ <command
+ description="%command.createinstance.description"
+ id="org.jboss.tools.deltacloud.ui.createinstance2"
+ name="%command.createinstance.name">
+ </command>
<!-- image commands -->
<command
description="%command.createinstance.description"
Added:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/CreateInstanceHandler2.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/CreateInstanceHandler2.java
(rev 0)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/CreateInstanceHandler2.java 2010-10-22
19:39:26 UTC (rev 26008)
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.deltacloud.ui.commands;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.IHandler;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.IWizard;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.jboss.tools.deltacloud.core.DeltaCloud;
+import org.jboss.tools.deltacloud.ui.views.CVCloudElement;
+import org.jboss.tools.deltacloud.ui.views.CloudViewElement;
+import org.jboss.tools.internal.deltacloud.ui.utils.UIUtils;
+import org.jboss.tools.internal.deltacloud.ui.wizards.NewInstance2;
+
+/**
+ * @author Jeff Johnston
+ */
+public class CreateInstanceHandler2 extends AbstractHandler implements IHandler {
+
+ @Override
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ ISelection selection = HandlerUtil.getCurrentSelection(event);
+ if (selection instanceof IStructuredSelection) {
+ CloudViewElement element = UIUtils.getFirstElement(selection,
CloudViewElement.class);
+ while (element != null && !(element instanceof CVCloudElement)) {
+ element = (CloudViewElement) element.getParent();
+ }
+ if (element != null) {
+ CVCloudElement cloudElement = (CVCloudElement) element;
+ DeltaCloud cloud = (DeltaCloud) cloudElement.getElement();
+ IWizard wizard = new NewInstance2(cloud);
+ WizardDialog dialog = new
WizardDialog(UIUtils.getActiveWorkbenchWindow().getShell(),
+ wizard);
+ dialog.create();
+ dialog.open();
+ }
+ }
+
+ return Status.OK_STATUS;
+ }
+
+}
Property changes on:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/CreateInstanceHandler2.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstance2.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstance2.java
(rev 0)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstance2.java 2010-10-22
19:39:26 UTC (rev 26008)
@@ -0,0 +1,227 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ *
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.jboss.tools.internal.deltacloud.ui.wizards;
+
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.core.runtime.preferences.InstanceScope;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.ErrorDialog;
+import org.eclipse.jface.dialogs.MessageDialogWithToggle;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.rse.core.IRSECoreRegistry;
+import org.eclipse.rse.core.IRSESystemType;
+import org.eclipse.rse.core.RSECorePlugin;
+import org.eclipse.rse.core.model.IHost;
+import org.eclipse.rse.core.model.ISystemRegistry;
+import org.eclipse.rse.core.model.SystemStartHere;
+import org.eclipse.rse.core.subsystems.IConnectorService;
+import org.jboss.tools.deltacloud.core.DeltaCloud;
+import org.jboss.tools.deltacloud.core.DeltaCloudException;
+import org.jboss.tools.deltacloud.core.DeltaCloudInstance;
+import org.jboss.tools.deltacloud.ui.Activator;
+import org.jboss.tools.deltacloud.ui.IDeltaCloudPreferenceConstants;
+import org.jboss.tools.deltacloud.ui.views.CVMessages;
+import org.osgi.service.prefs.Preferences;
+
+public class NewInstance2 extends Wizard {
+
+ private final static String CREATE_INSTANCE_FAILURE_TITLE =
"CreateInstanceError.title"; //$NON-NLS-1$
+ private final static String CREATE_INSTANCE_FAILURE_MSG =
"CreateInstanceError.msg"; //$NON-NLS-1$
+ private final static String DEFAULT_REASON = "CreateInstanceErrorReason.msg";
//$NON-NLS-1$
+ private final static String CONFIRM_CREATE_TITLE = "ConfirmCreate.title";
//$NON-NLS-1$
+ private final static String CONFIRM_CREATE_MSG = "ConfirmCreate.msg";
//$NON-NLS-1$
+ private final static String DONT_SHOW_THIS_AGAIN_MSG =
"DontShowThisAgain.msg"; //$NON-NLS-1$
+ private final static String STARTING_INSTANCE_MSG = "StartingInstance.msg";
//$NON-NLS-1$
+ private final static String STARTING_INSTANCE_TITLE =
"StartingInstance.title"; //$NON-NLS-1$
+ private final static String RSE_CONNECTING_MSG = "ConnectingRSE.msg";
//$NON-NLS-1$
+
+
+ private NewInstancePage2 mainPage;
+
+ private DeltaCloud cloud;
+ private DeltaCloudInstance instance;
+
+ public NewInstance2(DeltaCloud cloud) {
+ this.cloud = cloud;
+ }
+
+ @Override
+ public void addPages() {
+ // TODO Auto-generated method stub
+ mainPage = new NewInstancePage2(cloud);
+ addPage(mainPage);
+ }
+
+ @Override
+ public boolean canFinish() {
+ return mainPage.isPageComplete();
+ }
+
+
+ private class WatchCreateJob extends Job {
+
+ private DeltaCloud cloud;
+ private String instanceId;
+ private String instanceName;
+
+ public WatchCreateJob(String title, DeltaCloud cloud,
+ String instanceId, String instanceName) {
+ super(title);
+ this.cloud = cloud;
+ this.instanceId = instanceId;
+ this.instanceName = instanceName;
+ }
+
+ public IStatus run(IProgressMonitor pm) {
+ if (!pm.isCanceled()){
+ DeltaCloudInstance instance = null;
+ try {
+ pm.beginTask(WizardMessages.getFormattedString(STARTING_INSTANCE_MSG, new String[]
{instanceName}), IProgressMonitor.UNKNOWN);
+ pm.worked(1);
+ cloud.registerActionJob(instanceId, this);
+ boolean finished = false;
+ while (!finished && !pm.isCanceled()) {
+ instance = cloud.refreshInstance(instanceId);
+ if (instance != null &&
!instance.getState().equals(DeltaCloudInstance.PENDING))
+ break;
+ Thread.sleep(400);
+ }
+
+ } catch (Exception e) {
+ // do nothing
+ } finally {
+ cloud.addReplaceInstance(instance);
+ cloud.removeActionJob(instanceId, this);
+ String hostname = instance.getHostName();
+ Preferences prefs = new InstanceScope().getNode(Activator.PLUGIN_ID);
+ boolean autoConnect =
prefs.getBoolean(IDeltaCloudPreferenceConstants.AUTO_CONNECT_INSTANCE, true);
+ if (hostname != null && hostname.length() > 0 && autoConnect) {
+ ISystemRegistry registry = SystemStartHere.getSystemRegistry();
+ RSECorePlugin rsep = RSECorePlugin.getDefault();
+ IRSECoreRegistry coreRegistry = rsep.getCoreRegistry();
+ IRSESystemType[] sysTypes = coreRegistry.getSystemTypes();
+ IRSESystemType sshType = null;
+ for (IRSESystemType sysType : sysTypes) {
+ if (sysType.getId().equals(IRSESystemType.SYSTEMTYPE_SSH_ONLY_ID))
+ sshType = sysType;
+ }
+ String connectionName = instance.getName() + " [" + instance.getId() +
"]"; //$NON-NLS-1$ //$NON-NLS-2$
+ try {
+ IHost host = registry.createHost(sshType, connectionName, hostname, null);
+ if (host != null) {
+ host.setDefaultUserId("root"); //$NON-NLS-1$
+ IConnectorService[] services = host.getConnectorServices();
+ if (services.length > 0) {
+ final IConnectorService service = services[0];
+ Job connect = new Job(CVMessages.getFormattedString(RSE_CONNECTING_MSG,
connectionName)) {
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ try {
+ service.connect(monitor);
+ return Status.OK_STATUS;
+ } catch(Exception e) {
+ return Status.CANCEL_STATUS;
+ }
+ }
+ };
+ connect.setUser(true);
+ connect.schedule();
+ }
+ }
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ Activator.log(e);
+ }
+ }
+ pm.done();
+ }
+ return Status.OK_STATUS;
+ }
+ else {
+ pm.done();
+ return Status.CANCEL_STATUS;
+ }
+ };
+ };
+
+ @Override
+ public boolean performFinish() {
+ String imageId = mainPage.getImageId();
+ String profileId = mainPage.getHardwareProfile();
+ String realmId = mainPage.getRealmId();
+ String memory = mainPage.getMemoryProperty();
+ String storage = mainPage.getStorageProperty();
+ String keyname = mainPage.getKeyName();
+ String name = null;
+
+ // Save persistent settings for this particular cloud
+ cloud.setLastImageId(imageId);
+ cloud.setLastKeyname(keyname);
+ cloud.save();
+
+ Preferences prefs = new InstanceScope().getNode(Activator.PLUGIN_ID);
+
+ try {
+ name = URLEncoder.encode(mainPage.getInstanceName(), "UTF-8");
+ } catch (UnsupportedEncodingException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } //$NON-NLS-1$
+
+ boolean result = false;
+ String errorMessage = WizardMessages.getString(DEFAULT_REASON);
+ try {
+ boolean dontShowDialog =
prefs.getBoolean(IDeltaCloudPreferenceConstants.DONT_CONFIRM_CREATE_INSTANCE, false);
+ if (!dontShowDialog) {
+ MessageDialogWithToggle dialog =
+ MessageDialogWithToggle.openOkCancelConfirm(getShell(),
WizardMessages.getString(CONFIRM_CREATE_TITLE),
+ WizardMessages.getString(CONFIRM_CREATE_MSG),
+ WizardMessages.getString(DONT_SHOW_THIS_AGAIN_MSG),
+ false, null, null);
+ int retCode = dialog.getReturnCode();
+ boolean toggleState = dialog.getToggleState();
+ if (retCode == Dialog.CANCEL)
+ return true;
+ // If warning turned off by user, set the preference for future usage
+ if (toggleState) {
+ prefs.putBoolean(IDeltaCloudPreferenceConstants.DONT_CONFIRM_CREATE_INSTANCE,
true);
+ }
+ }
+ instance = cloud.createInstance(name, imageId, realmId, profileId, keyname, memory,
storage);
+ if (instance != null)
+ result = true;
+ if (instance != null &&
instance.getState().equals(DeltaCloudInstance.PENDING)) {
+ final String instanceId = instance.getId();
+ final String instanceName = name;
+ Job job = new WatchCreateJob(WizardMessages.getString(STARTING_INSTANCE_TITLE),
+ cloud, instanceId, instanceName);
+ job.setUser(true);
+ job.schedule();
+ }
+ } catch (DeltaCloudException e) {
+ errorMessage = e.getLocalizedMessage();
+ }
+ if (!result) {
+ ErrorDialog.openError(this.getShell(),
+ WizardMessages.getString(CREATE_INSTANCE_FAILURE_TITLE),
+ WizardMessages.getFormattedString(CREATE_INSTANCE_FAILURE_MSG, new String[] {name,
imageId, realmId, profileId}),
+ new Status(IStatus.ERROR, Activator.PLUGIN_ID, errorMessage));
+ }
+ return result;
+ }
+
+}
Property changes on:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstance2.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceModel.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceModel.java
(rev 0)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceModel.java 2010-10-22
19:39:26 UTC (rev 26008)
@@ -0,0 +1,162 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.internal.deltacloud.ui.wizards;
+
+import org.eclipse.core.databinding.conversion.Converter;
+import org.eclipse.core.databinding.validation.IValidator;
+import org.eclipse.core.databinding.validation.ValidationStatus;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IStatus;
+import org.jboss.tools.deltacloud.core.DeltaCloud;
+import org.jboss.tools.deltacloud.core.DeltaCloudImage;
+import org.jboss.tools.internal.deltacloud.ui.common.databinding.ObservablePojo;
+
+/**
+ * @author Andre Dietisheim
+ */
+public class NewInstanceModel extends ObservablePojo {
+
+ public static final String PROPERTY_URL = "url"; //$NON-NLS-1$
+ public static final String PROPERTY_NAME = "name"; //$NON-NLS-1$
+ public static final String PROPERTY_IMAGE_ID = "imageId"; //$NON-NLS-1$
+ public static final String PROPERTY_ARCH = "arch"; //$NON-NLS-1$
+ public static final String PROPERTY_REALM = "realm"; //$NON-NLS-1$
+ public static final String PROPERTY_KEYNAME = "keyname"; //$NON-NLS-1$
+ public static final String PROPERTY_PROFILE = "profile"; //$NON-NLS-1$
+
+ private static final String IMAGE_ID_NOT_FOUND = "ErrorImageIdNotFound.text";
//$NON-NLS-1$
+
+ private String name;
+ private String imageId;
+ private String arch;
+ private String realm;
+ private String keyname;
+ private String profile;
+
+ public static class ImageContainer {
+ private DeltaCloudImage image;
+
+ public DeltaCloudImage getImage() {
+ return image;
+ }
+
+ public void setImage(DeltaCloudImage image) {
+ this.image = image;
+ }
+ }
+
+ public static class ArchConverter extends Converter {
+
+ private DeltaCloud cloud;
+ private ImageContainer imageContainer;
+
+ public ArchConverter(DeltaCloud cloud, ImageContainer imageContainer,
+ Object fromType, Object toType) {
+ super(fromType, toType);
+ this.cloud = cloud;
+ this.imageContainer = imageContainer;
+ }
+
+ @Override
+ public Object convert(final Object fromObject) {
+ return getArch((String) fromObject);
+ }
+
+ private String getArch(String id) {
+ String arch = "";
+ if (id != null && id.length() > 0) {
+ DeltaCloudImage[] images = cloud.getCurrImages();
+ for (int i = 0; i < images.length; ++i) {
+ DeltaCloudImage image = images[i];
+ if (image.getId().equals(id)) {
+ imageContainer.setImage(image);
+ arch = image.getArchitecture();
+ break;
+ }
+ }
+ }
+ return arch;
+ }
+
+ }
+
+ public static class ArchValidator implements IValidator {
+
+ @Override
+ public IStatus validate(Object value) {
+ Assert.isTrue(value instanceof String);
+ if (value != null && ((String)value).length() > 0) {
+ return ValidationStatus.ok();
+ } else {
+ return ValidationStatus.error(WizardMessages.getString(IMAGE_ID_NOT_FOUND));
+ }
+ }
+ }
+
+
+ public NewInstanceModel(String name, String imageId, String arch, String realm,
+ String keyname, String profile) {
+ this.name = name;
+ this.imageId = imageId;
+ this.realm = realm;
+ this.keyname = keyname;
+ this.profile = profile;
+ this.arch = arch;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ getPropertyChangeSupport().firePropertyChange(PROPERTY_NAME, this.name, this.name =
name);
+ }
+
+ public String getImageId() {
+ return imageId;
+ }
+
+ public void setImageId(String imageId) {
+ getPropertyChangeSupport().firePropertyChange(PROPERTY_IMAGE_ID, this.imageId,
this.imageId = imageId);
+ }
+
+ public String getRealm() {
+ return realm;
+ }
+
+ public void setRealm(String realm) {
+ getPropertyChangeSupport().firePropertyChange(PROPERTY_REALM, this.realm, this.realm =
realm);
+ }
+
+ public String getKeyname() {
+ return keyname;
+ }
+
+ public void setKeyname(String keyname) {
+ getPropertyChangeSupport().firePropertyChange(PROPERTY_KEYNAME, this.keyname,
this.keyname = keyname);
+ }
+
+ public String getArch() {
+ return arch;
+ }
+
+ public void setArch(String arch) {
+ getPropertyChangeSupport().firePropertyChange(PROPERTY_ARCH, this.arch, this.arch =
arch);
+ }
+
+ public String getProfile() {
+ return profile;
+ }
+
+ public void setProfile(String profile) {
+ getPropertyChangeSupport().firePropertyChange(PROPERTY_PROFILE, this.profile,
this.profile = profile);
+ }
+}
Property changes on:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceModel.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage2.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage2.java
(rev 0)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage2.java 2010-10-22
19:39:26 UTC (rev 26008)
@@ -0,0 +1,507 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ *
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.jboss.tools.internal.deltacloud.ui.wizards;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.core.databinding.Binding;
+import org.eclipse.core.databinding.DataBindingContext;
+import org.eclipse.core.databinding.UpdateValueStrategy;
+import org.eclipse.core.databinding.beans.BeanProperties;
+import org.eclipse.core.databinding.observable.value.IObservableValue;
+import org.eclipse.core.databinding.observable.value.IValueChangeListener;
+import org.eclipse.core.databinding.observable.value.ValueChangeEvent;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jface.databinding.fieldassist.ControlDecorationSupport;
+import org.eclipse.jface.databinding.swt.WidgetProperties;
+import org.eclipse.jface.databinding.wizard.WizardPageSupport;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.jboss.tools.deltacloud.core.DeltaCloud;
+import org.jboss.tools.deltacloud.core.DeltaCloudHardwareProfile;
+import org.jboss.tools.deltacloud.core.DeltaCloudImage;
+import org.jboss.tools.deltacloud.core.DeltaCloudInstance;
+import org.jboss.tools.deltacloud.core.DeltaCloudRealm;
+import org.jboss.tools.deltacloud.ui.SWTImagesFactory;
+import
org.jboss.tools.internal.deltacloud.ui.common.databinding.validator.MandatoryStringValidator;
+
+public class NewInstancePage2 extends WizardPage {
+
+ private static final int IMAGE_CHECK_DELAY = 500;
+
+ private final static String NAME = "NewInstance.name"; //$NON-NLS-1$
+ private final static String DESCRIPTION = "NewInstance.desc"; //$NON-NLS-1$
+ private final static String TITLE = "NewInstance.title"; //$NON-NLS-1$
+
+ private static final String NAME_LABEL = "Name.label"; //$NON-NLS-1$
+ private static final String IMAGE_LABEL = "Image.label"; //$NON-NLS-1$
+ private static final String ARCH_LABEL = "Arch.label"; //$NON-NLS-1$
+ private static final String HARDWARE_LABEL = "Profile.label"; //$NON-NLS-1$
+ private static final String REALM_LABEL = "Realm.label"; //$NON-NLS-1$
+ private static final String KEY_LABEL = "Key.label"; //$NON-NLS-1$
+ private static final String MANAGE_BUTTON_LABEL = "ManageButton.label";
//$NON-NLS-1$
+ private static final String PROPERTIES_LABEL = "Properties.label";
//$NON-NLS-1$
+ private static final String MUST_ENTER_A_NAME = "ErrorMustProvideName.text";
//$NON-NLS-1$
+ private static final String MUST_ENTER_A_KEYNAME =
"ErrorMustProvideKeyName.text"; //$NON-NLS-1$
+ private static final String MUST_ENTER_IMAGE_ID =
"ErrorMustProvideImageId.text"; //$NON-NLS-1$
+ private static final String NONE_RESPONSE = "None.response"; //$NON-NLS-1$
+
+ private NewInstanceModel model;
+
+ private DeltaCloud cloud;
+ private DeltaCloudImage image;
+ private Label arch;
+ private Text nameText;
+ private Text imageText;
+ private Text keyText;
+ private Combo hardware;
+ private Button keyManage;
+ private Control realm;
+ private ProfileComposite currPage;
+ private Map<String, ProfileComposite> profilePages;
+ private ArrayList<String> realmIds;
+ private DeltaCloudHardwareProfile[] allProfiles;
+
+ private ModifyListener comboListener = new ModifyListener() {
+
+ @Override
+ public void modifyText(ModifyEvent e) {
+ String id = hardware.getItem(hardware.getSelectionIndex());
+ currPage.setVisible(false);
+ currPage = profilePages.get(id);
+ currPage.setVisible(true);
+ }
+ };
+
+ private SelectionListener manageListener = new SelectionAdapter() {
+
+ public void widgetSelected(SelectionEvent event) {
+ Shell shell = getShell();
+ ManageKeys wizard = new ManageKeys(cloud, ".pem"); //$NON-NLS-1$
+ WizardDialog dialog = new CustomWizardDialog(shell, wizard,
+ IDialogConstants.OK_LABEL);
+ dialog.create();
+ dialog.open();
+ String keyname = wizard.getKeyName();
+ if (keyname != null)
+ keyText.setText(keyname);
+ }
+
+ };
+
+ public NewInstancePage2(DeltaCloud cloud) {
+ super(WizardMessages.getString(NAME));
+ this.cloud = cloud;
+ profilePages = new HashMap<String, ProfileComposite>();
+ allProfiles = cloud.getProfiles();
+ String defaultKeyname = cloud.getLastKeyname();
+ model = new NewInstanceModel("", //$NON-NLS-1$
+ "", //$NON-NLS-1$
+ "", //$NON-NLS-1$
+ "", //$NON-NLS-1$
+ defaultKeyname,
+ ""); //$NON-NLS-1$
+ setDescription(WizardMessages.getString(DESCRIPTION));
+ setTitle(WizardMessages.getString(TITLE));
+ setImageDescriptor(SWTImagesFactory.DESC_DELTA_LARGE);
+ setPageComplete(false);
+ }
+
+ public String getHardwareProfile() {
+ return hardware.getText();
+ }
+
+ public String getRealmId() {
+ if (realm instanceof Combo) {
+ int index = ((Combo)realm).getSelectionIndex();
+ return realmIds.get(index);
+ } else {
+ return null;
+ }
+ }
+
+ public String getCpuProperty() {
+ return currPage.getCPU();
+ }
+
+ public String getStorageProperty() {
+ return currPage.getStorage();
+ }
+
+ public String getMemoryProperty() {
+ return currPage.getMemory();
+ }
+
+ public String getInstanceName() {
+ return nameText.getText();
+ }
+
+ public String getKeyName() {
+ return keyText.getText();
+ }
+
+ public String getImageId() {
+ return imageText.getText();
+ }
+
+ public void setImage(DeltaCloudImage image) {
+ this.image = image;
+ }
+
+ public void clearProfiles() {
+ hardware.removeModifyListener(comboListener);
+ hardware.removeAll();
+ currPage.setVisible(false);
+ hardware.setEnabled(false);
+ hardware.addModifyListener(comboListener);
+ }
+
+ public void filterProfiles() {
+ ArrayList<DeltaCloudHardwareProfile> profiles = new
ArrayList<DeltaCloudHardwareProfile>();
+ for (DeltaCloudHardwareProfile p : allProfiles) {
+ if (p.getArchitecture() == null ||
image.getArchitecture().equals(p.getArchitecture())) {
+ profiles.add(p);
+ }
+ }
+ String[] ids = new String[profiles.size()];
+ for (int i = 0; i < profiles.size(); ++i) {
+ DeltaCloudHardwareProfile p = profiles.get(i);
+ ids[i] = p.getId();
+ }
+ if (ids.length > 0) {
+ hardware.removeModifyListener(comboListener);
+ hardware.setItems(ids);
+ hardware.setText(ids[0]);
+ currPage = profilePages.get(ids[0]);
+ currPage.setVisible(true);
+ hardware.setEnabled(true);
+ hardware.addModifyListener(comboListener);
+ }
+ }
+
+ @Override
+ public void createControl(Composite parent) {
+ DataBindingContext dbc = new DataBindingContext();
+ WizardPageSupport.create(this, dbc);
+
+ final Composite container = new Composite(parent, SWT.NULL);
+ FormLayout layout = new FormLayout();
+ layout.marginHeight = 5;
+ layout.marginWidth = 5;
+ container.setLayout(layout);
+
+ Label dummyLabel = new Label(container, SWT.NULL);
+
+ Label imageLabel = new Label(container, SWT.NULL);
+ imageLabel.setText(WizardMessages.getString(IMAGE_LABEL));
+
+ Label archLabel = new Label(container, SWT.NULL);
+ archLabel.setText(WizardMessages.getString(ARCH_LABEL));
+
+
+ Label nameLabel = new Label(container, SWT.NULL);
+ nameLabel.setText(WizardMessages.getString(NAME_LABEL));
+
+ Label realmLabel = new Label(container, SWT.NULL);
+ realmLabel.setText(WizardMessages.getString(REALM_LABEL));
+
+
+ nameText = new Text(container, SWT.BORDER | SWT.SINGLE);
+ bindText(dbc, nameText, NewInstanceModel.PROPERTY_NAME, MUST_ENTER_A_NAME);
+
+ imageText = new Text(container, SWT.BORDER | SWT.SINGLE);
+ dbc.bindValue(
+ WidgetProperties.text(SWT.Modify).observeDelayed(IMAGE_CHECK_DELAY, imageText),
+ BeanProperties.value(NewInstanceModel.class, NewInstanceModel.PROPERTY_IMAGE_ID)
+ .observe(model),
+ new UpdateValueStrategy().setAfterGetValidator(new MandatoryStringValidator(
+ WizardMessages.getString(MUST_ENTER_IMAGE_ID))),
+ null);
+
+ arch = new Label(container, SWT.NULL);
+ bindArchLabel(dbc, imageText, arch, this);
+
+ DeltaCloudRealm[] realms = cloud.getRealms();
+ realmIds = new ArrayList<String>();
+ ArrayList<String> realmNames = new ArrayList<String>();
+ for (int i = 0; i < realms.length; ++i) {
+ DeltaCloudRealm r = realms[i];
+ if (r.getState() == null || r.getState().equals(DeltaCloudRealm.AVAILABLE)) {
+ realmNames.add(r.getId() + " [" + r.getName() + "]");
//$NON-NLS-1$ //$NON-NLS-2$
+ realmIds.add(r.getId());
+ }
+ }
+ if (realmIds.size() > 0) {
+ Combo combo = new Combo(container, SWT.BORDER | SWT.READ_ONLY);
+ combo.setItems(realmNames.toArray(new String[realmNames.size()]));
+ combo.setText(realmNames.get(0));
+ realm = combo;
+ } else {
+ Label label = new Label(container, SWT.NULL);
+ label.setText(WizardMessages.getString(NONE_RESPONSE));
+ realm = label;
+ }
+ IObservableValue realmObservable = WidgetProperties.text().observe(realm);
+ dbc.bindValue(
+ realmObservable,
+ BeanProperties.value(NewInstanceModel.class,
NewInstanceModel.PROPERTY_REALM).observe(
+ model));
+
+
+ Label hardwareLabel = new Label(container, SWT.NULL);
+ hardwareLabel.setText(WizardMessages.getString(HARDWARE_LABEL));
+
+ hardware = new Combo(container, SWT.READ_ONLY);
+ Group groupContainer = new Group(container, SWT.BORDER);
+ groupContainer.setText(WizardMessages.getString(PROPERTIES_LABEL));
+ FormLayout groupLayout = new FormLayout();
+ groupLayout.marginHeight = 0;
+ groupLayout.marginWidth = 0;
+ groupContainer.setLayout(groupLayout);
+ hardware.setEnabled(false);
+ IObservableValue hardwareObservable = WidgetProperties.text().observe(hardware);
+ dbc.bindValue(
+ hardwareObservable,
+ BeanProperties.value(NewInstanceModel.class,
NewInstanceModel.PROPERTY_PROFILE).observe(
+ model));
+
+ for (DeltaCloudHardwareProfile p : allProfiles) {
+ ProfileComposite pc = new ProfileComposite(p, groupContainer);
+ profilePages.put(p.getId(), pc);
+ pc.setVisible(false);
+ }
+
+ Point p1 = nameLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT);
+ Point p2 = nameText.computeSize(SWT.DEFAULT, SWT.DEFAULT);
+ int centering = (p2.y - p1.y + 1) / 2;
+
+ FormData f = new FormData();
+ f.left = new FormAttachment(0, 0);
+ f.right = new FormAttachment(100, 0);
+ dummyLabel.setLayoutData(f);
+
+ f = new FormData();
+ f.top = new FormAttachment(dummyLabel, 8 + centering);
+ f.left = new FormAttachment(0, 0);
+ nameLabel.setLayoutData(f);
+
+ f = new FormData();
+ f.top = new FormAttachment(dummyLabel, 8);
+ f.left = new FormAttachment(hardwareLabel, 5);
+ f.right = new FormAttachment(100, 0);
+ nameText.setLayoutData(f);
+
+ f = new FormData();
+ f.top = new FormAttachment(nameText, 8 + centering);
+ f.left = new FormAttachment(0, 0);
+ imageLabel.setLayoutData(f);
+
+ f = new FormData();
+ f.top = new FormAttachment(nameText, 8);
+ f.left = new FormAttachment(hardwareLabel, 5);
+ f.right = new FormAttachment(100, 0);
+ imageText.setLayoutData(f);
+
+ f = new FormData();
+ f.top = new FormAttachment(imageLabel, 8 + centering);
+ f.left = new FormAttachment(0, 0);
+ archLabel.setLayoutData(f);
+
+ f = new FormData();
+ f.top = new FormAttachment(imageLabel, 8 + centering);
+ f.left = new FormAttachment(hardwareLabel, 5);
+ f.right = new FormAttachment(100, 0);
+ arch.setLayoutData(f);
+
+ f = new FormData();
+ f.top = new FormAttachment(arch, 8 + centering);
+ f.left = new FormAttachment(0, 0);
+ realmLabel.setLayoutData(f);
+
+ f = new FormData();
+ f.top = new FormAttachment(arch, 8);
+ f.left = new FormAttachment(hardwareLabel, 5);
+ f.right = new FormAttachment(100, 0);
+ realm.setLayoutData(f);
+
+ Control control = realm;
+
+ Label keyLabel = new Label(container, SWT.NULL);
+ keyLabel.setText(WizardMessages.getString(KEY_LABEL));
+
+ keyText = new Text(container, SWT.BORDER | SWT.SINGLE);
+ bindText(dbc, keyText, NewInstanceModel.PROPERTY_KEYNAME, MUST_ENTER_A_KEYNAME);
+
+ keyManage = new Button(container, SWT.NULL);
+ keyManage.setText(WizardMessages.getString(MANAGE_BUTTON_LABEL));
+ keyManage.addSelectionListener(manageListener);
+ if (cloud.getType().equals(DeltaCloudInstance.MOCK_TYPE))
+ keyManage.setEnabled(false);
+ Point p3 = keyManage.computeSize(SWT.DEFAULT, SWT.DEFAULT);
+ int centering2 = (p3.y - p2.y + 1) / 2;
+
+ f = new FormData();
+ f.top = new FormAttachment(realm, 8 + centering + centering2);
+ f.left = new FormAttachment(0, 0);
+ keyLabel.setLayoutData(f);
+
+ f = new FormData();
+ int widthHint = convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
+ Point minSize = keyManage.computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
+ f.width = Math.max(widthHint, minSize.x);
+ f.top = new FormAttachment(realm, 8);
+ f.right = new FormAttachment(realm, 0, SWT.RIGHT);
+ keyManage.setLayoutData(f);
+
+ f = new FormData();
+ f.top = new FormAttachment(realm, 8 + centering2);
+ f.left = new FormAttachment(hardwareLabel, 5);
+ f.right = new FormAttachment(keyManage, -10);
+ keyText.setLayoutData(f);
+
+ control = keyText;
+
+ f = new FormData();
+ f.top = new FormAttachment(control, 8 + centering);
+ f.left = new FormAttachment(0, 0);
+ hardwareLabel.setLayoutData(f);
+
+ f = new FormData();
+ f.top = new FormAttachment(control, 8);
+ f.left = new FormAttachment(hardwareLabel, 5);
+ f.right = new FormAttachment(100, 0);
+ hardware.setLayoutData(f);
+
+ f = new FormData();
+ f.top = new FormAttachment(hardware, 10);
+ f.left = new FormAttachment(0, 0);
+ f.right = new FormAttachment(100, 0);
+ f.bottom = new FormAttachment(100, 0);
+ groupContainer.setLayoutData(f);
+
+ // We have to set the image id here instead of in the constructor
+ // of the model because the image id triggers other items to fill
+ // in their values such as the architecture and hardware profiles.
+ String defaultImage = cloud.getLastImageId();
+ model.setImageId(defaultImage);
+
+ setControl(container);
+ }
+
+ /**
+ * Displays the arch in the given label if the given binding is valid.
+ *
+ * @param archLabel
+ * the arch label
+ * @return the value change listener
+ */
+ private class ArchAdapter implements IValueChangeListener {
+
+ private Label archLabel;
+ private NewInstanceModel.ImageContainer container;
+ private NewInstancePage2 page;
+
+ public ArchAdapter(Label archLabel,
+ NewInstanceModel.ImageContainer container,
+ NewInstancePage2 page) {
+ this.archLabel = archLabel;
+ this.page = page;
+ this.container = container;
+ }
+
+ @Override
+ public void handleValueChange(ValueChangeEvent event) {
+ IStatus status = (IStatus) event.diff.getNewValue();
+ if (status.isOK()) {
+ archLabel.setText(model.getArch());
+ page.setImage(container.getImage());
+ page.filterProfiles();
+ } else {
+ archLabel.setText("");
+ page.clearProfiles();
+ }
+ }
+ }
+
+ /**
+ * Binds the architecture label to the given image id text widget. Attaches a
+ * listener to the image id text widget Adds a validity decorator to the image text
+ * widget.
+ *
+ * @param dbc
+ * the databinding context to use
+ * @param imageText
+ * the image id text widget
+ * @param archLabel
+ * the label to display the image architecture in
+ * @return
+ * @return the binding that was created
+ */
+ private Binding bindArchLabel(DataBindingContext dbc, Text imageText, final Label
archLabel,
+ final NewInstancePage2 page) {
+ UpdateValueStrategy updateStrategy = new UpdateValueStrategy();
+ NewInstanceModel.ImageContainer c = new NewInstanceModel.ImageContainer();
+ updateStrategy.setConverter(new NewInstanceModel.ArchConverter(cloud, c, String.class,
String.class));
+ updateStrategy.setBeforeSetValidator(new NewInstanceModel.ArchValidator());
+
+ Binding binding = dbc.bindValue(
+ WidgetProperties.text(SWT.Modify).observeDelayed(100, imageText),
+ BeanProperties.value(NewInstanceModel.PROPERTY_ARCH).observe(model),
+ updateStrategy,
+ new UpdateValueStrategy(UpdateValueStrategy.POLICY_NEVER));
+ binding.getValidationStatus().addValueChangeListener(new ArchAdapter(archLabel, c,
page));
+ ControlDecorationSupport.create(binding, SWT.LEFT | SWT.TOP);
+ return binding;
+ }
+
+ /**
+ * Bind the given text widget to the cloud connection model. Attaches
+ * validator to the binding that enforce a non-empty input.
+ *
+ * @param dbc
+ * the databinding context to use
+ * @param text
+ * the name text widget to bind
+ */
+ private void bindText(DataBindingContext dbc, final Text text, String property, String
errMsgId) {
+ Binding nameTextBinding = dbc.bindValue(
+ WidgetProperties.text(SWT.Modify).observe(text),
+ BeanProperties.value(NewInstanceModel.class, property)
+ .observe(model),
+ new UpdateValueStrategy().setBeforeSetValidator(new
MandatoryStringValidator(WizardMessages.getString(errMsgId))),
+ null);
+ ControlDecorationSupport.create(nameTextBinding, SWT.LEFT | SWT.TOP);
+ }
+
+
+
+}
Property changes on:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage2.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties 2010-10-22
19:35:39 UTC (rev 26007)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties 2010-10-22
19:39:26 UTC (rev 26008)
@@ -70,6 +70,10 @@
ErrorInvalidURL.text=URL specified is invalid
ErrorNonCloudURL.text=URL specified is not a valid Delta-cloud address
ErrorInvalidPem.text=File specified is not a valid existing key
+ErrorImageIdNotFound.text = No existing image with specified id can be found
+ErrorMustProvideName.text=A name must be specified
+ErrorMustProvideKeyName.text=A key name must be specified
+ErrorMustProvideImageId.text=An image id must be specified
NewInstance.desc=Specify details for a new instance you wish to launch based on an image
NewInstance.title=Launch Instance