JBoss Tools SVN: r27548 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-12-16 09:20:35 -0500 (Thu, 16 Dec 2010)
New Revision: 27548
Modified:
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/NewInstancePage.java
Log:
[JBIDE-7918] reimplemented the whole launch Instance page with databinding since many cases did not work properly
Modified: 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 2010-12-16 13:49:09 UTC (rev 27547)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceModel.java 2010-12-16 14:20:35 UTC (rev 27548)
@@ -213,8 +213,9 @@
new AbstractCloudElementJob("Get Profiles", cloud, CLOUDELEMENT.PROFILES) {
protected IStatus doRun(IProgressMonitor monitor) throws Exception {
try {
- setAllProfiles(Arrays.asList(cloud.getProfiles()));
- setFilteredProfiles(filterProfiles(image, allProfiles));
+ List<DeltaCloudHardwareProfile> profiles = Arrays.asList(cloud.getProfiles());
+ setAllProfiles(profiles);
+ setFilteredProfiles(filterProfiles(image, profiles));
setSelectedProfileIndex(0);
return Status.OK_STATUS;
} catch (DeltaCloudException e) {
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage.java 2010-12-16 13:49:09 UTC (rev 27547)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage.java 2010-12-16 14:20:35 UTC (rev 27548)
@@ -217,10 +217,20 @@
private void bindWidgets(DataBindingContext dbc, Composite container) {
+ // name
bindText(nameText, NewInstanceModel.PROPERTY_NAME, WizardMessages.getString(MUST_ENTER_A_NAME), dbc);
+ // image
IObservableValue imageObservable = bindImage(imageText, dbc);
+ // arch label
+ bindArchLabel(imageObservable, dbc);
+ bindRealmCombo(realmCombo, dbc);
+ bindProfileCombo(hardwareCombo, dbc);
+ bindProfilePages(hardwareCombo, profilePages, dbc);
+ // key
+ bindText(keyText, NewInstanceModel.PROPERTY_KEYNAME, WizardMessages.getString(MUST_ENTER_A_KEYNAME), dbc);
+ }
- // arch label
+ private void bindArchLabel(IObservableValue imageObservable, DataBindingContext dbc) {
dbc.bindValue(WidgetProperties.text().observe(arch),
imageObservable,
new UpdateValueStrategy(UpdateSetStrategy.POLICY_NEVER),
@@ -237,13 +247,6 @@
}
}));
-
- bindRealmCombo(realmCombo, dbc);
- bindProfileCombo(hardwareCombo, dbc);
- bindProfilePages(hardwareCombo, profilePages, dbc);
-
- // key
- bindText(keyText, NewInstanceModel.PROPERTY_KEYNAME, WizardMessages.getString(MUST_ENTER_A_KEYNAME), dbc);
}
private void bindRealmCombo(final Combo realmCombo, DataBindingContext dbc) {
@@ -294,6 +297,7 @@
}
));
+ // realm combo enablement
IObservableList realmsObservable = BeanProperties.list(NewInstanceModel.PROPERTY_REALMS).observe(model);
DataBindingUtils.addChangeListener(new IChangeListener() {
14 years, 1 month
JBoss Tools SVN: r27547 - in trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui: src/org/jboss/tools/internal/deltacloud/ui/common/databinding and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-12-16 08:49:09 -0500 (Thu, 16 Dec 2010)
New Revision: 27547
Added:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils/DataBindingUtils.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ProfilePage.java
Removed:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/common/databinding/DataBindingUtils.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ProfileComposite.java
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
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/NewInstancePage.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceWizard.java
Log:
[JBIDE-7918] reimplemented the whole launch Instance page with databinding since many cases did not work properly
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2010-12-16 10:57:15 UTC (rev 27546)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2010-12-16 13:49:09 UTC (rev 27547)
@@ -1,3 +1,12 @@
+2010-12-16 André Dietisheim <adietish(a)redhat.com>
+
+ * src/org/jboss/tools/internal/deltacloud/ui/utils/DataBindingUtils.java:
+ * src/org/jboss/tools/internal/deltacloud/ui/wizards/ProfilePage.java:
+ * src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceWizard.java:
+ * src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage.java:
+ * src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceModel.java:
+ [JBIDE-7918] reimplemented the whole launch Instance page with databinding since many cases did not work properly
+
2010-12-15 André Dietisheim <adietish(a)redhat.com>
* src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage.java:
Deleted: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/common/databinding/DataBindingUtils.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/common/databinding/DataBindingUtils.java 2010-12-16 10:57:15 UTC (rev 27546)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/common/databinding/DataBindingUtils.java 2010-12-16 13:49:09 UTC (rev 27547)
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * 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.common.databinding;
-
-
-import java.util.Collection;
-
-import org.eclipse.core.databinding.Binding;
-
-public class DataBindingUtils
-{
- private DataBindingUtils()
- {
- }
-
- /**
- * Disposes all bindings in a given collection an clears the collection.
- *
- * @param bindingCollection the binding collection
- *
- * @return the collection<binding>
- */
- public static Collection<Binding> disposeBindings( Collection<Binding> bindingCollection )
- {
- if ( bindingCollection != null )
- {
- for ( Binding binding : bindingCollection )
- {
- binding.dispose();
- }
- bindingCollection.clear();
- }
- return bindingCollection;
- }
-}
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils/DataBindingUtils.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils/DataBindingUtils.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils/DataBindingUtils.java 2010-12-16 13:49:09 UTC (rev 27547)
@@ -0,0 +1,98 @@
+/*******************************************************************************
+ * 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.utils;
+
+import java.util.Collection;
+
+import org.eclipse.core.databinding.Binding;
+import org.eclipse.core.databinding.observable.IChangeListener;
+import org.eclipse.core.databinding.observable.IObservable;
+import org.eclipse.core.databinding.observable.value.IObservableValue;
+import org.eclipse.core.databinding.observable.value.IValueChangeListener;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.widgets.Control;
+
+/**
+ *
+ * @author André Dietisheim
+ */
+public class DataBindingUtils {
+
+ private DataBindingUtils() {
+ }
+
+ /**
+ * Disposes all bindings in a given collection an clears the collection.
+ *
+ * @param bindingCollection
+ * the binding collection
+ *
+ * @return the collection<binding>
+ */
+ public static Collection<Binding> disposeBindings(Collection<Binding> bindingCollection) {
+ if (bindingCollection != null) {
+ for (Binding binding : bindingCollection) {
+ binding.dispose();
+ }
+ bindingCollection.clear();
+ }
+ return bindingCollection;
+ }
+
+ /**
+ * Adds the given change listener to the given observable. Listens for
+ * disposal of the given control and removes the listener when it gets
+ * disposed.
+ *
+ * @param listener
+ * the listener to add to the given observable
+ * @param observable
+ * the observable to add the listener to
+ * @param control
+ * the control to listen to disposal to
+ */
+ public static void addChangeListener(final IChangeListener listener, final IObservable observable, Control control) {
+ observable.addChangeListener(listener);
+ control.addDisposeListener(new DisposeListener() {
+
+ @Override
+ public void widgetDisposed(DisposeEvent e) {
+ observable.removeChangeListener(listener);
+ }
+ });
+ }
+
+ /**
+ * Adds the given value change listener to the given observable. Listens for
+ * disposal of the given control and removes the listener when it gets
+ * disposed.
+ *
+ * @param listener
+ * the listener to add to the given observable
+ * @param observable
+ * the observable to add the listener to
+ * @param control
+ * the control to listen to disposal to
+ */
+ public static void addValueChangeListener(final IValueChangeListener listener, final IObservableValue observable,
+ Control control) {
+ observable.addValueChangeListener(listener);
+ control.addDisposeListener(new DisposeListener() {
+
+ @Override
+ public void widgetDisposed(DisposeEvent e) {
+ observable.removeValueChangeListener(listener);
+ }
+ });
+ }
+
+}
Property changes on: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils/DataBindingUtils.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: 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 2010-12-16 10:57:15 UTC (rev 27546)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceModel.java 2010-12-16 13:49:09 UTC (rev 27547)
@@ -10,11 +10,29 @@
******************************************************************************/
package org.jboss.tools.internal.deltacloud.ui.wizards;
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.jboss.tools.common.log.StatusFactory;
+import org.jboss.tools.deltacloud.core.DeltaCloud;
+import org.jboss.tools.deltacloud.core.DeltaCloudException;
+import org.jboss.tools.deltacloud.core.DeltaCloudHardwareProfile;
import org.jboss.tools.deltacloud.core.DeltaCloudImage;
+import org.jboss.tools.deltacloud.core.DeltaCloudRealm;
+import org.jboss.tools.deltacloud.core.job.AbstractCloudElementJob;
+import org.jboss.tools.deltacloud.core.job.AbstractCloudElementJob.CLOUDELEMENT;
+import org.jboss.tools.deltacloud.ui.Activator;
import org.jboss.tools.internal.deltacloud.core.observable.ObservablePojo;
/**
* @author Jeff Jonhston
+ * @author André Dietisheim
*/
public class NewInstanceModel extends ObservablePojo {
@@ -22,20 +40,34 @@
public static final String PROPERTY_NAME = "name"; //$NON-NLS-1$
public static final String PROPERTY_IMAGE = "image"; //$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_REALMS = "realms"; //$NON-NLS-1$
+ public static final String PROPERTY_SELECTED_REALM_INDEX = "selectedRealmIndex"; //$NON-NLS-1$
public static final String PROPERTY_KEYNAME = "keyname"; //$NON-NLS-1$
public static final String PROPERTY_PROFILE = "profile"; //$NON-NLS-1$
+ public static final String PROPERTY_ALL_PROFILES = "allProfiles"; //$NON-NLS-1$
+ public static final String PROPERTY_FILTERED_PROFILES = "filteredProfiles"; //$NON-NLS-1$
+ public static final String PROPERTY_SELECTED_PROFILE_INDEX = "selectedProfileIndex"; //$NON-NLS-1$
private String name;
private DeltaCloudImage image;
private String arch;
- private String realm;
private String keyname;
- private String profile;
+ private DeltaCloud cloud;
+ private DeltaCloudRealm selectedRealm;
+ private List<DeltaCloudRealm> realms = new ArrayList<DeltaCloudRealm>();
+ private DeltaCloudHardwareProfile selectedProfile;
+ private List<DeltaCloudHardwareProfile> allProfiles = new ArrayList<DeltaCloudHardwareProfile>();
+ private List<DeltaCloudHardwareProfile> filteredProfiles = new ArrayList<DeltaCloudHardwareProfile>();
+ private String cpu;
+ private String storage;
+ private String memory;
- protected NewInstanceModel(String keyname, DeltaCloudImage image) {
+ protected NewInstanceModel(DeltaCloud cloud, String keyname, DeltaCloudImage image) {
+ this.cloud = cloud;
this.keyname = keyname;
this.image = image;
+ asyncGetRealms();
+ asyncGetProfiles();
}
public String getName() {
@@ -51,17 +83,94 @@
}
public void setImage(DeltaCloudImage image) {
+ List<DeltaCloudHardwareProfile> filteredProfiles = filterProfiles(image, allProfiles);
+ setFilteredProfiles(filteredProfiles);
getPropertyChangeSupport().firePropertyChange(PROPERTY_IMAGE, this.image, this.image = image);
}
-
- public String getRealm() {
- return realm;
+
+ public void setSelectedRealmIndex(int index) {
+ if (realms.size() > index) {
+ DeltaCloudRealm deltaCloudRealm = realms.get(index);
+ setSelectedRealm(deltaCloudRealm);
+ firePropertyChange(PROPERTY_SELECTED_REALM_INDEX, null, index);
+ }
}
- public void setRealm(String realm) {
- getPropertyChangeSupport().firePropertyChange(PROPERTY_REALM, this.realm, this.realm = realm);
+ public int getSelectedRealmIndex() {
+ return realms.indexOf(selectedRealm);
}
+ public void setSelectedRealm(DeltaCloudRealm realm) {
+ selectedRealm = realm;
+ }
+
+ public String getRealmId() {
+ if (selectedRealm == null) {
+ return null;
+ }
+ return selectedRealm.getId();
+ }
+
+ private void setRealms(List<DeltaCloudRealm> realms) {
+ getPropertyChangeSupport().firePropertyChange(PROPERTY_REALMS, this.realms, this.realms = realms);
+ }
+
+ public List<DeltaCloudRealm> getRealms() {
+ return realms;
+ }
+
+ private void setAllProfiles(List<DeltaCloudHardwareProfile> profiles) {
+ getPropertyChangeSupport().firePropertyChange(PROPERTY_ALL_PROFILES, this.allProfiles, this.allProfiles = profiles);
+ }
+
+ public List<DeltaCloudHardwareProfile> getAllProfiles() {
+ return allProfiles;
+ }
+
+ private void setFilteredProfiles(List<DeltaCloudHardwareProfile> profiles) {
+ getPropertyChangeSupport().firePropertyChange(PROPERTY_FILTERED_PROFILES, this.filteredProfiles, this.filteredProfiles = profiles);
+ }
+
+ public List<DeltaCloudHardwareProfile> getFilteredProfiles() {
+ return filteredProfiles;
+ }
+
+ private List<DeltaCloudHardwareProfile> filterProfiles(DeltaCloudImage image, Collection<DeltaCloudHardwareProfile> profiles) {
+ List<DeltaCloudHardwareProfile> filteredProfiles = new ArrayList<DeltaCloudHardwareProfile>();
+ for (DeltaCloudHardwareProfile p : profiles) {
+ if (p.getArchitecture() == null
+ || image == null
+ || image.getArchitecture().equals(p.getArchitecture())) {
+ filteredProfiles.add(p);
+ }
+ }
+
+ return filteredProfiles;
+ }
+
+ public void setSelectedProfileIndex(int index) {
+ if (filteredProfiles.size() > index) {
+ DeltaCloudHardwareProfile hardwareProfile = filteredProfiles.get(index);
+ setSelectedProfile(hardwareProfile);
+ firePropertyChange(PROPERTY_SELECTED_PROFILE_INDEX, null, index);
+ }
+ }
+
+ public int getSelectedProfileIndex() {
+ return filteredProfiles.indexOf(selectedProfile);
+ }
+
+ public void setSelectedProfile(DeltaCloudHardwareProfile profile) {
+ selectedProfile = profile;
+ }
+
+ public String getProfileId() {
+ if (selectedProfile == null) {
+ return null;
+ }
+ return selectedProfile.getId();
+ }
+
public String getKeyname() {
return keyname;
}
@@ -78,11 +187,66 @@
getPropertyChangeSupport().firePropertyChange(PROPERTY_ARCH, this.arch, this.arch = arch);
}
- public String getProfile() {
- return profile;
+ public int getSelectedProfile() {
+ return allProfiles.indexOf(selectedProfile);
}
- public void setProfile(String profile) {
- getPropertyChangeSupport().firePropertyChange(PROPERTY_PROFILE, this.profile, this.profile = profile);
+ private void asyncGetRealms() {
+ // TODO: internationalize strings
+ new AbstractCloudElementJob("Get realms", cloud, CLOUDELEMENT.REALMS) {
+ protected IStatus doRun(IProgressMonitor monitor) throws Exception {
+ try {
+ setRealms(Arrays.asList(cloud.getRealms()));
+ setSelectedRealmIndex(0);
+ return Status.OK_STATUS;
+ } catch (DeltaCloudException e) {
+ // TODO: internationalize strings
+ return StatusFactory.getInstance(IStatus.ERROR, Activator.PLUGIN_ID,
+ MessageFormat.format("Could not get realms from cloud {0}", cloud.getName()));
+ }
+ }
+ }.schedule();
}
+
+ private void asyncGetProfiles() {
+ // TODO: internationalize strings
+ new AbstractCloudElementJob("Get Profiles", cloud, CLOUDELEMENT.PROFILES) {
+ protected IStatus doRun(IProgressMonitor monitor) throws Exception {
+ try {
+ setAllProfiles(Arrays.asList(cloud.getProfiles()));
+ setFilteredProfiles(filterProfiles(image, allProfiles));
+ setSelectedProfileIndex(0);
+ return Status.OK_STATUS;
+ } catch (DeltaCloudException e) {
+ // TODO: internationalize strings
+ return StatusFactory.getInstance(IStatus.ERROR, Activator.PLUGIN_ID,
+ MessageFormat.format("Could not get allProfiles from cloud {0}", cloud.getName()));
+ }
+ }
+ }.schedule();
+ }
+
+ public void setCpu(String cpu) {
+ this.cpu = cpu;
+ }
+
+ public String getCpu() {
+ return this.cpu;
+ }
+
+ public void setMemory(String memory) {
+ this.memory = memory;
+ }
+
+ public String getMemory() {
+ return this.memory;
+ }
+
+ public void setStorage(String storage) {
+ this.storage = storage;
+ }
+
+ public String getStorage() {
+ return this.storage;
+ }
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage.java 2010-12-16 10:57:15 UTC (rev 27546)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage.java 2010-12-16 13:49:09 UTC (rev 27547)
@@ -10,50 +10,43 @@
*******************************************************************************/
package org.jboss.tools.internal.deltacloud.ui.wizards;
-import java.text.MessageFormat;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
+import java.util.Collection;
import java.util.HashMap;
-import java.util.List;
import java.util.Map;
import org.eclipse.core.databinding.Binding;
import org.eclipse.core.databinding.DataBindingContext;
+import org.eclipse.core.databinding.UpdateListStrategy;
+import org.eclipse.core.databinding.UpdateSetStrategy;
import org.eclipse.core.databinding.UpdateValueStrategy;
import org.eclipse.core.databinding.beans.BeanProperties;
import org.eclipse.core.databinding.conversion.Converter;
+import org.eclipse.core.databinding.observable.ChangeEvent;
+import org.eclipse.core.databinding.observable.IChangeListener;
+import org.eclipse.core.databinding.observable.IObservable;
+import org.eclipse.core.databinding.observable.list.IObservableList;
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.databinding.observable.value.WritableValue;
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.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
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.layout.GridDataFactory;
+import org.eclipse.jface.layout.GridLayoutFactory;
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.custom.StackLayout;
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.Display;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
@@ -64,12 +57,9 @@
import org.jboss.tools.deltacloud.core.DeltaCloudImage;
import org.jboss.tools.deltacloud.core.DeltaCloudRealm;
import org.jboss.tools.deltacloud.core.Driver;
-import org.jboss.tools.deltacloud.core.job.AbstractCloudElementJob;
-import org.jboss.tools.deltacloud.core.job.AbstractCloudElementJob.CLOUDELEMENT;
-import org.jboss.tools.deltacloud.ui.ErrorUtils;
import org.jboss.tools.deltacloud.ui.SWTImagesFactory;
import org.jboss.tools.internal.deltacloud.ui.common.databinding.validator.MandatoryStringValidator;
-import org.jboss.tools.internal.deltacloud.ui.utils.UIUtils;
+import org.jboss.tools.internal.deltacloud.ui.utils.DataBindingUtils;
/**
* @author Jeff Jonston
@@ -95,43 +85,23 @@
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 static final String LOADING_VALUE = "Loading.value"; //$NON-NLS-1$
private static final String IMAGE_ID_NOT_FOUND = "ErrorImageIdNotFound.text"; //$NON-NLS-1$
+ private Composite container;
private NewInstanceModel model;
-
private DeltaCloud cloud;
- private DeltaCloudImage image;
private Label arch;
private Text nameText;
private Text imageText;
private Text keyText;
- private Combo hardwareCombo;
private Combo realmCombo;
- private ProfileComposite currProfilePage;
- private Map<String, ProfileComposite> profilePages;
- private DeltaCloudHardwareProfile[] allProfiles;
- private List<DeltaCloudRealm> realms;
+ private Combo hardwareCombo;
+ private Map<String, ProfilePage> profilePages = new HashMap<String, ProfilePage>();
+ private StackLayout groupContainerStackLayout;
private Group groupContainer;
- private ModifyListener hardwareComboListener = new ModifyListener() {
-
- @Override
- public void modifyText(ModifyEvent e) {
- int index = hardwareCombo.getSelectionIndex();
- String id = index > -1 ? hardwareCombo.getItem(hardwareCombo.getSelectionIndex()) : null;
- if (currProfilePage != null) {
- currProfilePage.setVisible(false);
- }
- if (id != null) {
- currProfilePage = profilePages.get(id);
- currProfilePage.setVisible(true);
- }
- }
- };
-
private SelectionListener manageListener = new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
@@ -142,10 +112,10 @@
dialog.create();
dialog.open();
String keyname = wizard.getKeyName();
- if (keyname != null)
+ if (keyname != null) {
keyText.setText(keyname);
+ }
}
-
};
private SelectionListener findImageButtonListener = new SelectionAdapter() {
@@ -161,294 +131,289 @@
imageText.setText(imageId);
}
}
-
};
public NewInstancePage(DeltaCloud cloud, DeltaCloudImage image) {
super(WizardMessages.getString(NAME));
this.cloud = cloud;
- this.image = image;
String defaultKeyname = cloud.getLastKeyname();
- model = new NewInstanceModel(defaultKeyname, image); //$NON-NLS-1$
+ model = new NewInstanceModel(cloud, defaultKeyname, image); //$NON-NLS-1$
setDescription(WizardMessages.getString(DESCRIPTION));
setTitle(WizardMessages.getString(TITLE));
setImageDescriptor(SWTImagesFactory.DESC_DELTA_LARGE);
}
- // public String getRealmId() {
- // if (realmCombo instanceof Combo) {
- // int index = ((Combo) realmCombo).getSelectionIndex();
- // return realms.get(index).getId();
- // } else {
- // return null;
- // }
- // }
-
- public String getCpuProperty() {
- return currProfilePage.getCPU();
- }
-
- public String getStorageProperty() {
- return currProfilePage.getStorage();
- }
-
- public String getMemoryProperty() {
- return currProfilePage.getMemory();
- }
-
- private void clearProfiles() {
- hardwareCombo.removeModifyListener(hardwareComboListener);
- hardwareCombo.removeAll();
- if (currProfilePage != null) {
- currProfilePage.setVisible(false);
- }
- hardwareCombo.setEnabled(false);
- hardwareCombo.addModifyListener(hardwareComboListener);
- }
-
- private List<DeltaCloudHardwareProfile> filterProfiles(DeltaCloudHardwareProfile[] profiles) {
- if (profiles == null) {
- return Collections.emptyList();
- }
-
- List<DeltaCloudHardwareProfile> filteredProfiles = new ArrayList<DeltaCloudHardwareProfile>();
- for (DeltaCloudHardwareProfile p : profiles) {
- if (p.getArchitecture() == null
- || image == null
- || image.getArchitecture().equals(p.getArchitecture())) {
- filteredProfiles.add(p);
- }
- }
-
- return filteredProfiles;
- }
-
@Override
public void createControl(Composite parent) {
DataBindingContext dbc = new DataBindingContext();
WizardPageSupport.create(this, dbc);
- Composite control = createWidgets(parent);
- bindWidgets(dbc);
-
- asyncGetRealms();
- asyncGetProfiles();
-
- // We have to set the imageObservable id here instead of in the
- // constructor of the model because the imageObservable id triggers
- // other items to fill in their values such as the architecture
- // and hardwareCombo profiles.
- // try {
- // model.setImage(cloud.getLastImage());
- // } catch (DeltaCloudException e) {
- // // ignore
- // }
- setControl(control);
-
- // lastly, if there's already an image set, use it
- if (image != null) {
- imageText.setText(image.getId());
- } else {
- imageText.setText(cloud.getLastImageId());
- }
- setPageComplete(false);
+ this.container = createWidgets(parent);
+ setControl(container);
+ bindWidgets(dbc, container);
}
private Composite createWidgets(Composite parent) {
- final Composite container = new Composite(parent, SWT.NULL);
- FormLayout layout = new FormLayout();
- layout.marginHeight = 5;
- layout.marginWidth = 5;
- container.setLayout(layout);
+ Composite container = new Composite(parent, SWT.NULL);
+ GridLayoutFactory.fillDefaults().numColumns(3).equalWidth(false).applyTo(container);
- Label dummyLabel = new Label(container, SWT.NULL);
-
Label nameLabel = new Label(container, SWT.NULL);
nameLabel.setText(WizardMessages.getString(NAME_LABEL));
- nameText = new Text(container, SWT.BORDER | SWT.SINGLE);
+ GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(nameLabel);
+ this.nameText = new Text(container, SWT.BORDER | SWT.SINGLE);
+ GridDataFactory.fillDefaults().span(2, 1).grab(true, false).applyTo(nameText);
Label imageLabel = new Label(container, SWT.NULL);
imageLabel.setText(WizardMessages.getString(IMAGE_LABEL));
- imageText = new Text(container, SWT.BORDER | SWT.SINGLE);
+ GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(imageLabel);
+ this.imageText = new Text(container, SWT.BORDER | SWT.SINGLE);
+ GridDataFactory.fillDefaults().grab(true, false).applyTo(imageText);
Button findImageButton = new Button(container, SWT.NULL);
findImageButton.setText(WizardMessages.getString(FIND_BUTTON_LABEL));
findImageButton.addSelectionListener(findImageButtonListener);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).applyTo(findImageButton);
Label archLabel = new Label(container, SWT.NULL);
archLabel.setText(WizardMessages.getString(ARCH_LABEL));
+ GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(archLabel);
arch = new Label(container, SWT.NULL);
+ GridDataFactory.fillDefaults().span(2, 1).align(SWT.LEFT, SWT.CENTER).applyTo(arch);
Label realmLabel = new Label(container, SWT.NULL);
realmLabel.setText(WizardMessages.getString(REALM_LABEL));
- // createRealmsControl(container, getRealmNames(realms));
- createRealmsControl(container);
+ GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(realmLabel);
+ this.realmCombo = new Combo(container, SWT.BORDER | SWT.READ_ONLY);
+ realmCombo.setItems(new String[] { WizardMessages.getString(LOADING_VALUE) });
+ realmCombo.select(0);
+ GridDataFactory.fillDefaults().span(2, 1).align(SWT.FILL, SWT.CENTER).applyTo(realmCombo);
Label keyLabel = new Label(container, SWT.NULL);
keyLabel.setText(WizardMessages.getString(KEY_LABEL));
+ GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(keyLabel);
keyText = new Text(container, SWT.BORDER | SWT.SINGLE);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).applyTo(keyText);
Button keyManageButton = new Button(container, SWT.NULL);
keyManageButton.setText(WizardMessages.getString(MANAGE_BUTTON_LABEL));
keyManageButton.addSelectionListener(manageListener);
if (Driver.MOCK.equals(cloud.getDriver())) {
keyManageButton.setEnabled(false);
}
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).applyTo(keyManageButton);
Label hardwareLabel = new Label(container, SWT.NULL);
hardwareLabel.setText(WizardMessages.getString(HARDWARE_LABEL));
- hardwareCombo = new Combo(container, SWT.READ_ONLY);
- hardwareCombo.setEnabled(false);
+ GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(hardwareLabel);
+ this.hardwareCombo = new Combo(container, SWT.READ_ONLY);
hardwareCombo.setItems(new String[] { WizardMessages.getString(LOADING_VALUE) });
hardwareCombo.select(0);
+ GridDataFactory.fillDefaults().span(2, 1).align(SWT.FILL, SWT.CENTER).applyTo(hardwareCombo);
- groupContainer = new Group(container, SWT.BORDER);
+ this.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);
- // hardwareCombo.setEnabled(false);
+ GridDataFactory.fillDefaults().span(3, 5).hint(SWT.DEFAULT, 100).applyTo(groupContainer);
+ groupContainer.setLayout(this.groupContainerStackLayout = new StackLayout());
- // add invisible dummy widget to guarantee a min size
- dummyLabel = new Label(groupContainer, SWT.NONE);
- dummyLabel.setText("\n\n\n\n\n");
- FormData dummyData = UIUtils.createFormData(0, 0, 0, 150, null, 0, null, 0);
- dummyLabel.setLayoutData(dummyData);
- dummyLabel.setVisible(false);
+ return container;
+ }
- Point p1 = nameLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- Point p2 = nameText.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- Point p3 = findImageButton.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- int centering = (p2.y - p1.y + 1) / 2;
- int centering2 = (p3.y - p2.y + 1) / 2;
+ private void bindWidgets(DataBindingContext dbc, Composite container) {
- FormData f = UIUtils.createFormData(null, 0, null, 0, 0, 0, 100, 0);
- dummyLabel.setLayoutData(f);
+ bindText(nameText, NewInstanceModel.PROPERTY_NAME, WizardMessages.getString(MUST_ENTER_A_NAME), dbc);
+ IObservableValue imageObservable = bindImage(imageText, dbc);
- f = UIUtils.createFormData(dummyLabel, 8 + centering, null, 0, 0, 0, null, 0);
- nameLabel.setLayoutData(f);
+ // arch label
+ dbc.bindValue(WidgetProperties.text().observe(arch),
+ imageObservable,
+ new UpdateValueStrategy(UpdateSetStrategy.POLICY_NEVER),
+ new UpdateValueStrategy().setConverter(new Converter(DeltaCloudImage.class, String.class) {
- f = UIUtils.createFormData(dummyLabel, 8, null, 0, hardwareLabel, 5, 100, 0);
- nameText.setLayoutData(f);
+ @Override
+ public Object convert(Object fromObject) {
+ if (fromObject == null) {
+ return null;
+ }
+ Assert.isLegal(fromObject instanceof DeltaCloudImage);
+ DeltaCloudImage image = (DeltaCloudImage) fromObject;
+ return image.getArchitecture();
- f = UIUtils.createFormData(nameText, 8 + centering + centering2, null, 0, 0, 0, null, 0);
- imageLabel.setLayoutData(f);
+ }
+ }));
- int widthHint = convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
- Point minSize1 = findImageButton.computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
- Point minSize2 = keyManageButton.computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
- int buttonWidth = Math.max(widthHint, minSize1.x);
- buttonWidth = Math.max(buttonWidth, minSize2.x);
+ bindRealmCombo(realmCombo, dbc);
+ bindProfileCombo(hardwareCombo, dbc);
+ bindProfilePages(hardwareCombo, profilePages, dbc);
- f = new FormData();
- f.top = new FormAttachment(nameText, 8);
- f.right = new FormAttachment(realmCombo, 0, SWT.RIGHT);
- f.width = buttonWidth;
- findImageButton.setLayoutData(f);
+ // key
+ bindText(keyText, NewInstanceModel.PROPERTY_KEYNAME, WizardMessages.getString(MUST_ENTER_A_KEYNAME), dbc);
+ }
- f = UIUtils.createFormData(nameText, 8 + centering2, null, 0, hardwareLabel, 5, findImageButton, -10);
- imageText.setLayoutData(f);
+ private void bindRealmCombo(final Combo realmCombo, DataBindingContext dbc) {
+ dbc.bindValue(
+ WidgetProperties.singleSelectionIndex().observe(realmCombo),
+ BeanProperties.value(NewInstanceModel.class, NewInstanceModel.PROPERTY_SELECTED_REALM_INDEX)
+ .observe(model),
+ new UpdateValueStrategy()
+ .setAfterGetValidator(new IValidator() {
- f = UIUtils.createFormData(imageLabel, 8 + centering, null, 0, 0, 0, null, 0);
- archLabel.setLayoutData(f);
+ @Override
+ public IStatus validate(Object value) {
+ if (value == null
+ || (value instanceof Integer && ((Integer) value) < 0)) {
+ // TODO: internationalize strings
+ return ValidationStatus.error("You must select a realm.");
+ }
+ return ValidationStatus.ok();
+ }
+ }),
+ new UpdateValueStrategy()
+ .setAfterGetValidator(new IValidator() {
- f = UIUtils.createFormData(imageLabel, 8 + centering, null, 0, hardwareLabel, 5, 100, 0);
- arch.setLayoutData(f);
+ @Override
+ public IStatus validate(Object value) {
+ if (value == null) {
+ ValidationStatus.error("You must select a realm");
+ }
+ return ValidationStatus.ok();
+ }
+ }));
- f = UIUtils.createFormData(arch, 8 + centering, null, 0, 0, 0, null, 0);
- realmLabel.setLayoutData(f);
+ dbc.bindList(WidgetProperties.items().observe(realmCombo),
+ BeanProperties.list(NewInstanceModel.PROPERTY_REALMS).observe(model),
+ new UpdateListStrategy(UpdateListStrategy.POLICY_NEVER),
+ new UpdateListStrategy().setConverter(
+ new Converter(Object.class, String.class) {
- f = UIUtils.createFormData(arch, 8, null, 0, hardwareLabel, 5, 100, 0);
- realmCombo.setLayoutData(f);
+ @Override
+ public Object convert(Object fromObject) {
+ Assert.isTrue(fromObject instanceof DeltaCloudRealm);
+ DeltaCloudRealm realm = (DeltaCloudRealm) fromObject;
+ return new StringBuilder()
+ .append(realm.getId())
+ .append(" [").append(realm.getName()).append("]") //$NON-NLS-1$ $NON-NLS-2$
+ .toString();
+ }
+ }
+ ));
- Control control = realmCombo;
+ IObservableList realmsObservable = BeanProperties.list(NewInstanceModel.PROPERTY_REALMS).observe(model);
+ DataBindingUtils.addChangeListener(new IChangeListener() {
- f = UIUtils.createFormData(realmCombo, 8 + centering + centering2, null, 0, 0, 0, null, 0);
- keyLabel.setLayoutData(f);
+ @Override
+ public void handleChange(ChangeEvent event) {
+ realmCombo.setEnabled(model.getFilteredProfiles().size() > 0);
+ }
+ }, realmsObservable, container);
- f = new FormData();
- f.width = buttonWidth;
- f.top = new FormAttachment(realmCombo, 8);
- f.right = new FormAttachment(realmCombo, 0, SWT.RIGHT);
- keyManageButton.setLayoutData(f);
+ }
- f = UIUtils.createFormData(realmCombo, 8 + centering2, null, 0, hardwareLabel, 5, keyManageButton, -10);
- keyText.setLayoutData(f);
+ private void bindProfileCombo(final Combo profileCombo, DataBindingContext dbc) {
+ // bind selected combo item
+ dbc.bindValue(
+ WidgetProperties.singleSelectionIndex().observe(profileCombo),
+ BeanProperties.value(NewInstanceModel.class, NewInstanceModel.PROPERTY_SELECTED_PROFILE_INDEX).observe(
+ model),
+ new UpdateValueStrategy()
+ .setAfterGetValidator(new IValidator() {
- control = keyText;
+ @Override
+ public IStatus validate(Object value) {
+ if (value == null
+ || (value instanceof Integer && ((Integer) value) < 0)) {
+ // TODO: internationalize strings
+ return ValidationStatus.error("You must select a hardware profile.");
+ }
+ return ValidationStatus.ok();
+ }
+ }),
+ new UpdateValueStrategy()
+ .setAfterGetValidator(new IValidator() {
- f = UIUtils.createFormData(control, 8 + centering, null, 0, 0, 0, null, 0);
- hardwareLabel.setLayoutData(f);
+ @Override
+ public IStatus validate(Object value) {
+ if (value == null) {
+ ValidationStatus.error("You must select a hardware profile");
+ }
+ return ValidationStatus.ok();
+ }
+ }));
- f = UIUtils.createFormData(control, 8, null, 0, hardwareLabel, 5, 100, 0);
- hardwareCombo.setLayoutData(f);
+ // bind combo items
+ dbc.bindList(WidgetProperties.items().observe(profileCombo),
+ BeanProperties.list(NewInstanceModel.PROPERTY_FILTERED_PROFILES).observe(model),
+ new UpdateListStrategy(UpdateListStrategy.POLICY_NEVER),
+ new UpdateListStrategy().setConverter(
+ new Converter(Object.class, String.class) {
- f = UIUtils.createFormData(hardwareCombo, 10, 100, 0, 0, 0, 100, 0);
- groupContainer.setLayoutData(f);
- return container;
- }
+ @Override
+ public Object convert(Object fromObject) {
+ Assert.isTrue(fromObject instanceof DeltaCloudHardwareProfile);
+ DeltaCloudHardwareProfile profile = (DeltaCloudHardwareProfile) fromObject;
+ return profile.getId();
+ }
+ }
+ ));
- private void createProfileComposites() {
- for (DeltaCloudHardwareProfile p : allProfiles) {
- ProfileComposite pc = new ProfileComposite(p, groupContainer);
- profilePages.put(p.getId(), pc);
- pc.setVisible(false);
- }
- groupContainer.layout();
+ // bind combo enablement
+ IObservableList filteredProfilesObservable =
+ BeanProperties.list(NewInstanceModel.PROPERTY_FILTERED_PROFILES).observe(model);
+ DataBindingUtils.addChangeListener(
+ new IChangeListener() {
+
+ @Override
+ public void handleChange(ChangeEvent event) {
+ profileCombo.setEnabled(model.getFilteredProfiles().size() > 0);
+ }
+ }, filteredProfilesObservable, container);
}
- private void bindWidgets(DataBindingContext dbc) {
+ private void bindProfilePages(Combo hardwareCombo, final Map<String, ProfilePage> profilePages,
+ DataBindingContext dbc) {
+ // bind all profiles
+ IObservable allProfilesObservable =
+ BeanProperties.list(NewInstanceModel.class, NewInstanceModel.PROPERTY_ALL_PROFILES).observe(model);
+ DataBindingUtils.addChangeListener(new IChangeListener() {
- bindText(nameText, NewInstanceModel.PROPERTY_NAME, WizardMessages.getString(MUST_ENTER_A_NAME), dbc);
- IObservableValue imageObservable = bindImage(imageText, dbc);
-
- // arch label
- imageObservable.addValueChangeListener(new IValueChangeListener() {
@Override
- public void handleValueChange(ValueChangeEvent event) {
- DeltaCloudImage image = (DeltaCloudImage) event.diff.getNewValue();
- if (image != null) {
- arch.setText(image.getArchitecture());
- } else {
- arch.setText("");
- }
+ public void handleChange(ChangeEvent event) {
+ createProfilePages(model.getAllProfiles());
}
- });
+ }, allProfilesObservable, container);
- // realms
- // TODO: internationalize strings
- UpdateValueStrategy realmComboStrategy = new UpdateValueStrategy();
- realmComboStrategy.setConverter(new Converter(Integer.class, String.class)
- {
- @Override
- public Object convert(Object fromObject) {
- int selectedRealmIndex = (Integer) fromObject;
- if (realms == null || selectedRealmIndex >= realms.size()) {
- return "";
- }
- return realms.get(selectedRealmIndex);
- }
- });
- dbc.bindValue(
- WidgetProperties.singleSelectionIndex().observe(realmCombo),
- BeanProperties.value(
- NewInstanceModel.class, NewInstanceModel.PROPERTY_REALM).observe(model),
- realmComboStrategy,
- null);
+ // bind selected profile
+ IObservableValue selectedProfileIndexObservable =
+ BeanProperties.value(NewInstanceModel.class, NewInstanceModel.PROPERTY_SELECTED_PROFILE_INDEX).observe(
+ model);
+ DataBindingUtils.addChangeListener(new IChangeListener() {
- // hardwareCombo
- // TODO: internationalize strings
- UpdateValueStrategy hardwareComboStrategy = new UpdateValueStrategy()
- .setBeforeSetValidator(new MandatoryStringValidator("You must select a hardware profile."));
- dbc.bindValue(
- WidgetProperties.text().observe(hardwareCombo),
- BeanProperties.value(
- NewInstanceModel.class, NewInstanceModel.PROPERTY_PROFILE).observe(model),
- hardwareComboStrategy,
- null);
+ @Override
+ public void handleChange(ChangeEvent event) {
+ ProfilePage profilePage = profilePages.get(model.getProfileId());
+ selectProfilePage(profilePages, profilePage);
- // key
- bindText(keyText, NewInstanceModel.PROPERTY_KEYNAME, WizardMessages.getString(MUST_ENTER_A_KEYNAME), dbc);
+ }
+ }, selectedProfileIndexObservable, container);
}
+ private void createProfilePages(Collection<DeltaCloudHardwareProfile> profiles) {
+ for (ProfilePage page : profilePages.values()) {
+ page.getControl().dispose();
+ }
+ profilePages.clear();
+ for (DeltaCloudHardwareProfile p : profiles) {
+ ProfilePage pc = new ProfilePage(p, groupContainer);
+ profilePages.put(p.getId(), pc);
+ }
+ }
+
+ private void selectProfilePage(final Map<String, ProfilePage> profilePages, ProfilePage profilePage) {
+ if (profilePage != null) {
+ groupContainerStackLayout.topControl = profilePage.getControl();
+ groupContainer.layout();
+ model.setCpu(profilePage.getCPU());
+ model.setStorage(profilePage.getStorage());
+ model.setMemory(profilePage.getMemory());
+ }
+ }
+
private void bindText(Text text, String property, String errorMessage, DataBindingContext dbc) {
Binding textBinding = dbc.bindValue(
WidgetProperties.text(SWT.Modify).observe(text),
@@ -531,136 +496,6 @@
}
}
- private void asyncGetRealms() {
- // TODO: internationalize strings
- new AbstractCloudElementJob("Get realms", cloud, CLOUDELEMENT.REALMS) {
- protected IStatus doRun(IProgressMonitor monitor) throws Exception {
- realms = loadRealms();
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- updateRealmCombo(getRealmNames(realms));
- }
- });
- return Status.OK_STATUS;
- }
- }.schedule();
- }
-
- private void asyncGetProfiles() {
- // TODO: internationalize strings
- new AbstractCloudElementJob("Get Profiles", cloud, CLOUDELEMENT.PROFILES) {
- protected IStatus doRun(IProgressMonitor monitor) throws Exception {
- allProfiles = getProfiles();
- profilePages = new HashMap<String, ProfileComposite>();
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- createProfileComposites();
- clearProfiles();
- if (allProfiles.length > 0) {
- hardwareCombo.setEnabled(true);
- hardwareCombo.select(0);
- setPageComplete(true);
- }
- List<DeltaCloudHardwareProfile> filteredProfiles = filterProfiles(allProfiles);
- updateWidgets(getProfileIds(filteredProfiles));
- }
- });
- return Status.OK_STATUS;
- }
- }.schedule();
- }
-
- private DeltaCloudHardwareProfile[] getProfiles() {
- List<DeltaCloudHardwareProfile> profiles = new ArrayList<DeltaCloudHardwareProfile>();
- try {
- DeltaCloudHardwareProfile[] allProfiles = cloud.getProfiles();
- for (DeltaCloudHardwareProfile p : allProfiles) {
- profiles.add(p);
- }
- } catch (DeltaCloudException e) {
- // TODO internationalize strings
- ErrorUtils.handleError("Error",
- MessageFormat.format("Could not get profiles from cloud {0}", cloud.getName()), e, getShell());
- }
- return profiles.toArray(new DeltaCloudHardwareProfile[profiles.size()]);
- }
-
- private void updateWidgets(String[] ids) {
- if (ids.length > 0) {
- hardwareCombo.removeModifyListener(hardwareComboListener);
- hardwareCombo.setItems(ids);
- hardwareCombo.setText(ids[0]);
- currProfilePage = profilePages.get(ids[0]);
- currProfilePage.setVisible(true);
- hardwareCombo.setEnabled(true);
- hardwareCombo.addModifyListener(hardwareComboListener);
- }
- }
-
- private String[] getProfileIds(List<DeltaCloudHardwareProfile> filteredProfiles) {
- String[] ids = new String[filteredProfiles.size()];
- for (int i = 0; i < filteredProfiles.size(); ++i) {
- DeltaCloudHardwareProfile p = filteredProfiles.get(i);
- ids[i] = p.getId();
- }
- return ids;
- }
-
- private List<String> getRealmNames(List<DeltaCloudRealm> realms) {
- List<String> realmNames = new ArrayList<String>();
- for (DeltaCloudRealm realm : realms) {
- realmNames.add(
- new StringBuilder()
- .append(realm.getId())
- .append(" [") //$NON-NLS-1$
- .append(realm.getName())
- .append("]") //$NON-NLS-1$
- .toString());
- }
- return realmNames;
- }
-
- private List<DeltaCloudRealm> loadRealms() {
- List<DeltaCloudRealm> realms = new ArrayList<DeltaCloudRealm>();
- try {
- realms = Arrays.asList(cloud.getRealms());
- } catch (DeltaCloudException e) {
- // TODO: internationalize strings
- ErrorUtils.handleErrorAsync("Error",
- MessageFormat.format("Could not get realms from cloud {0}", cloud.getName()), e, getShell());
- }
- return realms;
- }
-
- /**
- * Creates the control that shall display the available realms. It creates
- * either a combo, if there are realms available, or a label if none are
- * available.
- *
- * @param parent
- * the container
- * @param realmNames
- * the realm names
- */
- private void createRealmsControl(final Composite parent) {
- Combo combo = new Combo(parent, SWT.BORDER | SWT.READ_ONLY);
- realmCombo = combo;
- combo.setEnabled(false);
- combo.setItems(new String[] { WizardMessages.getString(LOADING_VALUE) });
- combo.select(0);
- }
-
- private void updateRealmCombo(List<String> realms) {
- if (realms != null && realms.size() > 0) {
- realmCombo.setItems(realms.toArray(new String[realms.size()]));
- realmCombo.setEnabled(true);
- } else {
- realmCombo.setItems(new String[] { WizardMessages.getString(NONE_RESPONSE) });
- realmCombo.setEnabled(false);
- }
- realmCombo.select(0);
- }
-
public NewInstanceModel getModel() {
return model;
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceWizard.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceWizard.java 2010-12-16 10:57:15 UTC (rev 27546)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceWizard.java 2010-12-16 13:49:09 UTC (rev 27547)
@@ -82,10 +82,10 @@
Assert.isTrue(image != null);
String imageId = image.getId();
- String profileId = model.getProfile();
- String realmId = model.getRealm();
- String memory = mainPage.getMemoryProperty();
- String storage = mainPage.getStorageProperty();
+ String profileId = model.getProfileId();
+ String realmId = model.getRealmId();
+ String memory = model.getMemory();
+ String storage = model.getStorage();
String keyname = model.getKeyname();
String name = utf8Encode(model.getName());
Deleted: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ProfileComposite.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ProfileComposite.java 2010-12-16 10:57:15 UTC (rev 27546)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ProfileComposite.java 2010-12-16 13:49:09 UTC (rev 27547)
@@ -1,426 +0,0 @@
-/*******************************************************************************
- * 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.List;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Spinner;
-import org.jboss.tools.deltacloud.core.DeltaCloudHardwareProfile;
-import org.jboss.tools.deltacloud.core.DeltaCloudHardwareProperty;
-
-/**
- * @author Jeff Johnston
- * @author André Dietisheim
- */
-public class ProfileComposite {
-
- private static final String CPU_LABEL = "Cpu.label"; //$NON-NLS-1$
- private static final String MEMORY_LABEL = "Memory.label"; //$NON-NLS-1$
- private static final String STORAGE_LABEL = "Storage.label"; //$NON-NLS-1$
- private static final String DEFAULTED = "Defaulted"; //$NON-NLS-1$
-
- private Composite container;
- private DeltaCloudHardwareProfile profile;
- private String cpu;
- private String cpuDefaultValue;
- private Label cpuLabel;
- private Spinner cpuSpinner;
- private Combo cpuCombo;
- private String memory;
- private String memoryDefaultValue;
- private Label memoryLabel;
- private Spinner memorySpinner;
- private Combo memoryCombo;
- private int memoryDecDigits;
- private String storage;
- private String storageDefaultValue;
- private Label storageLabel;
- private Spinner storageSpinner;
- private Combo storageCombo;
- private int storageDecDigits;
-
- private static int cw = 160;
-
- private ModifyListener spinnerListener = new ModifyListener() {
-
- @Override
- public void modifyText(ModifyEvent e) {
- String value = ((Spinner) e.widget).getText();
- if (e.widget == cpuSpinner)
- cpu = value;
- else if (e.widget == memorySpinner)
- memory = value;
- else if (e.widget == storageSpinner)
- storage = value;
- }
- };
-
- private ModifyListener comboListener = new ModifyListener() {
-
- @Override
- public void modifyText(ModifyEvent e) {
- String value = ((Combo) e.widget).getText();
- if (e.widget == cpuCombo)
- cpu = value;
- else if (e.widget == memoryCombo)
- memory = value;
- else if (e.widget == storageCombo)
- storage = value;
- }
-
- };
-
- public ProfileComposite(DeltaCloudHardwareProfile p, Composite parent) {
- this.profile = p;
- container = new Composite(parent, SWT.NULL);
- FormLayout layout = new FormLayout();
- layout.marginHeight = 10;
- layout.marginWidth = 10;
- container.setLayout(layout);
-
- cpuLabel = new Label(container, SWT.NULL);
- cpuLabel.setText(WizardMessages.getString(CPU_LABEL));
- memoryLabel = new Label(container, SWT.NULL);
- memoryLabel.setText(WizardMessages.getString(MEMORY_LABEL));
- storageLabel = new Label(container, SWT.NULL);
- storageLabel.setText(WizardMessages.getString(STORAGE_LABEL));
-
- FormData fd = new FormData();
- fd.left = new FormAttachment(0, 0);
- fd.top = new FormAttachment(0, 0);
- cpuLabel.setLayoutData(fd);
- DeltaCloudHardwareProperty cpuProperty = profile.getNamedProperty("cpu"); //$NON-NLS-1$
- setCPU(cpuProperty.getValue());
- Control cpuControl = createCpuControls(cpuProperty, storageLabel, container);
-
- fd = new FormData();
- fd.left = new FormAttachment(cpuLabel, 0, SWT.LEFT);
- fd.top = new FormAttachment(cpuLabel, 8);
- memoryLabel.setLayoutData(fd);
- DeltaCloudHardwareProperty memoryProperty = profile.getNamedProperty("memory"); //$NON-NLS-1$
- setMemody(memoryProperty.getValue());
- Control memoryControl = createMemoyControl(cpuControl, memoryProperty, storageLabel, container);
-
- fd = new FormData();
- fd.left = new FormAttachment(cpuLabel, 0, SWT.LEFT);
- fd.top = new FormAttachment(memoryControl, 8);
- storageLabel.setLayoutData(fd);
- DeltaCloudHardwareProperty storageProperty = profile.getNamedProperty("storage"); //$NON-NLS-1$
- setStorage(storageProperty.getValue());
- createStorageControls(memoryControl, memoryProperty, storageProperty, storageLabel, container);
- }
-
- private Control createStorageControls(Control memoryControl, DeltaCloudHardwareProperty memoryProperty,
- DeltaCloudHardwareProperty storageProperty, Label storageLabel, Composite container) {
- Control storageControl = null;
- if (storageProperty != null) {
- if (storageProperty.getKind() == DeltaCloudHardwareProperty.Kind.FIXED) {
- Label storageValueLabel = new Label(container, SWT.NULL);
- storageValueLabel.setText(storageProperty.getValue());
- FormData f = new FormData();
- f.left = new FormAttachment(storageLabel, 50);
- f.top = new FormAttachment(memoryControl, 8);
- storageValueLabel.setLayoutData(f);
- storageValueLabel.setVisible(true);
- storageControl = storageValueLabel;
- } else if (storageProperty.getKind() == DeltaCloudHardwareProperty.Kind.RANGE) {
- storageDefaultValue = storageProperty.getValue();
- int indexDefault = storageDefaultValue.indexOf('.');
- int decDigitsDefault = 0;
- if (indexDefault >= 0) {
- decDigitsDefault = storageDefaultValue.length() - indexDefault - 1;
- storageDefaultValue = storageDefaultValue.replace(".", ""); //$NON-NLS-1$ //$NON-NLS-2$
- }
- Spinner storageSpinner = new Spinner(container, SWT.READ_ONLY | SWT.BORDER);
- String first = memoryProperty.getRange().getFirst();
- int indexFirst = first.indexOf('.');
- int decDigitsFirst = 0;
- if (indexFirst >= 0) {
- decDigitsFirst = first.length() - indexFirst - 1;
- first = first.replace(".", ""); //$NON-NLS-1$ //$NON-NLS-2$
- }
- String last = memoryProperty.getRange().getLast();
- int indexLast = first.indexOf('.');
- int decDigitsLast = 0;
- if (indexLast >= 0) {
- decDigitsLast = last.length() - indexLast - 1;
- last = last.replace(".", ""); //$NON-NLS-1$ //$NON-NLS-2$
- }
- int decDigits = Math.max(decDigitsFirst, decDigitsLast);
- storageDecDigits = Math.max(decDigits, decDigitsDefault);
- if (decDigitsFirst < storageDecDigits) {
- for (int i = 0; i < storageDecDigits - decDigitsFirst; ++i)
- first = first.concat("0"); //$NON-NLS-1$
- }
- if (decDigitsLast < storageDecDigits) {
- for (int i = 0; i < storageDecDigits - decDigitsLast; ++i)
- last = last.concat("0"); //$NON-NLS-1$
- }
- if (decDigitsDefault < storageDecDigits) {
- for (int i = 0; i < storageDecDigits - decDigitsLast; ++i)
- storageDefaultValue = storageDefaultValue.concat("0"); //$NON-NLS-1$
- }
- storageSpinner.setMinimum(Integer.valueOf(first));
- storageSpinner.setMaximum(Integer.valueOf(last));
- storageSpinner.setDigits(storageDecDigits);
- storageSpinner.addModifyListener(spinnerListener);
- storageSpinner.setSelection(Integer.valueOf(storageDefaultValue));
- FormData f = new FormData();
- f.width = 80;
- f.top = new FormAttachment(memoryControl, 5);
- f.left = new FormAttachment(storageLabel, 50);
- f.right = new FormAttachment(storageLabel, cw, SWT.RIGHT);
- storageSpinner.setLayoutData(f);
- storageControl = storageSpinner;
- } else if (storageProperty.getKind() == DeltaCloudHardwareProperty.Kind.ENUM) {
- storageDefaultValue = storageProperty.getValue();
- List<String> values = storageProperty.getEnums();
- storageCombo = new Combo(container, SWT.BORDER | SWT.READ_ONLY);
- String[] items = new String[values.size()];
- storageCombo.setItems(values.toArray(items));
- storageCombo.setText(items[0]);
- storageCombo.addModifyListener(comboListener);
- FormData f = new FormData();
- f.width = 80;
- f.left = new FormAttachment(storageLabel, 50);
- f.right = new FormAttachment(storageLabel, cw, SWT.RIGHT);
- f.top = new FormAttachment(memoryControl, 5);
- storageCombo.setLayoutData(f);
- storageControl = storageCombo;
- }
- String storageUnit = storageProperty.getUnit();
- if (storageUnit != null && !storageUnit.equals("label")) { //$NON-NLS-1$
- Label unitLabel = new Label(container, SWT.NULL);
- unitLabel.setText(storageUnit);
- FormData f = new FormData();
- f.left = new FormAttachment(storageControl, 3);
- f.top = new FormAttachment(memoryControl, 8);
- unitLabel.setLayoutData(f);
- }
-
- } else {
- Label storage = new Label(container, SWT.NULL);
- storage.setText(WizardMessages.getString(DEFAULTED));
- FormData f = new FormData();
- f.left = new FormAttachment(storageLabel, 50);
- f.top = new FormAttachment(memoryControl, 8);
- f.right = new FormAttachment(100, 0);
- storage.setLayoutData(f);
- storage.setVisible(true);
- storageControl = storage;
- }
- return storageControl;
- }
-
- private Control createMemoyControl(Control cpuControl, DeltaCloudHardwareProperty memoryProperty, Label storageLabel, Composite container) {
- Control memoryControl = null;
- if (memoryProperty != null) {
- if (memoryProperty.getKind() == DeltaCloudHardwareProperty.Kind.FIXED) {
- Label memory = new Label(container, SWT.NULL);
- memory.setText(memoryProperty.getValue());
- FormData f = new FormData();
- f.top = new FormAttachment(cpuControl, 8);
- f.left = new FormAttachment(storageLabel, 50);
- memory.setLayoutData(f);
- memoryControl = memory;
- } else if (memoryProperty.getKind() == DeltaCloudHardwareProperty.Kind.RANGE) {
- memoryDefaultValue = memoryProperty.getValue();
- int indexDefault = memoryDefaultValue.indexOf('.');
- int decDigitsDefault = 0;
- if (indexDefault >= 0) {
- decDigitsDefault = memoryDefaultValue.length() - indexDefault - 1;
- memoryDefaultValue = memoryDefaultValue.replace(".", ""); //$NON-NLS-1$ //$NON-NLS-2$
- }
- memorySpinner = new Spinner(container, SWT.READ_ONLY | SWT.BORDER);
- String first = memoryProperty.getRange().getFirst();
- int indexFirst = first.indexOf('.');
- int decDigitsFirst = 0;
- if (indexFirst >= 0) {
- decDigitsFirst = first.length() - indexFirst - 1;
- first = first.replace(".", ""); //$NON-NLS-1$ $NON-NLS-2$
- }
- String last = memoryProperty.getRange().getLast();
- int indexLast = first.indexOf('.');
- int decDigitsLast = 0;
- if (indexLast >= 0) {
- decDigitsLast = last.length() - indexLast - 1;
- last = last.replace(".", ""); //$NON-NLS-1$ //$NON-NLS-2$
- }
- int decDigits = Math.max(decDigitsFirst, decDigitsLast);
- memoryDecDigits = Math.max(decDigits, decDigitsDefault);
- if (decDigitsFirst < memoryDecDigits) {
- for (int i = 0; i < memoryDecDigits - decDigitsFirst; ++i)
- first = first.concat("0"); //$NON-NLS-1$
- }
- if (decDigitsLast < memoryDecDigits) {
- for (int i = 0; i < memoryDecDigits - decDigitsLast; ++i)
- last = last.concat("0"); //$NON-NLS-1$
- }
- if (decDigitsDefault < memoryDecDigits) {
- for (int i = 0; i < memoryDecDigits - decDigitsLast; ++i)
- memoryDefaultValue = memoryDefaultValue.concat("0"); //$NON-NLS-1$
- }
- memorySpinner.setMinimum(Integer.valueOf(first));
- memorySpinner.setMaximum(Integer.valueOf(last));
- memorySpinner.setDigits(memoryDecDigits);
- memorySpinner.addModifyListener(spinnerListener);
- memorySpinner.setSelection(Integer.valueOf(memoryDefaultValue));
- FormData f = new FormData();
- f.width = 80;
- f.left = new FormAttachment(storageLabel, 50);
- f.right = new FormAttachment(storageLabel, cw, SWT.RIGHT);
- f.top = new FormAttachment(cpuControl, 5);
- memorySpinner.setLayoutData(f);
- memoryControl = memorySpinner;
- } else if (memoryProperty.getKind() == DeltaCloudHardwareProperty.Kind.ENUM) {
- memoryDefaultValue = memoryProperty.getValue();
- List<String> values = memoryProperty.getEnums();
- memoryCombo = new Combo(container, SWT.BORDER | SWT.READ_ONLY);
- String[] items = new String[values.size()];
- memoryCombo.setItems(values.toArray(items));
- memoryCombo.setText(items[0]);
- memoryCombo.addModifyListener(comboListener);
- FormData f = new FormData();
- f.width = 80;
- f.left = new FormAttachment(storageLabel, 50);
- f.right = new FormAttachment(storageLabel, cw, SWT.RIGHT);
- f.top = new FormAttachment(cpuControl, 5);
- memoryCombo.setLayoutData(f);
- memoryControl = memoryCombo;
- }
- String memoryUnit = memoryProperty.getUnit();
- if (memoryUnit != null && !memoryUnit.equals("label")) { //$NON-NLS-1$
- Label unitLabel = new Label(container, SWT.NULL);
- unitLabel.setText(memoryUnit);
- FormData f = new FormData();
- f.left = new FormAttachment(memoryControl, 3);
- f.top = new FormAttachment(cpuControl, 8);
- unitLabel.setLayoutData(f);
- }
- } else {
- Label memory = new Label(container, SWT.NULL);
- memory.setText(WizardMessages.getString(DEFAULTED));
- FormData f = new FormData();
- f.top = new FormAttachment(cpuControl, 8);
- f.left = new FormAttachment(storageLabel, 50);
- f.right = new FormAttachment(100, 0);
- memory.setLayoutData(f);
- memoryControl = memory;
- }
- return memoryControl;
- }
-
- private Control createCpuControls(DeltaCloudHardwareProperty cpuProperty, Label storageLabel, Composite container) {
- Control cpuControl = null;
- if (cpuProperty != null) {
- if (cpuProperty.getKind() == DeltaCloudHardwareProperty.Kind.FIXED) {
- Label cpuLabel = new Label(container, SWT.NULL);
- cpuLabel.setText(cpuProperty.getValue());
- FormData f = new FormData();
- f.left = new FormAttachment(storageLabel, 50);
- f.right = new FormAttachment(100, 0);
- cpuLabel.setLayoutData(f);
- cpuControl = cpuLabel;
- } else if (cpuProperty.getKind() == DeltaCloudHardwareProperty.Kind.RANGE) {
- cpuDefaultValue = cpuProperty.getValue();
- cpuSpinner = new Spinner(container, SWT.READ_ONLY);
- cpuSpinner.setMinimum(Integer.valueOf(cpuProperty.getRange().getFirst()));
- cpuSpinner.setMaximum(Integer.valueOf(cpuProperty.getRange().getLast()));
- cpuSpinner.addModifyListener(spinnerListener);
- cpuSpinner.setSelection(Integer.valueOf(cpuDefaultValue));
- FormData f = new FormData();
- f.width = 80;
- f.left = new FormAttachment(storageLabel, 50);
- f.right = new FormAttachment(storageLabel, cw, SWT.RIGHT);
- cpuSpinner.setLayoutData(f);
- cpuControl = cpuSpinner;
- } else if (cpuProperty.getKind() == DeltaCloudHardwareProperty.Kind.ENUM) {
- cpuDefaultValue = cpuProperty.getValue();
- List<String> values = cpuProperty.getEnums();
- cpuCombo = new Combo(container, SWT.BORDER);
- String[] items = new String[values.size()];
- cpuCombo.setItems(values.toArray(items));
- cpuCombo.setText(items[0]);
- cpuCombo.addModifyListener(comboListener);
- FormData f = new FormData();
- f.width = 80;
- f.left = new FormAttachment(storageLabel, 50);
- f.right = new FormAttachment(storageLabel, cw, SWT.RIGHT);
- cpuCombo.setLayoutData(f);
- cpuControl = cpuCombo;
- }
- String cpuUnit = cpuProperty.getUnit();
- if (cpuUnit != null && !cpuUnit.equals("label") && !cpuUnit.equals("count")) { //$NON-NLS-1$ //$NON-NLS-1$
- Label unitLabel = new Label(container, SWT.NULL);
- unitLabel.setText(cpuProperty.getUnit());
- FormData f = new FormData();
- f.left = new FormAttachment(cpuControl, 5);
- unitLabel.setLayoutData(f);
- }
- } else {
- Label cpu = new Label(container, SWT.NULL);
- cpu.setText(WizardMessages.getString(DEFAULTED));
- FormData f = new FormData();
- f.left = new FormAttachment(storageLabel, 50);
- f.right = new FormAttachment(100, 0);
- cpu.setLayoutData(f);
- cpuControl = cpu;
- }
- return cpuControl;
- }
-
- public void setVisible(boolean visible) {
- container.setVisible(visible);
- }
-
- private void setCPU(String value) {
- this.cpu = value;
- }
-
- public String getCPU() {
- if (cpu != null && !cpu.equals(cpuDefaultValue)) {
- return cpu;
- }
- return null;
- }
-
- private void setMemody(String value) {
- this.memory = value;
- }
-
- public String getMemory() {
- if (memory != null && !memory.equals(memoryDefaultValue)) {
- return memory;
- }
- return null;
- }
-
- private void setStorage(String value) {
- this.storage = value;
- }
-
- public String getStorage() {
- if (storage != null && !storage.equals(storageDefaultValue)) {
- return storage;
- }
- return null;
- }
-}
Copied: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ProfilePage.java (from rev 27511, trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ProfileComposite.java)
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ProfilePage.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ProfilePage.java 2010-12-16 13:49:09 UTC (rev 27547)
@@ -0,0 +1,430 @@
+/*******************************************************************************
+ * 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.List;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Spinner;
+import org.jboss.tools.deltacloud.core.DeltaCloudHardwareProfile;
+import org.jboss.tools.deltacloud.core.DeltaCloudHardwareProperty;
+
+/**
+ * @author Jeff Johnston
+ * @author André Dietisheim
+ */
+public class ProfilePage {
+
+ private static final String CPU_LABEL = "Cpu.label"; //$NON-NLS-1$
+ private static final String MEMORY_LABEL = "Memory.label"; //$NON-NLS-1$
+ private static final String STORAGE_LABEL = "Storage.label"; //$NON-NLS-1$
+ private static final String DEFAULTED = "Defaulted"; //$NON-NLS-1$
+
+ private Composite container;
+ private DeltaCloudHardwareProfile profile;
+ private String cpu;
+ private String cpuDefaultValue;
+ private Label cpuLabel;
+ private Spinner cpuSpinner;
+ private Combo cpuCombo;
+ private String memory;
+ private String memoryDefaultValue;
+ private Label memoryLabel;
+ private Spinner memorySpinner;
+ private Combo memoryCombo;
+ private int memoryDecDigits;
+ private String storage;
+ private String storageDefaultValue;
+ private Label storageLabel;
+ private Spinner storageSpinner;
+ private Combo storageCombo;
+ private int storageDecDigits;
+
+ private static int cw = 160;
+
+ private ModifyListener spinnerListener = new ModifyListener() {
+
+ @Override
+ public void modifyText(ModifyEvent e) {
+ String value = ((Spinner) e.widget).getText();
+ if (e.widget == cpuSpinner)
+ cpu = value;
+ else if (e.widget == memorySpinner)
+ memory = value;
+ else if (e.widget == storageSpinner)
+ storage = value;
+ }
+ };
+
+ private ModifyListener comboListener = new ModifyListener() {
+
+ @Override
+ public void modifyText(ModifyEvent e) {
+ String value = ((Combo) e.widget).getText();
+ if (e.widget == cpuCombo)
+ cpu = value;
+ else if (e.widget == memoryCombo)
+ memory = value;
+ else if (e.widget == storageCombo)
+ storage = value;
+ }
+
+ };
+
+ public ProfilePage(DeltaCloudHardwareProfile p, Composite parent) {
+ this.profile = p;
+ container = new Composite(parent, SWT.NULL);
+ FormLayout layout = new FormLayout();
+ layout.marginHeight = 10;
+ layout.marginWidth = 10;
+ container.setLayout(layout);
+
+ cpuLabel = new Label(container, SWT.NULL);
+ cpuLabel.setText(WizardMessages.getString(CPU_LABEL));
+ memoryLabel = new Label(container, SWT.NULL);
+ memoryLabel.setText(WizardMessages.getString(MEMORY_LABEL));
+ storageLabel = new Label(container, SWT.NULL);
+ storageLabel.setText(WizardMessages.getString(STORAGE_LABEL));
+
+ FormData fd = new FormData();
+ fd.left = new FormAttachment(0, 0);
+ fd.top = new FormAttachment(0, 0);
+ cpuLabel.setLayoutData(fd);
+ DeltaCloudHardwareProperty cpuProperty = profile.getNamedProperty("cpu"); //$NON-NLS-1$
+ setCPU(cpuProperty.getValue());
+ Control cpuControl = createCpuControls(cpuProperty, storageLabel, container);
+
+ fd = new FormData();
+ fd.left = new FormAttachment(cpuLabel, 0, SWT.LEFT);
+ fd.top = new FormAttachment(cpuLabel, 8);
+ memoryLabel.setLayoutData(fd);
+ DeltaCloudHardwareProperty memoryProperty = profile.getNamedProperty("memory"); //$NON-NLS-1$
+ setMemody(memoryProperty.getValue());
+ Control memoryControl = createMemoyControl(cpuControl, memoryProperty, storageLabel, container);
+
+ fd = new FormData();
+ fd.left = new FormAttachment(cpuLabel, 0, SWT.LEFT);
+ fd.top = new FormAttachment(memoryControl, 8);
+ storageLabel.setLayoutData(fd);
+ DeltaCloudHardwareProperty storageProperty = profile.getNamedProperty("storage"); //$NON-NLS-1$
+ setStorage(storageProperty.getValue());
+ createStorageControls(memoryControl, memoryProperty, storageProperty, storageLabel, container);
+ }
+
+ private Control createStorageControls(Control memoryControl, DeltaCloudHardwareProperty memoryProperty,
+ DeltaCloudHardwareProperty storageProperty, Label storageLabel, Composite container) {
+ Control storageControl = null;
+ if (storageProperty != null) {
+ if (storageProperty.getKind() == DeltaCloudHardwareProperty.Kind.FIXED) {
+ Label storageValueLabel = new Label(container, SWT.NULL);
+ storageValueLabel.setText(storageProperty.getValue());
+ FormData f = new FormData();
+ f.left = new FormAttachment(storageLabel, 50);
+ f.top = new FormAttachment(memoryControl, 8);
+ storageValueLabel.setLayoutData(f);
+ storageValueLabel.setVisible(true);
+ storageControl = storageValueLabel;
+ } else if (storageProperty.getKind() == DeltaCloudHardwareProperty.Kind.RANGE) {
+ storageDefaultValue = storageProperty.getValue();
+ int indexDefault = storageDefaultValue.indexOf('.');
+ int decDigitsDefault = 0;
+ if (indexDefault >= 0) {
+ decDigitsDefault = storageDefaultValue.length() - indexDefault - 1;
+ storageDefaultValue = storageDefaultValue.replace(".", ""); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ Spinner storageSpinner = new Spinner(container, SWT.READ_ONLY | SWT.BORDER);
+ String first = memoryProperty.getRange().getFirst();
+ int indexFirst = first.indexOf('.');
+ int decDigitsFirst = 0;
+ if (indexFirst >= 0) {
+ decDigitsFirst = first.length() - indexFirst - 1;
+ first = first.replace(".", ""); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ String last = memoryProperty.getRange().getLast();
+ int indexLast = first.indexOf('.');
+ int decDigitsLast = 0;
+ if (indexLast >= 0) {
+ decDigitsLast = last.length() - indexLast - 1;
+ last = last.replace(".", ""); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ int decDigits = Math.max(decDigitsFirst, decDigitsLast);
+ storageDecDigits = Math.max(decDigits, decDigitsDefault);
+ if (decDigitsFirst < storageDecDigits) {
+ for (int i = 0; i < storageDecDigits - decDigitsFirst; ++i)
+ first = first.concat("0"); //$NON-NLS-1$
+ }
+ if (decDigitsLast < storageDecDigits) {
+ for (int i = 0; i < storageDecDigits - decDigitsLast; ++i)
+ last = last.concat("0"); //$NON-NLS-1$
+ }
+ if (decDigitsDefault < storageDecDigits) {
+ for (int i = 0; i < storageDecDigits - decDigitsLast; ++i)
+ storageDefaultValue = storageDefaultValue.concat("0"); //$NON-NLS-1$
+ }
+ storageSpinner.setMinimum(Integer.valueOf(first));
+ storageSpinner.setMaximum(Integer.valueOf(last));
+ storageSpinner.setDigits(storageDecDigits);
+ storageSpinner.addModifyListener(spinnerListener);
+ storageSpinner.setSelection(Integer.valueOf(storageDefaultValue));
+ FormData f = new FormData();
+ f.width = 80;
+ f.top = new FormAttachment(memoryControl, 5);
+ f.left = new FormAttachment(storageLabel, 50);
+ f.right = new FormAttachment(storageLabel, cw, SWT.RIGHT);
+ storageSpinner.setLayoutData(f);
+ storageControl = storageSpinner;
+ } else if (storageProperty.getKind() == DeltaCloudHardwareProperty.Kind.ENUM) {
+ storageDefaultValue = storageProperty.getValue();
+ List<String> values = storageProperty.getEnums();
+ storageCombo = new Combo(container, SWT.BORDER | SWT.READ_ONLY);
+ String[] items = new String[values.size()];
+ storageCombo.setItems(values.toArray(items));
+ storageCombo.setText(items[0]);
+ storageCombo.addModifyListener(comboListener);
+ FormData f = new FormData();
+ f.width = 80;
+ f.left = new FormAttachment(storageLabel, 50);
+ f.right = new FormAttachment(storageLabel, cw, SWT.RIGHT);
+ f.top = new FormAttachment(memoryControl, 5);
+ storageCombo.setLayoutData(f);
+ storageControl = storageCombo;
+ }
+ String storageUnit = storageProperty.getUnit();
+ if (storageUnit != null && !storageUnit.equals("label")) { //$NON-NLS-1$
+ Label unitLabel = new Label(container, SWT.NULL);
+ unitLabel.setText(storageUnit);
+ FormData f = new FormData();
+ f.left = new FormAttachment(storageControl, 3);
+ f.top = new FormAttachment(memoryControl, 8);
+ unitLabel.setLayoutData(f);
+ }
+
+ } else {
+ Label storage = new Label(container, SWT.NULL);
+ storage.setText(WizardMessages.getString(DEFAULTED));
+ FormData f = new FormData();
+ f.left = new FormAttachment(storageLabel, 50);
+ f.top = new FormAttachment(memoryControl, 8);
+ f.right = new FormAttachment(100, 0);
+ storage.setLayoutData(f);
+ storage.setVisible(true);
+ storageControl = storage;
+ }
+ return storageControl;
+ }
+
+ private Control createMemoyControl(Control cpuControl, DeltaCloudHardwareProperty memoryProperty, Label storageLabel, Composite container) {
+ Control memoryControl = null;
+ if (memoryProperty != null) {
+ if (memoryProperty.getKind() == DeltaCloudHardwareProperty.Kind.FIXED) {
+ Label memory = new Label(container, SWT.NULL);
+ memory.setText(memoryProperty.getValue());
+ FormData f = new FormData();
+ f.top = new FormAttachment(cpuControl, 8);
+ f.left = new FormAttachment(storageLabel, 50);
+ memory.setLayoutData(f);
+ memoryControl = memory;
+ } else if (memoryProperty.getKind() == DeltaCloudHardwareProperty.Kind.RANGE) {
+ memoryDefaultValue = memoryProperty.getValue();
+ int indexDefault = memoryDefaultValue.indexOf('.');
+ int decDigitsDefault = 0;
+ if (indexDefault >= 0) {
+ decDigitsDefault = memoryDefaultValue.length() - indexDefault - 1;
+ memoryDefaultValue = memoryDefaultValue.replace(".", ""); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ memorySpinner = new Spinner(container, SWT.READ_ONLY | SWT.BORDER);
+ String first = memoryProperty.getRange().getFirst();
+ int indexFirst = first.indexOf('.');
+ int decDigitsFirst = 0;
+ if (indexFirst >= 0) {
+ decDigitsFirst = first.length() - indexFirst - 1;
+ first = first.replace(".", ""); //$NON-NLS-1$ $NON-NLS-2$
+ }
+ String last = memoryProperty.getRange().getLast();
+ int indexLast = first.indexOf('.');
+ int decDigitsLast = 0;
+ if (indexLast >= 0) {
+ decDigitsLast = last.length() - indexLast - 1;
+ last = last.replace(".", ""); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ int decDigits = Math.max(decDigitsFirst, decDigitsLast);
+ memoryDecDigits = Math.max(decDigits, decDigitsDefault);
+ if (decDigitsFirst < memoryDecDigits) {
+ for (int i = 0; i < memoryDecDigits - decDigitsFirst; ++i)
+ first = first.concat("0"); //$NON-NLS-1$
+ }
+ if (decDigitsLast < memoryDecDigits) {
+ for (int i = 0; i < memoryDecDigits - decDigitsLast; ++i)
+ last = last.concat("0"); //$NON-NLS-1$
+ }
+ if (decDigitsDefault < memoryDecDigits) {
+ for (int i = 0; i < memoryDecDigits - decDigitsLast; ++i)
+ memoryDefaultValue = memoryDefaultValue.concat("0"); //$NON-NLS-1$
+ }
+ memorySpinner.setMinimum(Integer.valueOf(first));
+ memorySpinner.setMaximum(Integer.valueOf(last));
+ memorySpinner.setDigits(memoryDecDigits);
+ memorySpinner.addModifyListener(spinnerListener);
+ memorySpinner.setSelection(Integer.valueOf(memoryDefaultValue));
+ FormData f = new FormData();
+ f.width = 80;
+ f.left = new FormAttachment(storageLabel, 50);
+ f.right = new FormAttachment(storageLabel, cw, SWT.RIGHT);
+ f.top = new FormAttachment(cpuControl, 5);
+ memorySpinner.setLayoutData(f);
+ memoryControl = memorySpinner;
+ } else if (memoryProperty.getKind() == DeltaCloudHardwareProperty.Kind.ENUM) {
+ memoryDefaultValue = memoryProperty.getValue();
+ List<String> values = memoryProperty.getEnums();
+ memoryCombo = new Combo(container, SWT.BORDER | SWT.READ_ONLY);
+ String[] items = new String[values.size()];
+ memoryCombo.setItems(values.toArray(items));
+ memoryCombo.setText(items[0]);
+ memoryCombo.addModifyListener(comboListener);
+ FormData f = new FormData();
+ f.width = 80;
+ f.left = new FormAttachment(storageLabel, 50);
+ f.right = new FormAttachment(storageLabel, cw, SWT.RIGHT);
+ f.top = new FormAttachment(cpuControl, 5);
+ memoryCombo.setLayoutData(f);
+ memoryControl = memoryCombo;
+ }
+ String memoryUnit = memoryProperty.getUnit();
+ if (memoryUnit != null && !memoryUnit.equals("label")) { //$NON-NLS-1$
+ Label unitLabel = new Label(container, SWT.NULL);
+ unitLabel.setText(memoryUnit);
+ FormData f = new FormData();
+ f.left = new FormAttachment(memoryControl, 3);
+ f.top = new FormAttachment(cpuControl, 8);
+ unitLabel.setLayoutData(f);
+ }
+ } else {
+ Label memory = new Label(container, SWT.NULL);
+ memory.setText(WizardMessages.getString(DEFAULTED));
+ FormData f = new FormData();
+ f.top = new FormAttachment(cpuControl, 8);
+ f.left = new FormAttachment(storageLabel, 50);
+ f.right = new FormAttachment(100, 0);
+ memory.setLayoutData(f);
+ memoryControl = memory;
+ }
+ return memoryControl;
+ }
+
+ private Control createCpuControls(DeltaCloudHardwareProperty cpuProperty, Label storageLabel, Composite container) {
+ Control cpuControl = null;
+ if (cpuProperty != null) {
+ if (cpuProperty.getKind() == DeltaCloudHardwareProperty.Kind.FIXED) {
+ Label cpuLabel = new Label(container, SWT.NULL);
+ cpuLabel.setText(cpuProperty.getValue());
+ FormData f = new FormData();
+ f.left = new FormAttachment(storageLabel, 50);
+ f.right = new FormAttachment(100, 0);
+ cpuLabel.setLayoutData(f);
+ cpuControl = cpuLabel;
+ } else if (cpuProperty.getKind() == DeltaCloudHardwareProperty.Kind.RANGE) {
+ cpuDefaultValue = cpuProperty.getValue();
+ cpuSpinner = new Spinner(container, SWT.READ_ONLY);
+ cpuSpinner.setMinimum(Integer.valueOf(cpuProperty.getRange().getFirst()));
+ cpuSpinner.setMaximum(Integer.valueOf(cpuProperty.getRange().getLast()));
+ cpuSpinner.addModifyListener(spinnerListener);
+ cpuSpinner.setSelection(Integer.valueOf(cpuDefaultValue));
+ FormData f = new FormData();
+ f.width = 80;
+ f.left = new FormAttachment(storageLabel, 50);
+ f.right = new FormAttachment(storageLabel, cw, SWT.RIGHT);
+ cpuSpinner.setLayoutData(f);
+ cpuControl = cpuSpinner;
+ } else if (cpuProperty.getKind() == DeltaCloudHardwareProperty.Kind.ENUM) {
+ cpuDefaultValue = cpuProperty.getValue();
+ List<String> values = cpuProperty.getEnums();
+ cpuCombo = new Combo(container, SWT.BORDER);
+ String[] items = new String[values.size()];
+ cpuCombo.setItems(values.toArray(items));
+ cpuCombo.setText(items[0]);
+ cpuCombo.addModifyListener(comboListener);
+ FormData f = new FormData();
+ f.width = 80;
+ f.left = new FormAttachment(storageLabel, 50);
+ f.right = new FormAttachment(storageLabel, cw, SWT.RIGHT);
+ cpuCombo.setLayoutData(f);
+ cpuControl = cpuCombo;
+ }
+ String cpuUnit = cpuProperty.getUnit();
+ if (cpuUnit != null && !cpuUnit.equals("label") && !cpuUnit.equals("count")) { //$NON-NLS-1$ //$NON-NLS-1$
+ Label unitLabel = new Label(container, SWT.NULL);
+ unitLabel.setText(cpuProperty.getUnit());
+ FormData f = new FormData();
+ f.left = new FormAttachment(cpuControl, 5);
+ unitLabel.setLayoutData(f);
+ }
+ } else {
+ Label cpu = new Label(container, SWT.NULL);
+ cpu.setText(WizardMessages.getString(DEFAULTED));
+ FormData f = new FormData();
+ f.left = new FormAttachment(storageLabel, 50);
+ f.right = new FormAttachment(100, 0);
+ cpu.setLayoutData(f);
+ cpuControl = cpu;
+ }
+ return cpuControl;
+ }
+
+ public void setVisible(boolean visible) {
+ container.setVisible(visible);
+ }
+
+ private void setCPU(String value) {
+ this.cpu = value;
+ }
+
+ public String getCPU() {
+ if (cpu != null && !cpu.equals(cpuDefaultValue)) {
+ return cpu;
+ }
+ return null;
+ }
+
+ private void setMemody(String value) {
+ this.memory = value;
+ }
+
+ public String getMemory() {
+ if (memory != null && !memory.equals(memoryDefaultValue)) {
+ return memory;
+ }
+ return null;
+ }
+
+ private void setStorage(String value) {
+ this.storage = value;
+ }
+
+ public String getStorage() {
+ if (storage != null && !storage.equals(storageDefaultValue)) {
+ return storage;
+ }
+ return null;
+ }
+
+ public Composite getControl() {
+ return container;
+ }
+}
Property changes on: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ProfilePage.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
14 years, 1 month
JBoss Tools SVN: r27546 - trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/wizard.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-12-16 05:57:15 -0500 (Thu, 16 Dec 2010)
New Revision: 27546
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/wizard/NewCDIWizardTest.java
Log:
JBIDE-7899
https://issues.jboss.org/browse/JBIDE-7899
Modified: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/wizard/NewCDIWizardTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/wizard/NewCDIWizardTest.java 2010-12-16 10:56:18 UTC (rev 27545)
+++ trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/wizard/NewCDIWizardTest.java 2010-12-16 10:57:15 UTC (rev 27546)
@@ -26,12 +26,14 @@
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.internal.ui.wizards.NewElementWizard;
import org.eclipse.jdt.ui.wizards.NewTypeWizardPage;
+import org.eclipse.jface.dialogs.IMessageProvider;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.wizard.IWizard;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.osgi.util.NLS;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
+import org.jboss.tools.cdi.core.CDIConstants;
import org.jboss.tools.cdi.core.CDICorePlugin;
import org.jboss.tools.cdi.core.ICDIAnnotation;
import org.jboss.tools.cdi.core.ICDIProject;
@@ -206,18 +208,30 @@
PACK_NAME, STEREOTYPE2_NAME);
ICDIProject cdi = CDICorePlugin.getCDIProject(context.tck, true);
IStereotype s = cdi.getStereotype(PACK_NAME + "." + STEREOTYPE_NAME);
+ IStereotype d = cdi.getStereotype(CDIConstants.DECORATOR_STEREOTYPE_TYPE_NAME);
assertNotNull(s);
+ assertNotNull(d);
try {
NewStereotypeWizardPage page = (NewStereotypeWizardPage)context.page;
page.setInherited(true);
page.setTarget("METHOD,FIELD");
page.setNamed(true);
- page.addStereotype(s);
+ page.addStereotype(d);
String message = page.getErrorMessage();
- String testmessage = NLS.bind(CDIUIMessages.MESSAGE_STEREOTYPE_CANNOT_BE_APPLIED_TO_TYPE, s.getSourceType().getElementName());
+ assertNull(message);
+ message = page.getMessage();
+ assertNotNull(message);
+ int messageType = page.getMessageType();
+ assertEquals(IMessageProvider.WARNING, messageType);
+ String testmessage = NLS.bind(CDIUIMessages.MESSAGE_STEREOTYPE_IS_NOT_COMPATIBLE, d.getSourceType().getElementName());
assertEquals(testmessage, message);
+
+ page.addStereotype(s);
+ message = page.getErrorMessage();
+ testmessage = NLS.bind(CDIUIMessages.MESSAGE_STEREOTYPE_CANNOT_BE_APPLIED_TO_TYPE, s.getSourceType().getElementName());
+ assertEquals(testmessage, message);
} finally {
context.close();
}
14 years, 1 month
JBoss Tools SVN: r27545 - in trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui: wizard and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-12-16 05:56:18 -0500 (Thu, 16 Dec 2010)
New Revision: 27545
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIMessages.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIMessages.properties
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewStereotypeWizardPage.java
Log:
JBIDE-7899
https://issues.jboss.org/browse/JBIDE-7899
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIMessages.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIMessages.java 2010-12-16 09:45:27 UTC (rev 27544)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIMessages.java 2010-12-16 10:56:18 UTC (rev 27545)
@@ -73,6 +73,7 @@
public static String MESSAGE_INTERCEPTOR_BINDINGS_EMPTY;
public static String MESSAGE_STEREOTYPE_CANNOT_BE_APPLIED_TO_TYPE;
+ public static String MESSAGE_STEREOTYPE_IS_NOT_COMPATIBLE;
public static String MESSAGE_QUALIFIER_NOT_SET;
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIMessages.properties
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIMessages.properties 2010-12-16 09:45:27 UTC (rev 27544)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIMessages.properties 2010-12-16 10:56:18 UTC (rev 27545)
@@ -57,6 +57,7 @@
MESSAGE_INTERCEPTOR_BINDINGS_EMPTY=Interceptor Bindings list is empty
MESSAGE_STEREOTYPE_CANNOT_BE_APPLIED_TO_TYPE={0} cannot be applied to a type.
+MESSAGE_STEREOTYPE_IS_NOT_COMPATIBLE={0} annotated with '''@Target({TYPE})''' is not compatible with target.
MESSAGE_QUALIFIER_NOT_SET=Qualifier is not set
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewStereotypeWizardPage.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewStereotypeWizardPage.java 2010-12-16 09:45:27 UTC (rev 27544)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewStereotypeWizardPage.java 2010-12-16 10:56:18 UTC (rev 27545)
@@ -302,7 +302,8 @@
if(target != null) {
Set<String> targets = CDIUtil.getTargetAnnotationValues(target);
if(targets != null && targets.size() == 1 && targets.contains("TYPE") && hasMethodOrField) {
- String message = a.getSourceType().getElementName() + " annotated with @Target({TYPE}) is not compatible with target";
+ String message = NLS.bind(CDIUIMessages.MESSAGE_STEREOTYPE_IS_NOT_COMPATIBLE, a.getSourceType().getElementName());
+// String message = a.getSourceType().getElementName() + " annotated with @Target({TYPE}) is not compatible with target";
targetStatus.setWarning(message);
}
if(targets != null && !targets.contains("TYPE")) {
14 years, 1 month
JBoss Tools SVN: r27544 - in trunk/as: tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2010-12-16 04:45:27 -0500 (Thu, 16 Dec 2010)
New Revision: 27544
Added:
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/JBossServerAPITest.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServer.java
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTestSuite.java
Log:
JBIDE-7876 - javadoc added, unit test added, fix applied.
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServer.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServer.java 2010-12-16 09:41:19 UTC (rev 27543)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServer.java 2010-12-16 09:45:27 UTC (rev 27544)
@@ -58,9 +58,15 @@
return getServer().getHost();
}
+ /**
+ * The full path of the configuration, ex:
+ * /home/rob/tmp/default_copy3 would return /home/rob/tmp/default_copy3
+ * /home/rob/jboss-5.x.x/server/default would return /home/rob/jboss-5.x.x/server/default
+ * @return
+ */
public String getConfigDirectory() {
IJBossServerRuntime runtime = (IJBossServerRuntime)getServer().getRuntime().loadAdapter(IJBossServerRuntime.class, null);
- return runtime.getConfigLocationFullPath().toOSString();
+ return runtime.getConfigurationFullPath().toOSString();
}
public String getDeployFolder() {
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTestSuite.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTestSuite.java 2010-12-16 09:41:19 UTC (rev 27543)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTestSuite.java 2010-12-16 09:45:27 UTC (rev 27544)
@@ -35,6 +35,7 @@
import org.jboss.ide.eclipse.as.test.publishing.v2.JSTDeployBinaryChildModuleTest;
import org.jboss.ide.eclipse.as.test.publishing.v2.JSTDeploymentTester;
import org.jboss.ide.eclipse.as.test.publishing.v2.SingleFileDeploymentTester;
+import org.jboss.ide.eclipse.as.test.server.JBossServerAPITest;
public class ASTestSuite extends TestSuite {
public static Test suite() {
@@ -51,6 +52,7 @@
suite.addTestSuite(JSTDeploymentTester.class);
suite.addTestSuite(JSTDeployBinaryChildModuleTest.class);
suite.addTestSuite(SingleFileDeploymentTester.class);
+ suite.addTestSuite(JBossServerAPITest.class);
return suite;
}
Added: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/JBossServerAPITest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/JBossServerAPITest.java (rev 0)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/JBossServerAPITest.java 2010-12-16 09:45:27 UTC (rev 27544)
@@ -0,0 +1,37 @@
+package org.jboss.ide.eclipse.as.test.server;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.wst.server.core.IRuntime;
+import org.eclipse.wst.server.core.IServer;
+import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
+import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
+import org.jboss.ide.eclipse.as.test.util.ServerRuntimeUtils;
+
+public class JBossServerAPITest extends ServerRuntimeUtils {
+ protected IServer currentServer;
+ public void setUp() {
+ }
+
+ public void tearDown() {
+ try {
+ if( currentServer != null )
+ currentServer.delete();
+ } catch( CoreException ce ) {
+ // report
+ }
+ }
+ public void testJBossServerGetConfigDirectory() {
+ try {
+ currentServer = create42Server();
+ JBossServer jbs = (JBossServer)currentServer.getAdapter(JBossServer.class);
+ IRuntime rt = currentServer.getRuntime();
+ IJBossServerRuntime jbsrt = (IJBossServerRuntime)rt.loadAdapter(IJBossServerRuntime.class, new NullProgressMonitor());
+ String configName = jbsrt.getJBossConfiguration();
+ assertTrue(jbs.getConfigDirectory().endsWith(configName));
+ } catch( CoreException ce ) {
+ fail("Failed during setUp for " + getName() + ": " + ce.getMessage());
+ }
+ }
+
+}
14 years, 1 month
JBoss Tools SVN: r27543 - trunk/modeshape/tests/org.jboss.tools.modeshape.rest.ui.bot.test/src/org/jboss/tools/modeshape/rest/ui/bot/tests.
by jbosstools-commits@lists.jboss.org
Author: psrna
Date: 2010-12-16 04:41:19 -0500 (Thu, 16 Dec 2010)
New Revision: 27543
Modified:
trunk/modeshape/tests/org.jboss.tools.modeshape.rest.ui.bot.test/src/org/jboss/tools/modeshape/rest/ui/bot/tests/Properties.java
trunk/modeshape/tests/org.jboss.tools.modeshape.rest.ui.bot.test/src/org/jboss/tools/modeshape/rest/ui/bot/tests/Publishing.java
trunk/modeshape/tests/org.jboss.tools.modeshape.rest.ui.bot.test/src/org/jboss/tools/modeshape/rest/ui/bot/tests/TeiidFilesPublishing.java
Log:
* publishing/unpublishing tests fixed
Modified: trunk/modeshape/tests/org.jboss.tools.modeshape.rest.ui.bot.test/src/org/jboss/tools/modeshape/rest/ui/bot/tests/Properties.java
===================================================================
--- trunk/modeshape/tests/org.jboss.tools.modeshape.rest.ui.bot.test/src/org/jboss/tools/modeshape/rest/ui/bot/tests/Properties.java 2010-12-16 08:50:57 UTC (rev 27542)
+++ trunk/modeshape/tests/org.jboss.tools.modeshape.rest.ui.bot.test/src/org/jboss/tools/modeshape/rest/ui/bot/tests/Properties.java 2010-12-16 09:41:19 UTC (rev 27543)
@@ -14,7 +14,7 @@
public static final String URL = "http://localhost:8080/modeshape-rest";
public static final String WEBDAV_URL = "http://localhost:8080/modeshape-webdav";
- public static final String REPOSITORY = "repository";
+ public static final String REPOSITORY = "eds";
public static final String WORKSPACE = "default";
public static final String USER = "admin";
Modified: trunk/modeshape/tests/org.jboss.tools.modeshape.rest.ui.bot.test/src/org/jboss/tools/modeshape/rest/ui/bot/tests/Publishing.java
===================================================================
--- trunk/modeshape/tests/org.jboss.tools.modeshape.rest.ui.bot.test/src/org/jboss/tools/modeshape/rest/ui/bot/tests/Publishing.java 2010-12-16 08:50:57 UTC (rev 27542)
+++ trunk/modeshape/tests/org.jboss.tools.modeshape.rest.ui.bot.test/src/org/jboss/tools/modeshape/rest/ui/bot/tests/Publishing.java 2010-12-16 09:41:19 UTC (rev 27543)
@@ -15,6 +15,7 @@
import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
+import org.jboss.tools.ui.bot.ext.SWTEclipseExt;
import org.jboss.tools.ui.bot.ext.SWTTestExt;
import org.jboss.tools.ui.bot.ext.SWTUtilExt;
import org.jboss.tools.ui.bot.ext.config.Annotations.SWTBotTestRequires;
@@ -28,12 +29,13 @@
import org.junit.BeforeClass;
import org.junit.Test;
+
/**
*
* @author psrna
*
*/
-@SWTBotTestRequires(server=(a)Server(type=ServerType.SOA,version="5.1"),perspective="Java EE")
+//@SWTBotTestRequires(server=(a)Server(type=ServerType.SOA,version="5.1"),perspective="Java EE")
public class Publishing extends SWTTestExt{
private static final String CONNERR_MSG = "Unable to connect using the specified server properties." +
@@ -53,6 +55,8 @@
open.finish(wiz);
assertTrue(projectExplorer.isFilePresent(Properties.PROJECT_NAME, Properties.FILE_NAME));
+ bot.editorByTitle(Properties.FILE_NAME).close();
+
String projectLocation = SWTUtilExt.getPathToProject(Properties.PROJECT_NAME);
try {
FileWriter fstream = new FileWriter(projectLocation + "/" + Properties.FILE_NAME);
@@ -64,6 +68,15 @@
log.error(e.getMessage());
}
+ bot.viewByTitle("Project Explorer").show();
+ bot.viewByTitle("Project Explorer").setFocus();
+ SWTBot viewBot = bot.viewByTitle("Project Explorer").bot();
+
+ SWTBotTreeItem node = SWTEclipseExt.selectTreeLocation(viewBot, Properties.PROJECT_NAME);
+
+ ContextMenuHelper.prepareTreeItemForContextMenu(viewBot.tree(), node);
+ ContextMenuHelper.clickContextMenu(viewBot.tree(), "Refresh");
+
}
@BeforeClass
@@ -108,8 +121,8 @@
private void openModeshapeView(){
bot.menu(IDELabel.Menu.WINDOW)
- .menu(IDELabel.Menu.SHOW_VIEW)
- .menu(IDELabel.Menu.OTHER).click();
+ .menu(IDELabel.Menu.SHOW_VIEW)
+ .menu(IDELabel.Menu.OTHER).click();
SWTBotShell shell = bot.shell("Show View");
shell.activate();
@@ -135,6 +148,7 @@
SWTBotCombo serverCombo = shell.bot().comboBoxWithLabel("Server:");
SWTBotCombo repoCombo = shell.bot().comboBoxWithLabel("Repository:");
SWTBotCombo workspaceCombo = shell.bot().comboBoxWithLabel("Workspace:");
+ workspaceCombo.setSelection(Properties.WORKSPACE);
assertTrue("URL mismatch.", serverCombo.getText().equals(Properties.URL));
assertTrue("Repository mismatch.", repoCombo.getText().equals(Properties.REPOSITORY));
@@ -165,10 +179,10 @@
assertTrue("Repository mismatch.", table.cell(0, 2).equals(Properties.REPOSITORY));
assertTrue("Workspace mismatch.", table.cell(0, 3).equals(Properties.WORKSPACE));
- String expectedPublishedUrl = Properties.URL + "/" +
- Properties.REPOSITORY + "/" +
- Properties.WORKSPACE + "/items/" +
- Properties.PROJECT_NAME + "/" +
+ String expectedPublishedUrl = Properties.URL + "/" +
+ Properties.REPOSITORY + "/" +
+ Properties.WORKSPACE + "/items/files/" +
+ Properties.PROJECT_NAME + "/" +
Properties.FILE_NAME;
assertTrue("Published Url mismatch.", table.cell(0, 4).equals(expectedPublishedUrl));
@@ -195,6 +209,7 @@
SWTBotCombo serverCombo = shell.bot().comboBoxWithLabel("Server:");
SWTBotCombo repoCombo = shell.bot().comboBoxWithLabel("Repository:");
SWTBotCombo workspaceCombo = shell.bot().comboBoxWithLabel("Workspace:");
+ workspaceCombo.setSelection(Properties.WORKSPACE);
assertTrue("URL mismatch.", serverCombo.getText().equals(Properties.URL));
assertTrue("Repository mismatch.", repoCombo.getText().equals(Properties.REPOSITORY));
@@ -228,11 +243,12 @@
try {
- URL url = new URL(Properties.WEBDAV_URL + "/" +
- Properties.REPOSITORY + "/" +
- Properties.WORKSPACE + "/" +
- Properties.PROJECT_NAME + "/" +
+ URL url = new URL(Properties.WEBDAV_URL + "/" +
+ Properties.REPOSITORY + "/" +
+ Properties.WORKSPACE + "/files/" +
+ Properties.PROJECT_NAME + "/" +
Properties.FILE_NAME);
+
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("GET");
Modified: trunk/modeshape/tests/org.jboss.tools.modeshape.rest.ui.bot.test/src/org/jboss/tools/modeshape/rest/ui/bot/tests/TeiidFilesPublishing.java
===================================================================
--- trunk/modeshape/tests/org.jboss.tools.modeshape.rest.ui.bot.test/src/org/jboss/tools/modeshape/rest/ui/bot/tests/TeiidFilesPublishing.java 2010-12-16 08:50:57 UTC (rev 27542)
+++ trunk/modeshape/tests/org.jboss.tools.modeshape.rest.ui.bot.test/src/org/jboss/tools/modeshape/rest/ui/bot/tests/TeiidFilesPublishing.java 2010-12-16 09:41:19 UTC (rev 27543)
@@ -34,7 +34,7 @@
* @author psrna
*
*/
-@SWTBotTestRequires(server=(a)Server(type=ServerType.SOA,version="5.1"), perspective="Teiid Designer")
+//@SWTBotTestRequires(server=(a)Server(type=ServerType.SOA,version="5.1"), perspective="Teiid Designer")
public class TeiidFilesPublishing extends SWTTestExt{
private static final String CONNERR_MSG = "Unable to connect using the specified server properties." +
@@ -96,8 +96,8 @@
private void openModeshapeView(){
bot.menu(IDELabel.Menu.WINDOW)
- .menu(IDELabel.Menu.SHOW_VIEW)
- .menu(IDELabel.Menu.OTHER).click();
+ .menu(IDELabel.Menu.SHOW_VIEW)
+ .menu(IDELabel.Menu.OTHER).click();
SWTBotShell shell = bot.shell("Show View");
shell.activate();
@@ -124,6 +124,7 @@
SWTBotCombo serverCombo = shell.bot().comboBoxWithLabel("Server:");
SWTBotCombo repoCombo = shell.bot().comboBoxWithLabel("Repository:");
SWTBotCombo workspaceCombo = shell.bot().comboBoxWithLabel("Workspace:");
+ workspaceCombo.setSelection(Properties.WORKSPACE);
assertTrue("URL mismatch.", serverCombo.getText().equals(Properties.URL));
assertTrue("Repository mismatch.", repoCombo.getText().equals(Properties.REPOSITORY));
@@ -155,6 +156,7 @@
SWTBotCombo serverCombo = shell.bot().comboBoxWithLabel("Server:");
SWTBotCombo repoCombo = shell.bot().comboBoxWithLabel("Repository:");
SWTBotCombo workspaceCombo = shell.bot().comboBoxWithLabel("Workspace:");
+ workspaceCombo.setSelection(Properties.WORKSPACE);
assertTrue("URL mismatch.", serverCombo.getText().equals(Properties.URL));
assertTrue("Repository mismatch.", repoCombo.getText().equals(Properties.REPOSITORY));
@@ -178,10 +180,10 @@
try {
- URL url = new URL(Properties.WEBDAV_URL + "/" +
- Properties.REPOSITORY + "/" +
- Properties.WORKSPACE + "/" +
- Properties.TEIID_PROJECT_NAME + "/" + filename);
+ URL url = new URL(Properties.WEBDAV_URL + "/" +
+ Properties.REPOSITORY + "/" +
+ Properties.WORKSPACE + "/files/" +
+ Properties.TEIID_PROJECT_NAME + "/" + filename);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("GET");
14 years, 1 month
JBoss Tools SVN: r27542 - trunk/as/plugins/org.jboss.ide.eclipse.as.rse.ui/META-INF.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2010-12-16 03:50:57 -0500 (Thu, 16 Dec 2010)
New Revision: 27542
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.ui/META-INF/MANIFEST.MF
Log:
JBIDE-7921 - removing unneeded dependencies
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.rse.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.rse.ui/META-INF/MANIFEST.MF 2010-12-16 08:45:28 UTC (rev 27541)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.rse.ui/META-INF/MANIFEST.MF 2010-12-16 08:50:57 UTC (rev 27542)
@@ -26,10 +26,6 @@
org.eclipse.rse.files.ui,
org.eclipse.rse.ui,
org.eclipse.wst.server.ui,
- org.eclipse.tm.terminal,
- org.eclipse.tm.terminal.view,
- org.eclipse.tm.terminal.telnet,
- org.eclipse.tm.terminal.ssh,
org.eclipse.debug.ui;bundle-version="[3.6.0,4.0.0)"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
14 years, 1 month
JBoss Tools SVN: r27541 - trunk/as/tests/org.jboss.ide.eclipse.as.test/META-INF.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2010-12-16 03:45:28 -0500 (Thu, 16 Dec 2010)
New Revision: 27541
Modified:
trunk/as/tests/org.jboss.ide.eclipse.as.test/META-INF/MANIFEST.MF
Log:
JBIDE-7904 - committing manifest change
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/META-INF/MANIFEST.MF 2010-12-16 08:40:51 UTC (rev 27540)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/META-INF/MANIFEST.MF 2010-12-16 08:45:28 UTC (rev 27541)
@@ -54,4 +54,5 @@
org.jboss.ide.eclipse.as.test.publishing.v2,
org.jboss.ide.eclipse.as.test.server,
org.jboss.ide.eclipse.as.test.util,
+ org.jboss.ide.eclipse.as.test.util.jdt,
org.jboss.ide.eclipse.as.test.util.wtp
14 years, 1 month
JBoss Tools SVN: r27540 - trunk/jmx/features/org.jboss.tools.jmx.feature/sourceTemplatePlugin.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2010-12-16 03:40:51 -0500 (Thu, 16 Dec 2010)
New Revision: 27540
Added:
trunk/jmx/features/org.jboss.tools.jmx.feature/sourceTemplatePlugin/about.html
Log:
https://issues.jboss.org/browse/JBDS-1462 Missing Legal Info for JMX plugin
Added: trunk/jmx/features/org.jboss.tools.jmx.feature/sourceTemplatePlugin/about.html
===================================================================
--- trunk/jmx/features/org.jboss.tools.jmx.feature/sourceTemplatePlugin/about.html (rev 0)
+++ trunk/jmx/features/org.jboss.tools.jmx.feature/sourceTemplatePlugin/about.html 2010-12-16 08:40:51 UTC (rev 27540)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+<title>FreeMarker IDE</title>
+<style type="text/css" media="screen">
+<!--
+ body {
+ font-family: Sans-serif, Arial, Helvetica;
+ }
+
+-->
+</style>
+</head>
+<body>
+<h1>FreeMarker IDE</h1>
+
+<p>
+This plugin is part of the JBoss Tools developed by the <a href="http://www.jboss.com">JBoss Inc.</a>
+</p>
+
+<p>Information about this plugin is available at <a href="http://www.jboss.org/tools">JBoss Tools project page</a></p>
+
+<p>
+This software is distributed under the terms of the Eclipse Public License - v 1.0
+(see <a href="www.eclipse.org/legal/epl-v10.html">Eclipse Public License - Version 1.0</a>).
+</p>
+</body>
+</html>
\ No newline at end of file
Property changes on: trunk/jmx/features/org.jboss.tools.jmx.feature/sourceTemplatePlugin/about.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
14 years, 1 month
JBoss Tools SVN: r27539 - trunk/freemarker/features/org.jboss.ide.eclipse.freemarker.feature/sourceTemplatePlugin.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2010-12-16 03:39:10 -0500 (Thu, 16 Dec 2010)
New Revision: 27539
Added:
trunk/freemarker/features/org.jboss.ide.eclipse.freemarker.feature/sourceTemplatePlugin/about.html
Log:
https://issues.jboss.org/browse/JBDS-1463 Missing Legal Info for Freemaker plugin
aboout.html added
Added: trunk/freemarker/features/org.jboss.ide.eclipse.freemarker.feature/sourceTemplatePlugin/about.html
===================================================================
--- trunk/freemarker/features/org.jboss.ide.eclipse.freemarker.feature/sourceTemplatePlugin/about.html (rev 0)
+++ trunk/freemarker/features/org.jboss.ide.eclipse.freemarker.feature/sourceTemplatePlugin/about.html 2010-12-16 08:39:10 UTC (rev 27539)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+<title>FreeMarker IDE</title>
+<style type="text/css" media="screen">
+<!--
+ body {
+ font-family: Sans-serif, Arial, Helvetica;
+ }
+
+-->
+</style>
+</head>
+<body>
+<h1>FreeMarker IDE</h1>
+
+<p>
+This plugin is part of the JBoss Tools developed by the <a href="http://www.jboss.com">JBoss Inc.</a>
+</p>
+
+<p>Information about this plugin is available at <a href="http://www.jboss.org/tools">JBoss Tools project page</a></p>
+
+<p>
+This software is distributed under the terms of the Eclipse Public License - v 1.0
+(see <a href="www.eclipse.org/legal/epl-v10.html">Eclipse Public License - Version 1.0</a>).
+</p>
+</body>
+</html>
\ No newline at end of file
Property changes on: trunk/freemarker/features/org.jboss.ide.eclipse.freemarker.feature/sourceTemplatePlugin/about.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
14 years, 1 month