JBoss Tools SVN: r27709 - in trunk/jst/plugins/org.jboss.tools.jst.jsp: src/org/jboss/tools/jst/jsp/i18n and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-12-23 05:36:30 -0500 (Thu, 23 Dec 2010)
New Revision: 27709
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/META-INF/MANIFEST.MF
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/i18n/ExternalizeStringsUtils.java
Log:
JBIDE-7987
https://issues.jboss.org/browse/JBIDE-7987
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/META-INF/MANIFEST.MF
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/META-INF/MANIFEST.MF 2010-12-23 10:33:23 UTC (rev 27708)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/META-INF/MANIFEST.MF 2010-12-23 10:36:30 UTC (rev 27709)
@@ -57,4 +57,3 @@
org.eclipse.wst.standard.schemas
Bundle-Version: 3.2.0.qualifier
Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Import-Package: org.jboss.tools.jsf.model.pv
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/i18n/ExternalizeStringsUtils.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/i18n/ExternalizeStringsUtils.java 2010-12-23 10:33:23 UTC (rev 27708)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/i18n/ExternalizeStringsUtils.java 2010-12-23 10:36:30 UTC (rev 27709)
@@ -10,15 +10,16 @@
******************************************************************************/
package org.jboss.tools.jst.jsp.i18n;
+import java.util.List;
+import java.util.Properties;
+
import org.eclipse.jface.text.TextSelection;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.jboss.tools.common.model.XModel;
import org.jboss.tools.common.model.XModelObject;
-import org.jboss.tools.jsf.model.pv.JSFProjectTreeConstants;
-import org.jboss.tools.jsf.model.pv.JSFProjectsRoot;
-import org.jboss.tools.jsf.model.pv.JSFProjectsTree;
-import org.jboss.tools.jst.web.model.pv.WebProjectNode;
+import org.jboss.tools.common.model.util.ModelFeatureFactory;
+import org.jboss.tools.jst.web.project.list.IWebPromptingProvider;
import org.w3c.dom.Element;
/**
@@ -58,32 +59,15 @@
}
public static XModelObject findFacesConfig(XModel model) {
- XModelObject facesConfig = null;
- JSFProjectsRoot root = JSFProjectsTree.getProjectsRoot(model);
- if (root != null) {
- WebProjectNode n = (WebProjectNode) root
- .getChildByPath(JSFProjectTreeConstants.CONFIGURATION);
- if (n != null) {
- /*
- * The array contains the all configuration files in the project
- * including files from jar archives.
- * Only editable object is be the necessary faces-config file.
- */
- XModelObject[] os = n.getTreeChildren();
- for (XModelObject o : os) {
- if (o.isObjectEditable()) {
- facesConfig = o;
- break;
- }
- }
- }
+ IWebPromptingProvider provider = (IWebPromptingProvider)ModelFeatureFactory.getInstance().createFeatureInstance("org.jboss.tools.jsf.model.pv.JSFPromptingProvider"); //$NON-NLS-1$
+ if(provider == null) {
+ return null;
}
- /*
- * When nothing has been found try the last straight-forward way.
- */
- if (facesConfig == null) {
- facesConfig = model.getByPath("/faces-config.xml"); //$NON-NLS-1$
+ List<Object> result = provider.getList(model, IWebPromptingProvider.JSF_FACES_CONFIG, "", new Properties()); //$NON-NLS-1$
+ if(result != null && !result.isEmpty()) {
+ return (XModelObject)result.get(0);
}
- return facesConfig;
+ return null;
}
+
}
14 years, 1 month
JBoss Tools SVN: r27708 - trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/pv.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-12-23 05:33:23 -0500 (Thu, 23 Dec 2010)
New Revision: 27708
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/pv/JSFPromptingProvider.java
Log:
JBIDE-7987
https://issues.jboss.org/browse/JBIDE-7987
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/pv/JSFPromptingProvider.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/pv/JSFPromptingProvider.java 2010-12-23 10:32:13 UTC (rev 27707)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/pv/JSFPromptingProvider.java 2010-12-23 10:33:23 UTC (rev 27708)
@@ -62,6 +62,7 @@
SUPPORTED_IDS.add(JSF_GET_TAGLIBS);
SUPPORTED_IDS.add(JSF_CONVERTER_IDS);
SUPPORTED_IDS.add(JSF_VALIDATOR_IDS);
+ SUPPORTED_IDS.add(JSF_FACES_CONFIG);
}
public final static String PROVIDER_ID = "jsf"; //$NON-NLS-1$
@@ -172,6 +173,12 @@
return new OpenConverterHelper().getConverterIDs(model);
} else if(JSF_VALIDATOR_IDS.equals(id)) {
return new OpenValidatorHelper().getValidatorIDs(model);
+ } else if(JSF_FACES_CONFIG.equals(id)) {
+ XModelObject fc = findFacesConfig(model);
+ if(fc == null) return EMPTY_LIST;
+ ArrayList<Object> list = new ArrayList<Object>();
+ list.add(fc);
+ return list;
}
if(error != null) throw new XModelException(error);
return EMPTY_LIST;
@@ -498,4 +505,34 @@
return (pattern == null) ? url : pattern.getJSFPath(url);
}
+ public static XModelObject findFacesConfig(XModel model) {
+ XModelObject facesConfig = null;
+ JSFProjectsRoot root = JSFProjectsTree.getProjectsRoot(model);
+ if (root != null) {
+ WebProjectNode n = (WebProjectNode) root
+ .getChildByPath(JSFProjectTreeConstants.CONFIGURATION);
+ if (n != null) {
+ /*
+ * The array contains the all configuration files in the project
+ * including files from jar archives.
+ * Only editable object is be the necessary faces-config file.
+ */
+ XModelObject[] os = n.getTreeChildren();
+ for (XModelObject o : os) {
+ if (o.isObjectEditable()) {
+ facesConfig = o;
+ break;
+ }
+ }
+ }
+ }
+ /*
+ * When nothing has been found try the last straight-forward way.
+ */
+ if (facesConfig == null) {
+ facesConfig = model.getByPath("/faces-config.xml"); //$NON-NLS-1$
+ }
+ return facesConfig;
+ }
+
}
14 years, 1 month
JBoss Tools SVN: r27707 - trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/project/list.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-12-23 05:32:13 -0500 (Thu, 23 Dec 2010)
New Revision: 27707
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/project/list/IWebPromptingProvider.java
Log:
JBIDE-7987
https://issues.jboss.org/browse/JBIDE-7987
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/project/list/IWebPromptingProvider.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/project/list/IWebPromptingProvider.java 2010-12-23 08:15:15 UTC (rev 27706)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/project/list/IWebPromptingProvider.java 2010-12-23 10:32:13 UTC (rev 27707)
@@ -40,6 +40,7 @@
static String JSF_GET_TAGLIBS = "jsf.get.taglibs"; //$NON-NLS-1$
static String JSF_CONVERTER_IDS = "jsf.converter.ids"; //$NON-NLS-1$
static String JSF_VALIDATOR_IDS = "jsf.validator.ids"; //$NON-NLS-1$
+ static String JSF_FACES_CONFIG = "jsf.faces.config"; //$NON-NLS-1$
static String JSF_CONVERT_URL_TO_PATH = "jsf.url.to.path"; //$NON-NLS-1$
14 years, 1 month
JBoss Tools SVN: r27706 - trunk/deltacloud/features/org.jboss.tools.deltacloud.feature.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-12-23 03:15:15 -0500 (Thu, 23 Dec 2010)
New Revision: 27706
Modified:
trunk/deltacloud/features/org.jboss.tools.deltacloud.feature/pom.xml
Log:
Modified: trunk/deltacloud/features/org.jboss.tools.deltacloud.feature/pom.xml
===================================================================
--- trunk/deltacloud/features/org.jboss.tools.deltacloud.feature/pom.xml 2010-12-23 06:20:36 UTC (rev 27705)
+++ trunk/deltacloud/features/org.jboss.tools.deltacloud.feature/pom.xml 2010-12-23 08:15:15 UTC (rev 27706)
@@ -8,6 +8,6 @@
</parent>
<groupId>org.jboss.tools.deltacloud</groupId>
<artifactId>org.jboss.tools.deltacloud.feature</artifactId>
- <version>0.1.0-SNAPSHOT</version>
+ <version>0.0.1-SNAPSHOT</version>
<packaging>eclipse-feature</packaging>
</project>
14 years, 1 month
JBoss Tools SVN: r27705 - trunk/site.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-12-23 01:20:36 -0500 (Thu, 23 Dec 2010)
New Revision: 27705
Modified:
trunk/site/site.xml
Log:
remove runtime and tptp, now built upstream
Modified: trunk/site/site.xml
===================================================================
--- trunk/site/site.xml 2010-12-23 06:20:14 UTC (rev 27704)
+++ trunk/site/site.xml 2010-12-23 06:20:36 UTC (rev 27705)
@@ -32,9 +32,6 @@
<category name="AllTools" />
<category name="SOATools" />
</feature>
- <feature url="features/org.jboss.tools.tptp.feature_0.0.0.jar" id="org.jboss.tools.tptp.feature" version="0.0.0">
- <category name="TestPerfTools" />
- </feature>
<!-- only in JBT -->
<feature url="features/org.jboss.tools.maven.feature_0.0.0.jar" id="org.jboss.tools.maven.feature" version="0.0.0">
@@ -50,10 +47,6 @@
<category name="MavenTools" />
</feature>
- <feature url="features/org.jboss.tools.runtime.feature_0.0.0.jar" id="org.jboss.tools.runtime.feature" version="0.0.0">
- <category name="AllTools" />
- </feature>
-
<!-- categories - see also ../../../common/aggregateRepos.*.properties -->
<category-def name="SDKTools" label="JBoss Tools SDK">
<description>JBoss Tools SDK contains plugins where an SDK package
14 years, 1 month
JBoss Tools SVN: r27704 - trunk/build.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-12-23 01:20:14 -0500 (Thu, 23 Dec 2010)
New Revision: 27704
Modified:
trunk/build/pom-disabled-components.xml
Log:
remove runtime and tptp, now built upstream
Modified: trunk/build/pom-disabled-components.xml
===================================================================
--- trunk/build/pom-disabled-components.xml 2010-12-23 05:49:36 UTC (rev 27703)
+++ trunk/build/pom-disabled-components.xml 2010-12-23 06:20:14 UTC (rev 27704)
@@ -189,23 +189,6 @@
</profile>
<profile>
- <id>tptp</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
- <modules>
- <module>../tptp</module>
- </modules>
- </profile>
-
- <profile>
- <id>tptp-bootstrap</id>
- <modules>
- <module>../tptp</module>
- </modules>
- </profile>
-
- <profile>
<id>ws</id>
<activation>
<activeByDefault>true</activeByDefault>
@@ -224,16 +207,6 @@
</profile>
<profile>
- <id>runtime</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
- <modules>
- <module>../runtime</module>
- </modules>
- </profile>
-
- <profile>
<id>site</id>
<activation>
<activeByDefault>true</activeByDefault>
14 years, 1 month
JBoss Tools SVN: r27703 - trunk/build/target-platform.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-12-23 00:49:36 -0500 (Thu, 23 Dec 2010)
New Revision: 27703
Modified:
trunk/build/target-platform/multiple.target
trunk/build/target-platform/unified.target
Log:
https://issues.jboss.org/browse/JBIDE-7956 update GWT features to new version (because they stupidly RENAME the feature every time)
Modified: trunk/build/target-platform/multiple.target
===================================================================
--- trunk/build/target-platform/multiple.target 2010-12-23 05:41:49 UTC (rev 27702)
+++ trunk/build/target-platform/multiple.target 2010-12-23 05:49:36 UTC (rev 27703)
@@ -8,6 +8,7 @@
-->
<locations>
<location includeAllPlatforms="false" includeMode="planner" type="InstallableUnit">
+ <!-- NOT <unit id="org.maven.ide.eclipse.feature.feature.group" version="0.10.2.20100623-1649"/> -->
<unit id="org.maven.ide.eclipse.feature.feature.group" version="0.12.0.20101115-1102"/>
<repository location="http://m2eclipse.sonatype.org/sites/m2e/"/>
</location>
@@ -211,7 +212,7 @@
<repository location="http://download.jboss.org/jbosstools/builds/staging/_composite_/trunk/"/>
</location>
<location includeAllPlatforms="false" includeMode="planner" type="InstallableUnit">
- <unit id="com.google.gdt.eclipse.suite.e36.feature.feature.group" version="1.4.1.v201012170127"/>
+ <unit id="com.google.gdt.eclipse.suite.e36.feature.feature.group" version="1.4.2.v201012211742"/>
<unit id="com.google.gwt.eclipse.sdkbundle.e36.feature.2.1.1.feature.group" version="2.1.1.v201012170127"/>
<repository location="http://dl.google.com/eclipse/plugin/3.6/"/>
</location>
Modified: trunk/build/target-platform/unified.target
===================================================================
--- trunk/build/target-platform/unified.target 2010-12-23 05:41:49 UTC (rev 27702)
+++ trunk/build/target-platform/unified.target 2010-12-23 05:49:36 UTC (rev 27703)
@@ -8,7 +8,8 @@
-->
<locations>
<location includeAllPlatforms="false" includeMode="planner" type="InstallableUnit">
- <unit id="org.maven.ide.eclipse.feature.feature.group" version="0.12.0.20101115-1102"/>
+ <!-- NOT <unit id="org.maven.ide.eclipse.feature.feature.group" version="0.10.2.20100623-1649"/> -->
+ <unit id="org.maven.ide.eclipse.feature.feature.group" version="0.12.0.20101115-1102"/>
<repository location="http://download.jboss.org/jbosstools/updates/target-platform/latest/"/>
</location>
<location includeAllPlatforms="false" includeMode="planner" type="InstallableUnit">
@@ -211,7 +212,7 @@
<repository location="http://download.jboss.org/jbosstools/updates/target-platform/latest/"/>
</location>
<location includeAllPlatforms="false" includeMode="planner" type="InstallableUnit">
- <unit id="com.google.gdt.eclipse.suite.e36.feature.feature.group" version="1.4.1.v201012170127"/>
+ <unit id="com.google.gdt.eclipse.suite.e36.feature.feature.group" version="1.4.2.v201012211742"/>
<unit id="com.google.gwt.eclipse.sdkbundle.e36.feature.2.1.1.feature.group" version="2.1.1.v201012170127"/>
<repository location="http://download.jboss.org/jbosstools/updates/target-platform/latest/"/>
</location>
14 years, 1 month
JBoss Tools SVN: r27702 - trunk/build/target-platform.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-12-23 00:41:49 -0500 (Thu, 23 Dec 2010)
New Revision: 27702
Modified:
trunk/build/target-platform/multiple.target
trunk/build/target-platform/multiple.target.p2mirror.xml
trunk/build/target-platform/unified.target
trunk/build/target-platform/unified.target.p2mirror.xml
Log:
https://issues.jboss.org/browse/JBIDE-7956 update GWT features to new version (because they stupidly RENAME the feature every time)
Modified: trunk/build/target-platform/multiple.target
===================================================================
--- trunk/build/target-platform/multiple.target 2010-12-23 00:18:25 UTC (rev 27701)
+++ trunk/build/target-platform/multiple.target 2010-12-23 05:41:49 UTC (rev 27702)
@@ -211,8 +211,8 @@
<repository location="http://download.jboss.org/jbosstools/builds/staging/_composite_/trunk/"/>
</location>
<location includeAllPlatforms="false" includeMode="planner" type="InstallableUnit">
- <unit id="com.google.gdt.eclipse.suite.e36.feature.feature.group" version="1.4.0.v201010280102"/>
- <unit id="com.google.gwt.eclipse.sdkbundle.e36.feature.2.1.0.feature.group" version="2.1.0.v201010280102"/>
+ <unit id="com.google.gdt.eclipse.suite.e36.feature.feature.group" version="1.4.1.v201012170127"/>
+ <unit id="com.google.gwt.eclipse.sdkbundle.e36.feature.2.1.1.feature.group" version="2.1.1.v201012170127"/>
<repository location="http://dl.google.com/eclipse/plugin/3.6/"/>
</location>
Modified: trunk/build/target-platform/multiple.target.p2mirror.xml
===================================================================
--- trunk/build/target-platform/multiple.target.p2mirror.xml 2010-12-23 00:18:25 UTC (rev 27701)
+++ trunk/build/target-platform/multiple.target.p2mirror.xml 2010-12-23 05:41:49 UTC (rev 27702)
@@ -174,7 +174,7 @@
<iu id="org.eclipse.wst.ws_ui.feature.feature.group" version=""/>
<iu id="org.eclipse.wst.xml_core.feature.feature.group" version=""/>
<iu id="com.google.gdt.eclipse.suite.e36.feature.feature.group" version=""/>
-<iu id="com.google.gwt.eclipse.sdkbundle.e36.feature.2.1.0.feature.group" version=""/>
+<iu id="com.google.gwt.eclipse.sdkbundle.e36.feature.2.1.1.feature.group" version=""/>
<iu id="org.drools.eclipse.feature.feature.group" version=""/>
<iu id="org.drools.eclipse.task.feature.feature.group" version=""/>
<iu id="org.guvnor.tools.feature.feature.group" version=""/>
Modified: trunk/build/target-platform/unified.target
===================================================================
--- trunk/build/target-platform/unified.target 2010-12-23 00:18:25 UTC (rev 27701)
+++ trunk/build/target-platform/unified.target 2010-12-23 05:41:49 UTC (rev 27702)
@@ -211,8 +211,8 @@
<repository location="http://download.jboss.org/jbosstools/updates/target-platform/latest/"/>
</location>
<location includeAllPlatforms="false" includeMode="planner" type="InstallableUnit">
- <unit id="com.google.gdt.eclipse.suite.e36.feature.feature.group" version="1.4.0.v201010280102"/>
- <unit id="com.google.gwt.eclipse.sdkbundle.e36.feature.2.1.0.feature.group" version="2.1.0.v201010280102"/>
+ <unit id="com.google.gdt.eclipse.suite.e36.feature.feature.group" version="1.4.1.v201012170127"/>
+ <unit id="com.google.gwt.eclipse.sdkbundle.e36.feature.2.1.1.feature.group" version="2.1.1.v201012170127"/>
<repository location="http://download.jboss.org/jbosstools/updates/target-platform/latest/"/>
</location>
Modified: trunk/build/target-platform/unified.target.p2mirror.xml
===================================================================
--- trunk/build/target-platform/unified.target.p2mirror.xml 2010-12-23 00:18:25 UTC (rev 27701)
+++ trunk/build/target-platform/unified.target.p2mirror.xml 2010-12-23 05:41:49 UTC (rev 27702)
@@ -133,6 +133,11 @@
<iu id="org.eclipse.zest.feature.group" version=""/>
<iu id="org.eclipse.uml2.feature.group" version=""/>
<iu id="org.eclipse.rse.feature.group" version=""/>
+<iu id="org.eclipse.rse.useractions.feature.group" version=""/>
+<iu id="org.eclipse.tm.terminal.feature.group" version=""/>
+<iu id="org.eclipse.tm.terminal.view.feature.group" version=""/>
+<iu id="org.eclipse.tm.terminal.telnet.feature.group" version=""/>
+<iu id="org.eclipse.tm.terminal.ssh.feature.group" version=""/>
<iu id="org.eclipse.jst.jee" version=""/>
<iu id="org.eclipse.wst.common.frameworks" version=""/>
<iu id="org.eclipse.wst.common.project.facet.ui" version=""/>
@@ -169,7 +174,7 @@
<iu id="org.eclipse.wst.ws_ui.feature.feature.group" version=""/>
<iu id="org.eclipse.wst.xml_core.feature.feature.group" version=""/>
<iu id="com.google.gdt.eclipse.suite.e36.feature.feature.group" version=""/>
-<iu id="com.google.gwt.eclipse.sdkbundle.e36.feature.2.1.0.feature.group" version=""/>
+<iu id="com.google.gwt.eclipse.sdkbundle.e36.feature.2.1.1.feature.group" version=""/>
<iu id="org.drools.eclipse.feature.feature.group" version=""/>
<iu id="org.drools.eclipse.task.feature.feature.group" version=""/>
<iu id="org.guvnor.tools.feature.feature.group" version=""/>
14 years, 1 month
JBoss Tools SVN: r27701 - 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-22 19:18:25 -0500 (Wed, 22 Dec 2010)
New Revision: 27701
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ManageKeysPage.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/WizardMessages.properties
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.ui/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2010-12-23 00:16:12 UTC (rev 27700)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2010-12-23 00:18:25 UTC (rev 27701)
@@ -1,3 +1,10 @@
+2010-12-23 adietisheim <adietisheim@adietisheim-thinkpad>
+
+ * src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage.java:
+ * src/org/jboss/tools/internal/deltacloud/ui/wizards/ManageKeysWizard.java:
+ * src/org/jboss/tools/internal/deltacloud/ui/wizards/ManageKeysPage.java:
+ [JBIDE-7763] revamped the whole manage keys page to deal with keys on the server (list, refresh, create, delete)
+
2010-12-22 adietisheim <adietisheim@adietisheim-thinkpad>
* src/org/jboss/tools/deltacloud/ui/views/cloudelements/InstanceViewLabelAndContentProvider.java (asyncAddCloudElements):
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-23 00:16:12 UTC (rev 27700)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ManageKeysPage.java 2010-12-23 00:18:25 UTC (rev 27701)
@@ -10,305 +10,305 @@
******************************************************************************/
package org.jboss.tools.internal.deltacloud.ui.wizards;
-import java.io.File;
-import java.io.FilenameFilter;
+import java.lang.reflect.InvocationTargetException;
+import java.text.MessageFormat;
+import java.util.ArrayList;
import java.util.Arrays;
-import java.util.Comparator;
-import org.eclipse.core.runtime.preferences.InstanceScope;
-import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.dialogs.IInputValidator;
import org.eclipse.jface.dialogs.InputDialog;
import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.layout.GridDataFactory;
+import org.eclipse.jface.layout.GridLayoutFactory;
+import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.DirectoryDialog;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.List;
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.DeltaCloudKey;
+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.IDeltaCloudPreferenceConstants;
+import org.jboss.tools.deltacloud.ui.ErrorUtils;
import org.jboss.tools.deltacloud.ui.SWTImagesFactory;
-import org.osgi.service.prefs.Preferences;
/**
* @author Jeff Johnston
+ * @author André Dietisheim
*/
public class ManageKeysPage extends WizardPage {
private final static String NAME = "ManageKeys.name"; //$NON-NLS-1$
private final static String TITLE = "ManageKeys.title"; //$NON-NLS-1$
private final static String DESC = "ManageKeys.desc"; //$NON-NLS-1$
- private final static String DIR_LABEL = "Directory.label"; //$NON-NLS-1$
- private final static String BROWSE_LABEL = "BrowseButton.label"; //$NON-NLS-1$
private final static String NEW = "NewButton.label"; //$NON-NLS-1$
private final static String DELETE = "DeleteButton.label"; //$NON-NLS-1$
private final static String CREATE_KEY_TITLE = "CreateKey.title"; //$NON-NLS-1$
private final static String CREATE_KEY_MSG = "CreateKey.msg"; //$NON-NLS-1$
private final static String CONFIRM_KEY_DELETE_TITLE = "ConfirmKeyDelete.title"; //$NON-NLS-1$
private final static String CONFIRM_KEY_DELETE_MSG = "ConfirmKeyDelete.msg"; //$NON-NLS-1$
-
- private final static String INVALID_DIRECTORY = "ErrorInvalidDirectory.text"; //$NON-NLS-1$
-
+
private DeltaCloud cloud;
- private String fileExtension;
- private String currFile;
-
- private Text directory;
- private List fileList;
-
- private ModifyListener dirListener = new ModifyListener() {
+ private List keyList;
+ private java.util.List<DeltaCloudKey> keys;
+ private DeltaCloudKey selectedKey;
+ private class UniqueKeyIdConstraint implements IInputValidator {
+
@Override
- public void modifyText(ModifyEvent e) {
- // TODO Auto-generated method stub
- validateDirectory();
- }
-
- };
-
- private SelectionListener browseButtonListener = new SelectionAdapter() {
-
- @Override
- public void widgetSelected(SelectionEvent e) {
- Display display = Display.getDefault();
- Shell shell = new Shell(display);
- DirectoryDialog d = new DirectoryDialog(shell);
- String text = d.open();
- if (text != null)
- directory.setText(text);
- }
+ public String isValid(String keyId) {
+ if (keys == null
+ || keyId == null) {
+ return null;
+ }
- };
-
- private SelectionListener createButtonListener = new SelectionAdapter() {
-
- @Override
- public void widgetSelected(SelectionEvent e) {
- Display display = Display.getDefault();
- Shell shell = new Shell(display);
- String directoryText = directory.getText();
- InputDialog d = new InputDialog(shell, WizardMessages.getString(CREATE_KEY_TITLE),
- WizardMessages.getString(CREATE_KEY_MSG),
- "",
- null);
- d.setBlockOnOpen(true);
- d.create();
- int retcode = d.open();
- if (retcode == InputDialog.OK) {
- String keyname = d.getValue();
- try {
- cloud.createKey(keyname, directoryText);
- loadFileList();
- } catch (DeltaCloudException dce) {
- MessageDialog.openError(getShell(), null, dce.getLocalizedMessage());
+ for (DeltaCloudKey key : keys) {
+ if (keyId.equals(key.getId())) {
+ // TODO: internationalize string
+ return "Key id is already used, please choose another id.";
}
}
+ return null;
}
+ }
- };
+ private SelectionListener keyListListener = new SelectionAdapter() {
- private SelectionListener fileListListener = new SelectionAdapter() {
-
@Override
public void widgetSelected(SelectionEvent e) {
- currFile = fileList.getSelection()[0];
- setPageComplete(isKeySelected());
+ String selectedKeyName = keyList.getItem(keyList.getSelectionIndex());
+ selectedKey = getKey(selectedKeyName);
+ setPageComplete(selectedKey != null);
}
};
- private FilenameFilter extensionFilter = new FilenameFilter() {
-
- @Override
- public boolean accept(File arg0, String arg1) {
- if (arg1.endsWith(fileExtension))
- return true;
- return false;
- }
-
- };
-
- public ManageKeysPage(DeltaCloud cloud, String fileExtension) {
+ public ManageKeysPage(DeltaCloud cloud) {
super(WizardMessages.getString(NAME));
this.cloud = cloud;
- this.fileExtension = fileExtension;
setDescription(WizardMessages.getString(DESC));
setTitle(WizardMessages.getString(TITLE));
setImageDescriptor(SWTImagesFactory.DESC_DELTA_LARGE);
setPageComplete(false);
}
-
- public String getCurrFile() {
- return currFile;
+
+ public DeltaCloudKey getKey() {
+ return selectedKey;
}
-
- private void validateDirectory() {
- boolean hasError = false;
-
- if (directory.getText().length() > 0) {
- File f = new File(directory.getText());
- if (!f.exists() || !f.isDirectory()) {
- hasError = true;
- setErrorMessage(WizardMessages.getString(INVALID_DIRECTORY));
- } else {
- Preferences prefs = new InstanceScope().getNode(Activator.PLUGIN_ID);
- try {
- prefs.put(IDeltaCloudPreferenceConstants.DEFAULT_KEY_DIR, directory.getText());
- } catch(Exception e) {
- // do nothing
- }
- loadFileList();
- }
- }
- if (!hasError) {
- setErrorMessage(null);
- }
- setPageComplete(!hasError && isKeySelected());
- }
-
- private boolean isKeySelected() {
- return fileList.getSelectionCount() == 1;
- }
-
- private void loadFileList() {
- File dir = new File(directory.getText());
- if (dir.exists() && dir.isDirectory()) {
- File[] files = dir.listFiles(extensionFilter);
- Arrays.sort(files, new Comparator<File>() {
- @Override
- public int compare(File arg0, File arg1) {
- String name0 = arg0.getName();
- String name1 = arg1.getName();
- return name0.compareTo(name1);
- }
- });
- fileList.removeAll();
- for (File f : files) {
- fileList.add(f.getName());
- }
- }
- }
-
+
@Override
public void createControl(Composite parent) {
setPageComplete(false);
final Composite container = new Composite(parent, SWT.NULL);
- FormLayout layout = new FormLayout();
- layout.marginHeight = 5;
- layout.marginWidth = 5;
- container.setLayout(layout);
+ GridLayoutFactory.fillDefaults().numColumns(4).equalWidth(false).applyTo(container);
- Label dirLabel = new Label(container, SWT.NULL);
- dirLabel.setText(WizardMessages.getString(DIR_LABEL));
-
- directory = new Text(container, SWT.BORDER | SWT.SINGLE);
- Preferences prefs = new InstanceScope().getNode(Activator.PLUGIN_ID);
- String defaultDir = prefs.get(IDeltaCloudPreferenceConstants.DEFAULT_KEY_DIR, System.getProperty("user.home"));
- directory.setText(defaultDir);
- directory.addModifyListener(dirListener);
-
- Button browseButton = new Button(container, SWT.NULL);
- browseButton.setText(WizardMessages.getString(BROWSE_LABEL));
- browseButton.addSelectionListener(browseButtonListener);
-
- fileList = new List(container, SWT.BORDER | SWT.SINGLE | SWT.V_SCROLL);
- fileList.addSelectionListener(fileListListener);
-
+ keyList = new List(container, SWT.BORDER | SWT.SINGLE | SWT.V_SCROLL);
+ keyList.addSelectionListener(keyListListener);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, true).span(4, 5).applyTo(keyList);
+
+ Button refreshButton = new Button(container, SWT.NULL);
+ refreshButton.setText("Refresh keys");
+ refreshButton.addSelectionListener(onRefreshPressed());
+ GridDataFactory.fillDefaults().applyTo(refreshButton);
+
+ Label dummyLabel = new Label(container, SWT.NULL);
+ GridDataFactory.fillDefaults().grab(true, false).applyTo(dummyLabel);
+
Button createButton = new Button(container, SWT.NULL);
+ // TODO: internationalize string
createButton.setText(WizardMessages.getString(NEW));
- createButton.addSelectionListener(createButtonListener);
-
+ createButton.addSelectionListener(onNewPressed());
+ GridDataFactory.fillDefaults().applyTo(createButton);
+
Button deleteButton = new Button(container, SWT.NULL);
deleteButton.setText(WizardMessages.getString(DELETE));
- deleteButton.addSelectionListener(new SelectionAdapter() {
+ deleteButton.addSelectionListener(onDeletePressed());
+ GridDataFactory.fillDefaults().applyTo(deleteButton);
+
+ setControl(container);
+ asyncGetKeys(cloud);
+ setPageComplete(false);
+ }
+
+ private SelectionAdapter onDeletePressed() {
+ return new SelectionAdapter() {
@Override
- public void widgetSelected(SelectionEvent e) {
- final String keyName = fileList.getSelection()[0];
- boolean confirmed = MessageDialog.openConfirm(getShell(),
+ public void widgetSelected(SelectionEvent event) {
+ boolean confirmed = MessageDialog.openConfirm(getShell(),
WizardMessages.getString(CONFIRM_KEY_DELETE_TITLE),
- WizardMessages.getFormattedString(CONFIRM_KEY_DELETE_MSG, keyName));
+ WizardMessages.getFormattedString(CONFIRM_KEY_DELETE_MSG, selectedKey.getId()));
if (confirmed) {
+ deleteKey(selectedKey);
+ }
+ }
+ };
+ }
+
+ private SelectionListener onRefreshPressed() {
+ return new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ asyncGetKeys(cloud);
+ }
+ };
+ }
+
+ private SelectionListener onNewPressed() {
+ return new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ Display display = Display.getDefault();
+ Shell shell = new Shell(display);
+ // String directoryText = directory.getText();
+ InputDialog d = new InputDialog(shell, WizardMessages.getString(CREATE_KEY_TITLE),
+ WizardMessages.getString(CREATE_KEY_MSG), "", new UniqueKeyIdConstraint());
+ d.setBlockOnOpen(true);
+ d.create();
+ if (d.open() == InputDialog.OK) {
+ String keyId = d.getValue();
+ createkey(keyId);
+ }
+ }
+ };
+ }
+
+ private void asyncGetKeys(final DeltaCloud cloud) {
+ // TODO: internationalize strings
+ new AbstractCloudElementJob("get keys", cloud, CLOUDELEMENT.KEYS) {
+
+ protected IStatus doRun(IProgressMonitor monitor) throws Exception {
+ try {
+ keys = new ArrayList<DeltaCloudKey>();
+ keys.addAll(Arrays.asList(cloud.getKeys()));
+ setKeysToList(keys);
+ return Status.OK_STATUS;
+ } catch (DeltaCloudException e) {
+ // TODO: internationalize strings
+ return StatusFactory.getInstance(IStatus.ERROR, Activator.PLUGIN_ID,
+ MessageFormat.format("Could not get keys from cloud {0}", cloud.getName()), e);
+ }
+ }
+
+ }.schedule();
+ }
+
+ private String[] toKeyIds(java.util.List<DeltaCloudKey> keys) {
+ ArrayList<String> keyId = new ArrayList<String>();
+ for (DeltaCloudKey key : keys) {
+ keyId.add(key.getId());
+ }
+ return keyId.toArray(new String[keyId.size()]);
+ }
+
+ private void setKeysToList(java.util.List<DeltaCloudKey> keys) {
+ final String[] keyIds = toKeyIds(keys);
+ keyList.getDisplay().asyncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ if (keyIds.length == 0) {
+ keyList.setItems(new String[] { "There are no keys..." });
+ } else {
+ keyList.setItems(keyIds);
+ }
+ keyList.setEnabled(keyIds.length > 0);
+ }
+ });
+ }
+
+ private DeltaCloudKey getKey(String keyId) {
+ if (keys == null
+ || keyId == null) {
+ return null;
+ }
+ DeltaCloudKey matchingKey = null;
+ for (DeltaCloudKey key : keys) {
+ if (keyId.equals(key.getId())) {
+ matchingKey = key;
+ break;
+ }
+ }
+ return matchingKey;
+ }
+
+ private void createkey(final String keyId) {
+ try {
+ getWizard().getContainer().run(true, true, new IRunnableWithProgress() {
+
+ @Override
+ public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
try {
- cloud.deleteKey(keyName.substring(0, keyName.length() - fileExtension.length()));
- File f = new File(directory.getText());
- File[] files = f.listFiles(new FilenameFilter() {
+ DeltaCloudKey key = cloud.createKey(keyId);
+ keys.add(key);
+ setKeysToList(keys);
+ setSelection(key);
+ } catch (Exception e) {
+ throw new InvocationTargetException(e);
+ }
+ }
+ });
+ } catch (Exception e) {
+ // TODO: internationalize strings
+ ErrorUtils.handleError(
+ "Error",
+ MessageFormat.format("Error", "Could not create key \"{0}\"", keyId), e,
+ getShell());
+ }
+ }
+
+ private void deleteKey(final DeltaCloudKey key) {
+ try {
+ getWizard().getContainer().run(true, true, new IRunnableWithProgress() {
+
+ @Override
+ public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
+ try {
+ cloud.deleteKey(key.getId());
+ keys.remove(key);
+ getShell().getDisplay().syncExec(new Runnable() {
+
@Override
- public boolean accept(File dir, String name) {
- return name.equals(keyName);
+ public void run() {
+ keyList.remove(key.getId());
}
});
- if (files.length == 1) {
- if (files[0].delete())
- fileList.remove(fileList.getSelectionIndex());
- }
- } catch (DeltaCloudException dce) {
- MessageDialog.openError(getShell(), null, dce.getLocalizedMessage());
+ } catch (Exception e) {
+ throw new InvocationTargetException(e);
}
}
+ });
+ } catch (Exception e) {
+ // TODO: internationalize strings
+ ErrorUtils.handleError(
+ "Error",
+ MessageFormat.format("Error", "Could not create key \"{0}\"", key.getId()), e,
+ getShell());
+ }
+ }
+
+ private void setSelection(final DeltaCloudKey key) {
+ getShell().getDisplay().syncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ keyList.setSelection(new String[] { key.getId() });
+ keyList.showSelection();
}
});
-
- Point p1 = dirLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- Point p2 = directory.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- Point p3 = browseButton.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- int centering = (p2.y - p1.y + 1) / 2;
- int centering2 = (p3.y - p2.y + 1) / 2;
-
- FormData f = new FormData();
- f.left = new FormAttachment(0, 5);
- f.top = new FormAttachment(0, 5 + centering + centering2);
- dirLabel.setLayoutData(f);
-
- f = new FormData();
- f.right = new FormAttachment(100, -10);
- f.top = new FormAttachment(0, 5);
- browseButton.setLayoutData(f);
-
- f = new FormData();
- f.left = new FormAttachment(dirLabel, 5);
- f.top = new FormAttachment(0, 5 + centering2);
- f.right = new FormAttachment(browseButton, -10);
- directory.setLayoutData(f);
-
- f = new FormData();
- int widthHint = convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
- Point minSize = deleteButton.computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
- f.width = Math.max(widthHint, minSize.x);
- f.right = new FormAttachment(100, -20);
- f.bottom = new FormAttachment(100, -10);
- deleteButton.setLayoutData(f);
-
- f = new FormData();
- minSize = deleteButton.computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
- f.width = Math.max(widthHint, minSize.x);
- f.right = new FormAttachment(deleteButton, -10);
- f.bottom = new FormAttachment(100, -10);
- createButton.setLayoutData(f);
-
- f = new FormData();
- f.top = new FormAttachment(directory, 10);
- f.left = new FormAttachment(0, 0);
- f.right = new FormAttachment(100, 0);
- f.bottom = new FormAttachment(createButton, -10);
- fileList.setLayoutData(f);
-
- setControl(container);
- loadFileList();
- validateDirectory();
}
}
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-23 00:16:12 UTC (rev 27700)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ManageKeysWizard.java 2010-12-23 00:18:25 UTC (rev 27701)
@@ -12,29 +12,29 @@
import org.eclipse.jface.wizard.Wizard;
import org.jboss.tools.deltacloud.core.DeltaCloud;
+import org.jboss.tools.deltacloud.core.DeltaCloudKey;
/**
* @author Jeff Johnston
+ * @author André Dietisheim
*/
public class ManageKeysWizard extends Wizard {
private DeltaCloud cloud;
- private String fileExtension;
private ManageKeysPage mainPage;
- private String keyname;
+ private DeltaCloudKey key;
- public ManageKeysWizard(DeltaCloud cloud, String fileExtension) {
+ public ManageKeysWizard(DeltaCloud cloud) {
this.cloud = cloud;
- this.fileExtension = fileExtension;
}
- public String getKeyName() {
- return keyname;
+ public DeltaCloudKey getKey() {
+ return key;
}
@Override
public void addPages() {
- mainPage = new ManageKeysPage(cloud, fileExtension);
+ mainPage = new ManageKeysPage(cloud);
addPage(mainPage);
}
@@ -45,8 +45,7 @@
@Override
public boolean performFinish() {
- String currFile = mainPage.getCurrFile();
- keyname = currFile.substring(0, currFile.length() - fileExtension.length());
+ 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-23 00:16:12 UTC (rev 27700)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage.java 2010-12-23 00:18:25 UTC (rev 27701)
@@ -55,6 +55,7 @@
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.ui.SWTImagesFactory;
@@ -106,14 +107,14 @@
public void widgetSelected(SelectionEvent event) {
Shell shell = getShell();
- ManageKeysWizard wizard = new ManageKeysWizard(cloud, ".pem"); //$NON-NLS-1$
+ ManageKeysWizard wizard = new ManageKeysWizard(cloud); //$NON-NLS-1$
WizardDialog dialog = new CustomWizardDialog(shell, wizard,
IDialogConstants.OK_LABEL);
dialog.create();
dialog.open();
- String keyname = wizard.getKeyName();
- if (keyname != null) {
- keyText.setText(keyname);
+ DeltaCloudKey key = wizard.getKey();
+ if (key != null) {
+ keyText.setText(key.getId());
}
}
};
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties 2010-12-23 00:16:12 UTC (rev 27700)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties 2010-12-23 00:18:25 UTC (rev 27701)
@@ -116,7 +116,7 @@
Directory.label=Directory
CreateKey.title=Create Key
-CreateKey.msg=Specify a unique name for a new key:
+CreateKey.msg=Specify a unique id for a new key:
ConfirmKeyDelete.title=Confirm Key Delete
ConfirmKeyDelete.msg=Confirm deletion of key: {0}
14 years, 1 month
JBoss Tools SVN: r27700 - in trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core: src/org/jboss/tools/deltacloud/core and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-12-22 19:16:12 -0500 (Wed, 22 Dec 2010)
New Revision: 27700
Added:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudKey.java
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog
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/job/AbstractCloudElementJob.java
Log:
[JBIDE-7763] added methods to DeltaCloud to get all keys and to create a key on the server
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog 2010-12-22 22:05:46 UTC (rev 27699)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog 2010-12-23 00:16:12 UTC (rev 27700)
@@ -1,3 +1,12 @@
+2010-12-23 adietisheim <adietisheim@adietisheim-thinkpad>
+
+ * src/org/jboss/tools/deltacloud/core/job/AbstractCloudElementJob.java (CLOUDELEMENT.KEYS):
+ * src/org/jboss/tools/deltacloud/core/DeltaCloudKey.java:
+ * src/org/jboss/tools/deltacloud/core/DeltaCloud.java
+ (createKey):
+ (getKeys):
+ [JBIDE-7763] added methods to DeltaCloud to get all keys and to create a key on the server
+
2010-12-22 adietisheim <adietisheim@adietisheim-thinkpad>
* src/org/jboss/tools/deltacloud/core/client/DeltaCloudClientImpl.java (DeltaCloudClientImpl):
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-22 22:05:46 UTC (rev 27699)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java 2010-12-23 00:16:12 UTC (rev 27700)
@@ -26,6 +26,7 @@
import org.jboss.tools.deltacloud.core.client.Image;
import org.jboss.tools.deltacloud.core.client.Instance;
import org.jboss.tools.deltacloud.core.client.InternalDeltaCloudClient;
+import org.jboss.tools.deltacloud.core.client.Key;
import org.jboss.tools.deltacloud.core.client.Realm;
import org.jboss.tools.internal.deltacloud.core.observable.ObservablePojo;
@@ -407,6 +408,20 @@
return deltaCloudImage;
}
+ public DeltaCloudKey[] getKeys() throws DeltaCloudException {
+ List<DeltaCloudKey> keys = new ArrayList<DeltaCloudKey>();
+ try {
+ for (Key key : client.listKeys()) {
+ DeltaCloudKey deltaCloudKey = new DeltaCloudKey(key, this);
+ keys.add(deltaCloudKey);
+ }
+ return keys.toArray(new DeltaCloudKey[] {});
+ } catch (DeltaCloudClientException e) {
+ // TODO: internationalize strings
+ throw new DeltaCloudException(MessageFormat.format("Cloud not get keys from cloud \"{0}\"", getName()), e);
+ }
+ }
+
public void createKey(String keyname, String keystoreLocation) throws DeltaCloudException {
try {
client.createKey(keyname, keystoreLocation);
@@ -415,6 +430,17 @@
}
}
+ public DeltaCloudKey createKey(String id) throws DeltaCloudException {
+ try {
+ Key key = client.createKey(id);
+ return new DeltaCloudKey(key, this);
+ } catch (DeltaCloudClientException e) {
+ // TODO: internationalize strings
+ throw new DeltaCloudException(
+ MessageFormat.format("Could not create key \"{0}\" on cloud \"{1}\"", id, getName()), e);
+ }
+ }
+
public void deleteKey(String keyname) throws DeltaCloudException {
try {
client.deleteKey(keyname);
Added: 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 (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudKey.java 2010-12-23 00:16:12 UTC (rev 27700)
@@ -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.deltacloud.core;
+
+import org.jboss.tools.deltacloud.core.client.Key;
+
+/**
+ * @author André Dietisheim
+ */
+public class DeltaCloudKey extends AbstractDeltaCloudElement {
+
+ private Key key;
+
+ public DeltaCloudKey(Key key, DeltaCloud cloud) {
+ super(cloud);
+ this.key = key;
+ }
+
+ @Override
+ public String getName() {
+ return key.getId();
+ }
+
+ @Override
+ public String getId() {
+ return key.getId();
+ }
+
+ public String getFingerprint() {
+ return key.getFingerprint();
+ }
+
+ public String getPem() {
+ return key.getPem();
+ }
+}
Property changes on: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudKey.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/job/AbstractCloudElementJob.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/job/AbstractCloudElementJob.java 2010-12-22 22:05:46 UTC (rev 27699)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/job/AbstractCloudElementJob.java 2010-12-23 00:16:12 UTC (rev 27700)
@@ -19,7 +19,7 @@
public abstract class AbstractCloudElementJob extends AbstractCloudJob {
public static enum CLOUDELEMENT {
- IMAGES, INSTANCES, PROFILES, REALMS
+ IMAGES, INSTANCES, PROFILES, REALMS, KEYS
}
private CLOUDELEMENT cloudElement;
14 years, 1 month