JBoss Tools SVN: r27809 - 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-29 16:52:00 -0500 (Wed, 29 Dec 2010)
New Revision: 27809
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage.java
Log:
fixed invisible architecture value label
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-29 20:37:49 UTC (rev 27808)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage.java 2010-12-29 21:52:00 UTC (rev 27809)
@@ -21,7 +21,6 @@
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;
@@ -30,6 +29,8 @@
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;
@@ -190,7 +191,7 @@
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);
+ GridDataFactory.fillDefaults().span(2,1).align(SWT.FILL, SWT.CENTER).applyTo(arch);
Label realmLabel = new Label(container, SWT.NULL);
realmLabel.setText(WizardMessages.getString(REALM_LABEL));
@@ -231,30 +232,27 @@
// name
bindText(nameText, NewInstancePageModel.PROPERTY_NAME, WizardMessages.getString(MUST_ENTER_A_NAME), dbc);
IObservableValue imageObservable = bindImage(imageText, dbc);
- bindArchLabel(imageObservable, dbc);
+ bindArchLabel(arch, imageObservable, dbc);
bindRealmCombo(realmCombo, dbc);
bindProfileCombo(hardwareCombo, dbc);
bindProfilePages(hardwareCombo, profilePages, dbc);
bindKey(keyText, dbc);
}
- private void bindArchLabel(IObservableValue imageObservable, DataBindingContext dbc) {
- dbc.bindValue(WidgetProperties.text().observe(arch),
- imageObservable,
- new UpdateValueStrategy(UpdateSetStrategy.POLICY_NEVER),
- new UpdateValueStrategy().setConverter(new Converter(DeltaCloudImage.class, String.class) {
-
- @Override
- public Object convert(Object fromObject) {
- if (fromObject == null) {
- return null;
- }
- Assert.isLegal(fromObject instanceof DeltaCloudImage);
- DeltaCloudImage image = (DeltaCloudImage) fromObject;
- return image.getArchitecture();
-
- }
- }));
+ private void bindArchLabel(final Label architecture, IObservableValue imageObservable, DataBindingContext dbc) {
+ DataBindingUtils.addValueChangeListener(new IValueChangeListener() {
+
+ @Override
+ public void handleValueChange(ValueChangeEvent event) {
+ Object newValue = event.diff.getNewValue();
+ if (newValue == null
+ || !(newValue instanceof DeltaCloudImage)) {
+ return;
+ }
+ DeltaCloudImage image = (DeltaCloudImage) newValue;
+ architecture.setText(image.getArchitecture());
+ }
+ }, imageObservable, architecture);
}
private void bindRealmCombo(final Combo realmCombo, DataBindingContext dbc) {
14 years
JBoss Tools SVN: r27808 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-12-29 15:37:49 -0500 (Wed, 29 Dec 2010)
New Revision: 27808
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/DeltaCloudClientImpl.java
Log:
fixed ArrayOutOfBoundsException
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/DeltaCloudClientImpl.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/DeltaCloudClientImpl.java 2010-12-29 20:35:57 UTC (rev 27807)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/DeltaCloudClientImpl.java 2010-12-29 20:37:49 UTC (rev 27808)
@@ -534,7 +534,7 @@
Document document = getDocument(xml);
instance.setId(getAttributeValues(document, "instance", "id").get(0));
instance.setName(getElementTextValues(document, "name").get(0));
- instance.setOwnerId(getElementTextValues(document, "owner_id").get(0));
+ updateOwnerId(instance, document);
instance.setImageId(getIdFromHref(getAttributeValues(document, "image", "href").get(0))); //$NON-NLS-1$ //$NON-NLS-2$
instance.setProfileId(getIdFromHref(getAttributeValues(document, "hardware_profile", "href").get(0))); //$NON-NLS-1$ //$NON-NLS-2$
updateProfileProperties(instance, getPropertyNodes(document, "hardware_profile")); //$NON-NLS-1$
@@ -549,6 +549,13 @@
return instance;
}
+ private void updateOwnerId(Instance instance, Document document) {
+ List<String> values = getElementTextValues(document, "owner_id");
+ if (values.size() > 0) {
+ instance.setOwnerId(values.get(0));
+ }
+ }
+
private void updateProfileProperties(Instance instance,
List<Node> propertyNodes) {
if (propertyNodes != null) {
14 years
JBoss Tools SVN: r27807 - 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-29 15:35:57 -0500 (Wed, 29 Dec 2010)
New Revision: 27807
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePageModel.java
Log:
removed debug output
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePageModel.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePageModel.java 2010-12-29 20:14:55 UTC (rev 27806)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePageModel.java 2010-12-29 20:35:57 UTC (rev 27807)
@@ -152,7 +152,6 @@
}
DeltaCloudHardwareProfile hardwareProfile = filteredProfiles.get(index);
setSelectedProfile(hardwareProfile);
- System.err.println("firing oldIndex = " + oldIndex + " newIndex = " + index);
firePropertyChange(PROP_SELECTED_PROFILE_INDEX, oldIndex, index);
}
}
14 years
JBoss Tools SVN: r27806 - 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-29 15:14:55 -0500 (Wed, 29 Dec 2010)
New Revision: 27806
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePageModel.java
Log:
fixing profile-combo and realm-combo that dont get filled & selected
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePageModel.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePageModel.java 2010-12-29 20:12:25 UTC (rev 27805)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePageModel.java 2010-12-29 20:14:55 UTC (rev 27806)
@@ -60,7 +60,7 @@
}
public void setName(String name) {
- getPropertyChangeSupport().firePropertyChange(PROPERTY_NAME, this.name, this.name = name);
+ firePropertyChange(PROPERTY_NAME, this.name, this.name = name);
}
public DeltaCloudImage getImage() {
@@ -70,13 +70,13 @@
public void setImage(DeltaCloudImage image) {
List<DeltaCloudHardwareProfile> filteredProfiles = filterProfiles(image, allProfiles);
setFilteredProfiles(filteredProfiles);
- getPropertyChangeSupport().firePropertyChange(PROPERTY_IMAGE, this.image, this.image = image);
+ firePropertyChange(PROPERTY_IMAGE, this.image, this.image = image);
}
public void setSelectedRealmIndex(int index) {
if (realms.size() > index) {
int oldIndex = -1;
- if (selectedRealm != null
+ if (selectedRealm != null
&& realms.size() > 0) {
oldIndex = realms.indexOf(selectedRealm);
}
@@ -102,7 +102,7 @@
}
protected void setRealms(List<DeltaCloudRealm> realms) {
- getPropertyChangeSupport().firePropertyChange(PROPERTY_REALMS, this.realms, this.realms = realms);
+ firePropertyChange(PROPERTY_REALMS, this.realms, this.realms = realms);
setSelectedRealmIndex(0);
}
@@ -111,9 +111,8 @@
}
protected void setAllProfiles(List<DeltaCloudHardwareProfile> profiles) {
- getPropertyChangeSupport().firePropertyChange(PROP_ALL_PROFILES, this.allProfiles, this.allProfiles = profiles);
+ firePropertyChange(PROP_ALL_PROFILES, this.allProfiles, this.allProfiles = profiles);
setFilteredProfiles(filterProfiles(image, profiles));
- setSelectedProfileIndex(0);
}
public List<DeltaCloudHardwareProfile> getAllProfiles() {
@@ -121,14 +120,17 @@
}
private void setFilteredProfiles(List<DeltaCloudHardwareProfile> profiles) {
- getPropertyChangeSupport().firePropertyChange(PROP_FILTERED_PROFILES, this.filteredProfiles, this.filteredProfiles = profiles);
+ firePropertyChange(PROP_FILTERED_PROFILES, this.filteredProfiles,
+ this.filteredProfiles = profiles);
+ setSelectedProfileIndex(0);
}
public List<DeltaCloudHardwareProfile> getFilteredProfiles() {
return filteredProfiles;
}
- private List<DeltaCloudHardwareProfile> filterProfiles(DeltaCloudImage image, Collection<DeltaCloudHardwareProfile> profiles) {
+ private List<DeltaCloudHardwareProfile> filterProfiles(DeltaCloudImage image,
+ Collection<DeltaCloudHardwareProfile> profiles) {
List<DeltaCloudHardwareProfile> filteredProfiles = new ArrayList<DeltaCloudHardwareProfile>();
for (DeltaCloudHardwareProfile p : profiles) {
if (p.getArchitecture() == null
@@ -144,17 +146,22 @@
public void setSelectedProfileIndex(int index) {
if (filteredProfiles.size() > index) {
int oldIndex = -1;
- if (selectedProfile != null
+ if (selectedProfile != null
&& filteredProfiles.size() > 0) {
oldIndex = filteredProfiles.indexOf(selectedProfile);
}
DeltaCloudHardwareProfile hardwareProfile = filteredProfiles.get(index);
setSelectedProfile(hardwareProfile);
+ System.err.println("firing oldIndex = " + oldIndex + " newIndex = " + index);
firePropertyChange(PROP_SELECTED_PROFILE_INDEX, oldIndex, index);
}
}
public int getSelectedProfileIndex() {
+ if (filteredProfiles == null ||
+ filteredProfiles.size() <= 0) {
+ return -1;
+ }
return filteredProfiles.indexOf(selectedProfile);
}
@@ -192,7 +199,7 @@
public void setCpu(String cpu) {
this.cpu = cpu;
}
-
+
public String getCpu() {
return this.cpu;
}
14 years
JBoss Tools SVN: r27805 - in trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core: client and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-12-29 15:12:25 -0500 (Wed, 29 Dec 2010)
New Revision: 27805
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AbstractDeltaCloudObjectRepository.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/DeltaCloudClientImpl.java
Log:
fixed NPE
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AbstractDeltaCloudObjectRepository.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AbstractDeltaCloudObjectRepository.java 2010-12-29 19:42:03 UTC (rev 27804)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AbstractDeltaCloudObjectRepository.java 2010-12-29 20:12:25 UTC (rev 27805)
@@ -77,6 +77,15 @@
}
}
+ public int indexOf(E object) {
+ try {
+ lock();
+ return objects.indexOf(object);
+ } finally {
+ unlock();
+ }
+ }
+
protected E getById(C criteria) {
try {
lock();
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/DeltaCloudClientImpl.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/DeltaCloudClientImpl.java 2010-12-29 19:42:03 UTC (rev 27804)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/DeltaCloudClientImpl.java 2010-12-29 20:12:25 UTC (rev 27805)
@@ -532,6 +532,7 @@
private Instance updateInstance(String xml, Instance instance) throws Exception {
Document document = getDocument(xml);
+ instance.setId(getAttributeValues(document, "instance", "id").get(0));
instance.setName(getElementTextValues(document, "name").get(0));
instance.setOwnerId(getElementTextValues(document, "owner_id").get(0));
instance.setImageId(getIdFromHref(getAttributeValues(document, "image", "href").get(0))); //$NON-NLS-1$ //$NON-NLS-2$
14 years
JBoss Tools SVN: r27804 - in trunk/cdi: tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/unproxyable and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2010-12-29 14:42:03 -0500 (Wed, 29 Dec 2010)
New Revision: 27804
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/unproxyable/BeanWithDefaultConsturctor.java
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/messages.properties
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/unproxyable/Number_Broken.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/DeploymentProblemsValidationTests.java
Log:
https://issues.jboss.org/browse/JBIDE-8018
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2010-12-29 19:26:10 UTC (rev 27803)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2010-12-29 19:42:03 UTC (rev 27804)
@@ -1406,7 +1406,9 @@
} else {
IMethod[] methods = bean.getBeanClass().getMethods();
boolean hasDefaultConstructor = false;
+ boolean hasConstructor = false;
for (IMethod method : methods) {
+ hasConstructor = hasConstructor || method.isConstructor();
hasDefaultConstructor = hasDefaultConstructor || (method.isConstructor() && !Flags.isPrivate(method.getFlags()) && method.getParameterNames().length==0);
if(Flags.isFinal(method.getFlags())) {
// - Classes which have final methods cannot be proxied by the container.
@@ -1415,7 +1417,7 @@
break;
}
}
- if(!hasDefaultConstructor) {
+ if(!hasDefaultConstructor && hasConstructor) {
// - Classes which don't have a non-private constructor with no parameters cannot be proxied by the container.
addError(MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_TYPE_WITH_NPC, injection.getType().getSimpleName(), bean.getSimpleJavaName()), CDIPreferences.UNPROXYABLE_BEAN_TYPE, reference, injection.getResource());
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/messages.properties
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/messages.properties 2010-12-29 19:26:10 UTC (rev 27803)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/messages.properties 2010-12-29 19:42:03 UTC (rev 27804)
@@ -10,9 +10,9 @@
AMBIGUOUS_INJECTION_POINTS=Multiple beans are eligible for injection to the injection point [JSR-299 �5.2.1]
UNPROXYABLE_BEAN_ARRAY_TYPE=Injection point declares an array type {0} that cannot be proxied by the container resolves to a bean {1} with a normal scope [JSR-299 �5.4.1]
UNPROXYABLE_BEAN_PRIMITIVE_TYPE=Injection point declares a primitive type {0} that cannot be proxied by the container resolves to a bean {1} with a normal scope [JSR-299 �5.4.1]
-UNPROXYABLE_BEAN_TYPE_WITH_NPC=Injection point declares a class {0} with a non-private constructor with no parameters (such a class cannot be proxied by the container) resolves to a bean {1} with a normal scope [JSR-299 �5.4.1]
-UNPROXYABLE_BEAN_FINAL_TYPE=Injection point declares a final class {0} that cannot be proxied by the container resolves to a bean {1} with a normal scope [JSR-299 �5.4.1]
-UNPROXYABLE_BEAN_TYPE_WITH_FM=Injection point declares a class {0} with final methods (such a class cannot be proxied by the container) resolves to a bean {1} with a normal scope [JSR-299 �5.4.1]
+UNPROXYABLE_BEAN_TYPE_WITH_NPC=Injection point whose declared type ({0} is a class with a non-private constructor with no parameters) cannot be proxied by the container resolves to a bean {1} with a normal scope [JSR-299 �5.4.1]
+UNPROXYABLE_BEAN_FINAL_TYPE=Injection point whose declared type ({0} is a final class) cannot be proxied by the container resolves to a bean {1} with a normal scope [JSR-299 �5.4.1]
+UNPROXYABLE_BEAN_TYPE_WITH_FM=Injection point whose declared type ({0} is a class with final methods) cannot be proxied by the container resolves to a bean {1} with a normal scope [JSR-299 �5.4.1]
DECORATOR_RESOLVES_TO_FINAL_CLASS=Decorator must not be bound to a managed bean implemented by a class {0} which is declared final [JSR-299 �8.3]
DECORATOR_RESOLVES_TO_FINAL_METHOD=Decorator matches a managed bean {0} with a non-static, non-private, final method {1}, and the decorator also implements that method [JSR-299 �8.3]
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/unproxyable/BeanWithDefaultConsturctor.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/unproxyable/BeanWithDefaultConsturctor.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/unproxyable/BeanWithDefaultConsturctor.java 2010-12-29 19:42:03 UTC (rev 27804)
@@ -0,0 +1,8 @@
+package org.jboss.jsr299.tck.tests.jbt.validation.unproxyable;
+
+import javax.enterprise.context.ApplicationScoped;
+
+@ApplicationScoped
+public class BeanWithDefaultConsturctor {
+
+}
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/unproxyable/BeanWithDefaultConsturctor.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/unproxyable/Number_Broken.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/unproxyable/Number_Broken.java 2010-12-29 19:26:10 UTC (rev 27803)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/unproxyable/Number_Broken.java 2010-12-29 19:42:03 UTC (rev 27804)
@@ -19,4 +19,7 @@
@SuppressWarnings("unused")
@TestQualifier
@Inject private boolean numberOk1;
+
+ @SuppressWarnings("unused")
+ @Inject private BeanWithDefaultConsturctor numberOk2;
}
\ No newline at end of file
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/DeploymentProblemsValidationTests.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/DeploymentProblemsValidationTests.java 2010-12-29 19:26:10 UTC (rev 27803)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/DeploymentProblemsValidationTests.java 2010-12-29 19:42:03 UTC (rev 27804)
@@ -159,6 +159,15 @@
}
/**
+ * https://issues.jboss.org/browse/JBIDE-8018
+ * @throws Exception
+ */
+ public void testClassWithDefaultConstructor() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/unproxyable/Number_Broken.java");
+ assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_TYPE_WITH_NPC, "BeanWithDefaultConsturctor", "BeanWithDefaultConsturctor"), 24);
+ }
+
+ /**
* 5.4.1. Unproxyable bean types
* - Classes which are declared final cannot be proxied by the container.
* - If an injection point whose declared type cannot be proxied by the container resolves to a bean with a normal scope,
14 years
JBoss Tools SVN: r27803 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-12-29 14:26:10 -0500 (Wed, 29 Dec 2010)
New Revision: 27803
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java
Log:
fixed NPE
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java 2010-12-29 19:11:18 UTC (rev 27802)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java 2010-12-29 19:26:10 UTC (rev 27803)
@@ -304,7 +304,7 @@
public DeltaCloudInstance waitForState(String instanceId, IInstanceStateMatcher stateMatcher, IProgressMonitor pm)
throws InterruptedException, DeltaCloudException {
- DeltaCloudInstance instance = instanceRepo.getById(instanceId);
+ DeltaCloudInstance instance = getInstancesRepository().getById(instanceId);
if (instance != null) {
while (!pm.isCanceled()) {
if (stateMatcher.matchesState(instance, instance.getState())
@@ -473,7 +473,7 @@
public boolean performInstanceAction(String instanceId, DeltaCloudInstance.Action action)
throws DeltaCloudException {
- return performInstanceAction(instanceRepo.getById(instanceId), action);
+ return performInstanceAction(getInstancesRepository().getById(instanceId), action);
}
protected boolean performInstanceAction(DeltaCloudInstance instance, DeltaCloudInstance.Action action)
14 years
JBoss Tools SVN: r27802 - in trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui: marker and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2010-12-29 14:11:18 -0500 (Wed, 29 Dec 2010)
New Revision: 27802
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/SelectBeanMarkerResolution.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/AbstractModifyInjectionPointWizard.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/SelectBeanWizard.java
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/marker/CDIProblemMarkerResolutionGenerator.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/AddQualifiersToBeanComposite.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/AddQualifiersToBeanWizard.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/AddQualifiersToBeanWizardPage.java
Log:
https://issues.jboss.org/browse/JBIDE-7635
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-29 14:40:18 UTC (rev 27801)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIMessages.java 2010-12-29 19:11:18 UTC (rev 27802)
@@ -85,7 +85,7 @@
public static String DELETE_ALL_DISPOSER_DUPLICANT_MARKER_RESOLUTION_TITLE;
public static String DELETE_ALL_INJECTED_CONSTRUCTORS_MARKER_RESOLUTION_TITLE;
public static String MAKE_INJECTED_POINT_UNAMBIGUOUS_TITLE;
- public static String COLLECTING_MARKER_RESOLUTIONS;
+ public static String SELECT_BEAN_TITLE;
public static String ADD_QUALIFIERS_TO_BEAN_WIZARD_TITLE;
public static String ADD_QUALIFIERS_TO_BEAN_WIZARD_AVAILABLE;
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-29 14:40:18 UTC (rev 27801)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIMessages.properties 2010-12-29 19:11:18 UTC (rev 27802)
@@ -69,7 +69,7 @@
DELETE_ALL_DISPOSER_DUPLICANT_MARKER_RESOLUTION_TITLE=Delete @Disposes annotations from all methods except ''{0}'' method
DELETE_ALL_INJECTED_CONSTRUCTORS_MARKER_RESOLUTION_TITLE=Delete @Inject annotations from all constructors except ''{0}'' constructor
MAKE_INJECTED_POINT_UNAMBIGUOUS_TITLE=Make injected point unambiguous by specifying ''{0}'' bean
-COLLECTING_MARKER_RESOLUTIONS=Collecting CDI Marker Resolutions...
+SELECT_BEAN_TITLE=Select CDI Bean to configure the Injection Point
ADD_QUALIFIERS_TO_BEAN_WIZARD_TITLE=Add Qualifiers to the Bean
ADD_QUALIFIERS_TO_BEAN_WIZARD_AVAILABLE=Available:
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/CDIProblemMarkerResolutionGenerator.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/CDIProblemMarkerResolutionGenerator.java 2010-12-29 14:40:18 UTC (rev 27801)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/CDIProblemMarkerResolutionGenerator.java 2010-12-29 19:11:18 UTC (rev 27802)
@@ -38,8 +38,8 @@
import org.jboss.tools.cdi.core.IBean;
import org.jboss.tools.cdi.core.ICDIProject;
import org.jboss.tools.cdi.core.IInjectionPoint;
+import org.jboss.tools.cdi.internal.core.impl.CDIProject;
import org.jboss.tools.cdi.internal.core.validation.CDIValidationErrorManager;
-import org.jboss.tools.cdi.ui.CDIUIMessages;
import org.jboss.tools.cdi.ui.CDIUIPlugin;
import org.jboss.tools.common.EclipseUtil;
import org.jboss.tools.common.model.util.EclipseJavaUtil;
@@ -51,7 +51,7 @@
public class CDIProblemMarkerResolutionGenerator implements
IMarkerResolutionGenerator2 {
private static final String JAVA_EXTENSION = "java"; //$NON-NLS-1$
- IMarkerResolution[] resolutions;
+ private static final int MARKER_RESULUTION_NUMBER_LIMIT = 7;
public IMarkerResolution[] getResolutions(IMarker marker) {
try {
@@ -123,72 +123,65 @@
IInjectionPoint injectionPoint = findInjectionPoint(file, start);
if(injectionPoint != null){
List<IBean> beans = findBeans(injectionPoint);
- IMarkerResolution[] resolutions = new IMarkerResolution[beans.size()];
- for(int i = 0; i < beans.size(); i++){
- resolutions[i] = new MakeInjectedPointUnambiguousMarkerResolution(injectionPoint, beans, i);
+ if(beans.size() < MARKER_RESULUTION_NUMBER_LIMIT){
+ IMarkerResolution[] resolutions = new IMarkerResolution[beans.size()];
+ for(int i = 0; i < beans.size(); i++){
+ resolutions[i] = new MakeInjectedPointUnambiguousMarkerResolution(injectionPoint, beans, i);
+ }
+ return resolutions;
+ }else{
+ IMarkerResolution[] resolutions = new IMarkerResolution[1];
+ resolutions[0] = new SelectBeanMarkerResolution(injectionPoint, beans);
+ return resolutions;
}
- return resolutions;
}
}else if(messageId == CDIValidationErrorManager.UNSATISFIED_INJECTION_POINTS_ID){
-
- if (Display.getCurrent() != null) {
- try{
- PlatformUI.getWorkbench().getProgressService().busyCursorWhile(new IRunnableWithProgress(){
- public void run(IProgressMonitor monitor)
- throws InvocationTargetException, InterruptedException {
- monitor.beginTask(CDIUIMessages.COLLECTING_MARKER_RESOLUTIONS, 10);
- monitor.worked(3);
- resolutions = collectMarkerResolutions(file, start);
- monitor.worked(7);
- }
- });
- }catch(InterruptedException ie){
- CDIUIPlugin.getDefault().logError(ie);
- }catch(InvocationTargetException ite){
- CDIUIPlugin.getDefault().logError(ite);
- }
- } else {
- resolutions = collectMarkerResolutions(file, start);
- }
- return resolutions;
- }
- }
- return new IMarkerResolution[] {};
- }
-
- private IMarkerResolution[] collectMarkerResolutions(IFile file, int start){
- IJavaElement element = findJavaElement(file, start);
- if(element != null){
- CDICoreNature cdiNature = CDIUtil.getCDINatureWithProgress(file.getProject());
- if(cdiNature != null){
- ICDIProject cdiProject = cdiNature.getDelegate();
- if(cdiProject != null){
- Set<IBean> allBeans = cdiProject.getBeans(file.getFullPath());
+ IInjectionPoint injectionPoint = findInjectionPoint(file, start);
+ if(injectionPoint != null){
- IInjectionPoint injectionPoint = CDIUtil.findInjectionPoint(allBeans, element, start);
-
- IBean[] bs = cdiProject.getBeans();
- ArrayList<IBean> beans = new ArrayList<IBean>();
- try{
- for(IBean b : bs){
- if(Flags.isPublic(b.getBeanClass().getFlags()))
- beans.add(b);
- }
-
+ List<IBean> beans = findLegalBeans(injectionPoint);
+ if(beans.size() < MARKER_RESULUTION_NUMBER_LIMIT){
IMarkerResolution[] resolutions = new IMarkerResolution[beans.size()];
for(int i = 0; i < beans.size(); i++){
resolutions[i] = new MakeInjectedPointUnambiguousMarkerResolution(injectionPoint, beans, i);
}
return resolutions;
- }catch(CoreException ex){
- CDIUIPlugin.getDefault().logError(ex);
+ }else{
+ IMarkerResolution[] resolutions = new IMarkerResolution[1];
+ resolutions[0] = new SelectBeanMarkerResolution(injectionPoint, beans);
+ return resolutions;
}
}
}
}
- return new IMarkerResolution[]{};
+ return new IMarkerResolution[] {};
}
+ private List<IBean> findLegalBeans(IInjectionPoint injectionPoint){
+ IBean[] bs = injectionPoint.getCDIProject().getBeans();
+
+ String injectionPointTypeName = injectionPoint.getClassBean().getBeanClass().getFullyQualifiedName();
+ String injectionPointPackage = injectionPointTypeName.substring(0,injectionPointTypeName.lastIndexOf(MarkerResolutionUtils.DOT));
+
+ ArrayList<IBean> beans = new ArrayList<IBean>();
+ for(IBean bean : bs){
+ if(CDIProject.containsType(bean.getLegalTypes(), injectionPoint.getType())){
+ boolean isPublic = true;
+ try{
+ isPublic = Flags.isPublic(bean.getBeanClass().getFlags());
+ }catch(JavaModelException ex){
+ CDIUIPlugin.getDefault().logError(ex);
+ }
+ String beanTypeName = bean.getBeanClass().getFullyQualifiedName();
+ String beanPackage = beanTypeName.substring(0,beanTypeName.lastIndexOf(MarkerResolutionUtils.DOT));
+ if(isPublic || injectionPointPackage.equals(beanPackage))
+ beans.add(bean);
+ }
+ }
+ return beans;
+ }
+
+
private IInjectionPoint findInjectionPoint(IFile file, int start){
IJavaElement element = findJavaElement(file, start);
if(element == null)
Added: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/SelectBeanMarkerResolution.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/SelectBeanMarkerResolution.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/SelectBeanMarkerResolution.java 2010-12-29 19:11:18 UTC (rev 27802)
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * 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.cdi.ui.marker;
+
+import java.util.List;
+
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IMarkerResolution2;
+import org.eclipse.ui.internal.Workbench;
+import org.jboss.tools.cdi.core.IBean;
+import org.jboss.tools.cdi.core.IInjectionPoint;
+import org.jboss.tools.cdi.ui.CDIUIMessages;
+import org.jboss.tools.cdi.ui.wizard.SelectBeanWizard;
+
+/**
+ * @author Daniel Azarov
+ */
+public class SelectBeanMarkerResolution implements IMarkerResolution2 {
+ private String label;
+ private IInjectionPoint injectionPoint;
+ private List<IBean> beans;
+
+ public SelectBeanMarkerResolution(IInjectionPoint injectionPoint, List<IBean> beans){
+ this.injectionPoint = injectionPoint;
+ this.label = CDIUIMessages.SELECT_BEAN_TITLE;
+ this.beans = beans;;
+ }
+
+ public String getLabel() {
+ return label;
+ }
+
+ public void run(IMarker marker) {
+ Shell shell = Workbench.getInstance().getActiveWorkbenchWindow().getShell();
+ SelectBeanWizard wizard = new SelectBeanWizard(injectionPoint, beans);
+ WizardDialog dialog = new WizardDialog(shell, wizard);
+ int status = dialog.open();
+ if(status != WizardDialog.OK)
+ return;
+
+ }
+
+ public String getDescription() {
+ return null;
+ }
+
+ public Image getImage() {
+ return null;
+ }
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/SelectBeanMarkerResolution.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/AbstractModifyInjectionPointWizard.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/AbstractModifyInjectionPointWizard.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/AbstractModifyInjectionPointWizard.java 2010-12-29 19:11:18 UTC (rev 27802)
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * 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.cdi.ui.wizard;
+
+import java.util.List;
+
+import org.eclipse.jface.wizard.Wizard;
+import org.jboss.tools.cdi.core.IBean;
+import org.jboss.tools.cdi.core.IInjectionPoint;
+
+public abstract class AbstractModifyInjectionPointWizard extends Wizard {
+ protected IInjectionPoint injectionPoint;
+ protected List<IBean> beans;
+ protected IBean bean;
+
+ public AbstractModifyInjectionPointWizard(IInjectionPoint injectionPoint, List<IBean> beans){
+ this.injectionPoint = injectionPoint;
+ this.beans = beans;
+ }
+
+
+ public AbstractModifyInjectionPointWizard(IInjectionPoint injectionPoint, List<IBean> beans, IBean bean){
+ this.injectionPoint = injectionPoint;
+ this.beans = beans;
+ this.bean = bean;
+ }
+
+ public IInjectionPoint getInjectionPoint(){
+ return injectionPoint;
+ }
+
+ public List<IBean> getBeans(){
+ return beans;
+ }
+
+ public IBean getBean(){
+ return bean;
+ }
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/AbstractModifyInjectionPointWizard.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/AddQualifiersToBeanComposite.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/AddQualifiersToBeanComposite.java 2010-12-29 14:40:18 UTC (rev 27801)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/AddQualifiersToBeanComposite.java 2010-12-29 19:11:18 UTC (rev 27802)
@@ -59,10 +59,10 @@
private WizardPage wizard;
// original qualifiers on the bean
- private ArrayList<IQualifier> originalQualifiers;
+ private ArrayList<IQualifier> originalQualifiers = new ArrayList<IQualifier>();
// qualifiers available to be added to the bean
- private ArrayList<IQualifier> qualifiers;
+ private ArrayList<IQualifier> qualifiers = new ArrayList<IQualifier>();
// current qualifiers on the bean
private ArrayList<IQualifier> deployed = new ArrayList<IQualifier>();
@@ -75,21 +75,35 @@
private Button add, addAll;
private Button remove, removeAll;
+
+ private Label nLabel;
protected boolean isComplete = true;
public AddQualifiersToBeanComposite(Composite parent, WizardPage wizard) {
super(parent, SWT.NONE);
this.wizard = wizard;
- this.injectionPoint = ((AddQualifiersToBeanWizard)wizard.getWizard()).getInjectionPoint();
- this.bean = ((AddQualifiersToBeanWizard)wizard.getWizard()).getBean();
- this.beans = ((AddQualifiersToBeanWizard)wizard.getWizard()).getBeans();
+ this.injectionPoint = ((AbstractModifyInjectionPointWizard)wizard.getWizard()).getInjectionPoint();
+ this.bean = ((AbstractModifyInjectionPointWizard)wizard.getWizard()).getBean();
+ this.beans = ((AbstractModifyInjectionPointWizard)wizard.getWizard()).getBeans();
+ createControl();
+ if(bean != null)
+ init(bean);
+ }
+
+ public void init(IBean bean){
+ this.bean = bean;
originalQualifiers = new ArrayList<IQualifier>(bean.getQualifiers());
+ deployedListViewer.setInput(originalQualifiers);
+ qualifiers.clear();
+
loadAvailableQualifiers();
-
- createControl();
+ if(nLabel != null)
+ nLabel.setText(MessageFormat.format(CDIUIMessages.ADD_QUALIFIERS_TO_BEAN_WIZARD_MESSAGE,
+ new Object[]{bean.getBeanClass().getElementName()}));
+ refresh();
}
private void loadAvailableQualifiers(){
@@ -118,6 +132,7 @@
qualifiers.add(q);
}
}
+ availableListViewer.setInput(qualifiers);
}
@@ -196,14 +211,15 @@
}
});
- Label label = new Label(this, SWT.NONE);
+ nLabel = new Label(this, SWT.NONE);
GridData data = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING);
data.horizontalSpan = 3;
- label.setLayoutData(data);
- label.setText(MessageFormat.format(CDIUIMessages.ADD_QUALIFIERS_TO_BEAN_WIZARD_MESSAGE,
+ nLabel.setLayoutData(data);
+ if(bean != null)
+ nLabel.setText(MessageFormat.format(CDIUIMessages.ADD_QUALIFIERS_TO_BEAN_WIZARD_MESSAGE,
new Object[]{bean.getBeanClass().getElementName()}));
- label = new Label(this, SWT.NONE);
+ Label label = new Label(this, SWT.NONE);
label.setText(CDIUIMessages.ADD_QUALIFIERS_TO_BEAN_WIZARD_AVAILABLE);
label = new Label(this, SWT.NONE);
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/AddQualifiersToBeanWizard.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/AddQualifiersToBeanWizard.java 2010-12-29 14:40:18 UTC (rev 27801)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/AddQualifiersToBeanWizard.java 2010-12-29 19:11:18 UTC (rev 27802)
@@ -12,23 +12,17 @@
import java.util.List;
-import org.eclipse.jface.wizard.Wizard;
import org.jboss.tools.cdi.core.IBean;
import org.jboss.tools.cdi.core.IInjectionPoint;
import org.jboss.tools.cdi.core.IQualifier;
import org.jboss.tools.cdi.ui.CDIUIMessages;
import org.jboss.tools.common.model.ui.ModelUIImages;
-public class AddQualifiersToBeanWizard extends Wizard{
- private IInjectionPoint injectionPoint;
- private List<IBean> beans;
- private IBean bean;
+public class AddQualifiersToBeanWizard extends AbstractModifyInjectionPointWizard{
private AddQualifiersToBeanWizardPage page;
public AddQualifiersToBeanWizard(IInjectionPoint injectionPoint, List<IBean> beans, IBean bean){
- this.injectionPoint = injectionPoint;
- this.beans = beans;
- this.bean = bean;
+ super(injectionPoint, beans, bean);
setWindowTitle(CDIUIMessages.ADD_QUALIFIERS_TO_BEAN_WIZARD_TITLE);
setDefaultPageImageDescriptor(ModelUIImages.getImageDescriptor(ModelUIImages.WIZARD_DEFAULT));
@@ -48,15 +42,4 @@
return page.getDeployedQualifiers();
}
- public IInjectionPoint getInjectionPoint(){
- return injectionPoint;
- }
-
- public List<IBean> getBeans(){
- return beans;
- }
-
- public IBean getBean(){
- return bean;
- }
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/AddQualifiersToBeanWizardPage.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/AddQualifiersToBeanWizardPage.java 2010-12-29 14:40:18 UTC (rev 27801)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/AddQualifiersToBeanWizardPage.java 2010-12-29 19:11:18 UTC (rev 27802)
@@ -10,11 +10,11 @@
******************************************************************************/
package org.jboss.tools.cdi.ui.wizard;
-import java.text.MessageFormat;
import java.util.ArrayList;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.widgets.Composite;
+import org.jboss.tools.cdi.core.IBean;
import org.jboss.tools.cdi.core.IQualifier;
import org.jboss.tools.cdi.ui.CDIUIMessages;
@@ -36,4 +36,8 @@
return composite.getDeployedQualifiers();
}
+ public void init(IBean bean){
+ composite.init(bean);
+ }
+
}
Added: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/SelectBeanWizard.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/SelectBeanWizard.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/SelectBeanWizard.java 2010-12-29 19:11:18 UTC (rev 27802)
@@ -0,0 +1,192 @@
+/*******************************************************************************
+ * 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.cdi.ui.wizard;
+
+import java.util.ArrayList;
+import java.util.Set;
+
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.IContentProvider;
+import org.eclipse.jface.viewers.IDoubleClickListener;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ListViewer;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerComparator;
+import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.List;
+import org.jboss.tools.cdi.core.IBean;
+import org.jboss.tools.cdi.core.IInjectionPoint;
+import org.jboss.tools.cdi.core.IQualifier;
+import org.jboss.tools.cdi.ui.CDIUIMessages;
+import org.jboss.tools.cdi.ui.marker.MarkerResolutionUtils;
+import org.jboss.tools.common.model.ui.ModelUIImages;
+
+public class SelectBeanWizard extends AbstractModifyInjectionPointWizard{
+ private AddQualifiersToBeanWizardPage page;
+
+ public SelectBeanWizard(IInjectionPoint injectionPoint, java.util.List<IBean> beans){
+ super(injectionPoint, beans);
+ setWindowTitle(CDIUIMessages.SELECT_BEAN_TITLE);
+
+ setDefaultPageImageDescriptor(ModelUIImages.getImageDescriptor(ModelUIImages.WIZARD_DEFAULT));
+ }
+
+ public void addPages() {
+ addPage(new SelectBeanWizardPage(""));
+ page = new AddQualifiersToBeanWizardPage("");
+ addPage(page);
+ }
+ public java.util.List<IQualifier> getDeployedQualifiers(){
+ return page.getDeployedQualifiers();
+ }
+
+ @Override
+ public boolean performFinish() {
+ return true;
+ }
+
+ class SelectBeanWizardPage extends WizardPage{
+ ListViewer listViewer;
+ protected SelectBeanWizardPage(String pageName) {
+ super(pageName);
+ setTitle(CDIUIMessages.SELECT_BEAN_TITLE);
+ setPageComplete(false);
+ }
+
+ public void createControl(Composite parent) {
+ Composite composite = new Composite(parent, SWT.NONE);
+ GridLayout layout = new GridLayout();
+ layout.horizontalSpacing = 4;
+ layout.verticalSpacing = 10;
+ layout.numColumns = 1;
+ composite.setLayout(layout);
+ composite.setFont(composite.getParent().getFont());
+
+ Label label = new Label(composite, SWT.NONE);
+ label.setText("Select CDI Bean:");
+
+ List availableList = new List(composite, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
+ GridData data = new GridData(GridData.FILL_BOTH);
+ data.heightHint = 200;
+ data.widthHint = 150;
+ availableList.setLayoutData(data);
+
+ listViewer = new ListViewer(availableList);
+ ILabelProvider labelProvider = new BeanListLabelProvider();
+ listViewer.setLabelProvider(labelProvider);
+ IContentProvider contentProvider = new BeanListContentProvider();
+ listViewer.setContentProvider(contentProvider);
+ listViewer.setComparator(new ViewerComparator() {
+ public int compare(Viewer viewer, Object o1, Object o2) {
+ if (o1 instanceof IBean && o2 instanceof IBean) {
+ IBean b1 = (IBean) o1;
+ IBean b2 = (IBean) o2;
+ return (b1.getBeanClass().getElementName().compareToIgnoreCase(b2.getBeanClass().getElementName()));
+ }
+
+ return super.compare(viewer, o1, o2);
+ }
+ });
+ listViewer.setInput(beans);
+
+ listViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ bean = getSelection();
+ if(bean != null){
+ setPageComplete(true);
+ IWizardPage next = getNextPage();
+ if(next instanceof AddQualifiersToBeanWizardPage)
+ ((AddQualifiersToBeanWizardPage)next).init(bean);
+ }else
+ setPageComplete(false);
+ }
+ });
+ listViewer.addDoubleClickListener(new IDoubleClickListener() {
+ public void doubleClick(DoubleClickEvent event) {
+ }
+ });
+
+ setControl(composite);
+ }
+
+ protected IBean getSelection() {
+ IStructuredSelection sel = (IStructuredSelection) listViewer.getSelection();
+ if (sel.isEmpty())
+ return null;
+
+ return (IBean)sel.getFirstElement();
+ }
+
+
+ }
+
+ class BeanListLabelProvider implements ILabelProvider{
+
+ public void addListener(ILabelProviderListener listener) {
+ }
+
+ public void dispose() {
+ }
+
+ public boolean isLabelProperty(Object element, String property) {
+ return false;
+ }
+
+ public void removeListener(ILabelProviderListener listener) {
+ }
+
+ public Image getImage(Object element) {
+ return null;
+ }
+
+ public String getText(Object element) {
+ if(element instanceof IBean){
+ IBean bean = (IBean)element;
+ String beanTypeName = bean.getBeanClass().getFullyQualifiedName();
+ String beanPackage = beanTypeName.substring(0,beanTypeName.lastIndexOf(MarkerResolutionUtils.DOT));
+ String name = bean.getBeanClass().getElementName();
+
+ return name+" - "+beanPackage;
+ }
+ return "";
+ }
+
+ }
+
+ class BeanListContentProvider implements IStructuredContentProvider{
+
+ public void dispose() {
+ }
+
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ }
+
+ public Object[] getElements(Object inputElement) {
+ if(inputElement instanceof ArrayList){
+ return ((ArrayList)inputElement).toArray();
+ }
+ return new Object[]{};
+ }
+
+ }
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/SelectBeanWizard.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
14 years
JBoss Tools SVN: r27801 - in trunk/deltacloud/plugins: org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-12-29 09:40:18 -0500 (Wed, 29 Dec 2010)
New Revision: 27801
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudManager.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudPasswordStorageKey.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/DeltaCloudClientImpl.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/HardwareProfile.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/Realm.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/Deltacloud Tools.launch
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloud/DeltaCloudViewItem.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionPage.java
Log:
removed JAXB for unmarshalling HardwareProfiles and Realms
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudManager.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudManager.java 2010-12-29 14:31:43 UTC (rev 27800)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudManager.java 2010-12-29 14:40:18 UTC (rev 27801)
@@ -15,6 +15,8 @@
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.List;
@@ -36,6 +38,8 @@
*/
public class DeltaCloudManager {
+ private static final String USERNAME_ENCODING = "UTF8";
+
private static final DeltaCloudManager INSTANCE = new DeltaCloudManager();
public final static String CLOUDFILE_NAME = "clouds.xml"; //$NON-NLS-1$
@@ -83,7 +87,7 @@
NamedNodeMap attrs = n.getAttributes();
name = attrs.getNamedItem("name").getNodeValue(); // $NON-NLS-1$
String url = attrs.getNamedItem("url").getNodeValue(); // $NON-NLS-1$
- String username = attrs.getNamedItem("username").getNodeValue(); // $NON-NLS-1$
+ String username = URLEncoder.encode(attrs.getNamedItem("username").getNodeValue(), USERNAME_ENCODING); // $NON-NLS-1$
Driver driver = Driver.checkedValueOf(attrs.getNamedItem("type").getNodeValue()); // $NON-NLS-1$
String imageFilterRules = getImageFilterRules(attrs.getNamedItem("imagefilter")); // $NON-NLS-1$
String instanceFilterRules = getInstanceFilterRules(attrs.getNamedItem("instancefilter")); // $NON-NLS-1$
@@ -145,9 +149,11 @@
}
}
- private String createCloudXML(DeltaCloud d) {
- return "<cloud name=\"" + d.getName() + "\" url=\"" //$NON-NLS-1$ //$NON-NLS-2$
- + d.getURL() + "\" username=\"" + d.getUsername() + //$NON-NLS-1$ //$NON-NLS-2$
+ private String createCloudXML(DeltaCloud d) throws UnsupportedEncodingException {
+ String username = URLEncoder.encode(d.getUsername(), USERNAME_ENCODING);
+ return "<cloud name=\"" + d.getName() + //$NON-NLS-1$
+ "\" url=\"" + d.getURL() + //$NON-NLS-2$
+ "\" username=\"" + username + //$NON-NLS-1$ //$NON-NLS-2$
"\" type=\"" + d.getDriver() + //$NON-NLS-1$ //$NON-NLS-2$
"\" imagefilter=\"" + d.getImageFilter() + //$NON-NLS-1$ //$NON-NLS-2$
"\" instancefilter=\"" + d.getInstanceFilter() + //$NON-NLS-1$ //$NON-NLS-2$
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudPasswordStorageKey.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudPasswordStorageKey.java 2010-12-29 14:31:43 UTC (rev 27800)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudPasswordStorageKey.java 2010-12-29 14:40:18 UTC (rev 27801)
@@ -26,8 +26,8 @@
private String userName;
public DeltaCloudPasswordStorageKey(String cloudName, String userName) {
- this.userName = userName;
- this.cloudName = cloudName;
+ this.userName = EncodingUtils.encodeBase64(userName.getBytes());
+ this.cloudName = EncodingUtils.encodeBase64(cloudName.getBytes());
}
@Override
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/DeltaCloudClientImpl.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/DeltaCloudClientImpl.java 2010-12-29 14:31:43 UTC (rev 27800)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/DeltaCloudClientImpl.java 2010-12-29 14:40:18 UTC (rev 27801)
@@ -44,6 +44,8 @@
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpUriRequest;
import org.apache.http.impl.client.DefaultHttpClient;
+import org.eclipse.core.runtime.Assert;
+import org.jboss.tools.deltacloud.core.DeltaCloudHardwareProperty.Kind;
import org.jboss.tools.deltacloud.core.client.request.AbstractListObjectsRequest;
import org.jboss.tools.deltacloud.core.client.request.CreateInstanceRequest;
import org.jboss.tools.deltacloud.core.client.request.CreateKeyRequest;
@@ -64,6 +66,7 @@
import org.jboss.tools.deltacloud.core.client.unmarshal.KeyUnmarshaller;
import org.jboss.tools.deltacloud.core.client.unmarshal.KeysUnmarshaller;
import org.w3c.dom.Document;
+import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
@@ -239,8 +242,7 @@
StringBuilder sb = new StringBuilder();
String line = null;
- BufferedReader reader = new BufferedReader(
- new InputStreamReader(is, "UTF-8"));
+ BufferedReader reader = new BufferedReader(new InputStreamReader(is, "UTF-8"));
while ((line = reader.readLine()) != null) {
sb.append(line).append("\n");
}
@@ -335,10 +337,90 @@
@Override
public List<HardwareProfile> listProfiles() throws DeltaCloudClientException {
- return listDeltaCloudObjects(HardwareProfile.class,
- new ListHardwareProfilesRequest(baseUrl), "hardware_profile");
+ try {
+ return buildProfiles(request(new ListHardwareProfilesRequest(baseUrl)));
+ } catch (Exception e) {
+ throw new DeltaCloudClientException(MessageFormat.format("could not get realms on cloud at \"{0}\"",
+ baseUrl), e);
+ }
}
+ private List<HardwareProfile> buildProfiles(InputStream inputStream)
+ throws ParserConfigurationException, SAXException, IOException, DeltaCloudClientException {
+ Document document = getDocument(getResponse(inputStream));
+ List<HardwareProfile> profiles = new ArrayList<HardwareProfile>();
+ NodeList elements = document.getElementsByTagName("hardware_profile");
+ for (int i = 0; i < elements.getLength(); i++) {
+ HardwareProfile profile = createProfile(elements.item(i));
+ profiles.add(profile);
+ }
+ return profiles;
+ }
+
+ private HardwareProfile createProfile(Node node) {
+ Assert.isLegal(node instanceof Element);
+ Element element = (Element) node;
+ HardwareProfile profile = new HardwareProfile();
+ profile.setId(element.getAttribute("id"));
+ profile.setProperties(createProperties(element.getElementsByTagName("property")));
+ return profile;
+ }
+
+ private List<Property> createProperties(NodeList propertiesList) {
+ List<Property> properties = new ArrayList<Property>();
+ for (int i = 0; i < propertiesList.getLength(); i++) {
+ Property property = createProperty(propertiesList.item(i));
+ properties.add(property);
+ }
+ return properties;
+ }
+
+ private Property createProperty(Node node) {
+ Assert.isTrue(node instanceof Element);
+ Element element = (Element) node;
+ Property property = new Property();
+ property.setName(element.getAttribute("name"));
+ property.setId(element.getAttribute("id"));
+ property.setUnit(element.getAttribute("unit"));
+ property.setValue(element.getAttribute("value"));
+ String kind = element.getAttribute("kind");
+ Assert.isTrue(kind != null);
+ kind = kind.toUpperCase();
+ property.setKind(kind);
+ if (Kind.RANGE.toString().equals(property.getKind())) {
+ setRange(element, property);
+ }
+ else if (Kind.ENUM.toString().equals(property.getKind())) {
+ setEnum(element, property);
+ }
+ else if (Kind.FIXED.toString().equals(property.getKind())) {
+ // no special treatement
+ }
+ return property;
+ }
+
+ private void setRange(Element propertyElement, Property property) {
+ Node node = propertyElement.getElementsByTagName("range").item(0);
+ Assert.isLegal(node instanceof Element);
+ Element rangeElement = (Element) node;
+ property.setRange(rangeElement.getAttribute("first"), rangeElement.getAttribute("last"));
+ }
+
+ private void setEnum(Element propertyElement, Property property) {
+ Node node = propertyElement.getElementsByTagName("enum").item(0);
+ Assert.isLegal(node instanceof Element);
+ Element enumElement = (Element) node;
+ NodeList nodeList = enumElement.getElementsByTagName("entry");
+ ArrayList<String> enumValues = new ArrayList<String>();
+ for (int i = 0; i< nodeList.getLength(); i++) {
+ Node entryNode = nodeList.item(i);
+ Assert.isTrue(entryNode instanceof Element);
+ Element entryElement = (Element) entryNode;
+ enumValues.add(entryElement.getAttribute("value"));
+ }
+ property.setEnums(enumValues);
+ }
+
@Override
public List<Image> listImages() throws DeltaCloudClientException {
return listDeltaCloudObjects(Image.class,
@@ -359,10 +441,7 @@
}
@Override
- public Instance listInstances(String instanceId)
- throws DeltaCloudClientException {
- // return JAXB.unmarshal(new StringReader(request(new
- // ListInstanceRequest(baseUrl, instanceId))), Instance.class);
+ public Instance listInstances(String instanceId) throws DeltaCloudClientException {
try {
return buildInstance(requestStringResponse(new ListInstanceRequest(baseUrl, instanceId)));
} catch (DeltaCloudClientException e) {
@@ -374,14 +453,51 @@
@Override
public List<Realm> listRealms() throws DeltaCloudClientException {
- return listDeltaCloudObjects(Realm.class, new ListRealmsRequest(baseUrl), "realm");
+ try {
+ return buildRealms(request(new ListRealmsRequest(baseUrl)));
+ } catch (Exception e) {
+ throw new DeltaCloudClientException(MessageFormat.format("could not get realms on cloud at \"{0}\"",
+ baseUrl), e);
+ }
}
+ private List<Realm> buildRealms(InputStream inputStream)
+ throws ParserConfigurationException, SAXException, IOException, DeltaCloudClientException {
+ Document document = getDocument(getResponse(inputStream));
+ List<Realm> realms = new ArrayList<Realm>();
+ NodeList elements = document.getElementsByTagName("realms");
+ for (int i = 0; i < elements.getLength(); i++) {
+ Realm realm = createRealm((Element) elements.item(i));
+ realms.add(realm);
+ }
+ return realms;
+ }
+
+ private Realm createRealm(Node node) {
+ Assert.isLegal(node instanceof Element);
+ Realm realm = new Realm();
+ updateRealm(realm, (Element) node);
+ return realm;
+ }
+
+ private Realm updateRealm(Realm realm, Element element) {
+ realm.setId(element.getAttribute("id"));
+ realm.setName(element.getElementsByTagName("name").item(0).getTextContent());
+ realm.setLimit(element.getElementsByTagName("limit").item(0).getTextContent());
+ realm.setState(element.getElementsByTagName("state").item(0).getTextContent());
+
+ return realm;
+ }
+
@Override
public Realm listRealms(String realmId) throws DeltaCloudClientException {
- return JAXB.unmarshal(new StringReader(
- requestStringResponse(new ListRealmRequest(baseUrl, realmId))),
- Realm.class);
+ try {
+ Document document = getDocument(getResponse(request(new ListRealmRequest(baseUrl, realmId))));
+ return createRealm((Element) document.getElementsByTagName("realm").item(0));
+ } catch (Exception e) {
+ throw new DeltaCloudClientException(
+ MessageFormat.format("could not get realms on cloud at \"{0}\"", baseUrl), e);
+ }
}
public Key createKey(String keyname) throws DeltaCloudClientException {
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/HardwareProfile.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/HardwareProfile.java 2010-12-29 14:31:43 UTC (rev 27800)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/HardwareProfile.java 2010-12-29 14:40:18 UTC (rev 27801)
@@ -22,10 +22,14 @@
private List<Property> properties;
- private HardwareProfile()
+ protected HardwareProfile()
{
}
+ protected void setProperties(List<Property> properties) {
+ this.properties = properties;
+ }
+
public List<Property> getProperties() {
if (properties == null)
properties = new ArrayList<Property>();
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/Realm.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/Realm.java 2010-12-29 14:31:43 UTC (rev 27800)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/Realm.java 2010-12-29 14:40:18 UTC (rev 27801)
@@ -15,36 +15,30 @@
/**
* @author Martyn Taylor
*/
-public class Realm extends AbstractDeltaCloudObject
-{
+public class Realm extends AbstractDeltaCloudObject {
private static final long serialVersionUID = 1L;
public static enum RealmState {
AVAILABLE, UNAVAILABLE, UNKNOWN
}
-
+
@XmlElement
private String name;
-
+
@XmlElement
private RealmState state;
-
+
@XmlElement
private int limit;
-
- private Realm()
- {
+
+ protected Realm() {
}
- @SuppressWarnings("unused")
- private void setName(String name)
- {
+ protected void setName(String name) {
this.name = name;
}
- @SuppressWarnings("unused")
- private void setState(String state)
- {
+ protected void setState(String state) {
try {
this.state = RealmState.valueOf(state);
} catch (Exception e) {
@@ -52,38 +46,39 @@
}
}
- @SuppressWarnings("unused")
- private void setLimit(int limit)
- {
+ protected void setLimit(int limit) {
this.limit = limit;
}
- public static long getSerialversionuid()
- {
+ protected void setLimit(String limit) {
+ try {
+ this.limit = Integer.parseInt(limit);
+ } catch (Exception e) {
+ this.limit = -1;
+ }
+ }
+
+ public static long getSerialversionuid() {
return serialVersionUID;
}
- public String getName()
- {
+ public String getName() {
return name;
}
- public RealmState getState()
- {
+ public RealmState getState() {
return state;
}
-
- public int getLimit()
- {
+
+ public int getLimit() {
return limit;
}
-
+
@Override
- public String toString()
- {
+ public String toString() {
String s = "";
s += "Realm:\t\t" + getId() + "\n";
- s += "Name\t\t" + getName()+ "\n";
+ s += "Name\t\t" + getName() + "\n";
s += "State:\t\t" + getState() + "\n";
s += "Limit:\t\t" + getLimit() + "\n";
return s;
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/Deltacloud Tools.launch
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/Deltacloud Tools.launch 2010-12-29 14:31:43 UTC (rev 27800)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/Deltacloud Tools.launch 2010-12-29 14:40:18 UTC (rev 27801)
@@ -23,8 +23,8 @@
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dosgi.requiredJavaVersion=1.5 -XX:MaxPermSize=256m -Xms40m -Xmx1024m"/>
<stringAttribute key="pde.version" value="3.3"/>
<stringAttribute key="product" value="org.eclipse.sdk.ide"/>
-<stringAttribute key="selected_target_plugins" value="javax.xml@default:default,org.eclipse.jdt.core.manipulation@default:default,org.eclipse.jst.common.project.facet.core@default:default,org.eclipse.jst.j2ee.ejb.annotation.model@default:default,org.eclipse.jst.common.annotations.controller@default:default,org.eclipse.equinox.http.jetty@default:default,org.eclipse.jdt.debug@default:default,org.eclipse.jface@default:default,org.eclipse.debug.core@default:default,org.eclipse.jst.common.ui@default:default,org.eclipse.core.runtime.compatibility@default:default,org.eclipse.jdt.compiler.tool@default:false,org.eclipse.wst.common.frameworks.ui@default:default,org.eclipse.jem.util@default:default,org.eclipse.pde.core@default:default,org.eclipse.jst.server.ui@default:default,org.eclipse.wst.common.uriresolver@default:default,org.eclipse.equinox.p2.jarprocessor@default:default,org.eclipse.jst.j2ee.jca@default:default,org.eclipse.wst.server.ui@default:default,org.eclipse.ecf.filetransf!
er@default:default,org.eclipse.rse.files.ui@default:default,org.eclipse.update.configurator@3:true,org.eclipse.jface.databinding@default:default,org.eclipse.wst.sse.ui@default:default,org.eclipse.help@default:default,org.eclipse.wst.sse.core@default:default,org.eclipse.wst.common.emf@default:default,org.apache.xml.serializer@default:default,org.eclipse.search@default:default,org.eclipse.equinox.simpleconfigurator@default:default,org.eclipse.wst.html.ui@default:default,org.eclipse.ltk.ui.refactoring@default:default,org.eclipse.core.expressions@default:default,org.eclipse.tm.terminal.view@default:default,org.eclipse.jst.common.annotations.core@default:default,org.eclipse.rse.services@default:default,org.eclipse.core.filesystem@default:default,org.eclipse.equinox.frameworkadmin.equinox@default:default,org.eclipse.wst.server.core@default:default,org.eclipse.wst.common.environment@default:default,org.eclipse.ui.cheatsheets@default:default,org.eclipse.equinox.concurrent@default:d!
efault,org.eclipse.rse.subsystems.files.core@default:default,o!
rg.eclip
se.swtbot.ant.optional.junit4@default:false,org.eclipse.equinox.p2.director@default:default,org.apache.lucene@default:default,org.eclipse.swt@default:default,org.apache.commons.codec*1.3.0.v20100518-1140@default:default,org.mortbay.jetty.util@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.equinox.http.servlet@default:default,org.junit4@default:default,org.eclipse.core.databinding@default:default,org.eclipse.tm.terminal.ssh@default:default,org.eclipse.jface.text@default:default,org.eclipse.help.base@default:default,org.eclipse.emf.common.ui@default:default,org.eclipse.emf.common@default:default,org.sat4j.pb@default:default,org.eclipse.equinox.security@default:default,org.hamcrest.core@default:default,org.eclipse.equinox.common@2:true,org.eclipse.text@default:default,org.eclipse.jem@default:default,org.eclipse.emf.codegen@default:default,org.eclipse.osgi.util@default:default,org.eclipse.equinox.p2.director.app@default:default,org.eclipse.osgi@-1:true,!
org.eclipse.core.databinding.beans@default:default,org.eclipse.team.core@default:default,org.eclipse.wst.html.core@default:default,org.eclipse.wst.css.ui@default:default,org.eclipse.wst.common.frameworks@default:default,org.eclipse.jdt.debug.ui@default:default,org.eclipse.ui.console@default:default,org.eclipse.jst.jee.ui@default:default,org.eclipse.equinox.p2.ui@default:default,org.eclipse.rse.core@default:default,org.sat4j.core@default:default,org.eclipse.jdt.launching@default:default,org.eclipse.jdt.core@default:default,org.eclipse.jst.j2ee.navigator.ui@default:default,org.eclipse.jdt@default:default,org.eclipse.core.jobs@default:default,org.eclipse.help.ui@default:default,org.eclipse.core.commands@default:default,org.eclipse.jdt.junit.runtime@default:default,org.eclipse.ui.views.properties.tabbed@default:default,org.eclipse.swt.gtk.linux.x86_64@default:false,org.eclipse.pde.build@default:default,org.eclipse.equinox.p2.operations@default:default,org.eclipse.wst.server.ui.!
doc.user@default:default,org.eclipse.wst.web@default:default,o!
rg.apach
e.xerces@default:default,org.eclipse.equinox.p2.repository@default:default,org.eclipse.core.runtime.compatibility.registry@default:false,org.eclipse.wst.common.core@default:default,org.eclipse.ui.workbench.texteditor@default:default,org.eclipse.ecf.provider.filetransfer.ssl@default:false,org.eclipse.emf.ecore.change@default:default,org.eclipse.wst.jsdt.ui@default:default,org.eclipse.jdt.junit@default:default,org.eclipse.jst.j2ee@default:default,org.eclipse.ui.intro@default:default,org.eclipse.jst.j2ee.jca.ui@default:default,org.eclipse.compare.core@default:default,org.apache.jasper@default:default,org.eclipse.equinox.p2.engine@default:default,org.eclipse.emf.edit.ui@default:default,org.eclipse.wst.common.modulecore@default:default,org.eclipse.wst.xml.core@default:default,org.eclipse.equinox.preferences@default:default,org.eclipse.jst.server.core@default:default,org.apache.commons.el@default:default,org.eclipse.equinox.p2.core@default:default,org.mortbay.jetty.server@default:!
default,org.eclipse.ltk.core.refactoring@default:default,org.eclipse.wst.validation@default:default,org.eclipse.compare@default:default,org.apache.xml.resolver@default:default,org.eclipse.equinox.p2.metadata.repository@default:default,org.eclipse.ecf.ssl@default:false,org.eclipse.ecf.provider.filetransfer@default:default,com.jcraft.jsch@default:default,org.eclipse.core.filesystem.linux.x86_64@default:false,org.eclipse.core.net@default:default,org.eclipse.core.variables@default:default,org.eclipse.core.databinding.observable@default:default,org.eclipse.ecf.identity@default:default,org.eclipse.ui.navigator.resources@default:default,org.eclipse.jst.common.frameworks@default:default,org.eclipse.rse.services.local@default:default,org.eclipse.swtbot.ant.optional.junit3@default:false,javax.servlet@default:default,org.eclipse.debug.ui@default:default,org.eclipse.ui.workbench@default:default,org.eclipse.tm.terminal.telnet@default:default,org.eclipse.jst.j2ee.ejb@default:default,org.!
eclipse.rse.services.files.ftp@default:default,org.eclipse.wst!
.common.
project.facet.ui@default:default,org.apache.commons.logging*1.0.4.v201005080501@default:default,org.eclipse.equinox.security.ui@default:default,org.eclipse.rse.subsystems.shells.core@default:default,org.eclipse.ui.ide@default:default,org.eclipse.core.resources@default:default,org.eclipse.ui.navigator@default:default,org.eclipse.rse.services.ssh@default:default,com.ibm.icu@default:default,org.eclipse.emf.ecore.xmi@default:default,org.eclipse.jsch.core@default:default,org.eclipse.core.databinding.property@default:default,org.eclipse.core.filebuffers@default:default,org.eclipse.core.net.linux.x86_64@default:false,org.eclipse.emf.ecore@default:default,org.eclipse.ecf@default:default,org.eclipse.equinox.p2.metadata@default:default,org.eclipse.ant.core@default:default,org.apache.lucene.analysis@default:default,org.eclipse.wst.internet.monitor.core@default:default,org.eclipse.jdt.ui@default:default,org.eclipse.equinox.p2.repository.tools@default:default,org.eclipse.ui.views@default!
:default,org.eclipse.sdk@default:default,org.eclipse.wst.server.discovery@default:default,org.eclipse.update.core@default:default,org.eclipse.equinox.p2.garbagecollector@default:default,org.eclipse.jst.common.project.facet.ui@default:default,org.eclipse.emf.ecore.edit@default:default,org.eclipse.equinox.frameworkadmin@default:default,org.eclipse.equinox.p2.artifact.repository@default:default,org.eclipse.ui.browser@default:default,org.eclipse.jst.j2ee.ui@default:default,org.eclipse.jdt.compiler.apt@default:false,org.eclipse.wst.common.emfworkbench.integration@default:default,org.eclipse.jst.j2ee.core@default:default,org.eclipse.jst.servlet.ui@default:default,org.eclipse.jem.proxy@default:default,org.eclipse.wst.css.core@default:default,org.apache.commons.httpclient*3.1.0.v201005080502@default:default,org.eclipse.tm.terminal@default:default,org.eclipse.team.ui@default:default,org.eclipse.equinox.app@default:default,org.eclipse.core.runtime@default:true,org.eclipse.equinox.p2.!
updatesite@default:default,org.eclipse.jst.jee@default:default!
,org.ecl
ipse.ui@default:default,org.eclipse.wst.common.project.facet.core@default:default,org.eclipse.ui.views.log@default:default,org.eclipse.wst.common.modulecore.ui@default:default,org.eclipse.ui.editors@default:default,org.eclipse.jem.workbench@default:default,org.eclipse.wst.jsdt.core@default:default,org.eclipse.equinox.simpleconfigurator.manipulator@default:default,org.eclipse.wst.jsdt.manipulation@default:default,org.eclipse.rse.ui@default:default,javax.servlet.jsp@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.jst.j2ee.web@default:default,org.eclipse.ui.forms@default:default,org.eclipse.wst.xml.ui@default:default,org.eclipse.equinox.p2.touchpoint.eclipse@default:default,org.eclipse.emf.edit@default:default,org.eclipse.osgi.services@default:default,org.apache.ant@default:default,org.eclipse.wst.web.ui@default:default,org.apache.commons.net@default:default,org.eclipse.wst.common.ui@default:default,org.junit*4.8.1.v4_8_1_v20100427-1100@default:default,!
org.eclipse.ui.ide.application@default:default,org.eclipse.core.runtime.compatibility.auth@default:default,org.eclipse.equinox.p2.publisher@default:default,org.eclipse.jdt.junit.core@default:default"/>
-<stringAttribute key="selected_workspace_plugins" value="org.jboss.tools.deltacloud.integration@default:default,org.jboss.tools.jmx.ui@default:default,org.jboss.ide.eclipse.archives.ui@default:default,org.jboss.tools.common@default:default,org.jboss.tools.jmx.core@default:default,org.jboss.ide.eclipse.as.wtp.ui@default:default,org.jboss.tools.deltacloud.ui@default:default,org.jboss.ide.eclipse.as.wtp.core@default:default,org.jboss.ide.eclipse.as.core@default:default,org.jboss.ide.eclipse.archives.core@default:default,org.jboss.ide.eclipse.as.ui@default:default,org.jboss.ide.eclipse.as.rse.core@default:default,org.jboss.tools.usage@default:default,org.jboss.ide.eclipse.archives.webtools@default:default,org.jboss.tools.deltacloud.core@default:default"/>
+<stringAttribute key="selected_target_plugins" value="org.eclipse.pde.core@default:default,org.eclipse.equinox.p2.engine@default:default,org.eclipse.jdt.compiler.apt@default:false,org.eclipse.wst.common.emfworkbench.integration@default:default,org.eclipse.rse.subsystems.files.ssh@default:default,org.eclipse.wst.common.emf@default:default,org.eclipse.swtbot.ant.optional.junit3@default:false,org.eclipse.jdt.ui@default:default,org.eclipse.jst.common.ui@default:default,org.eclipse.ui.cheatsheets@default:default,org.eclipse.tm.terminal.ssh@default:default,org.eclipse.ui.intro@default:default,org.eclipse.ui.views@default:default,org.eclipse.ui.views.properties.tabbed@default:default,org.eclipse.search@default:default,org.eclipse.ui.browser@default:default,org.mortbay.jetty.server@default:default,org.eclipse.jst.common.project.facet.core@default:default,org.eclipse.equinox.preferences@default:default,org.eclipse.ecf.filetransfer@default:default,org.eclipse.jst.common.project.facet!
.ui@default:default,org.eclipse.ecf.identity@default:default,org.eclipse.core.resources@default:default,org.eclipse.osgi.util@default:default,org.apache.commons.httpclient*3.1.0.v201005080502@default:default,org.junit4@default:default,org.eclipse.core.net.linux.x86_64@default:false,org.mortbay.jetty.util@default:default,org.eclipse.emf.common.ui@default:default,org.eclipse.wst.server.ui@default:default,org.apache.lucene.analysis@default:default,org.eclipse.team.core@default:default,org.sat4j.pb@default:default,org.eclipse.emf.ecore@default:default,org.eclipse.jdt.compiler.tool@default:false,org.eclipse.core.variables@default:default,org.eclipse.equinox.frameworkadmin.equinox@default:default,org.eclipse.text@default:default,org.apache.commons.el@default:default,org.eclipse.ecf@default:default,org.apache.commons.net@default:default,org.eclipse.equinox.concurrent@default:default,org.eclipse.jdt.debug.ui@default:default,org.eclipse.core.expressions@default:default,org.eclipse.j!
dt.core@default:default,org.eclipse.core.filesystem@default:de!
fault,or
g.eclipse.emf.ecore.xmi@default:default,org.eclipse.core.databinding.beans@default:default,org.eclipse.tm.terminal@default:default,org.eclipse.wst.jsdt.core@default:default,org.eclipse.emf.ecore.change@default:default,org.eclipse.equinox.security@default:default,org.eclipse.tm.terminal.telnet@default:default,org.eclipse.equinox.security.ui@default:default,org.eclipse.core.jobs@default:default,org.eclipse.wst.html.core@default:default,org.eclipse.jem.proxy@default:default,org.eclipse.wst.server.discovery@default:default,javax.xml@default:default,org.eclipse.wst.server.core@default:default,org.eclipse.ltk.ui.refactoring@default:default,org.eclipse.wst.css.ui@default:default,org.eclipse.equinox.simpleconfigurator@1:true,org.eclipse.compare.core@default:default,org.eclipse.wst.common.uriresolver@default:default,org.hamcrest.core@default:default,org.eclipse.ui@default:default,org.eclipse.wst.common.frameworks@default:default,org.eclipse.debug.core@default:default,org.eclipse.core!
.filebuffers@default:default,org.sat4j.core@default:default,org.eclipse.equinox.p2.jarprocessor@default:default,org.eclipse.wst.html.ui@default:default,org.eclipse.jsch.core@default:default,org.eclipse.core.runtime.compatibility.auth@default:default,org.eclipse.jst.jee@default:default,org.eclipse.equinox.p2.publisher@default:default,org.eclipse.emf.edit@default:default,org.eclipse.wst.common.modulecore.ui@default:default,org.eclipse.equinox.http.jetty@default:default,org.eclipse.rse.services.ssh@default:default,org.eclipse.equinox.simpleconfigurator.manipulator@default:default,org.eclipse.jst.common.annotations.controller@default:default,org.eclipse.debug.ui@default:default,org.eclipse.equinox.p2.operations@default:default,org.eclipse.equinox.p2.garbagecollector@default:default,org.eclipse.core.runtime@default:true,org.eclipse.ecf.provider.filetransfer@default:default,org.eclipse.jem@default:default,org.eclipse.rse.files.ui@default:default,org.eclipse.wst.web@default:defaul!
t,org.eclipse.jdt.junit.runtime@default:default,org.eclipse.he!
lp.ui@de
fault:default,org.apache.jasper@default:default,org.eclipse.update.configurator@3:true,org.eclipse.jst.j2ee.ejb@default:default,org.eclipse.ecf.ssl@default:false,javax.servlet@default:default,org.eclipse.core.databinding.observable@default:default,org.eclipse.jsch.ui@default:default,org.junit*4.8.1.v4_8_1_v20100427-1100@default:default,org.eclipse.jface.text@default:default,org.eclipse.ui.ide.application@default:default,org.eclipse.equinox.p2.metadata.repository@default:default,org.eclipse.equinox.http.servlet@default:default,org.eclipse.ui.forms@default:default,org.eclipse.rse.subsystems.shells.ssh@default:default,org.eclipse.jst.j2ee.ejb.annotation.model@default:default,org.eclipse.rse.subsystems.terminals.ssh@default:default,org.eclipse.ui.editors@default:default,org.eclipse.equinox.p2.updatesite@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.core.net@default:default,org.eclipse.jst.j2ee.ui@default:default,org.eclipse.wst.common.ui@default:defaul!
t,org.eclipse.emf.common@default:default,org.eclipse.equinox.frameworkadmin@default:default,org.eclipse.jst.server.core@default:default,org.eclipse.equinox.p2.director@default:default,org.eclipse.sdk@default:default,org.eclipse.rse.connectorservice.ssh@default:default,com.ibm.icu@default:default,com.jcraft.jsch@default:default,org.eclipse.jface.databinding@default:default,org.eclipse.equinox.p2.ui@default:default,org.eclipse.wst.xml.ui@default:default,org.eclipse.jst.j2ee.jca.ui@default:default,org.eclipse.equinox.common@2:true,org.eclipse.core.runtime.compatibility.registry@default:false,javax.servlet.jsp@default:default,org.eclipse.jdt.junit.core@default:default,org.eclipse.wst.common.modulecore@default:default,org.eclipse.jst.servlet.ui@default:default,org.eclipse.equinox.p2.core@default:default,org.eclipse.equinox.p2.artifact.repository@default:default,org.eclipse.ui.console@default:default,org.eclipse.jface@default:default,org.eclipse.ui.workbench.texteditor@default:de!
fault,org.eclipse.core.runtime.compatibility@default:default,o!
rg.eclip
se.ui.views.log@default:default,org.eclipse.core.databinding.property@default:default,org.eclipse.ui.navigator@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.swt.gtk.linux.x86_64@default:false,org.eclipse.rse.services@default:default,org.eclipse.core.commands@default:default,org.eclipse.rse.services.files.ftp@default:default,org.eclipse.equinox.app@default:default,org.apache.commons.logging*1.0.4.v201005080501@default:default,org.eclipse.pde.build@default:default,org.eclipse.equinox.p2.touchpoint.eclipse@default:default,org.eclipse.jst.j2ee.web@default:default,org.eclipse.core.databinding@default:default,org.eclipse.compare@default:default,org.eclipse.ui.ide@default:default,org.eclipse.jst.j2ee@default:default,org.eclipse.wst.common.core@default:default,org.eclipse.wst.common.frameworks.ui@default:default,org.apache.xml.serializer@default:default,org.eclipse.equinox.p2.director.app@default:default,org.eclipse.team.ui@default:default,org.eclipse.help!
@default:default,org.eclipse.help.base@default:default,org.eclipse.swtbot.ant.optional.junit4@default:false,org.eclipse.update.core@default:default,org.eclipse.swt@default:default,org.eclipse.equinox.p2.metadata@default:default,org.eclipse.rse.services.local@default:default,org.apache.xml.resolver@default:default,org.eclipse.wst.server.ui.doc.user@default:default,org.eclipse.core.filesystem.linux.x86_64@default:false,org.eclipse.osgi@-1:true,org.eclipse.jst.server.ui@default:default,org.eclipse.rse.ui@default:default,org.eclipse.ltk.core.refactoring@default:default,org.eclipse.wst.sse.core@default:default,org.eclipse.jst.j2ee.core@default:default,org.eclipse.wst.common.project.facet.ui@default:default,org.apache.lucene@default:default,org.eclipse.jst.common.frameworks@default:default,org.eclipse.equinox.p2.repository.tools@default:default,org.eclipse.wst.internet.monitor.core@default:default,org.eclipse.equinox.p2.repository@default:default,org.eclipse.ui.navigator.resource!
s@default:default,org.eclipse.rse.core@default:default,org.ecl!
ipse.tm.
terminal.view@default:default,org.eclipse.emf.ecore.edit@default:default,org.eclipse.osgi.services@default:default,org.eclipse.wst.validation@default:default,org.apache.commons.codec*1.3.0.v20100518-1140@default:default,org.apache.ant@default:default,org.eclipse.rse.subsystems.shells.core@default:default,org.eclipse.ui.workbench@default:default,org.eclipse.jst.j2ee.navigator.ui@default:default,org.eclipse.wst.common.environment@default:default,org.eclipse.jdt.core.manipulation@default:default,org.eclipse.emf.edit.ui@default:default,org.eclipse.wst.css.core@default:default,org.apache.xerces@default:default,org.eclipse.wst.sse.ui@default:default,org.eclipse.jdt.junit@default:default,org.eclipse.jdt.launching@default:default,org.eclipse.ant.core@default:default,org.eclipse.ecf.provider.filetransfer.ssl@default:false,org.eclipse.wst.jsdt.manipulation@default:default,org.eclipse.emf.codegen@default:default,org.eclipse.wst.common.project.facet.core@default:default,org.eclipse.jst.!
jee.ui@default:default,org.eclipse.jdt.debug@default:default,org.eclipse.jem.workbench@default:default,org.eclipse.wst.web.ui@default:default,org.eclipse.rse.subsystems.files.core@default:default,org.eclipse.jst.j2ee.jca@default:default,org.eclipse.jem.util@default:default,org.eclipse.wst.jsdt.ui@default:default,org.eclipse.wst.xml.core@default:default,org.eclipse.jst.common.annotations.core@default:default,org.eclipse.jdt@default:default"/>
+<stringAttribute key="selected_workspace_plugins" value="org.jboss.ide.eclipse.archives.ui@default:default,org.jboss.ide.eclipse.as.ui@default:default,org.jboss.ide.eclipse.archives.webtools@default:default,org.jboss.tools.jmx.core@default:default,org.jboss.ide.eclipse.as.wtp.ui@default:default,org.jboss.ide.eclipse.as.rse.ui@default:default,org.jboss.tools.jmx.ui@default:default,org.jboss.tools.deltacloud.core@default:default,org.jboss.ide.eclipse.archives.core@default:default,org.jboss.ide.eclipse.as.wtp.core@default:default,org.jboss.ide.eclipse.as.core@default:default,org.jboss.tools.common@default:default,org.jboss.tools.usage@default:default,org.jboss.tools.deltacloud.ui@default:default,org.jboss.tools.deltacloud.integration@default:default,org.jboss.ide.eclipse.as.rse.core@default:default"/>
<booleanAttribute key="show_selected_only" value="false"/>
<stringAttribute key="templateConfig" value="${target_home}/configuration/config.ini"/>
<booleanAttribute key="tracing" value="false"/>
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloud/DeltaCloudViewItem.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloud/DeltaCloudViewItem.java 2010-12-29 14:31:43 UTC (rev 27800)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloud/DeltaCloudViewItem.java 2010-12-29 14:40:18 UTC (rev 27801)
@@ -60,9 +60,9 @@
@Override
public void run() {
viewer.remove(children.toArray());
+ children.clear();
}
});
- children.clear();
}
public boolean hasChildren() {
@@ -74,32 +74,29 @@
}
public void addChild(final DeltaCloudViewItem<?> element) {
- children.add(element);
-
- getDisplay().asyncExec(new Runnable() {
+ getDisplay().syncExec(new Runnable() {
@Override
public void run() {
viewer.add(DeltaCloudViewItem.this, element);
+ children.add(element);
}
});
}
public void addChildren(final DeltaCloudViewItem<?>[] elements) {
- for (DeltaCloudViewItem<?> element : elements) {
- children.add(element);
- }
-
- getDisplay().asyncExec(new Runnable() {
+ getDisplay().syncExec(new Runnable() {
@Override
public void run() {
viewer.add(DeltaCloudViewItem.this, elements);
+ for (DeltaCloudViewItem<?> element : elements) {
+ children.add(element);
+ }
}
});
}
public void removeChild(final DeltaCloudViewItem<?> element) {
-
- getDisplay().asyncExec(new Runnable() {
+ getDisplay().syncExec(new Runnable() {
@Override
public void run() {
if (element != null) {
@@ -111,7 +108,7 @@
}
protected void expand() {
- getDisplay().asyncExec(new Runnable() {
+ getDisplay().syncExec(new Runnable() {
@Override
public void run() {
@@ -138,7 +135,7 @@
private void initDisposeListener(Viewer viewer) {
final Control control = viewer.getControl();
- control.getDisplay().asyncExec(new Runnable() {
+ control.getDisplay().syncExec(new Runnable() {
@Override
public void run() {
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionPage.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionPage.java 2010-12-29 14:31:43 UTC (rev 27800)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionPage.java 2010-12-29 14:40:18 UTC (rev 27801)
@@ -376,8 +376,7 @@
dbc.bindValue(
passwordTextObservable,
BeanProperties.value(CloudConnectionPageModel.class, CloudConnectionPageModel.PROPERTY_PASSWORD)
- .observe(
- connectionModel));
+ .observe(connectionModel));
// test button
final Button testButton = new Button(container, SWT.NULL);
testButton.setText(WizardMessages.getString(TESTBUTTON_LABEL));
14 years
JBoss Tools SVN: r27800 - trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/handlers/bean.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-12-29 09:31:43 -0500 (Wed, 29 Dec 2010)
New Revision: 27800
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/handlers/bean/DeleteManagedPropertyHandler.java
Log:
JBIDE-8011
https://issues.jboss.org/browse/JBIDE-8011
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/handlers/bean/DeleteManagedPropertyHandler.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/handlers/bean/DeleteManagedPropertyHandler.java 2010-12-29 14:09:18 UTC (rev 27799)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/handlers/bean/DeleteManagedPropertyHandler.java 2010-12-29 14:31:43 UTC (rev 27800)
@@ -19,6 +19,7 @@
import org.jboss.tools.common.meta.action.impl.handlers.DefaultCreateHandler;
import org.jboss.tools.common.meta.action.impl.handlers.DefaultRemoveHandler;
import org.jboss.tools.common.model.*;
+import org.jboss.tools.common.util.BeanUtil;
import org.jboss.tools.jsf.messages.JSFUIMessages;
import org.jboss.tools.jsf.model.helpers.bean.ManagedBeanHelper;
@@ -63,14 +64,19 @@
IType type = member.getDeclaringType();
IMethod[] ms = type.getMethods();
String n = member.getElementName();
- if(member instanceof IMethod && n.startsWith("get") && n.length() > 3) { //$NON-NLS-1$
- n = n.substring(3, 4).toLowerCase() + n.substring(4);
+ if(member instanceof IMethod) {
+ n = BeanUtil.getPropertyName(n);
}
- String getter = "get" + n.substring(0, 1).toUpperCase() + n.substring(1); //$NON-NLS-1$
- String setter = "set" + n.substring(0, 1).toUpperCase() + n.substring(1); //$NON-NLS-1$
- for (int i = 0; i < ms.length; i++) {
- String ni = ms[i].getElementName();
- if(ni.equals(getter) || ni.equals(setter)) list.add(ms[i]);
+ if(n != null) {
+ for (int i = 0; i < ms.length; i++) {
+ if(ms[i] == member) continue;
+ if(BeanUtil.isGetter(ms[i]) || BeanUtil.isSetter(ms[i])) {
+ String ni = BeanUtil.getPropertyName(ms[i].getElementName());
+ if(n.equals(ni)) {
+ list.add(ms[i]);
+ }
+ }
+ }
}
return list.toArray(new IMember[0]);
}
14 years