JBoss Tools SVN: r27739 - in trunk/deltacloud/plugins: org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-12-25 10:27:49 -0500 (Sat, 25 Dec 2010)
New Revision: 27739
Added:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/PemFileFactory.java
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/DeltaCloudInstance.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudKey.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/InstanceFilter.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/AbstractDeltaCloudObject.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/DeltaCloudClient.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/Instance.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/Key.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.integration/src/org/jboss/tools/deltacloud/integration/wizard/CreateServerFromRSEJob.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.integration/src/org/jboss/tools/deltacloud/integration/wizard/RSEandASWizardPage.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/property/InstancePropertySource.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ManageKeysPage.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ManageKeysPageModel.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ManageKeysWizard.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/NewInstancePageModel.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceWizard.java
Log:
[JBIDE-7763] revamped the whole manage keys page to deal with keys on the server (list, refresh, create, delete)
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-25 10:51:17 UTC (rev 27738)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java 2010-12-25 15:27:49 UTC (rev 27739)
@@ -422,11 +422,13 @@
}
}
- public void createKey(String keyname, String keystoreLocation) throws DeltaCloudException {
+ public DeltaCloudKey getKey(String keyId) throws DeltaCloudException {
try {
- client.createKey(keyname, keystoreLocation);
+ Key key = client.listKey(keyId);
+ return new DeltaCloudKey(key, this);
} catch (DeltaCloudClientException e) {
- throw new DeltaCloudException(e);
+ // TODO: internationalize strings
+ throw new DeltaCloudException(MessageFormat.format("Could not get key \"{0}\" from cloud \"{1}\"", keyId, getName()), e);
}
}
@@ -547,11 +549,11 @@
}
public DeltaCloudInstance createInstance(String name, String imageId, String realmId, String profileId,
- String keyname, String memory, String storage) throws DeltaCloudException {
+ String keyId, String memory, String storage) throws DeltaCloudException {
try {
Instance instance = null;
- if (keyname != null) {
- instance = client.createInstance(imageId, profileId, realmId, name, keyname, memory, storage);
+ if (keyId != null) {
+ instance = client.createInstance(imageId, profileId, realmId, name, keyId, memory, storage);
} else {
instance = client.createInstance(imageId, profileId, realmId, name, memory, storage);
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudInstance.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudInstance.java 2010-12-25 10:51:17 UTC (rev 27738)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudInstance.java 2010-12-25 15:27:49 UTC (rev 27739)
@@ -105,10 +105,16 @@
return State.valueOf(instance.getState().name());
}
- public String getKey() {
- return instance.getKey();
+ public DeltaCloudKey getKey() throws DeltaCloudException {
+ // TODO: cache keys locally
+ DeltaCloud cloud = getDeltaCloud();
+ return cloud.getKey(instance.getKeyId());
}
+ public String getKeyId() {
+ return instance.getKeyId();
+ }
+
public List<Action> getActions() {
List<Action> actions = new ArrayList<Action>();
for (InstanceAction action : instance.getActions()) {
@@ -189,7 +195,7 @@
.append("name: ").append(getName())
.append("hostName: ").append(getHostName())
.append("imageId: ").append(getImageId())
- .append("key: ").append(getKey())
+ .append("key: ").append(getKeyId())
.append("ownerId: ").append(getOwnerId())
.append("profileId: ").append(getProfileId())
.append("realmId: ").append(getRealmId())
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudKey.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudKey.java 2010-12-25 10:51:17 UTC (rev 27738)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudKey.java 2010-12-25 15:27:49 UTC (rev 27739)
@@ -41,4 +41,10 @@
public String getPem() {
return key.getPem();
}
+
+ @Override
+ public String toString() {
+ return "DeltaCloudKey [key=" + key + "]";
+ }
+
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/InstanceFilter.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/InstanceFilter.java 2010-12-25 10:51:17 UTC (rev 27738)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/InstanceFilter.java 2010-12-25 15:27:49 UTC (rev 27739)
@@ -23,22 +23,22 @@
*/
public class InstanceFilter extends AbstractCloudElementFilter<DeltaCloudInstance> implements IInstanceFilter {
- public InstanceFilter(DeltaCloud cloud) {
- super(cloud);
- }
-
private IFieldMatcher imageIdRule;
private IFieldMatcher realmRule;
private IFieldMatcher profileRule;
private IFieldMatcher ownerIdRule;
private IFieldMatcher keyNameRule;
+
+ public InstanceFilter(DeltaCloud cloud) {
+ super(cloud);
+ }
@Override
public boolean matches(DeltaCloudInstance instance) {
return super.matches(instance) &&
imageIdRule.matches(instance.getImageId()) &&
ownerIdRule.matches(instance.getOwnerId()) &&
- keyNameRule.matches(instance.getKey()) &&
+ keyNameRule.matches(instance.getKeyId()) &&
realmRule.matches(instance.getRealmId()) &&
profileRule.matches(instance.getProfileId());
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/AbstractDeltaCloudObject.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/AbstractDeltaCloudObject.java 2010-12-25 10:51:17 UTC (rev 27738)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/AbstractDeltaCloudObject.java 2010-12-25 15:27:49 UTC (rev 27739)
@@ -17,6 +17,7 @@
* @author André Dietisheim
*/
public abstract class AbstractDeltaCloudObject {
+
protected String id;
public void setId(String id) {
@@ -27,4 +28,10 @@
public String getId() {
return id;
}
+
+ @Override
+ public String toString() {
+ return "AbstractDeltaCloudObject [id=" + id + "]";
+ }
+
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/DeltaCloudClient.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/DeltaCloudClient.java 2010-12-25 10:51:17 UTC (rev 27738)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/DeltaCloudClient.java 2010-12-25 15:27:49 UTC (rev 27739)
@@ -125,20 +125,6 @@
String memory, String storage) throws DeltaCloudClientException;
/**
- * Creates a key for a given name on the deltacloud server and stores it in
- * the file at the given path. The file gets created if the file path does
- * not exist yet.
- *
- * @param keyname
- * the name of the key to retrieve from the server
- * @param keyStoreLocation
- * the path to the file to store the key in
- * @throws DeltaCloudClientException
- * the delta cloud client exception
- */
- public void createKey(String keyname, String keystoreLocation) throws DeltaCloudClientException;
-
- /**
* Creates a key for a given name on the deltacloud server.
*
* @param keyname
@@ -172,5 +158,5 @@
* Returns a key with the given name if it is available on the server.
* Throws a DeltaCloudException if it is not available.
*/
- public Key listKey(String name) throws DeltaCloudClientException;
+ public Key listKey(String id) throws DeltaCloudClientException;
}
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-25 10:51:17 UTC (rev 27738)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/DeltaCloudClientImpl.java 2010-12-25 15:27:49 UTC (rev 27739)
@@ -11,8 +11,6 @@
package org.jboss.tools.deltacloud.core.client;
import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
@@ -46,7 +44,6 @@
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.Path;
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;
@@ -78,7 +75,6 @@
*/
public class DeltaCloudClientImpl implements InternalDeltaCloudClient {
- private static final String PEM_FILE_SUFFIX = "pem";
private static final String DOCUMENT_ELEMENT_DRIVER = "driver";
private static final String DOCUMENT_ELEMENT_API = "api";
@@ -299,26 +295,28 @@
}
@Override
- public Instance createInstance(String imageId, String profileId,
- String realmId, String name) throws DeltaCloudClientException {
- return createInstance(imageId, profileId, realmId, name, null, null,
- null);
- }
-
- public Instance createInstance(String imageId, String profileId,
- String realmId, String name, String memory, String storage)
+ public Instance createInstance(String imageId, String profileId, String realmId, String name)
throws DeltaCloudClientException {
- return createInstance(imageId, profileId, realmId, name, null, memory,
- storage);
+ return createInstance(imageId, profileId, realmId, name, null, null, null);
}
- public Instance createInstance(String imageId, String profileId,
- String realmId, String name, String keyname, String memory,
+ public Instance createInstance(String imageId, String profileId, String realmId, String name, String memory,
String storage) throws DeltaCloudClientException {
+ return createInstance(imageId, profileId, realmId, name, null, memory, storage);
+ }
+
+ public Instance createInstance(String imageId, String profileId, String realmId, String name, String keyId,
+ String memory, String storage) throws DeltaCloudClientException {
try {
String response = requestStringResponse(
- new CreateInstanceRequest(baseUrl, imageId, profileId, realmId, name, keyname, memory, storage));
- return buildInstance(response);
+ new CreateInstanceRequest(baseUrl, imageId, profileId, realmId, name, keyId, memory, storage));
+ Instance instance = buildInstance(response);
+ // TODO: WORKAROUND for https://issues.apache.org/jira/browse/DTACLOUD-11
+ if (keyId != null) {
+ instance.setKeyId(keyId);
+ }
+ // TODO: WORKAROUND for https://issues.apache.org/jira/browse/DTACLOUD-11
+ return instance;
} catch (DeltaCloudClientException e) {
throw e;
} catch (Exception e) {
@@ -403,36 +401,6 @@
}
}
- public void createKey(String keyname, String keyStoreLocation)
- throws DeltaCloudClientException {
- Key key = createKey(keyname);
- try {
- File keyFile = createKeyFile(keyname, keyStoreLocation);
- storeKey(key.getPem(), keyFile);
- } catch (Exception e) {
- throw new DeltaCloudClientException(e);
- }
- }
-
- private void storeKey(String key, File keyFile) throws IOException {
- FileWriter w = new FileWriter(keyFile);
- w.write(key);
- w.close();
- }
-
- private File createKeyFile(String keyname, String keyStoreLocation)
- throws IOException {
- File keyFile = Path.fromOSString(keyStoreLocation).append(keyname)
- .append(".").append(PEM_FILE_SUFFIX).toFile(); //$NON-NLS-1$
- if (!keyFile.exists()) {
- keyFile.createNewFile();
- }
- keyFile.setReadable(false, false);
- keyFile.setWritable(true, true);
- keyFile.setReadable(true, true);
- return keyFile;
- }
-
public void deleteKey(String keyname) throws DeltaCloudClientException {
requestStringResponse(new DeleteKeyRequest(baseUrl, keyname));
}
@@ -444,8 +412,8 @@
return keys;
}
- public Key listKey(String name) throws DeltaCloudClientException {
- InputStream inputStream = request(new ListKeyRequest(baseUrl, name));
+ public Key listKey(String id) throws DeltaCloudClientException {
+ InputStream inputStream = request(new ListKeyRequest(baseUrl, id));
Key key = new KeyUnmarshaller().unmarshall(inputStream, new Key());
return key;
}
@@ -459,12 +427,12 @@
getPropertyNodes(document, "hardware_profile")); //$NON-NLS-1$
instance.setRealmId(getIdFromHref(getAttributeValues(document, "realm", "href").get(0))); //$NON-NLS-1$ //$NON-NLS-2$
instance.setState(getElementTextValues(document, "state").get(0)); //$NON-NLS-1$
- getAuthentication(document, instance);
+ updateKeyname(document, instance);
instance.setActions(createInstanceActions(instance, document));
- instance.setPublicAddresses(new AddressList(getElementTextValues(
- document, "public_addresses")));
- instance.setPrivateAddresses(new AddressList(getElementTextValues(
- document, "private_addresses")));
+ instance.setPublicAddresses(
+ new AddressList(getElementTextValues(document, "public_addresses")));
+ instance.setPrivateAddresses(
+ new AddressList(getElementTextValues(document, "private_addresses")));
return instance;
}
@@ -621,7 +589,7 @@
return values;
}
- private void getAuthentication(Document document, Instance instance) {
+ private void updateKeyname(Document document, Instance instance) {
NodeList elements = document.getElementsByTagName("authentication");
for (int i = 0; i < elements.getLength(); i++) {
Node element = elements.item(i);
@@ -636,7 +604,7 @@
for (int k = 0; k < loginChildren.getLength(); ++k) {
Node loginChild = loginChildren.item(k);
if (loginChild.getNodeName().equals("keyname")) { //$NON-NLS-1$
- instance.setKey(loginChild.getTextContent());
+ instance.setKeyId(loginChild.getTextContent());
}
}
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/Instance.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/Instance.java 2010-12-25 10:51:17 UTC (rev 27738)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/Instance.java 2010-12-25 15:27:49 UTC (rev 27739)
@@ -45,7 +45,7 @@
private String realmId;
- private String keyname;
+ private String keyId;
@XmlElement
private InstanceState state;
@@ -107,14 +107,14 @@
}
}
- public void setKey(String keyname) {
- this.keyname = keyname;
+ protected void setKeyId(String keyId) {
+ this.keyId = keyId;
}
-
- public String getKey() {
- return keyname;
+
+ public String getKeyId() {
+ return keyId;
}
-
+
protected void setPrivateAddresses(AddressList privateAddresses) {
this.privateAddresses = privateAddresses;
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/Key.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/Key.java 2010-12-25 10:51:17 UTC (rev 27738)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/Key.java 2010-12-25 15:27:49 UTC (rev 27739)
@@ -14,8 +14,6 @@
import java.net.URL;
import java.util.List;
-import javax.xml.bind.annotation.XmlRootElement;
-
/**
* @author Andre Dietisheim
*/
@@ -75,4 +73,11 @@
public List<KeyAction> getActions() {
return actions;
}
+
+ @Override
+ public String toString() {
+ return "Key [url=" + url + ", pem=" + pem + ", fingerprint=" + fingerprint + ", state=" + state + ", actions="
+ + actions + ", toString()=" + super.toString() + "]";
+ }
+
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.integration/src/org/jboss/tools/deltacloud/integration/wizard/CreateServerFromRSEJob.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.integration/src/org/jboss/tools/deltacloud/integration/wizard/CreateServerFromRSEJob.java 2010-12-25 10:51:17 UTC (rev 27738)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.integration/src/org/jboss/tools/deltacloud/integration/wizard/CreateServerFromRSEJob.java 2010-12-25 15:27:49 UTC (rev 27739)
@@ -36,6 +36,7 @@
private String name;
private String[] data;
private IHost host;
+
public CreateServerFromRSEJob(String type, String[] data, String name) {
super("Create Server From RSE Host");
this.data = data;
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.integration/src/org/jboss/tools/deltacloud/integration/wizard/RSEandASWizardPage.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.integration/src/org/jboss/tools/deltacloud/integration/wizard/RSEandASWizardPage.java 2010-12-25 10:51:17 UTC (rev 27738)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.integration/src/org/jboss/tools/deltacloud/integration/wizard/RSEandASWizardPage.java 2010-12-25 15:27:49 UTC (rev 27739)
@@ -30,7 +30,9 @@
import org.eclipse.wst.server.core.ServerCore;
import org.eclipse.wst.server.ui.ServerUIUtil;
import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
+import org.jboss.tools.deltacloud.core.DeltaCloudException;
import org.jboss.tools.deltacloud.core.DeltaCloudInstance;
+import org.jboss.tools.deltacloud.core.DeltaCloudKey;
import org.jboss.tools.deltacloud.core.job.AbstractInstanceJob;
import org.jboss.tools.deltacloud.integration.DeltaCloudIntegrationPlugin;
import org.jboss.tools.deltacloud.ui.INewInstanceWizardPage;
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-25 10:51:17 UTC (rev 27738)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/Deltacloud Tools.launch 2010-12-25 15:27:49 UTC (rev 27739)
@@ -24,8 +24,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="org.eclipse.jst.common.frameworks@default:default,org.hamcrest.core@default:default,org.eclipse.jdt.core@default:default,org.eclipse.rse.importexport@default:default,org.eclipse.rse.files.ui@default:default,org.eclipse.jdt@default:default,org.eclipse.equinox.p2.artifact.repository@default:default,org.eclipse.rse.connectorservice.ssh@default:default,org.eclipse.help.base@default:default,org.eclipse.ecf.provider.filetransfer@default:default,org.eclipse.core.commands@default:default,org.eclipse.rse.subsystems.shells.dstore@default:default,org.eclipse.jface.text@default:default,org.eclipse.ui.browser@default:default,org.junit*4.8.1.v4_8_1_v20100427-1100@default:default,org.eclipse.equinox.security.ui@default:default,javax.servlet.jsp@default:default,org.eclipse.core.jobs@default:default,org.eclipse.wst.jsdt.manipulation@default:default,org.eclipse.ui.workbench@default:default,org.eclipse.wst.validation@default:default,org.ec!
lipse.wst.server.ui.infopop@default:default,org.eclipse.jdt.junit.runtime@default:default,org.eclipse.jdt.junit.core@default:default,org.eclipse.text@default:default,org.eclipse.jdt.compiler.tool@default:false,org.eclipse.equinox.p2.publisher@default:default,org.eclipse.help.ui@default:default,org.eclipse.compare.core@default:default,org.eclipse.jsch.core@default:default,org.eclipse.jst.j2ee.ui@default:default,org.eclipse.wst.css.core@default:default,org.eclipse.equinox.http.jetty@default:default,org.eclipse.jst.j2ee@default:default,org.sat4j.core@default:default,org.eclipse.equinox.p2.core@default:default,org.eclipse.jst.j2ee.web@default:default,org.eclipse.ui.intro@default:default,org.eclipse.core.databinding.beans@default:default,org.eclipse.pde.build@default:default,org.eclipse.rse.ui@default:default,javax.xml@default:default,org.eclipse.equinox.p2.metadata.repository@default:default,org.eclipse.rse.subsystems.files.ssh@default:default,org.eclipse.equinox.p2.updatesite@!
default:default,org.eclipse.jem.beaninfo.vm@default:default,or!
g.eclips
e.emf.common.ui@default:default,org.eclipse.jem.proxy@default:default,org.eclipse.jst.j2ee.navigator.ui@default:default,org.eclipse.wst.css.ui@default:default,org.eclipse.help@default:default,org.eclipse.ui.views.properties.tabbed@default:default,org.eclipse.wst.internet.monitor.core@default:default,org.eclipse.dstore.core@default:default,org.eclipse.rse.subsystems.files.core@default:default,org.eclipse.ui@default:default,org.eclipse.wst.common.ui@default:default,org.apache.xerces@default:default,org.eclipse.ui.cheatsheets@default:default,org.eclipse.wst.sse.core@default:default,org.eclipse.ui.workbench.texteditor@default:default,org.eclipse.jst.common.annotations.controller@default:default,com.ibm.icu@default:default,org.eclipse.swt@default:default,org.eclipse.ui.navigator.resources@default:default,org.eclipse.wst.xml.ui@default:default,org.eclipse.jst.jee.ui@default:default,org.apache.commons.codec*1.3.0.v20100518-1140@default:default,org.apache.commons.el@default:default,!
org.eclipse.equinox.p2.jarprocessor@default:default,org.eclipse.jem.beaninfo@default:default,org.eclipse.wst.common.emf@default:default,org.eclipse.search@default:default,org.eclipse.wst.server.core@default:default,org.eclipse.wst.server.ui@default:default,org.eclipse.rse.subsystems.shells.ssh@default:default,org.eclipse.wst.jsdt.ui@default:default,org.apache.commons.net@default:default,org.eclipse.rse.shells.ui@default:default,org.eclipse.swt.gtk.linux.x86_64@default:false,org.eclipse.ecf.ssl@default:false,org.mortbay.jetty.server@default:default,org.eclipse.ui.console@default:default,org.eclipse.equinox.frameworkadmin@default:default,org.eclipse.update.core@default:default,org.eclipse.wst.jsdt.core@default:default,org.eclipse.jst.j2ee.jca.ui@default:default,org.eclipse.jst.server.ui@default:default,org.eclipse.ui.views@default:default,org.eclipse.jem.workbench@default:default,org.eclipse.ui.views.log@default:default,org.apache.jasper@default:default,org.eclipse.sdk@defaul!
t:default,org.eclipse.rse.useractions@default:default,org.ecli!
pse.rse.
connectorservice.local@default:default,org.eclipse.wst.common.project.facet.ui@default:default,org.eclipse.emf.ecore.edit@default:default,org.eclipse.jst.j2ee.core@default:default,org.eclipse.rse.terminals.ui@default:default,org.eclipse.emf.ecore.change@default:default,org.apache.commons.httpclient*3.1.0.v201005080502@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.jst.j2ee.ejb.annotation.model@default:default,org.eclipse.jst.j2ee.jca@default:default,org.eclipse.equinox.common@2:true,org.eclipse.swtbot.ant.optional.junit4@default:false,org.eclipse.team.ui@default:default,org.eclipse.rse.efs.ui@default:default,org.eclipse.wst.common.modulecore@default:default,org.eclipse.equinox.frameworkadmin.equinox@default:default,org.eclipse.ant.core@default:default,org.eclipse.rse.subsystems.processes.local@default:default,org.eclipse.wst.common.environment@default:default,org.eclipse.core.net.linux.x86_64@default:false,org.eclipse.ui.forms@default:default,org.ec!
lipse.jst.common.ui@default:default,org.eclipse.rse.subsystems.terminals.core@default:default,org.eclipse.jem.beaninfo.vm.common@default:default,org.eclipse.core.resources@default:default,org.eclipse.jst.servlet.ui@default:default,org.eclipse.rse.subsystems.processes.core@default:default,org.eclipse.emf.ecore@default:default,org.eclipse.ecf.filetransfer@default:default,org.eclipse.osgi.services@default:default,org.eclipse.wst.xml.core@default:default,org.eclipse.equinox.simpleconfigurator@1:true,org.eclipse.core.filebuffers@default:default,org.apache.xml.resolver@default:default,org.eclipse.wst.common.frameworks@default:default,org.eclipse.rse.doc.user@default:default,org.eclipse.jface.databinding@default:default,org.eclipse.ltk.core.refactoring@default:default,org.eclipse.equinox.p2.operations@default:default,org.eclipse.equinox.p2.director.app@default:default,org.eclipse.core.net@default:default,org.eclipse.ltk.ui.refactoring@default:default,org.apache.lucene.analysis@def!
ault:default,com.jcraft.jsch@default:default,org.eclipse.rse.s!
ubsystem
s.shells.telnet@default:default,org.eclipse.ui.ide.application@default:default,org.eclipse.emf.common@default:default,org.apache.lucene@default:default,org.mortbay.jetty.util@default:default,org.eclipse.swtbot.ant.optional.junit3@default:false,org.sat4j.pb@default:default,org.eclipse.equinox.p2.ui@default:default,org.eclipse.osgi.util@default:default,org.eclipse.wst.server.discovery@default:default,org.eclipse.emf.ecore.xmi@default:default,org.eclipse.rse.subsystems.files.ftp@default:default,org.eclipse.equinox.app@default:default,org.eclipse.rse.subsystems.shells.local@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.debug.ui@default:default,org.eclipse.dstore.extra@default:default,org.eclipse.update.configurator@3:true,org.eclipse.jem.util@default:default,org.eclipse.rse.services@default:default,org.eclipse.core.filesystem@default:default,org.eclipse.rse.subsystems.shells.core@default:default,org.eclipse.compare@default:default,org.eclipse.rse.servi!
ces.local@default:default,org.eclipse.emf.edit.ui@default:default,org.eclipse.jdt.compiler.apt@default:false,org.eclipse.tm.terminal@default:default,org.eclipse.rse.services.telnet@default:default,org.eclipse.wst.common.core@default:default,org.eclipse.emf.edit@default:default,org.eclipse.equinox.p2.director@default:default,org.eclipse.rse.subsystems.terminals.ssh@default:default,org.eclipse.rse.services.ssh@default:default,org.eclipse.core.databinding.property@default:default,org.eclipse.rse.processes.ui@default:default,org.eclipse.wst.sse.ui@default:default,org.eclipse.osgi@-1:true,org.eclipse.ecf.provider.filetransfer.ssl@default:false,org.eclipse.jdt.launching@default:default,org.eclipse.wst.common.project.facet.core@default:default,org.eclipse.equinox.p2.metadata@default:default,org.eclipse.ecf@default:default,org.eclipse.equinox.p2.touchpoint.eclipse@default:default,org.eclipse.ui.ide@default:default,org.eclipse.rse.subsystems.processes.dstore@default:default,org.ecli!
pse.rse.subsystems.files.local@default:default,org.eclipse.jst!
.common.
project.facet.core@default:default,org.eclipse.rse.subsystems.processes.shell.linux@default:default,org.eclipse.wst.common.emfworkbench.integration@default:default,org.eclipse.wst.common.uriresolver@default:default,org.eclipse.jst.common.annotations.core@default:default,org.eclipse.equinox.concurrent@default:default,org.eclipse.core.variables@default:default,org.junit4@default:default,org.eclipse.ecf.identity@default:default,org.eclipse.jdt.debug@default:default,org.eclipse.core.databinding.observable@default:default,javax.servlet@default:default,org.eclipse.jst.common.project.facet.ui@default:default,org.eclipse.core.databinding@default:default,org.eclipse.wst.html.core@default:default,org.eclipse.rse.services.dstore@default:default,org.eclipse.core.runtime.compatibility@default:default,org.eclipse.wst.html.ui@default:default,org.eclipse.rse.services.files.ftp@default:default,org.eclipse.jst.jee@default:default,org.eclipse.jst.server.core@default:default,org.eclipse.pde.cor!
e@default:default,org.eclipse.core.filesystem.linux.x86_64@default:false,org.eclipse.equinox.http.servlet@default:default,org.eclipse.equinox.p2.engine@default:default,org.eclipse.rse.connectorservice.telnet@default:default,org.eclipse.equinox.simpleconfigurator.manipulator@default:default,org.eclipse.equinox.preferences@default:default,org.eclipse.rse.subsystems.files.dstore@default:default,org.apache.ant@default:default,org.eclipse.team.core@default:default,org.eclipse.equinox.p2.repository@default:default,org.eclipse.equinox.p2.repository.tools@default:default,org.eclipse.rse.connectorservice.dstore@default:default,org.eclipse.jdt.ui@default:default,org.eclipse.rse.efs@default:default,org.eclipse.jface@default:default,org.eclipse.debug.core@default:default,org.eclipse.ui.editors@default:default,org.eclipse.core.runtime.compatibility.registry@default:false,org.apache.commons.logging*1.0.4.v201005080501@default:default,org.eclipse.rse.dstore.security@default:default,org.ec!
lipse.wst.web@default:default,org.eclipse.core.runtime.compati!
bility.a
uth@default:default,org.eclipse.jdt.debug.ui@default:default,org.eclipse.jdt.core.manipulation@default:default,org.eclipse.ui.navigator@default:default,org.eclipse.equinox.security@default:default,org.eclipse.equinox.p2.garbagecollector@default:default,org.eclipse.wst.server.ui.doc.user@default:default,org.eclipse.wst.common.frameworks.ui@default:default,org.eclipse.rse.core@default:default,org.apache.xml.serializer@default:default,org.eclipse.core.expressions@default:default,org.eclipse.jdt.junit@default:default,org.eclipse.jst.j2ee.ejb@default:default,org.eclipse.core.runtime@default:true,org.eclipse.platform@default:default,org.eclipse.wst.web.ui@default:default,org.eclipse.wst.common.modulecore.ui@default:default,org.eclipse.jem@default:default,org.eclipse.emf.codegen@default:default"/>
-<stringAttribute key="selected_workspace_plugins" value="org.jboss.tools.common@default:default,org.jboss.tools.jmx.core@default:default,org.jboss.ide.eclipse.as.wtp.ui@default:default,org.jboss.ide.eclipse.as.rse.core@default:default,org.jboss.ide.eclipse.archives.ui@default:default,org.jboss.tools.deltacloud.core@default:default,org.jboss.ide.eclipse.as.core@default:default,org.jboss.ide.eclipse.as.wtp.core@default:default,org.jboss.ide.eclipse.as.ui@default:default,org.jboss.ide.eclipse.archives.webtools@default:default,org.jboss.tools.jmx.ui@default:default,org.jboss.tools.deltacloud.ui@default:default,org.jboss.ide.eclipse.archives.core@default:default,org.jboss.tools.deltacloud.integration@default:default"/>
+<stringAttribute key="selected_target_plugins" value="org.eclipse.wst.sse.core@default:default,org.eclipse.emf.codegen@default:default,org.eclipse.wst.common.core@default:default,org.eclipse.rse.terminals.ui@default:default,org.eclipse.equinox.p2.operations@default:default,org.junit*4.8.1.v4_8_1_v20100427-1100@default:default,org.eclipse.rse.files.ui@default:default,org.eclipse.pde.core@default:default,org.eclipse.core.filesystem.linux.x86_64@default:false,org.eclipse.jdt.debug.ui@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.jst.server.ui@default:default,org.eclipse.wst.common.emfworkbench.integration@default:default,org.eclipse.wst.sse.ui@default:default,org.eclipse.wst.common.frameworks@default:default,org.eclipse.ecf@default:default,org.eclipse.ui.workbench@default:default,org.eclipse.core.runtime@default:true,org.eclipse.wst.common.modulecore@default:default,org.eclipse.emf.common.ui@default:default,org.eclipse.team.ui@default:default,org.ecl!
ipse.team.core@default:default,org.eclipse.wst.common.environment@default:default,org.eclipse.core.jobs@default:default,org.eclipse.ecf.ssl@default:false,org.apache.lucene@default:default,org.eclipse.rse.services.telnet@default:default,org.eclipse.rse.services.local@default:default,org.eclipse.ltk.ui.refactoring@default:default,org.eclipse.wst.jsdt.ui@default:default,org.eclipse.wst.web.ui@default:default,org.eclipse.equinox.http.servlet@default:default,org.eclipse.equinox.p2.touchpoint.eclipse@default:default,org.eclipse.rse.services.files.ftp@default:default,org.eclipse.jst.server.core@default:default,org.eclipse.ecf.provider.filetransfer.ssl@default:false,org.eclipse.core.databinding.property@default:default,org.sat4j.core@default:default,org.eclipse.equinox.frameworkadmin@default:default,org.eclipse.jst.common.project.facet.core@default:default,org.eclipse.wst.css.core@default:default,org.eclipse.ui.workbench.texteditor@default:default,org.apache.commons.codec*1.3.0.v20!
100518-1140@default:default,org.eclipse.rse.connectorservice.d!
store@de
fault:default,org.apache.jasper@default:default,org.eclipse.rse.subsystems.processes.core@default:default,org.eclipse.ui.intro@default:default,org.eclipse.wst.common.emf@default:default,org.apache.commons.net@default:default,org.eclipse.platform@default:default,org.eclipse.rse.subsystems.shells.local@default:default,org.eclipse.jdt.junit.core@default:default,org.eclipse.emf.ecore.xmi@default:default,org.eclipse.jem.util@default:default,org.eclipse.equinox.concurrent@default:default,org.eclipse.rse.subsystems.processes.shell.linux@default:default,org.eclipse.equinox.app@default:default,org.eclipse.wst.internet.monitor.core@default:default,org.eclipse.ui.cheatsheets@default:default,org.eclipse.jdt.compiler.apt@default:false,org.eclipse.wst.common.ui@default:default,org.eclipse.emf.ecore@default:default,javax.xml@default:default,org.eclipse.jdt.core.manipulation@default:default,org.eclipse.jst.common.project.facet.ui@default:default,org.eclipse.rse.shells.ui@default:default,org!
.eclipse.rse.processes.ui@default:default,org.mortbay.jetty.server@default:default,org.eclipse.rse.subsystems.files.core@default:default,org.apache.xml.serializer@default:default,org.eclipse.rse.importexport@default:default,org.eclipse.rse.subsystems.processes.local@default:default,org.eclipse.rse.subsystems.files.ssh@default:default,org.eclipse.equinox.simpleconfigurator@1:true,org.eclipse.swtbot.ant.optional.junit3@default:false,org.eclipse.core.runtime.compatibility.auth@default:default,org.eclipse.emf.ecore.change@default:default,org.eclipse.core.commands@default:default,org.eclipse.rse.useractions@default:default,org.eclipse.equinox.p2.updatesite@default:default,org.eclipse.wst.server.ui.infopop@default:default,org.apache.commons.logging*1.0.4.v201005080501@default:default,org.eclipse.wst.web@default:default,org.eclipse.wst.common.project.facet.ui@default:default,org.eclipse.core.databinding.beans@default:default,org.eclipse.equinox.http.jetty@default:default,org.eclip!
se.ui.ide@default:default,org.eclipse.jdt.debug@default:defaul!
t,org.ec
lipse.update.configurator@3:true,org.eclipse.equinox.p2.director.app@default:default,org.eclipse.wst.html.ui@default:default,org.eclipse.equinox.security@default:default,org.eclipse.pde.build@default:default,org.eclipse.rse.services.dstore@default:default,org.eclipse.ui.editors@default:default,org.eclipse.jem.proxy@default:default,org.eclipse.wst.validation@default:default,org.eclipse.rse.subsystems.shells.telnet@default:default,org.eclipse.core.net@default:default,org.eclipse.equinox.p2.engine@default:default,org.eclipse.equinox.p2.repository@default:default,org.eclipse.ui.browser@default:default,org.eclipse.ecf.filetransfer@default:default,org.eclipse.osgi.util@default:default,org.eclipse.jst.j2ee.jca@default:default,org.eclipse.rse.services.ssh@default:default,org.eclipse.jst.j2ee@default:default,javax.servlet@default:default,org.eclipse.jdt.junit.runtime@default:default,org.eclipse.rse.subsystems.terminals.ssh@default:default,org.eclipse.jem.beaninfo.vm@default:default,o!
rg.eclipse.equinox.frameworkadmin.equinox@default:default,org.eclipse.jst.j2ee.navigator.ui@default:default,org.eclipse.rse.connectorservice.ssh@default:default,org.eclipse.wst.xml.core@default:default,org.eclipse.rse.subsystems.files.ftp@default:default,org.eclipse.rse.connectorservice.telnet@default:default,org.eclipse.wst.common.modulecore.ui@default:default,org.eclipse.rse.subsystems.shells.ssh@default:default,org.eclipse.rse.efs.ui@default:default,org.eclipse.equinox.simpleconfigurator.manipulator@default:default,org.apache.commons.httpclient*3.1.0.v201005080502@default:default,org.eclipse.osgi.services@default:default,com.ibm.icu@default:default,org.apache.lucene.analysis@default:default,org.eclipse.wst.html.core@default:default,org.eclipse.ui.forms@default:default,org.eclipse.wst.css.ui@default:default,org.apache.xml.resolver@default:default,org.eclipse.rse.subsystems.files.local@default:default,org.eclipse.wst.jsdt.manipulation@default:default,org.eclipse.equinox.p2!
.repository.tools@default:default,org.eclipse.equinox.p2.metad!
ata@defa
ult:default,org.eclipse.search@default:default,org.eclipse.rse.ui@default:default,org.eclipse.emf.edit@default:default,org.eclipse.ecf.identity@default:default,org.eclipse.rse.connectorservice.local@default:default,javax.servlet.jsp@default:default,org.apache.ant@default:default,org.eclipse.wst.jsdt.core@default:default,org.eclipse.sdk@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.p2.metadata.repository@default:default,org.eclipse.equinox.p2.core@default:default,org.eclipse.core.runtime.compatibility@default:default,org.eclipse.rse.subsystems.shells.core@default:default,com.jcraft.jsch@default:default,org.eclipse.equinox.p2.artifact.repository@default:default,org.hamcrest.core@default:default,org.eclipse.jst.j2ee.ui@default:default,org.eclipse.jem.beaninfo@default:default,org.eclipse.core.expressions@default:default,org.eclipse.jem.workbench@default:default,org.eclipse.jdt.core@default:default,org.eclipse.equinox.p2.jarprocessor@default:default,org.ec!
lipse.jem@default:default,org.eclipse.text@default:default,org.eclipse.jsch.core@default:default,org.eclipse.compare.core@default:default,org.eclipse.jdt.compiler.tool@default:false,org.eclipse.osgi@-1:true,org.eclipse.jst.common.ui@default:default,org.eclipse.help.ui@default:default,org.eclipse.rse.core@default:default,org.apache.xerces@default:default,org.eclipse.core.resources@default:default,org.eclipse.jface.text@default:default,org.eclipse.wst.xml.ui@default:default,org.eclipse.equinox.p2.garbagecollector@default:default,org.eclipse.rse.subsystems.terminals.core@default:default,org.eclipse.equinox.p2.ui@default:default,org.eclipse.ant.core@default:default,org.eclipse.core.variables@default:default,org.eclipse.jdt@default:default,org.eclipse.core.filebuffers@default:default,org.eclipse.jface.databinding@default:default,org.eclipse.jst.jee@default:default,org.eclipse.ui.navigator@default:default,org.eclipse.ui.console@default:default,org.eclipse.wst.common.uriresolver@d!
efault:default,org.eclipse.rse.subsystems.files.dstore@default!
:default
,org.eclipse.swt.gtk.linux.x86_64@default:false,org.eclipse.jdt.launching@default:default,org.eclipse.ui@default:default,org.eclipse.rse.subsystems.processes.dstore@default:default,org.apache.commons.el@default:default,org.eclipse.jdt.ui@default:default,org.eclipse.debug.ui@default:default,org.eclipse.equinox.p2.publisher@default:default,org.eclipse.jface@default:default,org.eclipse.ui.views@default:default,org.eclipse.swtbot.ant.optional.junit4@default:false,org.eclipse.emf.common@default:default,org.eclipse.jst.common.annotations.controller@default:default,org.eclipse.help.base@default:default,org.eclipse.emf.ecore.edit@default:default,org.eclipse.ui.navigator.resources@default:default,org.eclipse.help@default:default,org.eclipse.rse.subsystems.shells.dstore@default:default,org.eclipse.ltk.core.refactoring@default:default,org.eclipse.rse.dstore.security@default:default,org.eclipse.equinox.preferences@default:default,org.eclipse.jst.j2ee.web@default:default,org.eclipse.wst.!
server.ui.doc.user@default:default,org.sat4j.pb@default:default,org.mortbay.jetty.util@default:default,org.eclipse.ui.ide.application@default:default,org.eclipse.equinox.security.ui@default:default,org.eclipse.compare@default:default,org.eclipse.ecf.provider.filetransfer@default:default,org.eclipse.jem.beaninfo.vm.common@default:default,org.eclipse.rse.efs@default:default,org.eclipse.jst.servlet.ui@default:default,org.eclipse.ui.views.log@default:default,org.eclipse.jdt.junit@default:default,org.eclipse.dstore.extra@default:default,org.eclipse.emf.edit.ui@default:default,org.eclipse.jst.jee.ui@default:default,org.eclipse.core.databinding.observable@default:default,org.eclipse.wst.common.frameworks.ui@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.jst.common.frameworks@default:default,org.eclipse.wst.server.discovery@default:default,org.eclipse.core.filesystem@default:default,org.eclipse.rse.services@default:default,org.eclipse.equinox.p2.director@d!
efault:default,org.eclipse.update.core@default:default,org.ecl!
ipse.swt
@default:default,org.eclipse.jst.common.annotations.core@default:default,org.eclipse.core.databinding@default:default,org.eclipse.jst.j2ee.ejb.annotation.model@default:default,org.junit4@default:default,org.eclipse.wst.server.ui@default:default,org.eclipse.jst.j2ee.ejb@default:default,org.eclipse.ui.views.properties.tabbed@default:default,org.eclipse.core.runtime.compatibility.registry@default:false,org.eclipse.dstore.core@default:default,org.eclipse.tm.terminal@default:default,org.eclipse.wst.server.core@default:default,org.eclipse.jst.j2ee.core@default:default,org.eclipse.debug.core@default:default,org.eclipse.core.net.linux.x86_64@default:false,org.eclipse.jst.j2ee.jca.ui@default:default,org.eclipse.rse.doc.user@default:default,org.eclipse.wst.common.project.facet.core@default:default"/>
+<stringAttribute key="selected_workspace_plugins" value="org.jboss.ide.eclipse.as.rse.core@default:default,org.jboss.ide.eclipse.as.ui@default:default,org.jboss.tools.jmx.ui@default:default,org.jboss.ide.eclipse.as.core@default:default,org.jboss.ide.eclipse.archives.ui@default:default,org.jboss.tools.deltacloud.ui@default:default,org.jboss.ide.eclipse.archives.core@default:default,org.jboss.ide.eclipse.as.wtp.core@default:default,org.jboss.tools.common@default:default,org.jboss.ide.eclipse.archives.webtools@default:default,org.jboss.tools.deltacloud.integration@default:default,org.jboss.tools.deltacloud.core@default:default,org.jboss.tools.jmx.core@default:default,org.jboss.ide.eclipse.as.wtp.ui@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/property/InstancePropertySource.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloud/property/InstancePropertySource.java 2010-12-25 10:51:17 UTC (rev 27738)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloud/property/InstancePropertySource.java 2010-12-25 15:27:49 UTC (rev 27739)
@@ -15,11 +15,9 @@
import org.eclipse.ui.views.properties.IPropertyDescriptor;
import org.eclipse.ui.views.properties.IPropertySource;
import org.eclipse.ui.views.properties.PropertyDescriptor;
-import org.jboss.tools.deltacloud.core.DeltaCloud;
import org.jboss.tools.deltacloud.core.DeltaCloudInstance;
import org.jboss.tools.deltacloud.ui.views.CVMessages;
import org.jboss.tools.deltacloud.ui.views.cloud.InstanceItem;
-import org.jboss.tools.internal.deltacloud.ui.utils.CloudViewElementUtils;
public class InstancePropertySource implements IPropertySource {
@@ -44,10 +42,8 @@
private IPropertyDescriptor[] propertyDescriptors;
private DeltaCloudInstance instance;
- private DeltaCloud cloud;
public InstancePropertySource(InstanceItem element, Object o) {
- cloud = CloudViewElementUtils.getCloud(element);
instance = (DeltaCloudInstance) o;
}
@@ -134,7 +130,7 @@
// a mock and then refresh the instance? investigate what are the
// consequences of uncommenting this stuff here
// try {
- key = instance.getKey();
+ key = instance.getKeyId();
// if (!cloud.getType().equals(DeltaCloud.MOCK_TYPE)) {
// if (instance.getState().equals(DeltaCloudInstance.State.RUNNING) &&
// (key == null || key.length() == 0)) {
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ManageKeysPage.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ManageKeysPage.java 2010-12-25 10:51:17 UTC (rev 27738)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ManageKeysPage.java 2010-12-25 15:27:49 UTC (rev 27739)
@@ -269,7 +269,9 @@
private void createKey(final String keyId) {
try {
- model.createKey(keyId);
+ DeltaCloudKey key = model.createKey(keyId);
+// I guess that the launch job stores the key in the appropriate place already
+// PemFileFactory.create(key);
} catch (Exception e) {
// TODO: internationalize strings
ErrorUtils.handleError(
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ManageKeysPageModel.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ManageKeysPageModel.java 2010-12-25 10:51:17 UTC (rev 27738)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ManageKeysPageModel.java 2010-12-25 15:27:49 UTC (rev 27739)
@@ -61,12 +61,13 @@
setSelectedKey(index - 1);
}
- public void createKey(String keyId) throws DeltaCloudException {
+ public DeltaCloudKey createKey(String keyId) throws DeltaCloudException {
DeltaCloudKey key = cloud.createKey(keyId);
keys.add(key);
int index = keys.indexOf(key);
fireIndexedPropertyChange(PROP_KEYS, index, null, key);
setSelectedKey(key);
+ return key;
}
public DeltaCloudKey getSelectedKey() {
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ManageKeysWizard.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ManageKeysWizard.java 2010-12-25 10:51:17 UTC (rev 27738)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ManageKeysWizard.java 2010-12-25 15:27:49 UTC (rev 27739)
@@ -48,5 +48,4 @@
this.key = mainPage.getKey();
return true;
}
-
}
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-25 10:51:17 UTC (rev 27738)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage.java 2010-12-25 15:27:49 UTC (rev 27739)
@@ -237,7 +237,7 @@
bindProfileCombo(hardwareCombo, dbc);
bindProfilePages(hardwareCombo, profilePages, dbc);
// key
- bindText(keyText, NewInstancePageModel.PROPERTY_KEYNAME, WizardMessages.getString(MUST_ENTER_A_KEYNAME), dbc);
+ bindText(keyText, NewInstancePageModel.PROPERTY_KEYID, WizardMessages.getString(MUST_ENTER_A_KEYNAME), dbc);
}
private void bindArchLabel(IObservableValue imageObservable, DataBindingContext dbc) {
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-25 10:51:17 UTC (rev 27738)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePageModel.java 2010-12-25 15:27:49 UTC (rev 27739)
@@ -31,7 +31,7 @@
public static final String PROPERTY_ARCH = "arch"; //$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_KEYID = "keyId"; //$NON-NLS-1$
public static final String PROP_PROFILE = "profile"; //$NON-NLS-1$
public static final String PROP_ALL_PROFILES = "allProfiles"; //$NON-NLS-1$
public static final String PROP_FILTERED_PROFILES = "filteredProfiles"; //$NON-NLS-1$
@@ -40,7 +40,7 @@
private String name;
private DeltaCloudImage image;
private String arch;
- private String keyname;
+ private String keyId;
private DeltaCloudRealm selectedRealm;
private List<DeltaCloudRealm> realms = new ArrayList<DeltaCloudRealm>();
private DeltaCloudHardwareProfile selectedProfile;
@@ -51,7 +51,7 @@
private String memory;
protected NewInstancePageModel(String keyname, DeltaCloudImage image) {
- this.keyname = keyname;
+ this.keyId = keyname;
this.image = image;
}
@@ -169,12 +169,12 @@
return selectedProfile.getId();
}
- public String getKeyname() {
- return keyname;
+ public String getKeyId() {
+ return keyId;
}
public void setKeyname(String keyname) {
- getPropertyChangeSupport().firePropertyChange(PROPERTY_KEYNAME, this.keyname, this.keyname = keyname);
+ getPropertyChangeSupport().firePropertyChange(PROPERTY_KEYID, this.keyId, this.keyId = keyname);
}
public String getArch() {
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-25 10:51:17 UTC (rev 27738)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceWizard.java 2010-12-25 15:27:49 UTC (rev 27739)
@@ -87,12 +87,13 @@
String memory = model.getMemory();
String storage = model.getStorage();
- String keyname = model.getKeyname();
+ String keyId = model.getKeyId();
+
String name = utf8Encode(model.getName());
// Save persistent settings for this particular cloud
cloud.setLastImageId(imageId);
- cloud.setLastKeyname(keyname);
+ cloud.setLastKeyname(keyId);
Preferences prefs = new InstanceScope().getNode(Activator.PLUGIN_ID);
@@ -119,7 +120,7 @@
prefs.putBoolean(IDeltaCloudPreferenceConstants.DONT_CONFIRM_CREATE_INSTANCE, true);
}
}
- instance = cloud.createInstance(name, imageId, realmId, profileId, keyname, memory, storage);
+ instance = cloud.createInstance(name, imageId, realmId, profileId, keyId, memory, storage);
if (instance != null) {
result = true;
}
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/PemFileFactory.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/PemFileFactory.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/PemFileFactory.java 2010-12-25 15:27:49 UTC (rev 27739)
@@ -0,0 +1,78 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.internal.deltacloud.ui.wizards;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+
+import org.eclipse.core.runtime.Path;
+import org.jboss.tools.deltacloud.core.DeltaCloudException;
+import org.jboss.tools.deltacloud.core.DeltaCloudKey;
+
+/**
+ * @author André Dietisheim
+ */
+public class PemFileFactory {
+
+ private static final String PEM_FILE_SUFFIX = "pem";
+
+ public static File create(DeltaCloudKey key) throws DeltaCloudException {
+ return create(key, getKeyStorePath());
+ }
+
+ private static String getKeyStorePath() throws DeltaCloudException {
+ // TODO: replace by code that queries the RSE preferences for its key
+ // location setting
+ String userHomePath = System.getProperty("user.home");
+ if (userHomePath == null) {
+ throw new DeltaCloudException("Could not determine path to save pem file to");
+ }
+ return new StringBuilder(userHomePath)
+ .append(File.separatorChar).append(".ssh").append(File.separatorChar)
+ .toString();
+ }
+
+ private static File create(DeltaCloudKey key, String keyStorePath) throws DeltaCloudException {
+ try {
+ File keyFile = createFile(key.getId(), keyStorePath);
+ save(key.getPem(), keyFile);
+ return keyFile;
+ } catch (Exception e) {
+ throw new DeltaCloudException(e);
+ }
+ }
+
+ private static void save(String key, File keyFile) throws IOException {
+ if (key != null) {
+ FileWriter w = new FileWriter(keyFile);
+ w.write(key);
+ w.close();
+ }
+ }
+
+ private static File createFile(String keyname, String keyStoreLocation)
+ throws IOException {
+ File keyFile =
+ Path.fromOSString(keyStoreLocation)
+ .append(keyname)
+ .addFileExtension(PEM_FILE_SUFFIX) //$NON-NLS-1$
+ .toFile();
+ if (!keyFile.exists()) {
+ keyFile.createNewFile();
+ }
+ keyFile.setReadable(false, false);
+ keyFile.setWritable(true, true);
+ keyFile.setReadable(true, true);
+ return keyFile;
+ }
+
+}
Property changes on: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/PemFileFactory.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
14 years
JBoss Tools SVN: r27738 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-12-25 05:51:17 -0500 (Sat, 25 Dec 2010)
New Revision: 27738
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/Deltacloud Tools.launch
Log:
corrected missing dependencies
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-25 10:36:25 UTC (rev 27737)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/Deltacloud Tools.launch 2010-12-25 10:51:17 UTC (rev 27738)
@@ -24,8 +24,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="org.eclipse.rse.subsystems.shells.ssh@default:default,org.eclipse.wst.xml.core@default:default,org.eclipse.wst.common.modulecore.ui@default:default,org.eclipse.equinox.p2.engine@default:default,org.eclipse.rse.subsystems.shells.telnet@default:default,org.eclipse.jst.j2ee@default:default,org.eclipse.jst.common.annotations.controller@default:default,org.eclipse.wst.web.ui@default:default,org.eclipse.ui.cheatsheets@default:default,org.eclipse.jst.j2ee.ejb@default:default,org.apache.xml.resolver@default:default,org.eclipse.jem.workbench@default:default,org.eclipse.jst.jee.ui@default:default,org.eclipse.jst.servlet.ui@default:default,org.eclipse.wst.common.project.facet.core@default:default,org.apache.xerces@default:default,org.eclipse.wst.server.ui@default:default,org.eclipse.jface.text@default:default,org.eclipse.jdt@default:default,org.eclipse.platform@default:default,org.eclipse.ui.browser@default:default,org.eclipse.core!
.net.linux.x86_64@default:false,org.apache.commons.codec*1.3.0.v20100518-1140@default:default,org.eclipse.rse.services.ssh@default:default,org.eclipse.jdt.compiler.tool@default:false,org.eclipse.jface.databinding@default:default,org.eclipse.rse.connectorservice.local@default:default,org.eclipse.wst.common.environment@default:default,org.eclipse.equinox.security@default:default,org.eclipse.wst.common.ui@default:default,org.eclipse.rse.subsystems.files.core@default:default,org.eclipse.wst.common.uriresolver@default:default,org.eclipse.wst.html.ui@default:default,org.eclipse.rse.ui@default:default,org.eclipse.wst.server.core@default:default,org.eclipse.pde.core@default:default,org.eclipse.wst.internet.monitor.core@default:default,org.eclipse.wst.common.frameworks.ui@default:default,org.eclipse.jem.beaninfo@default:default,org.apache.lucene.analysis@default:default,org.eclipse.equinox.frameworkadmin@default:default,org.eclipse.equinox.p2.core@default:default,org.eclipse.equinox!
.app@default:default,org.eclipse.jst.j2ee.ejb.annotation.model!
@default
:default,org.eclipse.wst.common.emfworkbench.integration@default:default,org.eclipse.rse.files.ui@default:default,org.eclipse.core.databinding@default:default,org.eclipse.jst.common.project.facet.ui@default:default,org.eclipse.wst.validation@default:default,org.eclipse.wst.common.core@default:default,org.eclipse.jdt.junit@default:default,org.eclipse.equinox.p2.director@default:default,org.mortbay.jetty.server@default:default,org.eclipse.rse.connectorservice.telnet@default:default,org.eclipse.text@default:default,org.eclipse.ecf.ssl@default:false,org.eclipse.ltk.ui.refactoring@default:default,org.eclipse.emf.edit@default:default,org.eclipse.core.databinding.observable@default:default,org.eclipse.core.runtime.compatibility.registry@default:false,javax.servlet.jsp@default:default,org.eclipse.equinox.p2.artifact.repository@default:default,org.eclipse.team.core@default:default,org.eclipse.equinox.p2.metadata.repository@default:default,org.eclipse.dstore.extra@default:default,org.!
eclipse.ui.workbench@default:default,org.eclipse.equinox.frameworkadmin.equinox@default:default,javax.xml@default:default,org.eclipse.equinox.concurrent@default:default,org.eclipse.jst.j2ee.ui@default:default,org.eclipse.tm.terminal@default:default,org.eclipse.equinox.p2.ui@default:default,org.eclipse.ui.views.properties.tabbed@default:default,org.junit4@default:default,org.eclipse.core.databinding.property@default:default,org.eclipse.jst.j2ee.jca@default:default,org.apache.xml.serializer@default:default,org.eclipse.ecf.provider.filetransfer.ssl@default:false,org.eclipse.wst.jsdt.ui@default:default,org.eclipse.sdk@default:default,org.eclipse.pde.build@default:default,org.eclipse.help@default:default,org.eclipse.emf.edit.ui@default:default,org.eclipse.core.runtime.compatibility.auth@default:default,org.eclipse.jem.beaninfo.vm@default:default,org.apache.commons.net@default:default,org.eclipse.rse.connectorservice.ssh@default:default,org.eclipse.osgi.util@default:default,com.i!
bm.icu@default:default,org.eclipse.ui.editors@default:default,!
org.ecli
pse.compare@default:default,org.eclipse.emf.ecore.change@default:default,org.eclipse.ltk.core.refactoring@default:default,org.eclipse.wst.html.core@default:default,org.eclipse.jdt.core@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.wst.sse.ui@default:default,org.eclipse.equinox.p2.updatesite@default:default,org.eclipse.ui@default:default,org.eclipse.equinox.p2.director.app@default:default,org.eclipse.emf.ecore.edit@default:default,org.eclipse.rse.services.telnet@default:default,org.eclipse.emf.ecore@default:default,org.eclipse.jdt.ui@default:default,org.eclipse.wst.server.ui.infopop@default:default,org.apache.ant@default:default,org.eclipse.core.commands@default:default,org.eclipse.jdt.junit.core@default:default,org.eclipse.core.databinding.beans@default:default,org.eclipse.core.expressions@default:default,org.apache.commons.el@default:default,org.eclipse.jdt.debug@default:default,org.eclipse.ui.forms@default:default,org.eclipse.core.runtime@default!
:true,org.eclipse.emf.ecore.xmi@default:default,org.eclipse.ecf.provider.filetransfer@default:default,org.eclipse.osgi.services@default:default,org.junit*4.8.1.v4_8_1_v20100427-1100@default:default,org.eclipse.equinox.p2.metadata@default:default,org.eclipse.compare.core@default:default,org.eclipse.wst.common.modulecore@default:default,org.eclipse.ant.core@default:default,org.eclipse.ui.console@default:default,org.eclipse.jst.j2ee.core@default:default,org.eclipse.equinox.p2.touchpoint.eclipse@default:default,org.eclipse.equinox.simpleconfigurator.manipulator@default:default,org.eclipse.ecf.filetransfer@default:default,org.eclipse.equinox.http.servlet@default:default,org.eclipse.search@default:default,org.eclipse.core.filebuffers@default:default,org.eclipse.swtbot.ant.optional.junit3@default:false,org.eclipse.ui.ide@default:default,org.eclipse.equinox.http.jetty@default:default,org.eclipse.team.ui@default:default,org.eclipse.equinox.preferences@default:default,org.eclipse.equ!
inox.simpleconfigurator@1:true,org.eclipse.wst.server.ui.doc.u!
ser@defa
ult:default,org.eclipse.core.filesystem.linux.x86_64@default:false,org.eclipse.ecf.identity@default:default,org.eclipse.jst.server.core@default:default,org.hamcrest.core@default:default,org.eclipse.rse.useractions@default:default,org.eclipse.wst.sse.core@default:default,org.eclipse.jst.j2ee.navigator.ui@default:default,org.eclipse.osgi@-1:true,org.eclipse.rse.core@default:default,org.eclipse.jface@default:default,org.eclipse.swtbot.ant.optional.junit4@default:false,org.eclipse.rse.services.files.ftp@default:default,org.eclipse.rse.connectorservice.dstore@default:default,org.eclipse.swt@default:default,org.eclipse.emf.common@default:default,org.eclipse.ui.ide.application@default:default,org.eclipse.rse.shells.ui@default:default,org.eclipse.jdt.core.manipulation@default:default,org.eclipse.equinox.p2.publisher@default:default,com.jcraft.jsch@default:default,org.eclipse.core.jobs@default:default,org.apache.jasper@default:default,org.eclipse.help.base@default:default,org.eclipse!
.rse.services.dstore@default:default,org.eclipse.equinox.p2.repository@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.jst.common.annotations.core@default:default,org.eclipse.debug.core@default:default,org.eclipse.core.resources@default:default,org.eclipse.jem.proxy@default:default,org.eclipse.wst.web@default:default,org.eclipse.jsch.core@default:default,org.sat4j.core@default:default,org.eclipse.ui.navigator.resources@default:default,org.eclipse.ui.workbench.texteditor@default:default,org.eclipse.wst.xml.ui@default:default,org.eclipse.jst.common.project.facet.core@default:default,org.eclipse.core.runtime.compatibility@default:default,javax.servlet@default:default,org.eclipse.help.ui@default:default,org.eclipse.emf.common.ui@default:default,org.eclipse.jst.server.ui@default:default,org.eclipse.jdt.junit.runtime@default:default,org.eclipse.jdt.launching@default:default,org.eclipse.rse.services.local@default:default,org.eclipse.equinox.p2.operations@d!
efault:default,org.eclipse.rse.subsystems.terminals.ssh@defaul!
t:defaul
t,org.eclipse.jst.common.ui@default:default,org.eclipse.rse.subsystems.terminals.core@default:default,org.eclipse.equinox.p2.garbagecollector@default:default,org.eclipse.jst.j2ee.web@default:default,org.sat4j.pb@default:default,org.eclipse.dstore.core@default:default,org.eclipse.wst.jsdt.manipulation@default:default,org.eclipse.rse.subsystems.shells.dstore@default:default,org.eclipse.wst.css.core@default:default,org.eclipse.jst.common.frameworks@default:default,org.eclipse.wst.css.ui@default:default,org.eclipse.jdt.compiler.apt@default:false,org.eclipse.wst.server.discovery@default:default,org.eclipse.wst.common.emf@default:default,org.eclipse.equinox.p2.repository.tools@default:default,org.eclipse.core.variables@default:default,org.eclipse.jem@default:default,org.eclipse.jem.util@default:default,org.apache.commons.httpclient*3.1.0.v201005080502@default:default,org.eclipse.swt.gtk.linux.x86_64@default:false,org.eclipse.jst.j2ee.jca.ui@default:default,org.mortbay.jetty.util@d!
efault:default,org.eclipse.equinox.common@2:true,org.eclipse.rse.subsystems.shells.core@default:default,org.eclipse.rse.subsystems.shells.local@default:default,org.eclipse.jem.beaninfo.vm.common@default:default,org.eclipse.ui.views@default:default,org.eclipse.ui.intro@default:default,org.eclipse.wst.jsdt.core@default:default,org.eclipse.debug.ui@default:default,org.eclipse.jdt.debug.ui@default:default,org.apache.lucene@default:default,org.eclipse.core.net@default:default,org.eclipse.update.core@default:default,org.eclipse.jst.jee@default:default,org.apache.commons.logging*1.0.4.v201005080501@default:default,org.eclipse.ecf@default:default,org.eclipse.update.configurator@3:true,org.eclipse.rse.services@default:default,org.eclipse.ui.views.log@default:default,org.eclipse.wst.common.frameworks@default:default,org.eclipse.equinox.security.ui@default:default,org.eclipse.wst.common.project.facet.ui@default:default,org.eclipse.ui.navigator@default:default,org.eclipse.equinox.p2.ja!
rprocessor@default:default,org.eclipse.rse.terminals.ui@defaul!
t:defaul
t,org.eclipse.emf.codegen@default:default,org.eclipse.core.filesystem@default:default"/>
-<stringAttribute key="selected_workspace_plugins" value="org.jboss.ide.eclipse.archives.core@default:default,org.jboss.ide.eclipse.as.wtp.core@default:default,org.jboss.tools.jmx.ui@default:default,org.jboss.tools.common@default:default,org.jboss.tools.jmx.core@default:default,org.jboss.ide.eclipse.as.rse.core@default:default,org.jboss.ide.eclipse.archives.ui@default:default,org.jboss.tools.deltacloud.ui@default:default,org.jboss.tools.deltacloud.core@default:default,org.jboss.ide.eclipse.archives.webtools@default:default,org.jboss.ide.eclipse.as.ui@default:default,org.jboss.tools.deltacloud.integration@default:default,org.jboss.ide.eclipse.as.wtp.ui@default:default,org.jboss.ide.eclipse.as.core@default:default"/>
+<stringAttribute key="selected_target_plugins" value="org.eclipse.jst.common.frameworks@default:default,org.hamcrest.core@default:default,org.eclipse.jdt.core@default:default,org.eclipse.rse.importexport@default:default,org.eclipse.rse.files.ui@default:default,org.eclipse.jdt@default:default,org.eclipse.equinox.p2.artifact.repository@default:default,org.eclipse.rse.connectorservice.ssh@default:default,org.eclipse.help.base@default:default,org.eclipse.ecf.provider.filetransfer@default:default,org.eclipse.core.commands@default:default,org.eclipse.rse.subsystems.shells.dstore@default:default,org.eclipse.jface.text@default:default,org.eclipse.ui.browser@default:default,org.junit*4.8.1.v4_8_1_v20100427-1100@default:default,org.eclipse.equinox.security.ui@default:default,javax.servlet.jsp@default:default,org.eclipse.core.jobs@default:default,org.eclipse.wst.jsdt.manipulation@default:default,org.eclipse.ui.workbench@default:default,org.eclipse.wst.validation@default:default,org.ec!
lipse.wst.server.ui.infopop@default:default,org.eclipse.jdt.junit.runtime@default:default,org.eclipse.jdt.junit.core@default:default,org.eclipse.text@default:default,org.eclipse.jdt.compiler.tool@default:false,org.eclipse.equinox.p2.publisher@default:default,org.eclipse.help.ui@default:default,org.eclipse.compare.core@default:default,org.eclipse.jsch.core@default:default,org.eclipse.jst.j2ee.ui@default:default,org.eclipse.wst.css.core@default:default,org.eclipse.equinox.http.jetty@default:default,org.eclipse.jst.j2ee@default:default,org.sat4j.core@default:default,org.eclipse.equinox.p2.core@default:default,org.eclipse.jst.j2ee.web@default:default,org.eclipse.ui.intro@default:default,org.eclipse.core.databinding.beans@default:default,org.eclipse.pde.build@default:default,org.eclipse.rse.ui@default:default,javax.xml@default:default,org.eclipse.equinox.p2.metadata.repository@default:default,org.eclipse.rse.subsystems.files.ssh@default:default,org.eclipse.equinox.p2.updatesite@!
default:default,org.eclipse.jem.beaninfo.vm@default:default,or!
g.eclips
e.emf.common.ui@default:default,org.eclipse.jem.proxy@default:default,org.eclipse.jst.j2ee.navigator.ui@default:default,org.eclipse.wst.css.ui@default:default,org.eclipse.help@default:default,org.eclipse.ui.views.properties.tabbed@default:default,org.eclipse.wst.internet.monitor.core@default:default,org.eclipse.dstore.core@default:default,org.eclipse.rse.subsystems.files.core@default:default,org.eclipse.ui@default:default,org.eclipse.wst.common.ui@default:default,org.apache.xerces@default:default,org.eclipse.ui.cheatsheets@default:default,org.eclipse.wst.sse.core@default:default,org.eclipse.ui.workbench.texteditor@default:default,org.eclipse.jst.common.annotations.controller@default:default,com.ibm.icu@default:default,org.eclipse.swt@default:default,org.eclipse.ui.navigator.resources@default:default,org.eclipse.wst.xml.ui@default:default,org.eclipse.jst.jee.ui@default:default,org.apache.commons.codec*1.3.0.v20100518-1140@default:default,org.apache.commons.el@default:default,!
org.eclipse.equinox.p2.jarprocessor@default:default,org.eclipse.jem.beaninfo@default:default,org.eclipse.wst.common.emf@default:default,org.eclipse.search@default:default,org.eclipse.wst.server.core@default:default,org.eclipse.wst.server.ui@default:default,org.eclipse.rse.subsystems.shells.ssh@default:default,org.eclipse.wst.jsdt.ui@default:default,org.apache.commons.net@default:default,org.eclipse.rse.shells.ui@default:default,org.eclipse.swt.gtk.linux.x86_64@default:false,org.eclipse.ecf.ssl@default:false,org.mortbay.jetty.server@default:default,org.eclipse.ui.console@default:default,org.eclipse.equinox.frameworkadmin@default:default,org.eclipse.update.core@default:default,org.eclipse.wst.jsdt.core@default:default,org.eclipse.jst.j2ee.jca.ui@default:default,org.eclipse.jst.server.ui@default:default,org.eclipse.ui.views@default:default,org.eclipse.jem.workbench@default:default,org.eclipse.ui.views.log@default:default,org.apache.jasper@default:default,org.eclipse.sdk@defaul!
t:default,org.eclipse.rse.useractions@default:default,org.ecli!
pse.rse.
connectorservice.local@default:default,org.eclipse.wst.common.project.facet.ui@default:default,org.eclipse.emf.ecore.edit@default:default,org.eclipse.jst.j2ee.core@default:default,org.eclipse.rse.terminals.ui@default:default,org.eclipse.emf.ecore.change@default:default,org.apache.commons.httpclient*3.1.0.v201005080502@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.jst.j2ee.ejb.annotation.model@default:default,org.eclipse.jst.j2ee.jca@default:default,org.eclipse.equinox.common@2:true,org.eclipse.swtbot.ant.optional.junit4@default:false,org.eclipse.team.ui@default:default,org.eclipse.rse.efs.ui@default:default,org.eclipse.wst.common.modulecore@default:default,org.eclipse.equinox.frameworkadmin.equinox@default:default,org.eclipse.ant.core@default:default,org.eclipse.rse.subsystems.processes.local@default:default,org.eclipse.wst.common.environment@default:default,org.eclipse.core.net.linux.x86_64@default:false,org.eclipse.ui.forms@default:default,org.ec!
lipse.jst.common.ui@default:default,org.eclipse.rse.subsystems.terminals.core@default:default,org.eclipse.jem.beaninfo.vm.common@default:default,org.eclipse.core.resources@default:default,org.eclipse.jst.servlet.ui@default:default,org.eclipse.rse.subsystems.processes.core@default:default,org.eclipse.emf.ecore@default:default,org.eclipse.ecf.filetransfer@default:default,org.eclipse.osgi.services@default:default,org.eclipse.wst.xml.core@default:default,org.eclipse.equinox.simpleconfigurator@1:true,org.eclipse.core.filebuffers@default:default,org.apache.xml.resolver@default:default,org.eclipse.wst.common.frameworks@default:default,org.eclipse.rse.doc.user@default:default,org.eclipse.jface.databinding@default:default,org.eclipse.ltk.core.refactoring@default:default,org.eclipse.equinox.p2.operations@default:default,org.eclipse.equinox.p2.director.app@default:default,org.eclipse.core.net@default:default,org.eclipse.ltk.ui.refactoring@default:default,org.apache.lucene.analysis@def!
ault:default,com.jcraft.jsch@default:default,org.eclipse.rse.s!
ubsystem
s.shells.telnet@default:default,org.eclipse.ui.ide.application@default:default,org.eclipse.emf.common@default:default,org.apache.lucene@default:default,org.mortbay.jetty.util@default:default,org.eclipse.swtbot.ant.optional.junit3@default:false,org.sat4j.pb@default:default,org.eclipse.equinox.p2.ui@default:default,org.eclipse.osgi.util@default:default,org.eclipse.wst.server.discovery@default:default,org.eclipse.emf.ecore.xmi@default:default,org.eclipse.rse.subsystems.files.ftp@default:default,org.eclipse.equinox.app@default:default,org.eclipse.rse.subsystems.shells.local@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.debug.ui@default:default,org.eclipse.dstore.extra@default:default,org.eclipse.update.configurator@3:true,org.eclipse.jem.util@default:default,org.eclipse.rse.services@default:default,org.eclipse.core.filesystem@default:default,org.eclipse.rse.subsystems.shells.core@default:default,org.eclipse.compare@default:default,org.eclipse.rse.servi!
ces.local@default:default,org.eclipse.emf.edit.ui@default:default,org.eclipse.jdt.compiler.apt@default:false,org.eclipse.tm.terminal@default:default,org.eclipse.rse.services.telnet@default:default,org.eclipse.wst.common.core@default:default,org.eclipse.emf.edit@default:default,org.eclipse.equinox.p2.director@default:default,org.eclipse.rse.subsystems.terminals.ssh@default:default,org.eclipse.rse.services.ssh@default:default,org.eclipse.core.databinding.property@default:default,org.eclipse.rse.processes.ui@default:default,org.eclipse.wst.sse.ui@default:default,org.eclipse.osgi@-1:true,org.eclipse.ecf.provider.filetransfer.ssl@default:false,org.eclipse.jdt.launching@default:default,org.eclipse.wst.common.project.facet.core@default:default,org.eclipse.equinox.p2.metadata@default:default,org.eclipse.ecf@default:default,org.eclipse.equinox.p2.touchpoint.eclipse@default:default,org.eclipse.ui.ide@default:default,org.eclipse.rse.subsystems.processes.dstore@default:default,org.ecli!
pse.rse.subsystems.files.local@default:default,org.eclipse.jst!
.common.
project.facet.core@default:default,org.eclipse.rse.subsystems.processes.shell.linux@default:default,org.eclipse.wst.common.emfworkbench.integration@default:default,org.eclipse.wst.common.uriresolver@default:default,org.eclipse.jst.common.annotations.core@default:default,org.eclipse.equinox.concurrent@default:default,org.eclipse.core.variables@default:default,org.junit4@default:default,org.eclipse.ecf.identity@default:default,org.eclipse.jdt.debug@default:default,org.eclipse.core.databinding.observable@default:default,javax.servlet@default:default,org.eclipse.jst.common.project.facet.ui@default:default,org.eclipse.core.databinding@default:default,org.eclipse.wst.html.core@default:default,org.eclipse.rse.services.dstore@default:default,org.eclipse.core.runtime.compatibility@default:default,org.eclipse.wst.html.ui@default:default,org.eclipse.rse.services.files.ftp@default:default,org.eclipse.jst.jee@default:default,org.eclipse.jst.server.core@default:default,org.eclipse.pde.cor!
e@default:default,org.eclipse.core.filesystem.linux.x86_64@default:false,org.eclipse.equinox.http.servlet@default:default,org.eclipse.equinox.p2.engine@default:default,org.eclipse.rse.connectorservice.telnet@default:default,org.eclipse.equinox.simpleconfigurator.manipulator@default:default,org.eclipse.equinox.preferences@default:default,org.eclipse.rse.subsystems.files.dstore@default:default,org.apache.ant@default:default,org.eclipse.team.core@default:default,org.eclipse.equinox.p2.repository@default:default,org.eclipse.equinox.p2.repository.tools@default:default,org.eclipse.rse.connectorservice.dstore@default:default,org.eclipse.jdt.ui@default:default,org.eclipse.rse.efs@default:default,org.eclipse.jface@default:default,org.eclipse.debug.core@default:default,org.eclipse.ui.editors@default:default,org.eclipse.core.runtime.compatibility.registry@default:false,org.apache.commons.logging*1.0.4.v201005080501@default:default,org.eclipse.rse.dstore.security@default:default,org.ec!
lipse.wst.web@default:default,org.eclipse.core.runtime.compati!
bility.a
uth@default:default,org.eclipse.jdt.debug.ui@default:default,org.eclipse.jdt.core.manipulation@default:default,org.eclipse.ui.navigator@default:default,org.eclipse.equinox.security@default:default,org.eclipse.equinox.p2.garbagecollector@default:default,org.eclipse.wst.server.ui.doc.user@default:default,org.eclipse.wst.common.frameworks.ui@default:default,org.eclipse.rse.core@default:default,org.apache.xml.serializer@default:default,org.eclipse.core.expressions@default:default,org.eclipse.jdt.junit@default:default,org.eclipse.jst.j2ee.ejb@default:default,org.eclipse.core.runtime@default:true,org.eclipse.platform@default:default,org.eclipse.wst.web.ui@default:default,org.eclipse.wst.common.modulecore.ui@default:default,org.eclipse.jem@default:default,org.eclipse.emf.codegen@default:default"/>
+<stringAttribute key="selected_workspace_plugins" value="org.jboss.tools.common@default:default,org.jboss.tools.jmx.core@default:default,org.jboss.ide.eclipse.as.wtp.ui@default:default,org.jboss.ide.eclipse.as.rse.core@default:default,org.jboss.ide.eclipse.archives.ui@default:default,org.jboss.tools.deltacloud.core@default:default,org.jboss.ide.eclipse.as.core@default:default,org.jboss.ide.eclipse.as.wtp.core@default:default,org.jboss.ide.eclipse.as.ui@default:default,org.jboss.ide.eclipse.archives.webtools@default:default,org.jboss.tools.jmx.ui@default:default,org.jboss.tools.deltacloud.ui@default:default,org.jboss.ide.eclipse.archives.core@default:default,org.jboss.tools.deltacloud.integration@default:default"/>
<booleanAttribute key="show_selected_only" value="false"/>
<stringAttribute key="templateConfig" value="${target_home}/configuration/config.ini"/>
<booleanAttribute key="tracing" value="false"/>
14 years
JBoss Tools SVN: r27737 - 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-25 05:36:25 -0500 (Sat, 25 Dec 2010)
New Revision: 27737
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/NewInstancePageModel.java
Log:
[JBIDE-8000] switched to observable pojo that notifies in UI thread only, corrected binding order (first bind items, then selected item, then enablement)
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-25 10:17:25 UTC (rev 27736)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage.java 2010-12-25 10:36:25 UTC (rev 27737)
@@ -10,8 +10,12 @@
*******************************************************************************/
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.HashMap;
+import java.util.List;
import java.util.Map;
import org.eclipse.core.databinding.Binding;
@@ -30,7 +34,9 @@
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;
@@ -51,13 +57,16 @@
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
+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.DeltaCloudKey;
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.Activator;
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.common.databinding.validator.SelectedComboItemValidator;
@@ -139,7 +148,7 @@
super(WizardMessages.getString(NAME));
this.cloud = cloud;
String defaultKeyname = cloud.getLastKeyname();
- model = new NewInstancePageModel(cloud, defaultKeyname, image); //$NON-NLS-1$
+ model = new NewInstancePageModel(defaultKeyname, image); //$NON-NLS-1$
setDescription(WizardMessages.getString(DESCRIPTION));
setTitle(WizardMessages.getString(TITLE));
setImageDescriptor(SWTImagesFactory.DESC_DELTA_LARGE);
@@ -152,6 +161,8 @@
this.container = createWidgets(parent);
setControl(container);
bindWidgets(dbc, container);
+ asyncGetProfiles(model, cloud);
+ asyncGetRealms(model, cloud);
}
private Composite createWidgets(Composite parent) {
@@ -196,9 +207,6 @@
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);
@@ -490,4 +498,40 @@
public NewInstancePageModel getModel() {
return model;
}
+
+ private void asyncGetProfiles(final NewInstancePageModel model, final DeltaCloud cloud) {
+ // TODO: internationalize strings
+ new AbstractCloudElementJob("Get profiles", cloud, CLOUDELEMENT.PROFILES) {
+ protected IStatus doRun(IProgressMonitor monitor) throws Exception {
+ try {
+ List<DeltaCloudHardwareProfile> profiles = Arrays.asList(cloud.getProfiles());
+ model.setAllProfiles(profiles);
+ return Status.OK_STATUS;
+ } catch (DeltaCloudException e) {
+ // TODO: internationalize strings
+ return StatusFactory.getInstance(IStatus.ERROR, Activator.PLUGIN_ID,
+ MessageFormat.format("Could not get profiles from cloud {0}", cloud.getName()));
+ }
+ }
+ }.schedule();
+ }
+
+ private void asyncGetRealms(final NewInstancePageModel model, final DeltaCloud cloud) {
+ // TODO: internationalize strings
+ new AbstractCloudElementJob("Get realms", cloud, CLOUDELEMENT.REALMS) {
+ protected IStatus doRun(IProgressMonitor monitor) throws Exception {
+ try {
+ List<DeltaCloudRealm> allRealms = new ArrayList<DeltaCloudRealm>();
+ allRealms.addAll(Arrays.asList(cloud.getRealms()));
+ model.setRealms(allRealms);
+ 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();
+ }
+
}
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-25 10:17:25 UTC (rev 27736)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePageModel.java 2010-12-25 10:36:25 UTC (rev 27737)
@@ -10,24 +10,13 @@
******************************************************************************/
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.ui.common.databinding.validator.ObservableUIPojo;
/**
@@ -52,7 +41,6 @@
private DeltaCloudImage image;
private String arch;
private String keyname;
- private DeltaCloud cloud;
private DeltaCloudRealm selectedRealm;
private List<DeltaCloudRealm> realms = new ArrayList<DeltaCloudRealm>();
private DeltaCloudHardwareProfile selectedProfile;
@@ -62,12 +50,9 @@
private String storage;
private String memory;
- protected NewInstancePageModel(DeltaCloud cloud, String keyname, DeltaCloudImage image) {
- this.cloud = cloud;
+ protected NewInstancePageModel(String keyname, DeltaCloudImage image) {
this.keyname = keyname;
this.image = image;
- asyncGetRealms();
- asyncGetProfiles();
}
public String getName() {
@@ -116,16 +101,19 @@
return selectedRealm.getId();
}
- private void setRealms(List<DeltaCloudRealm> realms) {
+ protected void setRealms(List<DeltaCloudRealm> realms) {
getPropertyChangeSupport().firePropertyChange(PROPERTY_REALMS, this.realms, this.realms = realms);
+ setSelectedRealmIndex(0);
}
public List<DeltaCloudRealm> getRealms() {
return realms;
}
- private void setAllProfiles(List<DeltaCloudHardwareProfile> profiles) {
+ protected void setAllProfiles(List<DeltaCloudHardwareProfile> profiles) {
getPropertyChangeSupport().firePropertyChange(PROP_ALL_PROFILES, this.allProfiles, this.allProfiles = profiles);
+ setFilteredProfiles(filterProfiles(image, profiles));
+ setSelectedProfileIndex(0);
}
public List<DeltaCloudHardwareProfile> getAllProfiles() {
@@ -201,42 +189,6 @@
return allProfiles.indexOf(selectedProfile);
}
- 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 {
- List<DeltaCloudHardwareProfile> profiles = Arrays.asList(cloud.getProfiles());
- setAllProfiles(profiles);
- setFilteredProfiles(filterProfiles(image, profiles));
- 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 profiles from cloud {0}", cloud.getName()));
- }
- }
- }.schedule();
- }
-
public void setCpu(String cpu) {
this.cpu = cpu;
}
14 years
JBoss Tools SVN: r27736 - 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-25 05:17:25 -0500 (Sat, 25 Dec 2010)
New Revision: 27736
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/NewInstancePageModel.java
Log:
[JBIDE-8000] switched to observable pojo that notifies in UI thread only, corrected binding order (first bind items, then selected item, then enablement)
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-25 10:06:20 UTC (rev 27735)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage.java 2010-12-25 10:17:25 UTC (rev 27736)
@@ -295,7 +295,7 @@
private void bindProfileCombo(final Combo profileCombo, DataBindingContext dbc) {
// bind combo items
dbc.bindList(WidgetProperties.items().observe(profileCombo),
- BeanProperties.list(NewInstancePageModel.PROPERTY_FILTERED_PROFILES).observe(model),
+ BeanProperties.list(NewInstancePageModel.PROP_FILTERED_PROFILES).observe(model),
new UpdateListStrategy(UpdateListStrategy.POLICY_NEVER),
new UpdateListStrategy().setConverter(
new Converter(Object.class, String.class) {
@@ -313,7 +313,7 @@
Binding selectedProfileBinding = dbc.bindValue(
WidgetProperties.singleSelectionIndex().observe(profileCombo),
BeanProperties
- .value(NewInstancePageModel.class, NewInstancePageModel.PROPERTY_SELECTED_PROFILE_INDEX)
+ .value(NewInstancePageModel.class, NewInstancePageModel.PROP_SELECTED_PROFILE_INDEX)
.observe(model),
new UpdateValueStrategy()
.setAfterGetValidator(new SelectedComboItemValidator("You must select a hardware profile.")),
@@ -322,7 +322,7 @@
// bind combo enablement
IObservableList filteredProfilesObservable =
- BeanProperties.list(NewInstancePageModel.PROPERTY_FILTERED_PROFILES).observe(model);
+ BeanProperties.list(NewInstancePageModel.PROP_FILTERED_PROFILES).observe(model);
DataBindingUtils.addChangeListener(
new IChangeListener() {
@@ -349,7 +349,7 @@
DataBindingContext dbc) {
// bind all profiles
IObservable allProfilesObservable =
- BeanProperties.list(NewInstancePageModel.class, NewInstancePageModel.PROPERTY_ALL_PROFILES).observe(
+ BeanProperties.list(NewInstancePageModel.class, NewInstancePageModel.PROP_ALL_PROFILES).observe(
model);
DataBindingUtils.addChangeListener(new IChangeListener() {
@@ -362,7 +362,7 @@
// bind selected profile page
IObservableValue selectedProfileIndexObservable =
BeanProperties
- .value(NewInstancePageModel.class, NewInstancePageModel.PROPERTY_SELECTED_PROFILE_INDEX)
+ .value(NewInstancePageModel.class, NewInstancePageModel.PROP_SELECTED_PROFILE_INDEX)
.observe(model);
DataBindingUtils.addChangeListener(new IChangeListener() {
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-25 10:06:20 UTC (rev 27735)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePageModel.java 2010-12-25 10:17:25 UTC (rev 27736)
@@ -43,10 +43,10 @@
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$
+ public static final String PROP_PROFILE = "profile"; //$NON-NLS-1$
+ public static final String PROP_ALL_PROFILES = "allProfiles"; //$NON-NLS-1$
+ public static final String PROP_FILTERED_PROFILES = "filteredProfiles"; //$NON-NLS-1$
+ public static final String PROP_SELECTED_PROFILE_INDEX = "selectedProfileIndex"; //$NON-NLS-1$
private String name;
private DeltaCloudImage image;
@@ -125,7 +125,7 @@
}
private void setAllProfiles(List<DeltaCloudHardwareProfile> profiles) {
- getPropertyChangeSupport().firePropertyChange(PROPERTY_ALL_PROFILES, this.allProfiles, this.allProfiles = profiles);
+ getPropertyChangeSupport().firePropertyChange(PROP_ALL_PROFILES, this.allProfiles, this.allProfiles = profiles);
}
public List<DeltaCloudHardwareProfile> getAllProfiles() {
@@ -133,7 +133,7 @@
}
private void setFilteredProfiles(List<DeltaCloudHardwareProfile> profiles) {
- getPropertyChangeSupport().firePropertyChange(PROPERTY_FILTERED_PROFILES, this.filteredProfiles, this.filteredProfiles = profiles);
+ getPropertyChangeSupport().firePropertyChange(PROP_FILTERED_PROFILES, this.filteredProfiles, this.filteredProfiles = profiles);
}
public List<DeltaCloudHardwareProfile> getFilteredProfiles() {
@@ -162,7 +162,7 @@
}
DeltaCloudHardwareProfile hardwareProfile = filteredProfiles.get(index);
setSelectedProfile(hardwareProfile);
- firePropertyChange(PROPERTY_SELECTED_PROFILE_INDEX, oldIndex, index);
+ firePropertyChange(PROP_SELECTED_PROFILE_INDEX, oldIndex, index);
}
}
14 years
JBoss Tools SVN: r27735 - in trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui: wizards and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-12-25 05:06:20 -0500 (Sat, 25 Dec 2010)
New Revision: 27735
Added:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/common/databinding/validator/SelectedComboItemValidator.java
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage.java
Log:
[JBIDE-8000] switched to observable pojo that notifies in UI thread only, corrected binding order (first bind items, then selected item, then enablement)
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/common/databinding/validator/SelectedComboItemValidator.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/common/databinding/validator/SelectedComboItemValidator.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/common/databinding/validator/SelectedComboItemValidator.java 2010-12-25 10:06:20 UTC (rev 27735)
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * 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.validator;
+
+import org.eclipse.core.databinding.validation.IValidator;
+import org.eclipse.core.databinding.validation.ValidationStatus;
+import org.eclipse.core.runtime.IStatus;
+
+/**
+ * @author André Dietisheim
+ */
+public class SelectedComboItemValidator implements IValidator {
+
+ private String errorMessage;
+
+ public SelectedComboItemValidator(String errorMessage) {
+ this.errorMessage = errorMessage;
+ }
+
+ @Override
+ public IStatus validate(Object value) {
+ if (// areProfilesAvailable() &&
+ !isValidComboIndex(value)) {
+ // TODO: internationalize strings
+ return ValidationStatus.error(errorMessage);
+ }
+ return ValidationStatus.ok();
+ }
+
+
+ private boolean isValidComboIndex(Object index) {
+ return index != null
+ && index instanceof Integer
+ && ((Integer) index) >= 0;
+ }
+}
Property changes on: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/common/databinding/validator/SelectedComboItemValidator.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
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-25 09:06:56 UTC (rev 27734)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage.java 2010-12-25 10:06:20 UTC (rev 27735)
@@ -60,6 +60,7 @@
import org.jboss.tools.deltacloud.core.Driver;
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.common.databinding.validator.SelectedComboItemValidator;
import org.jboss.tools.internal.deltacloud.ui.utils.DataBindingUtils;
/**
@@ -274,30 +275,10 @@
BeanProperties.value(NewInstancePageModel.class, NewInstancePageModel.PROPERTY_SELECTED_REALM_INDEX)
.observe(model),
new UpdateValueStrategy()
- .setAfterGetValidator(new IValidator() {
-
- @Override
- public IStatus validate(Object value) {
- if (areRealmsAvailable() &&
- !isValidComboIndex(value)) {
- // TODO: internationalize strings
- return ValidationStatus.error("You must select a realm.");
- }
- return ValidationStatus.ok();
- }
- }),
+ .setAfterGetValidator(new SelectedComboItemValidator("You must select a realm.")),
new UpdateValueStrategy()
- .setAfterGetValidator(new IValidator() {
+ .setAfterGetValidator(new SelectedComboItemValidator("You must select a realm.")));
- @Override
- public IStatus validate(Object value) {
- if (value == null) {
- ValidationStatus.error("You must select a realm");
- }
- return ValidationStatus.ok();
- }
- }));
-
// realm combo enablement
IObservableList realmsObservable = BeanProperties.list(NewInstancePageModel.PROPERTY_REALMS).observe(model);
DataBindingUtils.addChangeListener(new IChangeListener() {
@@ -331,34 +312,14 @@
// bind selected combo item
Binding selectedProfileBinding = dbc.bindValue(
WidgetProperties.singleSelectionIndex().observe(profileCombo),
- BeanProperties.value(NewInstancePageModel.class, NewInstancePageModel.PROPERTY_SELECTED_PROFILE_INDEX)
- .observe(
- model),
+ BeanProperties
+ .value(NewInstancePageModel.class, NewInstancePageModel.PROPERTY_SELECTED_PROFILE_INDEX)
+ .observe(model),
new UpdateValueStrategy()
- .setAfterGetValidator(new IValidator() {
-
- @Override
- public IStatus validate(Object value) {
- if (// areProfilesAvailable() &&
- !isValidComboIndex(value)) {
- // TODO: internationalize strings
- return ValidationStatus.error("You must select a hardware profile.");
- }
- return ValidationStatus.ok();
- }
- }),
+ .setAfterGetValidator(new SelectedComboItemValidator("You must select a hardware profile.")),
new UpdateValueStrategy()
- .setAfterGetValidator(new IValidator() {
+ .setAfterGetValidator(new SelectedComboItemValidator("You must select a hardware profile.")));
- @Override
- public IStatus validate(Object value) {
- if (isValidComboIndex(value)) {
- ValidationStatus.error("You must select a hardware profile");
- }
- return ValidationStatus.ok();
- }
- }));
-
// bind combo enablement
IObservableList filteredProfilesObservable =
BeanProperties.list(NewInstancePageModel.PROPERTY_FILTERED_PROFILES).observe(model);
@@ -374,15 +335,7 @@
ControlDecorationSupport.create(selectedProfileBinding, SWT.LEFT | SWT.TOP);
}
- private boolean isValidComboIndex(Object index) {
- return index != null
- && index instanceof Integer
- && ((Integer) index) >= 0;
- }
-
private boolean areProfilesAvailable() {
- System.err.println("NewInstancePage#areProfilesAvailable" + model.getFilteredProfiles() != null
- && model.getFilteredProfiles().size() > 0);
return model.getFilteredProfiles() != null
&& model.getFilteredProfiles().size() > 0;
}
@@ -406,20 +359,19 @@
}
}, allProfilesObservable, container);
- // bind selected profile
+ // bind selected profile page
IObservableValue selectedProfileIndexObservable =
- BeanProperties.value(NewInstancePageModel.class, NewInstancePageModel.PROPERTY_SELECTED_PROFILE_INDEX)
- .observe(
- model);
+ BeanProperties
+ .value(NewInstancePageModel.class, NewInstancePageModel.PROPERTY_SELECTED_PROFILE_INDEX)
+ .observe(model);
DataBindingUtils.addChangeListener(new IChangeListener() {
@Override
public void handleChange(ChangeEvent event) {
ProfilePage profilePage = profilePages.get(model.getProfileId());
selectProfilePage(profilePages, profilePage);
-
}
- }, selectedProfileIndexObservable, container);
+ }, selectedProfileIndexObservable, hardwareCombo);
}
private void createProfilePages(Collection<DeltaCloudHardwareProfile> profiles) {
14 years
JBoss Tools SVN: r27734 - 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-25 04:06:56 -0500 (Sat, 25 Dec 2010)
New Revision: 27734
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/MakeInjectedPointUnambiguousMarkerResolution.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
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
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-25 00:07:01 UTC (rev 27733)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIMessages.java 2010-12-25 09:06:56 UTC (rev 27734)
@@ -84,7 +84,18 @@
public static String ADD_LOCAL_BEAN_MARKER_RESOLUTION_TITLE;
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 ADD_QUALIFIERS_TO_BEAN_WIZARD_TITLE;
+ public static String ADD_QUALIFIERS_TO_BEAN_WIZARD_AVAILABLE;
+ public static String ADD_QUALIFIERS_TO_BEAN_WIZARD_IN_BEAN;
+ public static String ADD_QUALIFIERS_TO_BEAN_WIZARD_MESSAGE;
+ public static String ADD_QUALIFIERS_TO_BEAN_WIZARD_ADD;
+ public static String ADD_QUALIFIERS_TO_BEAN_WIZARD_ADD_ALL;
+ public static String ADD_QUALIFIERS_TO_BEAN_WIZARD_REMOVE;
+ public static String ADD_QUALIFIERS_TO_BEAN_WIZARD_REMOVE_ALL;
+ public static String ADD_QUALIFIERS_TO_BEAN_WIZARD_CREATE_NEW_QUALIFIER;
+
public static String CDI_GENERATE_BEANS_XML;
public static String CDI_INSTALL_WIZARD_PAGE_FACET;
public static String CDI_INSTALL_WIZARD_PAGE_CONFIGURE;
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-25 00:07:01 UTC (rev 27733)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIMessages.properties 2010-12-25 09:06:56 UTC (rev 27734)
@@ -68,7 +68,19 @@
ADD_LOCAL_BEAN_MARKER_RESOLUTION_TITLE=Add @LocalBean annotation to ''{0}'' class
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 adding to it ''{0}'' bean
+
+ADD_QUALIFIERS_TO_BEAN_WIZARD_TITLE=Add Qualifiers to the Bean
+ADD_QUALIFIERS_TO_BEAN_WIZARD_AVAILABLE=Available:
+ADD_QUALIFIERS_TO_BEAN_WIZARD_IN_BEAN=In the Bean:
+ADD_QUALIFIERS_TO_BEAN_WIZARD_MESSAGE=Move qualifiers to the right to add them to the ''{0}'' bean
+ADD_QUALIFIERS_TO_BEAN_WIZARD_ADD=Add >
+ADD_QUALIFIERS_TO_BEAN_WIZARD_ADD_ALL=Add All >>
+ADD_QUALIFIERS_TO_BEAN_WIZARD_REMOVE=< Remove
+ADD_QUALIFIERS_TO_BEAN_WIZARD_REMOVE_ALL=<< Remove All
+ADD_QUALIFIERS_TO_BEAN_WIZARD_CREATE_NEW_QUALIFIER=Create New Qualifier
+
CDI_GENERATE_BEANS_XML=Generate beans.xml file:
CDI_INSTALL_WIZARD_PAGE_FACET=Context and Dependency Injection (CDI) Facet
CDI_INSTALL_WIZARD_PAGE_CONFIGURE=Configure Context and Dependency Injection (CDI) Facet Settings
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-25 00:07:01 UTC (rev 27733)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/CDIProblemMarkerResolutionGenerator.java 2010-12-25 09:06:56 UTC (rev 27734)
@@ -12,11 +12,11 @@
import java.util.ArrayList;
import java.util.List;
+import java.util.Set;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jdt.core.Flags;
import org.eclipse.jdt.core.IAnnotation;
import org.eclipse.jdt.core.ICompilationUnit;
@@ -28,6 +28,11 @@
import org.eclipse.ui.IMarkerResolution;
import org.eclipse.ui.IMarkerResolutionGenerator2;
import org.jboss.tools.cdi.core.CDIConstants;
+import org.jboss.tools.cdi.core.CDICoreNature;
+import org.jboss.tools.cdi.core.CDIUtil;
+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.validation.CDIValidationErrorManager;
import org.jboss.tools.cdi.ui.CDIUIPlugin;
import org.jboss.tools.common.EclipseUtil;
@@ -107,26 +112,74 @@
new DeleteAllInjectedConstructorsMarkerResolution(method, file)
};
}
- }
+ }/*else if(messageId == CDIValidationErrorManager.UNSATISFIED_INJECTION_POINTS_ID ||
+ messageId == CDIValidationErrorManager.AMBIGUOUS_INJECTION_POINTS_ID){
+ List<IBean> beans = findBeans(file, start);
+ IMarkerResolution[] resolutions = new IMarkerResolution[beans.size()];
+ for(int i = 0; i < beans.size(); i++){
+ resolutions[i] = new MakeInjectedPointUnambiguousMarkerResolution(beans, file, i);
+ }
+ return resolutions;
+ }*/
}
return new IMarkerResolution[] {};
}
+ private List<IBean> findBeans(IFile file, int start){
+ IJavaElement element = findJavaElement(file, start);
+ if(element == null)
+ return null;
+
+ CDICoreNature cdiNature = CDIUtil.getCDINatureWithProgress(file.getProject());
+ if(cdiNature == null)
+ return null;
+
+
+ ICDIProject cdiProject = cdiNature.getDelegate();
+
+ if(cdiProject == null){
+ return null;
+ }
+
+ Set<IBean> allBeans = cdiProject.getBeans(file.getFullPath());
+
+ //System.out.println("All beans - "+allBeans.size());
+ //System.out.println("java element - "+element.getClass());
+
+ IInjectionPoint injectionPoint = CDIUtil.findInjectionPoint(allBeans, element, start);
+ if(injectionPoint == null){
+ return null;
+ }
+
+ Set<IBean> beanSet = cdiProject.getBeans(false, injectionPoint);
+
+ //System.out.println("Beans on injected point - "+beanSet.size());
+
+ List<IBean> beanList = CDIUtil.sortBeans(beanSet);
+
+ return beanList;
+ }
+
private IMethod findMethod(IFile file, int start){
+ IJavaElement javaElement = findJavaElement(file, start);
+ if(javaElement != null && javaElement instanceof IMethod){
+ IMethod method = (IMethod)javaElement;
+ if(!method.isBinary())
+ return method;
+ }
+ return null;
+ }
+
+ private IJavaElement findJavaElement(IFile file, int start){
try{
- ICompilationUnit original = EclipseUtil.getCompilationUnit(file);
- ICompilationUnit compilationUnit = original.getWorkingCopy(new NullProgressMonitor());
+ ICompilationUnit compilationUnit = EclipseUtil.getCompilationUnit(file);
- IJavaElement javaElement = compilationUnit.getElementAt(start);
- if(javaElement != null && javaElement instanceof IMethod){
- IMethod method = (IMethod)javaElement;
- if(!method.isBinary())
- return method;
- }
+ return compilationUnit.getElementAt(start);
}catch(CoreException ex){
CDIUIPlugin.getDefault().logError(ex);
}
return null;
+
}
private List<IType> findLocalAnnotattedInterfaces(IMethod method) throws JavaModelException{
@@ -163,17 +216,14 @@
private IField findNonStaticField(IFile file, int start){
try{
- ICompilationUnit original = EclipseUtil.getCompilationUnit(file);
- ICompilationUnit compilationUnit = original.getWorkingCopy(new NullProgressMonitor());
+ IJavaElement javaElement = findJavaElement(file, start);
- IJavaElement javaElement = compilationUnit.getElementAt(start);
-
if(javaElement != null && javaElement instanceof IField){
IField field = (IField)javaElement;
if(!Flags.isStatic(field.getFlags()) && !field.isBinary())
return field;
}
- }catch(CoreException ex){
+ }catch(JavaModelException ex){
CDIUIPlugin.getDefault().logError(ex);
}
return null;
Added: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/MakeInjectedPointUnambiguousMarkerResolution.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/MakeInjectedPointUnambiguousMarkerResolution.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/MakeInjectedPointUnambiguousMarkerResolution.java 2010-12-25 09:06:56 UTC (rev 27734)
@@ -0,0 +1,103 @@
+/*******************************************************************************
+ * 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.text.MessageFormat;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.core.resources.IFile;
+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.IQualifier;
+import org.jboss.tools.cdi.ui.CDIUIMessages;
+import org.jboss.tools.cdi.ui.wizard.AddQualifiersToBeanWizard;
+
+/**
+ * @author Daniel Azarov
+ */
+public class MakeInjectedPointUnambiguousMarkerResolution implements IMarkerResolution2 {
+ private String label;
+ private IFile file;
+ private List<IBean> beans;
+ private IBean selectedBean;
+
+ public MakeInjectedPointUnambiguousMarkerResolution(List<IBean> beans, IFile file, int index){
+ this.file = file;
+ this.beans = beans;
+ this.selectedBean = beans.get(index);
+ this.label = MessageFormat.format(CDIUIMessages.MAKE_INJECTED_POINT_UNAMBIGUOUS_TITLE, new Object[]{selectedBean.getBeanClass().getElementName()});
+ }
+
+ public String getLabel() {
+ return label;
+ }
+
+ public void run(IMarker marker) {
+ if(checkBeans()){
+ //System.out.println("Should show dialog here.");
+ Shell shell = Workbench.getInstance().getActiveWorkbenchWindow().getShell();
+ AddQualifiersToBeanWizard wizard = new AddQualifiersToBeanWizard(selectedBean);
+ WizardDialog dialog = new WizardDialog(shell, wizard);
+ dialog.open();
+ }else{
+ //System.out.println("Should update injected point without dialog");
+ }
+ }
+
+ private boolean checkBeans(){
+ Set<IQualifier> qualifiers = selectedBean.getQualifiers();
+ if(qualifiers.size() == 0)
+ return true;
+
+ for(IBean bean: beans){
+ if(bean.equals(selectedBean))
+ continue;
+ if(checkBeanQualifiers(bean, qualifiers))
+ return true;
+
+ }
+ return false;
+ }
+
+ private boolean checkBeanQualifiers(IBean bean, Set<IQualifier> qualifiers){
+ for(IQualifier qualifier : qualifiers){
+ if(!isBeanContainQualifier(bean.getQualifiers(), qualifier)){
+ return false;
+ }
+ }
+ if(bean.getQualifiers().size() == qualifiers.size())
+ return true;
+ return false;
+ }
+
+ private boolean isBeanContainQualifier(Set<IQualifier> qualifiers, IQualifier qualifier){
+ for(IQualifier q : qualifiers){
+ if(q.getSourceType().getFullyQualifiedName().equals(qualifier.getSourceType().getFullyQualifiedName()))
+ return true;
+ }
+ return false;
+ }
+
+ 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/MakeInjectedPointUnambiguousMarkerResolution.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: 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 (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/AddQualifiersToBeanComposite.java 2010-12-25 09:06:56 UTC (rev 27734)
@@ -0,0 +1,443 @@
+package org.jboss.tools.cdi.ui.wizard;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import org.eclipse.jface.dialogs.Dialog;
+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.swt.SWT;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+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.IQualifier;
+import org.jboss.tools.cdi.ui.CDIUIMessages;
+
+public class AddQualifiersToBeanComposite extends Composite {
+ private static Font font;
+
+ // original qualifiers on the bean
+ private ArrayList<IQualifier> originalQualifiers;
+
+ // qualifiers available to be added to the bean
+ private ArrayList<IQualifier> qualifiers;
+
+ // current qualifiers on the bean
+ private ArrayList<IQualifier> deployed = new ArrayList<IQualifier>();
+
+ private ListViewer availableListViewer;
+ private ListViewer deployedListViewer;
+
+ private Button add, addAll;
+ private Button remove, removeAll;
+
+ protected boolean isComplete = true;
+
+ public AddQualifiersToBeanComposite(Composite parent, IBean bean) {
+ super(parent, SWT.NONE);
+
+ originalQualifiers = new ArrayList<IQualifier>(bean.getQualifiers());
+
+ IQualifier[] qs = bean.getCDIProject().getQualifiers();
+ qualifiers = new ArrayList<IQualifier>();
+
+ for(IQualifier q : qs){
+ if(!originalQualifiers.contains(q))
+ qualifiers.add(q);
+ }
+
+ createControl();
+ }
+
+ public void setVisible(boolean visible) {
+ if (visible)
+ this.refresh();
+ super.setVisible(visible);
+ }
+
+ public void refresh() {
+
+ Display.getDefault().syncExec(new Runnable() {
+ public void run() {
+ if (availableListViewer == null || availableListViewer.getControl().isDisposed())
+ return;
+ availableListViewer.refresh();
+ deployedListViewer.refresh();
+ setEnablement();
+ }
+ });
+ }
+
+ protected void createControl() {
+ GridLayout layout = new GridLayout();
+ layout.horizontalSpacing = 4;
+ layout.verticalSpacing = 10;
+ layout.numColumns = 3;
+ setLayout(layout);
+ setFont(getParent().getFont());
+
+ Display display = getDisplay();
+ FontData[] fd = getFont().getFontData();
+ int size2 = fd.length;
+ for (int i = 0; i < size2; i++)
+ fd[i].setStyle(SWT.ITALIC);
+ font = new Font(display, fd);
+ addDisposeListener(new DisposeListener() {
+ public void widgetDisposed(DisposeEvent e) {
+ font.dispose();
+ }
+ });
+
+ Label label = new Label(this, SWT.NONE);
+ label.setText(CDIUIMessages.ADD_QUALIFIERS_TO_BEAN_WIZARD_AVAILABLE);
+
+ label = new Label(this, SWT.NONE);
+ label.setText("");
+
+ label = new Label(this, SWT.NONE);
+ label.setText(CDIUIMessages.ADD_QUALIFIERS_TO_BEAN_WIZARD_IN_BEAN);
+
+ List availableList = new List(this, SWT.BORDER | SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
+ GridData data = new GridData(GridData.FILL_BOTH);
+ data.heightHint = 200;
+ data.widthHint = 150;
+ availableList.setLayoutData(data);
+
+ availableListViewer = new ListViewer(availableList);
+ ILabelProvider labelProvider = new QualifiersListLabelProvider();
+ availableListViewer.setLabelProvider(labelProvider);
+ IContentProvider contentProvider = new QualifiersListContentProvider();
+ availableListViewer.setContentProvider(contentProvider);
+ availableListViewer.setComparator(new ViewerComparator() {
+ public int compare(Viewer viewer, Object o1, Object o2) {
+ if (o1 instanceof IQualifier && o2 instanceof IQualifier) {
+ IQualifier q1 = (IQualifier) o1;
+ IQualifier q2 = (IQualifier) o2;
+ return (q1.getSourceType().getFullyQualifiedName().compareToIgnoreCase(q2.getSourceType().getFullyQualifiedName()));
+ }
+
+ return super.compare(viewer, o1, o2);
+ }
+ });
+ availableListViewer.setInput(qualifiers);
+
+ availableListViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ setEnablement();
+ }
+ });
+ availableListViewer.addDoubleClickListener(new IDoubleClickListener() {
+ public void doubleClick(DoubleClickEvent event) {
+ setEnablement();
+ if (add.isEnabled())
+ add(false);
+ }
+ });
+
+ Composite comp = new Composite(this, SWT.NONE);
+ data = new GridData(GridData.FILL_VERTICAL | GridData.HORIZONTAL_ALIGN_FILL);
+ data.widthHint = 120;
+ comp.setLayoutData(data);
+
+ layout = new GridLayout();
+ layout.marginWidth = 5;
+ layout.marginHeight = 25;
+ layout.verticalSpacing = 20;
+ comp.setLayout(layout);
+
+ add = new Button(comp, SWT.PUSH);
+ add.setText(CDIUIMessages.ADD_QUALIFIERS_TO_BEAN_WIZARD_ADD);
+ add.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ add.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent event) {
+ add(false);
+ }
+ });
+
+ remove = new Button(comp, SWT.PUSH);
+ remove.setText(CDIUIMessages.ADD_QUALIFIERS_TO_BEAN_WIZARD_REMOVE);
+ remove.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ remove.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent event) {
+ remove(false);
+ }
+ });
+
+ label = new Label(comp, SWT.NONE);
+ label.setText("");
+
+ addAll = new Button(comp, SWT.PUSH);
+ addAll.setText(CDIUIMessages.ADD_QUALIFIERS_TO_BEAN_WIZARD_ADD_ALL);
+ addAll.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ addAll.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent event) {
+ add(true);
+ }
+ });
+
+ removeAll = new Button(comp, SWT.PUSH);
+ removeAll.setText(CDIUIMessages.ADD_QUALIFIERS_TO_BEAN_WIZARD_REMOVE_ALL);
+ removeAll.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ removeAll.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent event) {
+ remove(true);
+ }
+ });
+
+ List deployedList = new List(this, SWT.BORDER | SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
+ data = new GridData(GridData.FILL_BOTH);
+ data.widthHint = 150;
+ deployedList.setLayoutData(data);
+
+ deployedListViewer = new ListViewer(deployedList);
+ deployedListViewer.setLabelProvider(labelProvider);
+ deployedListViewer.setContentProvider(contentProvider);
+ deployedListViewer.setComparator(new ViewerComparator() {
+ public int compare(Viewer viewer, Object o1, Object o2) {
+ if (o1 instanceof IQualifier && o2 instanceof IQualifier) {
+ IQualifier q1 = (IQualifier) o1;
+ IQualifier q2 = (IQualifier) o2;
+ return (q1.getSourceType().getFullyQualifiedName().compareToIgnoreCase(q2.getSourceType().getFullyQualifiedName()));
+ }
+
+ return super.compare(viewer, o1, o2);
+ }
+ });
+ deployedListViewer.setInput(originalQualifiers);
+
+ deployedListViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ setEnablement();
+ }
+ });
+ deployedListViewer.addDoubleClickListener(new IDoubleClickListener() {
+ public void doubleClick(DoubleClickEvent event) {
+ setEnablement();
+ if (remove.isEnabled())
+ remove(false);
+ }
+ });
+
+ final Button createQualifier = new Button(this, SWT.PUSH);
+ createQualifier.setText(CDIUIMessages.ADD_QUALIFIERS_TO_BEAN_WIZARD_CREATE_NEW_QUALIFIER);
+
+ createQualifier.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent event) {
+ // TODO
+ }
+ });
+
+ setEnablement();
+ availableList.setFocus();
+
+ Dialog.applyDialogFont(this);
+ }
+
+ protected IQualifier[] getAvailableSelection() {
+ IStructuredSelection sel = (IStructuredSelection) availableListViewer.getSelection();
+ if (sel.isEmpty())
+ return new IQualifier[0];
+
+ IQualifier[] mss = new IQualifier[sel.size()];
+ System.arraycopy(sel.toArray(), 0, mss, 0, sel.size());
+ return mss;
+ }
+
+ protected IQualifier[] getDeployedSelection() {
+ IStructuredSelection sel = (IStructuredSelection) deployedListViewer.getSelection();
+ if (sel.isEmpty())
+ return new IQualifier[0];
+
+ IQualifier[] mss = new IQualifier[sel.size()];
+ System.arraycopy(sel.toArray(), 0, mss, 0, sel.size());
+ return mss;
+ }
+
+ protected void setEnablement() {
+ isComplete = true;
+
+ IQualifier[] ms = getAvailableSelection();
+ if (ms == null || ms.length == 0) {
+ add.setEnabled(false);
+ } else {
+ boolean enabled = false;
+ for (int i = 0; i < ms.length; i++) {
+ IQualifier qualifier = ms[i];
+ if (qualifier != null) {
+ if (qualifiers.contains(qualifier)) {
+ enabled = true;
+ }else{
+ enabled = false;
+ break;
+ }
+ }
+ }
+ add.setEnabled(enabled);
+ }
+ addAll.setEnabled(qualifiers.size() > 0);
+
+ ms = getDeployedSelection();
+ if (ms == null || ms.length == 0) {
+ remove.setEnabled(false);
+ } else {
+ boolean enabled = false;
+ for (int i = 0; i < ms.length; i++) {
+ IQualifier qualifier = ms[i];
+ if (qualifier != null && deployed.contains(qualifier)) {
+ enabled = true;
+ }
+ else{
+ enabled = false;
+ break;
+ }
+ }
+ remove.setEnabled(enabled);
+ }
+
+ removeAll.setEnabled(deployed.size() > 0);
+ }
+
+ protected void add(boolean all) {
+ if (all) {
+ IQualifier[] qualifiers2 = new IQualifier[qualifiers.size()];
+ qualifiers.toArray(qualifiers2);
+ moveAll(qualifiers2, true);
+ } else
+ moveAll(getAvailableSelection(), true);
+ }
+
+ protected void remove(boolean all) {
+ if (all) {
+ ArrayList<IQualifier> list = new ArrayList<IQualifier>();
+ list.addAll(deployed);
+
+ IQualifier[] qualifiers2 = new IQualifier[list.size()];
+ list.toArray(qualifiers2);
+
+ moveAll(qualifiers2, false);
+ } else
+ moveAll(getDeployedSelection(), false);
+ }
+
+ protected void moveAll(IQualifier[] mods, boolean add2) {
+ int size = mods.length;
+ ArrayList<IQualifier> list = new ArrayList<IQualifier>();
+ for (int i = 0; i < size; i++) {
+ if (!list.contains(mods[i]))
+ list.add(mods[i]);
+ }
+
+ Iterator iterator = list.iterator();
+ while (iterator.hasNext()) {
+ IQualifier qualifier = (IQualifier) iterator.next();
+ if (add2) {
+ qualifiers.remove(qualifier);
+ deployed.add(qualifier);
+ availableListViewer.remove(qualifier);
+ deployedListViewer.add(qualifier);
+ } else {
+ qualifiers.add(qualifier);
+ deployed.remove(qualifier);
+ availableListViewer.add(qualifier);
+ deployedListViewer.remove(qualifier);
+ }
+ }
+
+ setEnablement();
+ }
+
+
+ public ArrayList<IQualifier> getQualifiersToRemove() {
+ ArrayList<IQualifier> list = new ArrayList<IQualifier>();
+ Iterator iterator = originalQualifiers.iterator();
+ while (iterator.hasNext()) {
+ IQualifier qualifier = (IQualifier) iterator.next();
+ if (!deployed.contains(qualifier))
+ list.add(qualifier);
+ }
+ return list;
+ }
+
+ public ArrayList<IQualifier> getQualifiersToAdd() {
+ ArrayList<IQualifier> list = new ArrayList<IQualifier>();
+ Iterator iterator = deployed.iterator();
+ while (iterator.hasNext()) {
+ IQualifier qualifier = (IQualifier) iterator.next();
+ if (!originalQualifiers.contains(qualifier))
+ list.add(qualifier);
+ }
+ return list;
+ }
+
+ public boolean isComplete() {
+ return isComplete;
+ }
+
+ class QualifiersListLabelProvider 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 IQualifier){
+ IQualifier qualifier = (IQualifier)element;
+ return qualifier.getSourceType().getFullyQualifiedName();
+ }
+ return "";
+ }
+
+ }
+
+ class QualifiersListContentProvider 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[]{};
+ }
+
+ }
+}
\ No newline at end of file
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/AddQualifiersToBeanComposite.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: 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 (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/AddQualifiersToBeanWizard.java 2010-12-25 09:06:56 UTC (rev 27734)
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * 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 org.eclipse.jface.wizard.Wizard;
+import org.jboss.tools.cdi.core.IBean;
+import org.jboss.tools.cdi.ui.CDIUIMessages;
+import org.jboss.tools.common.model.ui.ModelUIImages;
+
+public class AddQualifiersToBeanWizard extends Wizard{
+ private IBean bean;
+
+ public AddQualifiersToBeanWizard(IBean bean){
+ this.bean = bean;
+ setWindowTitle(CDIUIMessages.ADD_QUALIFIERS_TO_BEAN_WIZARD_TITLE);
+
+ setDefaultPageImageDescriptor(ModelUIImages.getImageDescriptor(ModelUIImages.WIZARD_DEFAULT));
+ }
+
+ public void addPages() {
+ addPage(new AddQualifiersToBeanWizardPage(""));
+ }
+
+
+ @Override
+ public boolean performFinish() {
+ return false;
+ }
+
+ public IBean getBean(){
+ return bean;
+ }
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/AddQualifiersToBeanWizard.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: 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 (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/AddQualifiersToBeanWizardPage.java 2010-12-25 09:06:56 UTC (rev 27734)
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * 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.text.MessageFormat;
+
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.widgets.Composite;
+import org.jboss.tools.cdi.ui.CDIUIMessages;
+
+public class AddQualifiersToBeanWizardPage extends WizardPage{
+
+ protected AddQualifiersToBeanWizardPage(String pageName) {
+ super(pageName);
+ setTitle(CDIUIMessages.ADD_QUALIFIERS_TO_BEAN_WIZARD_TITLE);
+ }
+
+ public void createControl(Composite parent) {
+ setControl(new AddQualifiersToBeanComposite(parent, ((AddQualifiersToBeanWizard)getWizard()).getBean()));
+ setMessage(MessageFormat.format(CDIUIMessages.ADD_QUALIFIERS_TO_BEAN_WIZARD_MESSAGE,
+ new Object[]{((AddQualifiersToBeanWizard)getWizard()).getBean().getBeanClass().getElementName()}));
+ }
+
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/AddQualifiersToBeanWizardPage.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
14 years
JBoss Tools SVN: r27733 - in trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui: src/org/jboss/tools/internal/deltacloud/ui/wizards and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-12-24 19:07:01 -0500 (Fri, 24 Dec 2010)
New Revision: 27733
Added:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePageModel.java
Removed:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceModel.java
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/Deltacloud Tools.launch
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-8000] switched to observable pojo that notifies in UI thread only, corrected binding order (first bind items, then selected item, then enablement)
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2010-12-24 23:45:38 UTC (rev 27732)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2010-12-25 00:07:01 UTC (rev 27733)
@@ -1,3 +1,12 @@
+2010-12-25 adietisheim <adietisheim@adietisheim-thinkpad>
+
+ * src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePageModel.java:
+ [JBIDE-8000] switched to observable pojo that notifies in UI thread only
+ * src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage.java
+ (bindRealmCombo):
+ (bindProfileCombo):
+ [JBIDE-8000] corrected binding order (first bind items, then selected item, then enablement)
+
2010-12-23 adietisheim <adietisheim@adietisheim-thinkpad>
* src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage.java:
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-24 23:45:38 UTC (rev 27732)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/Deltacloud Tools.launch 2010-12-25 00:07:01 UTC (rev 27733)
@@ -6,12 +6,12 @@
<booleanAttribute key="automaticValidate" value="false"/>
<stringAttribute key="bootstrap" value=""/>
<stringAttribute key="checked" value="[NONE]"/>
-<booleanAttribute key="clearConfig" value="false"/>
+<booleanAttribute key="clearConfig" value="true"/>
<booleanAttribute key="clearws" value="false"/>
<booleanAttribute key="clearwslog" value="false"/>
<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/Deltacloud Tools"/>
<booleanAttribute key="default" value="false"/>
-<stringAttribute key="deselected_workspace_plugins" value="org.jboss.ide.eclipse.as.wtp.ui,org.jboss.tools.ui.bot.ext,org.jboss.tools.common.projecttemplates,org.jboss.ide.eclipse.as.rse.core,org.jboss.tools.tests.performance,org.jboss.tools.common.el.core,org.jboss.ide.eclipse.as.ui.mbeans,org.jboss.tools.common.gef,org.jboss.ide.eclipse.as.archives.integration.test,org.jboss.tools.common.verification.test,org.jboss.ide.eclipse.archives.core,org.jboss.tools.common.verification,org.jboss.ide.eclipse.archives.jdt.integration,org.jboss.tools.jmx.core.test,org.jboss.tools.common.model,org.jboss.ide.eclipse.as.classpath.core,org.jboss.ide.eclipse.archives.test,org.jboss.ide.eclipse.as.classpath.ui,org.jboss.tools.common.ui,org.jboss.tools.common.text.ext,org.jboss.tools.jmx.ui,org.jboss.tools.ui.bot.ext.test,org.jboss.tools.common.el.core.test,org.jboss.tools.common.model.ui.test,org.jboss.tools.tests,org.jboss.tools.common.text.xml,org.jboss.ide.eclipse.as.ui.test,org.jboss.to!
ols.common.meta.ui,org.jboss.ide.eclipse.archives.webtools,org.jboss.tools.deltacloud.docs,org.jboss.ide.eclipse.as.rse.ui,org.jboss.tools.common.verification.ui.test,org.jboss.tools.common.verification.ui,org.jboss.tools.common.test,org.jboss.tools.common.model.ui.capabilities,org.jboss.tools.common.resref.core,org.jboss.ide.eclipse.archives.ui,org.jboss.tools.common.el.ui,org.jboss.ide.eclipse.as.test,org.jboss.tools.deltacloud.test,org.jboss.tools.jmx.ui.test,org.jboss.ide.eclipse.as.ssh,org.jboss.tools.common.resref.ui,org.jboss.ide.eclipse.as.ui,org.jboss.ide.eclipse.archives.ui.test,org.jboss.ide.eclipse.as.doc.user,org.jboss.tools.common.model.ui,org.jboss.tools.common.model.test"/>
+<stringAttribute key="deselected_workspace_plugins" value="org.jboss.tools.ui.bot.ext,org.jboss.tools.common.projecttemplates,org.jboss.tools.tests.performance,org.jboss.tools.common.el.core,org.jboss.ide.eclipse.as.ui.mbeans,org.jboss.tools.common.gef,org.jboss.ide.eclipse.as.archives.integration.test,org.jboss.tools.common.verification.test,org.jboss.tools.common.verification,org.jboss.ide.eclipse.archives.jdt.integration,org.jboss.tools.jmx.core.test,org.jboss.tools.common.model,org.jboss.ide.eclipse.as.classpath.core,org.jboss.ide.eclipse.archives.test,org.jboss.ide.eclipse.as.classpath.ui,org.jboss.tools.common.ui,org.jboss.tools.common.text.ext,org.jboss.tools.ui.bot.ext.test,org.jboss.tools.common.el.core.test,org.jboss.tools.common.model.ui.test,org.jboss.tools.tests,org.jboss.tools.common.text.xml,org.jboss.ide.eclipse.as.ui.test,org.jboss.tools.common.meta.ui,org.jboss.tools.deltacloud.docs,org.jboss.ide.eclipse.as.rse.ui,org.jboss.tools.common.verification.ui.tes!
t,org.jboss.tools.common.verification.ui,org.jboss.tools.common.test,org.jboss.tools.common.model.ui.capabilities,org.jboss.tools.common.resref.core,org.jboss.ide.eclipse.as.test,org.jboss.tools.common.el.ui,org.jboss.tools.deltacloud.test,org.jboss.tools.jmx.ui.test,org.jboss.ide.eclipse.as.ssh,org.jboss.tools.common.resref.ui,org.jboss.ide.eclipse.archives.ui.test,org.jboss.ide.eclipse.as.doc.user,org.jboss.tools.common.model.ui,org.jboss.tools.common.model.test"/>
<booleanAttribute key="includeOptional" value="true"/>
<stringAttribute key="location" value="${workspace_loc}/../runtime-deltacloud"/>
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
@@ -24,8 +24,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="org.eclipse.rse.services@default:default,org.eclipse.wst.common.project.facet.core@default:default,org.eclipse.equinox.p2.metadata.repository@default:default,org.eclipse.ecf.ssl@default:false,org.eclipse.sdk@default:default,org.eclipse.jem.beaninfo@default:default,org.eclipse.compare@default:default,org.eclipse.compare.core@default:default,org.eclipse.equinox.p2.director@default:default,org.apache.commons.el@default:default,org.eclipse.wst.web@default:default,org.eclipse.equinox.p2.touchpoint.eclipse@default:default,org.eclipse.jem.beaninfo.vm@default:default,org.eclipse.pde.build@default:default,org.eclipse.team.ui@default:default,org.eclipse.equinox.p2.engine@default:default,org.eclipse.wst.server.core@default:default,org.eclipse.jdt.ui@default:default,org.eclipse.search@default:default,org.apache.lucene.analysis@default:default,org.eclipse.emf.edit@default:default,org.eclipse.equinox.simpleconfigurator.manipulator@def!
ault:default,org.eclipse.jem.beaninfo.vm.common@default:default,org.eclipse.osgi@-1:true,org.eclipse.ltk.core.refactoring@default:default,org.eclipse.equinox.p2.repository.tools@default:default,org.eclipse.wst.common.environment@default:default,org.eclipse.equinox.frameworkadmin@default:default,org.eclipse.core.jobs@default:default,org.hamcrest.core@default:default,org.eclipse.ecf.provider.filetransfer.ssl@default:false,org.eclipse.core.contenttype@default:default,org.eclipse.pde.core@default:default,org.eclipse.core.filesystem.linux.x86_64@default:false,org.eclipse.jst.common.annotations.core@default:default,org.eclipse.ui.cheatsheets@default:default,org.eclipse.ui.editors@default:default,org.eclipse.debug.ui@default:default,org.eclipse.wst.validation@default:default,org.eclipse.ecf.filetransfer@default:default,org.eclipse.jst.j2ee.jca@default:default,org.junit*4.8.1.v4_8_1_v20100427-1100@default:default,org.eclipse.wst.common.uriresolver@default:default,org.eclipse.ui.wor!
kbench@default:default,org.eclipse.ui.console@default:default,!
org.ecli
pse.core.expressions@default:default,org.eclipse.jst.j2ee@default:default,org.eclipse.debug.core@default:default,org.eclipse.equinox.p2.metadata@default:default,org.eclipse.core.runtime.compatibility.registry@default:false,org.eclipse.jdt.debug@default:default,org.eclipse.ui.views.properties.tabbed@default:default,org.eclipse.core.databinding.beans@default:default,org.eclipse.help@default:default,org.apache.commons.logging*1.0.4.v201005080501@default:default,org.eclipse.jst.common.project.facet.core@default:default,javax.servlet.jsp@default:default,org.eclipse.core.runtime.compatibility@default:default,org.eclipse.wst.common.modulecore@default:default,org.eclipse.core.databinding@default:default,org.eclipse.emf.codegen@default:default,org.eclipse.core.resources@default:default,org.apache.commons.httpclient*3.1.0.v201005080502@default:default,org.eclipse.core.runtime.compatibility.auth@default:default,org.eclipse.jdt.compiler.apt@default:false,org.eclipse.jface.databinding@de!
fault:default,javax.servlet@default:default,org.eclipse.equinox.http.servlet@default:default,org.eclipse.wst.common.emf@default:default,org.eclipse.emf.ecore@default:default,org.eclipse.jface.text@default:default,org.mortbay.jetty.server@default:default,org.eclipse.swt.gtk.linux.x86_64@default:false,org.eclipse.equinox.preferences@default:default,org.eclipse.core.variables@default:default,org.eclipse.equinox.p2.director.app@default:default,org.eclipse.wst.sse.core@default:default,org.eclipse.osgi.services@default:default,org.eclipse.text@default:default,org.eclipse.core.databinding.observable@default:default,org.eclipse.equinox.p2.repository@default:default,org.eclipse.wst.common.emfworkbench.integration@default:default,org.apache.lucene@default:default,org.eclipse.jem.workbench@default:default,org.eclipse.equinox.app@default:default,org.eclipse.jdt.compiler.tool@default:false,org.eclipse.ecf@default:default,org.eclipse.team.core@default:default,org.eclipse.emf.ecore.change!
@default:default,org.eclipse.jem@default:default,org.sat4j.cor!
e@defaul
t:default,org.eclipse.jst.server.core@default:default,org.eclipse.ui.views@default:default,org.eclipse.equinox.http.jetty@default:default,org.eclipse.ltk.ui.refactoring@default:default,org.eclipse.ant.core@default:default,org.eclipse.equinox.p2.jarprocessor@default:default,org.apache.xml.serializer@default:default,org.eclipse.core.databinding.property@default:default,org.eclipse.ui.workbench.texteditor@default:default,org.eclipse.jst.j2ee.core@default:default,org.eclipse.equinox.concurrent@default:default,org.eclipse.jst.jee@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.registry@default:default,org.eclipse.jem.util@default:default,org.eclipse.ecf.provider.filetransfer@default:default,org.eclipse.ui.intro@default:default,org.eclipse.equinox.p2.garbagecollector@default:default,org.junit4@default:default,org.apache.ant@default:default,org.eclipse.wst.common.frameworks@default:default,org.eclipse.emf.ecore.xmi@default:default,org.eclipse.equinox.security@!
default:default,org.eclipse.core.commands@default:default,org.eclipse.update.core@default:default,org.eclipse.jdt.launching@default:default,org.eclipse.core.filesystem@default:default,org.eclipse.ui.ide@default:default,org.eclipse.core.net@default:default,org.apache.jasper@default:default,org.eclipse.rse.core@default:default,org.eclipse.equinox.p2.publisher@default:default,org.eclipse.ui.navigator.resources@default:default,org.eclipse.wst.common.core@default:default,org.eclipse.jface@default:default,org.eclipse.equinox.frameworkadmin.equinox@default:default,org.eclipse.core.runtime@default:true,org.eclipse.swt@default:default,javax.xml@default:default,org.eclipse.equinox.p2.updatesite@default:default,org.eclipse.equinox.p2.artifact.repository@default:default,org.eclipse.equinox.simpleconfigurator@1:true,org.eclipse.wst.xml.core@default:default,org.eclipse.update.configurator@3:true,org.eclipse.jdt.core@default:default,org.eclipse.help.base@default:default,org.eclipse.ui@def!
ault:default,com.ibm.icu@default:default,org.apache.xerces@def!
ault:def
ault,org.eclipse.emf.common@default:default,org.eclipse.jst.common.frameworks@default:default,org.apache.xml.resolver@default:default,org.eclipse.platform@default:default,org.eclipse.swtbot.ant.optional.junit3@default:false,org.eclipse.jst.common.annotations.controller@default:default,org.eclipse.ui.navigator@default:default,org.eclipse.help.ui@default:default,org.mortbay.jetty.util@default:default,org.eclipse.core.filebuffers@default:default,org.apache.commons.codec*1.3.0.v20100518-1140@default:default,org.eclipse.swtbot.ant.optional.junit4@default:false,org.eclipse.ui.ide.application@default:default,org.eclipse.ui.forms@default:default,org.eclipse.ecf.identity@default:default,org.eclipse.jdt.core.manipulation@default:default,org.sat4j.pb@default:default,org.eclipse.core.net.linux.x86_64@default:false,org.eclipse.jem.proxy@default:default,org.eclipse.equinox.p2.core@default:default,org.eclipse.osgi.util@default:default,org.eclipse.equinox.security.ui@default:default"/>
-<stringAttribute key="selected_workspace_plugins" value="org.jboss.ide.eclipse.as.core@default:default,org.jboss.tools.deltacloud.integration@default:default,org.jboss.tools.common@default:default,org.jboss.tools.jmx.core@default:default,org.jboss.ide.eclipse.as.wtp.core@default:default,org.jboss.tools.deltacloud.ui@default:default,org.jboss.tools.deltacloud.core@default:default"/>
+<stringAttribute key="selected_target_plugins" value="org.eclipse.rse.subsystems.shells.ssh@default:default,org.eclipse.wst.xml.core@default:default,org.eclipse.wst.common.modulecore.ui@default:default,org.eclipse.equinox.p2.engine@default:default,org.eclipse.rse.subsystems.shells.telnet@default:default,org.eclipse.jst.j2ee@default:default,org.eclipse.jst.common.annotations.controller@default:default,org.eclipse.wst.web.ui@default:default,org.eclipse.ui.cheatsheets@default:default,org.eclipse.jst.j2ee.ejb@default:default,org.apache.xml.resolver@default:default,org.eclipse.jem.workbench@default:default,org.eclipse.jst.jee.ui@default:default,org.eclipse.jst.servlet.ui@default:default,org.eclipse.wst.common.project.facet.core@default:default,org.apache.xerces@default:default,org.eclipse.wst.server.ui@default:default,org.eclipse.jface.text@default:default,org.eclipse.jdt@default:default,org.eclipse.platform@default:default,org.eclipse.ui.browser@default:default,org.eclipse.core!
.net.linux.x86_64@default:false,org.apache.commons.codec*1.3.0.v20100518-1140@default:default,org.eclipse.rse.services.ssh@default:default,org.eclipse.jdt.compiler.tool@default:false,org.eclipse.jface.databinding@default:default,org.eclipse.rse.connectorservice.local@default:default,org.eclipse.wst.common.environment@default:default,org.eclipse.equinox.security@default:default,org.eclipse.wst.common.ui@default:default,org.eclipse.rse.subsystems.files.core@default:default,org.eclipse.wst.common.uriresolver@default:default,org.eclipse.wst.html.ui@default:default,org.eclipse.rse.ui@default:default,org.eclipse.wst.server.core@default:default,org.eclipse.pde.core@default:default,org.eclipse.wst.internet.monitor.core@default:default,org.eclipse.wst.common.frameworks.ui@default:default,org.eclipse.jem.beaninfo@default:default,org.apache.lucene.analysis@default:default,org.eclipse.equinox.frameworkadmin@default:default,org.eclipse.equinox.p2.core@default:default,org.eclipse.equinox!
.app@default:default,org.eclipse.jst.j2ee.ejb.annotation.model!
@default
:default,org.eclipse.wst.common.emfworkbench.integration@default:default,org.eclipse.rse.files.ui@default:default,org.eclipse.core.databinding@default:default,org.eclipse.jst.common.project.facet.ui@default:default,org.eclipse.wst.validation@default:default,org.eclipse.wst.common.core@default:default,org.eclipse.jdt.junit@default:default,org.eclipse.equinox.p2.director@default:default,org.mortbay.jetty.server@default:default,org.eclipse.rse.connectorservice.telnet@default:default,org.eclipse.text@default:default,org.eclipse.ecf.ssl@default:false,org.eclipse.ltk.ui.refactoring@default:default,org.eclipse.emf.edit@default:default,org.eclipse.core.databinding.observable@default:default,org.eclipse.core.runtime.compatibility.registry@default:false,javax.servlet.jsp@default:default,org.eclipse.equinox.p2.artifact.repository@default:default,org.eclipse.team.core@default:default,org.eclipse.equinox.p2.metadata.repository@default:default,org.eclipse.dstore.extra@default:default,org.!
eclipse.ui.workbench@default:default,org.eclipse.equinox.frameworkadmin.equinox@default:default,javax.xml@default:default,org.eclipse.equinox.concurrent@default:default,org.eclipse.jst.j2ee.ui@default:default,org.eclipse.tm.terminal@default:default,org.eclipse.equinox.p2.ui@default:default,org.eclipse.ui.views.properties.tabbed@default:default,org.junit4@default:default,org.eclipse.core.databinding.property@default:default,org.eclipse.jst.j2ee.jca@default:default,org.apache.xml.serializer@default:default,org.eclipse.ecf.provider.filetransfer.ssl@default:false,org.eclipse.wst.jsdt.ui@default:default,org.eclipse.sdk@default:default,org.eclipse.pde.build@default:default,org.eclipse.help@default:default,org.eclipse.emf.edit.ui@default:default,org.eclipse.core.runtime.compatibility.auth@default:default,org.eclipse.jem.beaninfo.vm@default:default,org.apache.commons.net@default:default,org.eclipse.rse.connectorservice.ssh@default:default,org.eclipse.osgi.util@default:default,com.i!
bm.icu@default:default,org.eclipse.ui.editors@default:default,!
org.ecli
pse.compare@default:default,org.eclipse.emf.ecore.change@default:default,org.eclipse.ltk.core.refactoring@default:default,org.eclipse.wst.html.core@default:default,org.eclipse.jdt.core@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.wst.sse.ui@default:default,org.eclipse.equinox.p2.updatesite@default:default,org.eclipse.ui@default:default,org.eclipse.equinox.p2.director.app@default:default,org.eclipse.emf.ecore.edit@default:default,org.eclipse.rse.services.telnet@default:default,org.eclipse.emf.ecore@default:default,org.eclipse.jdt.ui@default:default,org.eclipse.wst.server.ui.infopop@default:default,org.apache.ant@default:default,org.eclipse.core.commands@default:default,org.eclipse.jdt.junit.core@default:default,org.eclipse.core.databinding.beans@default:default,org.eclipse.core.expressions@default:default,org.apache.commons.el@default:default,org.eclipse.jdt.debug@default:default,org.eclipse.ui.forms@default:default,org.eclipse.core.runtime@default!
:true,org.eclipse.emf.ecore.xmi@default:default,org.eclipse.ecf.provider.filetransfer@default:default,org.eclipse.osgi.services@default:default,org.junit*4.8.1.v4_8_1_v20100427-1100@default:default,org.eclipse.equinox.p2.metadata@default:default,org.eclipse.compare.core@default:default,org.eclipse.wst.common.modulecore@default:default,org.eclipse.ant.core@default:default,org.eclipse.ui.console@default:default,org.eclipse.jst.j2ee.core@default:default,org.eclipse.equinox.p2.touchpoint.eclipse@default:default,org.eclipse.equinox.simpleconfigurator.manipulator@default:default,org.eclipse.ecf.filetransfer@default:default,org.eclipse.equinox.http.servlet@default:default,org.eclipse.search@default:default,org.eclipse.core.filebuffers@default:default,org.eclipse.swtbot.ant.optional.junit3@default:false,org.eclipse.ui.ide@default:default,org.eclipse.equinox.http.jetty@default:default,org.eclipse.team.ui@default:default,org.eclipse.equinox.preferences@default:default,org.eclipse.equ!
inox.simpleconfigurator@1:true,org.eclipse.wst.server.ui.doc.u!
ser@defa
ult:default,org.eclipse.core.filesystem.linux.x86_64@default:false,org.eclipse.ecf.identity@default:default,org.eclipse.jst.server.core@default:default,org.hamcrest.core@default:default,org.eclipse.rse.useractions@default:default,org.eclipse.wst.sse.core@default:default,org.eclipse.jst.j2ee.navigator.ui@default:default,org.eclipse.osgi@-1:true,org.eclipse.rse.core@default:default,org.eclipse.jface@default:default,org.eclipse.swtbot.ant.optional.junit4@default:false,org.eclipse.rse.services.files.ftp@default:default,org.eclipse.rse.connectorservice.dstore@default:default,org.eclipse.swt@default:default,org.eclipse.emf.common@default:default,org.eclipse.ui.ide.application@default:default,org.eclipse.rse.shells.ui@default:default,org.eclipse.jdt.core.manipulation@default:default,org.eclipse.equinox.p2.publisher@default:default,com.jcraft.jsch@default:default,org.eclipse.core.jobs@default:default,org.apache.jasper@default:default,org.eclipse.help.base@default:default,org.eclipse!
.rse.services.dstore@default:default,org.eclipse.equinox.p2.repository@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.jst.common.annotations.core@default:default,org.eclipse.debug.core@default:default,org.eclipse.core.resources@default:default,org.eclipse.jem.proxy@default:default,org.eclipse.wst.web@default:default,org.eclipse.jsch.core@default:default,org.sat4j.core@default:default,org.eclipse.ui.navigator.resources@default:default,org.eclipse.ui.workbench.texteditor@default:default,org.eclipse.wst.xml.ui@default:default,org.eclipse.jst.common.project.facet.core@default:default,org.eclipse.core.runtime.compatibility@default:default,javax.servlet@default:default,org.eclipse.help.ui@default:default,org.eclipse.emf.common.ui@default:default,org.eclipse.jst.server.ui@default:default,org.eclipse.jdt.junit.runtime@default:default,org.eclipse.jdt.launching@default:default,org.eclipse.rse.services.local@default:default,org.eclipse.equinox.p2.operations@d!
efault:default,org.eclipse.rse.subsystems.terminals.ssh@defaul!
t:defaul
t,org.eclipse.jst.common.ui@default:default,org.eclipse.rse.subsystems.terminals.core@default:default,org.eclipse.equinox.p2.garbagecollector@default:default,org.eclipse.jst.j2ee.web@default:default,org.sat4j.pb@default:default,org.eclipse.dstore.core@default:default,org.eclipse.wst.jsdt.manipulation@default:default,org.eclipse.rse.subsystems.shells.dstore@default:default,org.eclipse.wst.css.core@default:default,org.eclipse.jst.common.frameworks@default:default,org.eclipse.wst.css.ui@default:default,org.eclipse.jdt.compiler.apt@default:false,org.eclipse.wst.server.discovery@default:default,org.eclipse.wst.common.emf@default:default,org.eclipse.equinox.p2.repository.tools@default:default,org.eclipse.core.variables@default:default,org.eclipse.jem@default:default,org.eclipse.jem.util@default:default,org.apache.commons.httpclient*3.1.0.v201005080502@default:default,org.eclipse.swt.gtk.linux.x86_64@default:false,org.eclipse.jst.j2ee.jca.ui@default:default,org.mortbay.jetty.util@d!
efault:default,org.eclipse.equinox.common@2:true,org.eclipse.rse.subsystems.shells.core@default:default,org.eclipse.rse.subsystems.shells.local@default:default,org.eclipse.jem.beaninfo.vm.common@default:default,org.eclipse.ui.views@default:default,org.eclipse.ui.intro@default:default,org.eclipse.wst.jsdt.core@default:default,org.eclipse.debug.ui@default:default,org.eclipse.jdt.debug.ui@default:default,org.apache.lucene@default:default,org.eclipse.core.net@default:default,org.eclipse.update.core@default:default,org.eclipse.jst.jee@default:default,org.apache.commons.logging*1.0.4.v201005080501@default:default,org.eclipse.ecf@default:default,org.eclipse.update.configurator@3:true,org.eclipse.rse.services@default:default,org.eclipse.ui.views.log@default:default,org.eclipse.wst.common.frameworks@default:default,org.eclipse.equinox.security.ui@default:default,org.eclipse.wst.common.project.facet.ui@default:default,org.eclipse.ui.navigator@default:default,org.eclipse.equinox.p2.ja!
rprocessor@default:default,org.eclipse.rse.terminals.ui@defaul!
t:defaul
t,org.eclipse.emf.codegen@default:default,org.eclipse.core.filesystem@default:default"/>
+<stringAttribute key="selected_workspace_plugins" value="org.jboss.ide.eclipse.archives.core@default:default,org.jboss.ide.eclipse.as.wtp.core@default:default,org.jboss.tools.jmx.ui@default:default,org.jboss.tools.common@default:default,org.jboss.tools.jmx.core@default:default,org.jboss.ide.eclipse.as.rse.core@default:default,org.jboss.ide.eclipse.archives.ui@default:default,org.jboss.tools.deltacloud.ui@default:default,org.jboss.tools.deltacloud.core@default:default,org.jboss.ide.eclipse.archives.webtools@default:default,org.jboss.ide.eclipse.as.ui@default:default,org.jboss.tools.deltacloud.integration@default:default,org.jboss.ide.eclipse.as.wtp.ui@default:default,org.jboss.ide.eclipse.as.core@default:default"/>
<booleanAttribute key="show_selected_only" value="false"/>
<stringAttribute key="templateConfig" value="${target_home}/configuration/config.ini"/>
<booleanAttribute key="tracing" value="false"/>
Deleted: 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-24 23:45:38 UTC (rev 27732)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceModel.java 2010-12-25 00:07:01 UTC (rev 27733)
@@ -1,253 +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.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 {
-
- public static final String PROPERTY_URL = "url"; //$NON-NLS-1$
- public static final String PROPERTY_NAME = "name"; //$NON-NLS-1$
- public static final String PROPERTY_IMAGE = "image"; //$NON-NLS-1$
- public static final String PROPERTY_ARCH = "arch"; //$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 keyname;
- 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(DeltaCloud cloud, String keyname, DeltaCloudImage image) {
- this.cloud = cloud;
- this.keyname = keyname;
- this.image = image;
- asyncGetRealms();
- asyncGetProfiles();
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- getPropertyChangeSupport().firePropertyChange(PROPERTY_NAME, this.name, this.name = name);
- }
-
- public DeltaCloudImage getImage() {
- return image;
- }
-
- public void setImage(DeltaCloudImage image) {
- List<DeltaCloudHardwareProfile> filteredProfiles = filterProfiles(image, allProfiles);
- setFilteredProfiles(filteredProfiles);
- getPropertyChangeSupport().firePropertyChange(PROPERTY_IMAGE, this.image, this.image = image);
- }
-
- public void setSelectedRealmIndex(int index) {
- if (realms.size() > index) {
- DeltaCloudRealm deltaCloudRealm = realms.get(index);
- setSelectedRealm(deltaCloudRealm);
- firePropertyChange(PROPERTY_SELECTED_REALM_INDEX, null, index);
- }
- }
-
- 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;
- }
-
- public void setKeyname(String keyname) {
- getPropertyChangeSupport().firePropertyChange(PROPERTY_KEYNAME, this.keyname, this.keyname = keyname);
- }
-
- public String getArch() {
- return arch;
- }
-
- public void setArch(String arch) {
- getPropertyChangeSupport().firePropertyChange(PROPERTY_ARCH, this.arch, this.arch = arch);
- }
-
- public int getSelectedProfile() {
- return allProfiles.indexOf(selectedProfile);
- }
-
- 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 {
- List<DeltaCloudHardwareProfile> profiles = Arrays.asList(cloud.getProfiles());
- setAllProfiles(profiles);
- setFilteredProfiles(filterProfiles(image, profiles));
- 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 profiles 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-24 23:45:38 UTC (rev 27732)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage.java 2010-12-25 00:07:01 UTC (rev 27733)
@@ -90,7 +90,7 @@
private static final String IMAGE_ID_NOT_FOUND = "ErrorImageIdNotFound.text"; //$NON-NLS-1$
private Composite container;
- private NewInstanceModel model;
+ private NewInstancePageModel model;
private DeltaCloud cloud;
private Label arch;
private Text nameText;
@@ -138,7 +138,7 @@
super(WizardMessages.getString(NAME));
this.cloud = cloud;
String defaultKeyname = cloud.getLastKeyname();
- model = new NewInstanceModel(cloud, defaultKeyname, image); //$NON-NLS-1$
+ model = new NewInstancePageModel(cloud, defaultKeyname, image); //$NON-NLS-1$
setDescription(WizardMessages.getString(DESCRIPTION));
setTitle(WizardMessages.getString(TITLE));
setImageDescriptor(SWTImagesFactory.DESC_DELTA_LARGE);
@@ -219,7 +219,7 @@
private void bindWidgets(DataBindingContext dbc, Composite container) {
// name
- bindText(nameText, NewInstanceModel.PROPERTY_NAME, WizardMessages.getString(MUST_ENTER_A_NAME), dbc);
+ bindText(nameText, NewInstancePageModel.PROPERTY_NAME, WizardMessages.getString(MUST_ENTER_A_NAME), dbc);
// image
IObservableValue imageObservable = bindImage(imageText, dbc);
// arch label
@@ -228,7 +228,7 @@
bindProfileCombo(hardwareCombo, dbc);
bindProfilePages(hardwareCombo, profilePages, dbc);
// key
- bindText(keyText, NewInstanceModel.PROPERTY_KEYNAME, WizardMessages.getString(MUST_ENTER_A_KEYNAME), dbc);
+ bindText(keyText, NewInstancePageModel.PROPERTY_KEYNAME, WizardMessages.getString(MUST_ENTER_A_KEYNAME), dbc);
}
private void bindArchLabel(IObservableValue imageObservable, DataBindingContext dbc) {
@@ -251,19 +251,27 @@
}
private void bindRealmCombo(final Combo realmCombo, DataBindingContext dbc) {
- // realm combo enablement
- IObservableList realmsObservable = BeanProperties.list(NewInstanceModel.PROPERTY_REALMS).observe(model);
- DataBindingUtils.addChangeListener(new IChangeListener() {
+ dbc.bindList(WidgetProperties.items().observe(realmCombo),
+ BeanProperties.list(NewInstancePageModel.PROPERTY_REALMS).observe(model),
+ new UpdateListStrategy(UpdateListStrategy.POLICY_NEVER),
+ new UpdateListStrategy().setConverter(
+ new Converter(Object.class, String.class) {
- @Override
- public void handleChange(ChangeEvent event) {
- realmCombo.setEnabled(areRealmsAvailable());
- }
- }, realmsObservable, container);
+ @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();
+ }
+ }
+ ));
Binding selectedRealmBinding = dbc.bindValue(
WidgetProperties.singleSelectionIndex().observe(realmCombo),
- BeanProperties.value(NewInstanceModel.class, NewInstanceModel.PROPERTY_SELECTED_REALM_INDEX)
+ BeanProperties.value(NewInstancePageModel.class, NewInstancePageModel.PROPERTY_SELECTED_REALM_INDEX)
.observe(model),
new UpdateValueStrategy()
.setAfterGetValidator(new IValidator() {
@@ -290,51 +298,49 @@
}
}));
- dbc.bindList(WidgetProperties.items().observe(realmCombo),
- BeanProperties.list(NewInstanceModel.PROPERTY_REALMS).observe(model),
+ // realm combo enablement
+ IObservableList realmsObservable = BeanProperties.list(NewInstancePageModel.PROPERTY_REALMS).observe(model);
+ DataBindingUtils.addChangeListener(new IChangeListener() {
+
+ @Override
+ public void handleChange(ChangeEvent event) {
+ realmCombo.setEnabled(areRealmsAvailable());
+ }
+ }, realmsObservable, container);
+
+ ControlDecorationSupport.create(selectedRealmBinding, SWT.LEFT | SWT.TOP);
+ }
+
+ private void bindProfileCombo(final Combo profileCombo, DataBindingContext dbc) {
+ // bind combo items
+ dbc.bindList(WidgetProperties.items().observe(profileCombo),
+ BeanProperties.list(NewInstancePageModel.PROPERTY_FILTERED_PROFILES).observe(model),
new UpdateListStrategy(UpdateListStrategy.POLICY_NEVER),
new UpdateListStrategy().setConverter(
new Converter(Object.class, String.class) {
@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();
+ Assert.isTrue(fromObject instanceof DeltaCloudHardwareProfile);
+ DeltaCloudHardwareProfile profile = (DeltaCloudHardwareProfile) fromObject;
+ return profile.getId();
}
}
));
- ControlDecorationSupport.create(selectedRealmBinding, SWT.LEFT | SWT.TOP);
- }
- private void bindProfileCombo(final Combo profileCombo, DataBindingContext dbc) {
- // 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(areProfilesAvailable());
- }
- }, filteredProfilesObservable, container);
-
// bind selected combo item
Binding selectedProfileBinding = dbc.bindValue(
WidgetProperties.singleSelectionIndex().observe(profileCombo),
- BeanProperties.value(NewInstanceModel.class, NewInstanceModel.PROPERTY_SELECTED_PROFILE_INDEX).observe(
- model),
+ BeanProperties.value(NewInstancePageModel.class, NewInstancePageModel.PROPERTY_SELECTED_PROFILE_INDEX)
+ .observe(
+ model),
new UpdateValueStrategy()
.setAfterGetValidator(new IValidator() {
@Override
public IStatus validate(Object value) {
- if (areProfilesAvailable() &&
- !isValidComboIndex(value)) {
+ if (// areProfilesAvailable() &&
+ !isValidComboIndex(value)) {
// TODO: internationalize strings
return ValidationStatus.error("You must select a hardware profile.");
}
@@ -346,38 +352,37 @@
@Override
public IStatus validate(Object value) {
- if (value == null) {
+ if (isValidComboIndex(value)) {
ValidationStatus.error("You must select a hardware profile");
}
return ValidationStatus.ok();
}
}));
- // 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) {
+ // bind combo enablement
+ IObservableList filteredProfilesObservable =
+ BeanProperties.list(NewInstancePageModel.PROPERTY_FILTERED_PROFILES).observe(model);
+ DataBindingUtils.addChangeListener(
+ new IChangeListener() {
- @Override
- public Object convert(Object fromObject) {
- Assert.isTrue(fromObject instanceof DeltaCloudHardwareProfile);
- DeltaCloudHardwareProfile profile = (DeltaCloudHardwareProfile) fromObject;
- return profile.getId();
- }
- }
- ));
+ @Override
+ public void handleChange(ChangeEvent event) {
+ profileCombo.setEnabled(areProfilesAvailable());
+ }
+ }, filteredProfilesObservable, container);
+
ControlDecorationSupport.create(selectedProfileBinding, SWT.LEFT | SWT.TOP);
}
private boolean isValidComboIndex(Object index) {
return index != null
&& index instanceof Integer
- && ((Integer) index) > 0;
+ && ((Integer) index) >= 0;
}
private boolean areProfilesAvailable() {
+ System.err.println("NewInstancePage#areProfilesAvailable" + model.getFilteredProfiles() != null
+ && model.getFilteredProfiles().size() > 0);
return model.getFilteredProfiles() != null
&& model.getFilteredProfiles().size() > 0;
}
@@ -391,7 +396,8 @@
DataBindingContext dbc) {
// bind all profiles
IObservable allProfilesObservable =
- BeanProperties.list(NewInstanceModel.class, NewInstanceModel.PROPERTY_ALL_PROFILES).observe(model);
+ BeanProperties.list(NewInstancePageModel.class, NewInstancePageModel.PROPERTY_ALL_PROFILES).observe(
+ model);
DataBindingUtils.addChangeListener(new IChangeListener() {
@Override
@@ -402,8 +408,9 @@
// bind selected profile
IObservableValue selectedProfileIndexObservable =
- BeanProperties.value(NewInstanceModel.class, NewInstanceModel.PROPERTY_SELECTED_PROFILE_INDEX).observe(
- model);
+ BeanProperties.value(NewInstancePageModel.class, NewInstancePageModel.PROPERTY_SELECTED_PROFILE_INDEX)
+ .observe(
+ model);
DataBindingUtils.addChangeListener(new IChangeListener() {
@Override
@@ -439,7 +446,7 @@
private void bindText(Text text, String property, String errorMessage, DataBindingContext dbc) {
Binding textBinding = dbc.bindValue(
WidgetProperties.text(SWT.Modify).observe(text),
- BeanProperties.value(NewInstanceModel.class, property).observe(model),
+ BeanProperties.value(NewInstancePageModel.class, property).observe(model),
new UpdateValueStrategy().setBeforeSetValidator(
new MandatoryStringValidator(errorMessage)),
null);
@@ -459,7 +466,7 @@
Binding imageBinding = dbc.bindValue(
WidgetProperties.text(SWT.Modify).observeDelayed(IMAGE_CHECK_DELAY, imageText),
- BeanProperties.value(NewInstanceModel.class, NewInstanceModel.PROPERTY_IMAGE).observe(model),
+ BeanProperties.value(NewInstancePageModel.class, NewInstancePageModel.PROPERTY_IMAGE).observe(model),
widgetToModelUpdateStrategy,
modelToTextUpdateStrategy);
ControlDecorationSupport.create(imageBinding, SWT.LEFT | SWT.TOP);
@@ -528,7 +535,7 @@
}
}
- public NewInstanceModel getModel() {
+ public NewInstancePageModel getModel() {
return model;
}
}
Copied: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePageModel.java (from rev 27687, 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/NewInstancePageModel.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePageModel.java 2010-12-25 00:07:01 UTC (rev 27733)
@@ -0,0 +1,263 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.internal.deltacloud.ui.wizards;
+
+import 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.ui.common.databinding.validator.ObservableUIPojo;
+
+/**
+ * @author Jeff Jonhston
+ * @author André Dietisheim
+ */
+public class NewInstancePageModel extends ObservableUIPojo {
+
+ public static final String PROPERTY_URL = "url"; //$NON-NLS-1$
+ public static final String PROPERTY_NAME = "name"; //$NON-NLS-1$
+ public static final String PROPERTY_IMAGE = "image"; //$NON-NLS-1$
+ public static final String PROPERTY_ARCH = "arch"; //$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 keyname;
+ 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 NewInstancePageModel(DeltaCloud cloud, String keyname, DeltaCloudImage image) {
+ this.cloud = cloud;
+ this.keyname = keyname;
+ this.image = image;
+ asyncGetRealms();
+ asyncGetProfiles();
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ getPropertyChangeSupport().firePropertyChange(PROPERTY_NAME, this.name, this.name = name);
+ }
+
+ public DeltaCloudImage getImage() {
+ return image;
+ }
+
+ public void setImage(DeltaCloudImage image) {
+ List<DeltaCloudHardwareProfile> filteredProfiles = filterProfiles(image, allProfiles);
+ setFilteredProfiles(filteredProfiles);
+ getPropertyChangeSupport().firePropertyChange(PROPERTY_IMAGE, this.image, this.image = image);
+ }
+
+ public void setSelectedRealmIndex(int index) {
+ if (realms.size() > index) {
+ int oldIndex = -1;
+ if (selectedRealm != null
+ && realms.size() > 0) {
+ oldIndex = realms.indexOf(selectedRealm);
+ }
+ DeltaCloudRealm deltaCloudRealm = realms.get(index);
+ setSelectedRealm(deltaCloudRealm);
+ firePropertyChange(PROPERTY_SELECTED_REALM_INDEX, oldIndex, index);
+ }
+ }
+
+ 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) {
+ int oldIndex = -1;
+ if (selectedProfile != null
+ && filteredProfiles.size() > 0) {
+ oldIndex = filteredProfiles.indexOf(selectedProfile);
+ }
+ DeltaCloudHardwareProfile hardwareProfile = filteredProfiles.get(index);
+ setSelectedProfile(hardwareProfile);
+ firePropertyChange(PROPERTY_SELECTED_PROFILE_INDEX, oldIndex, 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;
+ }
+
+ public void setKeyname(String keyname) {
+ getPropertyChangeSupport().firePropertyChange(PROPERTY_KEYNAME, this.keyname, this.keyname = keyname);
+ }
+
+ public String getArch() {
+ return arch;
+ }
+
+ public void setArch(String arch) {
+ getPropertyChangeSupport().firePropertyChange(PROPERTY_ARCH, this.arch, this.arch = arch);
+ }
+
+ public int getSelectedProfile() {
+ return allProfiles.indexOf(selectedProfile);
+ }
+
+ 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 {
+ List<DeltaCloudHardwareProfile> profiles = Arrays.asList(cloud.getProfiles());
+ setAllProfiles(profiles);
+ setFilteredProfiles(filterProfiles(image, profiles));
+ 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 profiles 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;
+ }
+}
Property changes on: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePageModel.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
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-24 23:45:38 UTC (rev 27732)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceWizard.java 2010-12-25 00:07:01 UTC (rev 27733)
@@ -76,7 +76,7 @@
@Override
public boolean performFinish() {
- NewInstanceModel model = mainPage.getModel();
+ NewInstancePageModel model = mainPage.getModel();
DeltaCloudImage image = model.getImage();
Assert.isTrue(image != null);
14 years
JBoss Tools SVN: r27732 - trunk/vpe/plugins/org.jboss.tools.vpe.base.test/META-INF.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2010-12-24 18:45:38 -0500 (Fri, 24 Dec 2010)
New Revision: 27732
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.base.test/META-INF/MANIFEST.MF
Log:
Removed restriction for the version number of XPath plug-in.
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.base.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.base.test/META-INF/MANIFEST.MF 2010-12-24 23:38:11 UTC (rev 27731)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.base.test/META-INF/MANIFEST.MF 2010-12-24 23:45:38 UTC (rev 27732)
@@ -17,7 +17,7 @@
org.jboss.tools.vpe;bundle-version="3.2.0",
org.eclipse.ui.ide;bundle-version="[3.6.0,4.0.0)",
org.jboss.tools.jst.jsp;bundle-version="3.2.0",
- org.eclipse.wst.xml.xpath.core;bundle-version="1.1.1",
+ org.eclipse.wst.xml.xpath.core,
org.mozilla.xpcom;bundle-version="1.9.1",
org.jboss.tools.vpe.xulrunner;bundle-version="3.2.0",
org.jboss.tools.common.text.ext;bundle-version="3.2.0",
14 years
JBoss Tools SVN: r27731 - trunk/vpe/plugins/org.jboss.tools.vpe.base.test.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2010-12-24 18:38:11 -0500 (Fri, 24 Dec 2010)
New Revision: 27731
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.base.test/
Log:
added target folder to svn:ignore
Property changes on: trunk/vpe/plugins/org.jboss.tools.vpe.base.test
___________________________________________________________________
Name: svn:ignore
+ target
14 years
JBoss Tools SVN: r27730 - in trunk: cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2010-12-24 18:36:03 -0500 (Fri, 24 Dec 2010)
New Revision: 27730
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/CoreValidationTest.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/DependentProjectValidationTest.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/LinkCollection.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ProjectValidationContext.java
Log:
https://issues.jboss.org/browse/JBIDE-7961
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-24 22:34:36 UTC (rev 27729)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2010-12-24 23:36:03 UTC (rev 27730)
@@ -114,7 +114,7 @@
private BeansXmlValidationDelegate beansXmlValidator = new BeansXmlValidationDelegate(this);
private AnnotationValidationDelegate annotationValidator = new AnnotationValidationDelegate(this);
- static final String SHORT_ID = "jboss.cdi.core"; //$NON-NLS-1$
+ public static final String SHORT_ID = "jboss.cdi.core"; //$NON-NLS-1$
/*
* (non-Javadoc)
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/CoreValidationTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/CoreValidationTest.java 2010-12-24 22:34:36 UTC (rev 27729)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/CoreValidationTest.java 2010-12-24 23:36:03 UTC (rev 27730)
@@ -10,12 +10,20 @@
******************************************************************************/
package org.jboss.tools.cdi.core.test.tck.validation;
+import java.util.List;
+
+import org.eclipse.core.resources.IProject;
import org.eclipse.jface.preference.IPersistentPreferenceStore;
import org.eclipse.jface.preference.IPreferenceStore;
import org.jboss.tools.cdi.core.CDICorePlugin;
+import org.jboss.tools.cdi.internal.core.validation.CDICoreValidator;
import org.jboss.tools.cdi.internal.core.validation.CDIProjectSet;
import org.jboss.tools.common.preferences.SeverityPreferences;
+import org.jboss.tools.jst.web.kb.internal.validation.LinkCollection;
+import org.jboss.tools.jst.web.kb.internal.validation.ProjectValidationContext;
+import org.jboss.tools.jst.web.kb.internal.validation.ValidationContext;
import org.jboss.tools.jst.web.kb.internal.validation.ValidatorManager;
+import org.jboss.tools.jst.web.kb.validation.IValidator;
/**
* @author Alexey Kazakov
@@ -60,4 +68,33 @@
CDIProjectSet set = new CDIProjectSet(tckProject);
assertTrue("TCKProject is not included in the set of CDI projects", set.getAllProjects().contains(tckProject));
}
+
+ /**
+ * https://issues.jboss.org/browse/JBIDE-7961
+ */
+ public void testValidationContext() {
+ LinkCollection collection = getCoreLinks(tckProject);
+ assertFalse("Validation context for CDIproject is empty", collection.isEmpty());
+ collection = getCoreLinks(tckProject, "jboss.seam");
+ assertTrue("Validation context for CDIproject with wrong ID is not empty", collection.isEmpty());
+ }
+
+ private LinkCollection getCoreLinks(IProject project) {
+ return getCoreLinks(project, CDICoreValidator.SHORT_ID);
+ }
+
+ private LinkCollection getCoreLinks(IProject project, String validatorId) {
+ ValidationContext context = new ValidationContext(project);
+ List<IValidator> validators = context.getValidators();
+ IValidator cdiValidator = null;
+ for (IValidator validator : validators) {
+ if(validator instanceof CDICoreValidator) {
+ cdiValidator = validator;
+ }
+ }
+ if(cdiValidator!=null) {
+ return ((ProjectValidationContext)context.getValidatingProjectTree(cdiValidator).getBrunches().get(project).getRootContext()).getCoreLinks(validatorId);
+ }
+ return null;
+ }
}
\ 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/DependentProjectValidationTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/DependentProjectValidationTest.java 2010-12-24 22:34:36 UTC (rev 27729)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/DependentProjectValidationTest.java 2010-12-24 23:36:03 UTC (rev 27730)
@@ -59,6 +59,9 @@
JobUtils.waitForIdle();
}
+ /**
+ * https://issues.jboss.org/browse/JBIDE-7946
+ */
public void testDependentProjects() throws CoreException, IOException {
boolean saveAutoBuild = ResourcesUtils.setBuildAutomatically(false);
JobUtils.waitForIdle();
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/LinkCollection.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/LinkCollection.java 2010-12-24 22:34:36 UTC (rev 27729)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/LinkCollection.java 2010-12-24 23:36:03 UTC (rev 27730)
@@ -321,4 +321,8 @@
public String getId() {
return id;
}
+
+ public boolean isEmpty() {
+ return resourcesByVariableName.isEmpty() && variableNamesByResource.isEmpty() && resourcesByDeclaringVariableName.isEmpty() && declaringVariableNamesByResource.isEmpty() && unnamedResources.isEmpty();
+ }
}
\ No newline at end of file
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ProjectValidationContext.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ProjectValidationContext.java 2010-12-24 22:34:36 UTC (rev 27729)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ProjectValidationContext.java 2010-12-24 23:36:03 UTC (rev 27730)
@@ -38,7 +38,7 @@
private ValidationResourceRegister validationResourceRegister;
- private LinkCollection getCoreLinks(String validatorId) {
+ public LinkCollection getCoreLinks(String validatorId) {
LinkCollection linkCollection = coreLinks.get(validatorId);
if(linkCollection==null) {
linkCollection = new LinkCollection(validatorId);
14 years