JBoss Tools SVN: r26477 - trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2010-11-11 17:50:04 -0500 (Thu, 11 Nov 2010)
New Revision: 26477
Modified:
trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/MavenCoreActivator.java
Log:
JBIDE-4809 Creating application.xml, jboss-app.xml and datasource files when importing Maven EAR project
Modified: trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/MavenCoreActivator.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/MavenCoreActivator.java 2010-11-11 21:29:47 UTC (rev 26476)
+++ trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/MavenCoreActivator.java 2010-11-11 22:50:04 UTC (rev 26477)
@@ -416,7 +416,7 @@
version.setValue("5"); //$NON-NLS-1$
configuration.addChild(version);
Xpp3Dom generateApplicationXml = new Xpp3Dom("generateApplicationXml"); //$NON-NLS-1$
- generateApplicationXml.setValue("false"); //$NON-NLS-1$
+ generateApplicationXml.setValue("true"); //$NON-NLS-1$
configuration.addChild(generateApplicationXml);
Xpp3Dom defaultLibBundleDir = new Xpp3Dom("defaultLibBundleDir"); //$NON-NLS-1$
defaultLibBundleDir.setValue("lib"); //$NON-NLS-1$
15 years, 5 months
JBoss Tools SVN: r26476 - in trunk/tests: features and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-11-11 16:29:47 -0500 (Thu, 11 Nov 2010)
New Revision: 26476
Modified:
trunk/tests/features/pom.xml
trunk/tests/plugins/org.jboss.tools.tests.performance/pom.xml
trunk/tests/plugins/org.jboss.tools.tests/pom.xml
trunk/tests/plugins/pom.xml
trunk/tests/pom.xml
trunk/tests/site/pom.xml
Log:
add .gitignore files and tweak poms to depend on published parent pom in JBoss Tools Nexus repo
Modified: trunk/tests/features/pom.xml
===================================================================
--- trunk/tests/features/pom.xml 2010-11-11 21:29:17 UTC (rev 26475)
+++ trunk/tests/features/pom.xml 2010-11-11 21:29:47 UTC (rev 26476)
@@ -2,8 +2,8 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.tools.tests</groupId>
- <artifactId>features</artifactId>
- <name>tests.features</name>
+ <artifactId>org.jboss.tools.tests.features</artifactId>
+ <name>org.jboss.tools.tests.features</name>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
Modified: trunk/tests/plugins/org.jboss.tools.tests/pom.xml
===================================================================
--- trunk/tests/plugins/org.jboss.tools.tests/pom.xml 2010-11-11 21:29:17 UTC (rev 26475)
+++ trunk/tests/plugins/org.jboss.tools.tests/pom.xml 2010-11-11 21:29:47 UTC (rev 26476)
@@ -2,7 +2,6 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
-
<groupId>org.jboss.tools</groupId>
<artifactId>org.jboss.tools.parent.pom</artifactId>
<version>0.0.1-SNAPSHOT</version>
Modified: trunk/tests/plugins/org.jboss.tools.tests.performance/pom.xml
===================================================================
--- trunk/tests/plugins/org.jboss.tools.tests.performance/pom.xml 2010-11-11 21:29:17 UTC (rev 26475)
+++ trunk/tests/plugins/org.jboss.tools.tests.performance/pom.xml 2010-11-11 21:29:47 UTC (rev 26476)
@@ -2,7 +2,6 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
-
<groupId>org.jboss.tools</groupId>
<artifactId>org.jboss.tools.parent.pom</artifactId>
<version>0.0.1-SNAPSHOT</version>
Modified: trunk/tests/plugins/pom.xml
===================================================================
--- trunk/tests/plugins/pom.xml 2010-11-11 21:29:17 UTC (rev 26475)
+++ trunk/tests/plugins/pom.xml 2010-11-11 21:29:47 UTC (rev 26476)
@@ -2,8 +2,8 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.tools.tests</groupId>
- <artifactId>plugins</artifactId>
- <name>tests.plugins</name>
+ <artifactId>org.jboss.tools.tests.plugins</artifactId>
+ <name>org.jboss.tools.tests.plugins</name>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
Modified: trunk/tests/pom.xml
===================================================================
--- trunk/tests/pom.xml 2010-11-11 21:29:17 UTC (rev 26475)
+++ trunk/tests/pom.xml 2010-11-11 21:29:47 UTC (rev 26476)
@@ -1,9 +1,18 @@
<project
-xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+ xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.tools</groupId>
+ <artifactId>org.jboss.tools.parent.pom</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ <type>pom</type>
+ </dependency>
+ </dependencies>
<groupId>org.jboss.tools</groupId>
- <artifactId>tests</artifactId>
- <name>tests.all</name>
+ <artifactId>org.jboss.tools.tests.all</artifactId>
+ <name>org.jboss.tools.tests.all</name>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
Modified: trunk/tests/site/pom.xml
===================================================================
--- trunk/tests/site/pom.xml 2010-11-11 21:29:17 UTC (rev 26475)
+++ trunk/tests/site/pom.xml 2010-11-11 21:29:47 UTC (rev 26476)
@@ -1,14 +1,13 @@
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
-
<groupId>org.jboss.tools</groupId>
<artifactId>org.jboss.tools.parent.pom</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<groupId>org.jboss.tools.tests</groupId>
- <artifactId>tests.site</artifactId>
- <name>tests.site</name>
+ <artifactId>org.jboss.tools.tests.site</artifactId>
+ <name>org.jboss.tools.tests.site</name>
<version>0.0.1-SNAPSHOT</version>
<packaging>eclipse-update-site</packaging>
</project>
15 years, 5 months
JBoss Tools SVN: r26475 - in trunk/tests: features and 7 other directories.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-11-11 16:29:17 -0500 (Thu, 11 Nov 2010)
New Revision: 26475
Added:
trunk/tests/.gitignore
trunk/tests/features/.gitignore
trunk/tests/features/org.jboss.tools.test.feature/.gitignore
trunk/tests/plugins/.gitignore
trunk/tests/plugins/org.jboss.tools.tests.performance/.gitignore
trunk/tests/plugins/org.jboss.tools.tests/.gitignore
trunk/tests/plugins/org.jboss.tools.ui.bot.ext.test/.gitignore
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/.gitignore
trunk/tests/site/.gitignore
Log:
add .gitignore files and tweak poms to depend on published parent pom in JBoss Tools Nexus repo
Added: trunk/tests/.gitignore
===================================================================
--- trunk/tests/.gitignore (rev 0)
+++ trunk/tests/.gitignore 2010-11-11 21:29:17 UTC (rev 26475)
@@ -0,0 +1,2 @@
+.project
+.settings/
Added: trunk/tests/features/.gitignore
===================================================================
--- trunk/tests/features/.gitignore (rev 0)
+++ trunk/tests/features/.gitignore 2010-11-11 21:29:17 UTC (rev 26475)
@@ -0,0 +1,2 @@
+.settings/
+.project
Added: trunk/tests/features/org.jboss.tools.test.feature/.gitignore
===================================================================
--- trunk/tests/features/org.jboss.tools.test.feature/.gitignore (rev 0)
+++ trunk/tests/features/org.jboss.tools.test.feature/.gitignore 2010-11-11 21:29:17 UTC (rev 26475)
@@ -0,0 +1 @@
+target/
Added: trunk/tests/plugins/.gitignore
===================================================================
--- trunk/tests/plugins/.gitignore (rev 0)
+++ trunk/tests/plugins/.gitignore 2010-11-11 21:29:17 UTC (rev 26475)
@@ -0,0 +1,2 @@
+.project
+.settings/
Added: trunk/tests/plugins/org.jboss.tools.tests/.gitignore
===================================================================
--- trunk/tests/plugins/org.jboss.tools.tests/.gitignore (rev 0)
+++ trunk/tests/plugins/org.jboss.tools.tests/.gitignore 2010-11-11 21:29:17 UTC (rev 26475)
@@ -0,0 +1,2 @@
+bin/
+target/
Added: trunk/tests/plugins/org.jboss.tools.tests.performance/.gitignore
===================================================================
--- trunk/tests/plugins/org.jboss.tools.tests.performance/.gitignore (rev 0)
+++ trunk/tests/plugins/org.jboss.tools.tests.performance/.gitignore 2010-11-11 21:29:17 UTC (rev 26475)
@@ -0,0 +1 @@
+bin/
Added: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/.gitignore
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/.gitignore (rev 0)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/.gitignore 2010-11-11 21:29:17 UTC (rev 26475)
@@ -0,0 +1 @@
+target/
Added: trunk/tests/plugins/org.jboss.tools.ui.bot.ext.test/.gitignore
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext.test/.gitignore (rev 0)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext.test/.gitignore 2010-11-11 21:29:17 UTC (rev 26475)
@@ -0,0 +1,2 @@
+bin/
+target/
Added: trunk/tests/site/.gitignore
===================================================================
--- trunk/tests/site/.gitignore (rev 0)
+++ trunk/tests/site/.gitignore 2010-11-11 21:29:17 UTC (rev 26475)
@@ -0,0 +1,4 @@
+.settings/
+.project
+target/
+.classpath
15 years, 5 months
JBoss Tools SVN: r26474 - trunk/build/target-platform.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-11-11 15:53:17 -0500 (Thu, 11 Nov 2010)
New Revision: 26474
Modified:
trunk/build/target-platform/pom.xml
Log:
refactor artifactId
Modified: trunk/build/target-platform/pom.xml
===================================================================
--- trunk/build/target-platform/pom.xml 2010-11-11 20:51:21 UTC (rev 26473)
+++ trunk/build/target-platform/pom.xml 2010-11-11 20:53:17 UTC (rev 26474)
@@ -5,7 +5,7 @@
<!-- <parent> <groupId>org.jboss.tools</groupId> <artifactId>org.jboss.tools.parent.pom</artifactId>
<version>0.0.1-SNAPSHOT</version> </parent> -->
<groupId>org.jboss.tools</groupId>
- <artifactId>target-platform</artifactId>
+ <artifactId>org.jboss.tools.target.platform</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>JBoss Tools Target Platform Definition</name>
<packaging>pom</packaging>
15 years, 5 months
JBoss Tools SVN: r26473 - trunk/build/target-platform.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-11-11 15:51:21 -0500 (Thu, 11 Nov 2010)
New Revision: 26473
Modified:
trunk/build/target-platform/pom.xml
Log:
uniqueVersion = false
Modified: trunk/build/target-platform/pom.xml
===================================================================
--- trunk/build/target-platform/pom.xml 2010-11-11 20:42:10 UTC (rev 26472)
+++ trunk/build/target-platform/pom.xml 2010-11-11 20:51:21 UTC (rev 26473)
@@ -185,7 +185,7 @@
<snapshotRepository>
<id>jboss-snapshots-repository</id>
<name>JBoss Snapshot Repository</name>
- <uniqueVersion>true</uniqueVersion>
+ <uniqueVersion>false</uniqueVersion>
<url>https://repository.jboss.org/nexus/content/repositories/snapshots/</url>
<layout>default</layout>
</snapshotRepository>
15 years, 5 months
JBoss Tools SVN: r26472 - in trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui: src/org/jboss/tools/deltacloud/ui and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-11-11 15:42:10 -0500 (Thu, 11 Nov 2010)
New Revision: 26472
Added:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/DeltaCloudImageAdapterFactory.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/DeltaCloudInstanceAdapterFactory.java
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.xml
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/CVInstanceElementAdapterFactory.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/FilterInstancesHandler.java
Log:
[JBIDE-7558] enabled instance filter
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.xml
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.xml 2010-11-11 20:29:54 UTC (rev 26471)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.xml 2010-11-11 20:42:10 UTC (rev 26472)
@@ -264,7 +264,7 @@
<activeWhen>
<with
variable="selection">
- <iterate>
+ <iterate operator="and">
<instanceof
value="org.jboss.tools.deltacloud.ui.views.CVImageElement">
</instanceof>
@@ -282,9 +282,9 @@
<activeWhen>
<with
variable="selection">
- <iterate>
+ <iterate operator="and">
<instanceof
- value="org.jboss.tools.deltacloud.ui.views.CVImageElement" />
+ value="org.jboss.tools.deltacloud.ui.views.CloudViewElement" />
</iterate>
</with>
</activeWhen>
@@ -295,11 +295,11 @@
<activeWhen>
<with
variable="selection">
- i <iterate>
+ i <iterate operator="and">
<adapt
- type="org.jboss.tools.deltacloud.core.DeltaCloudInstance">
+ type="org.jboss.tools.deltacloud.core.DeltaCloud">
<instanceof
- value="org.jboss.tools.deltacloud.core.DeltaCloudInstance" />
+ value="org.jboss.tools.deltacloud.core.DeltaCloud" />
</adapt>
</iterate>
</with>
@@ -599,34 +599,12 @@
label="%command.filterimages.label"
style="push"
tooltip="%command.filterimages.tooltip">
- <visibleWhen
- checkEnabled="true">
- <with
- variable="selection">
- <iterate>
- <instanceof
- value="org.jboss.tools.deltacloud.core">
- </instanceof>
- </iterate>
- </with>
- </visibleWhen>
</command>
<command
commandId="org.jboss.tools.deltacloud.ui.filterinstances"
label="%command.filterinstances.label"
style="push"
tooltip="%command.filterinstances.tooltip">
- <visibleWhen
- checkEnabled="true">
- <with
- variable="selection">
- <iterate>
- <instanceof
- value="org.jboss.tools.deltacloud.ui.views.CloudViewElement">
- </instanceof>
- </iterate>
- </with>
- </visibleWhen>
</command>
</menuContribution>
<!-- DeltaCloudView local menu ========================================= -->
@@ -727,6 +705,20 @@
type="org.jboss.tools.deltacloud.core.DeltaCloudInstance">
</adapter>
</factory>
+ <factory
+ adaptableType="org.jboss.tools.deltacloud.core.DeltaCloudInstance"
+ class="org.jboss.tools.deltacloud.ui.DeltaCloudInstanceAdapterFactory">
+ <adapter
+ type="org.jboss.tools.deltacloud.core.DeltaCloud">
+ </adapter>
+ </factory>
+ <factory
+ adaptableType="org.jboss.tools.deltacloud.core.DeltaCloudImage"
+ class="org.jboss.tools.deltacloud.ui.DeltaCloudImageAdapterFactory">
+ <adapter
+ type="org.jboss.tools.deltacloud.core.DeltaCloud">
+ </adapter>
+ </factory>
</extension>
</plugin>
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/CVInstanceElementAdapterFactory.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/CVInstanceElementAdapterFactory.java 2010-11-11 20:29:54 UTC (rev 26471)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/CVInstanceElementAdapterFactory.java 2010-11-11 20:42:10 UTC (rev 26472)
@@ -1,20 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.tools.deltacloud.ui;
import org.eclipse.core.runtime.IAdapterFactory;
+import org.jboss.tools.deltacloud.core.DeltaCloud;
import org.jboss.tools.deltacloud.core.DeltaCloudInstance;
import org.jboss.tools.internal.deltacloud.ui.utils.UIUtils;
public class CVInstanceElementAdapterFactory implements IAdapterFactory {
+ @SuppressWarnings("rawtypes")
private static final Class[] ADAPTERS = new Class[]{
- DeltaCloudInstance.class
+ DeltaCloudInstance.class,
+ DeltaCloud.class
};
+ @SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public Object getAdapter(Object adaptableObject, Class adapterType) {
- return UIUtils.adapt(adaptableObject, DeltaCloudInstance.class);
+ return UIUtils.adapt(adaptableObject, adapterType);
}
+ @SuppressWarnings("rawtypes")
@Override
public Class[] getAdapterList() {
return ADAPTERS;
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/DeltaCloudImageAdapterFactory.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/DeltaCloudImageAdapterFactory.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/DeltaCloudImageAdapterFactory.java 2010-11-11 20:42:10 UTC (rev 26472)
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.deltacloud.ui;
+
+import org.eclipse.core.runtime.IAdapterFactory;
+import org.jboss.tools.deltacloud.core.DeltaCloud;
+import org.jboss.tools.deltacloud.core.DeltaCloudImage;
+
+public class DeltaCloudImageAdapterFactory implements IAdapterFactory {
+
+ @SuppressWarnings("rawtypes")
+ private static final Class[] ADAPTERS = new Class[]{
+ DeltaCloud.class
+ };
+
+ @SuppressWarnings("rawtypes")
+ @Override
+ public Object getAdapter(Object adaptableObject, Class adapterType) {
+ if (adaptableObject instanceof DeltaCloudImage) {
+ return ((DeltaCloudImage) adaptableObject).getDeltaCloud();
+ } else {
+ return null;
+ }
+ }
+
+ @SuppressWarnings("rawtypes")
+ @Override
+ public Class[] getAdapterList() {
+ return ADAPTERS;
+ }
+
+}
Property changes on: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/DeltaCloudImageAdapterFactory.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/DeltaCloudInstanceAdapterFactory.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/DeltaCloudInstanceAdapterFactory.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/DeltaCloudInstanceAdapterFactory.java 2010-11-11 20:42:10 UTC (rev 26472)
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.deltacloud.ui;
+
+import org.eclipse.core.runtime.IAdapterFactory;
+import org.jboss.tools.deltacloud.core.DeltaCloud;
+import org.jboss.tools.deltacloud.core.DeltaCloudInstance;
+
+public class DeltaCloudInstanceAdapterFactory implements IAdapterFactory {
+
+ @SuppressWarnings("rawtypes")
+ private static final Class[] ADAPTERS = new Class[]{
+ DeltaCloud.class
+ };
+
+ @SuppressWarnings("rawtypes")
+ @Override
+ public Object getAdapter(Object adaptableObject, Class adapterType) {
+ if (adaptableObject instanceof DeltaCloudInstance) {
+ return ((DeltaCloudInstance) adaptableObject).getDeltaCloud();
+ } else {
+ return null;
+ }
+ }
+
+ @SuppressWarnings("rawtypes")
+ @Override
+ public Class[] getAdapterList() {
+ return ADAPTERS;
+ }
+
+}
Property changes on: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/DeltaCloudInstanceAdapterFactory.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/FilterInstancesHandler.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/FilterInstancesHandler.java 2010-11-11 20:29:54 UTC (rev 26471)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/FilterInstancesHandler.java 2010-11-11 20:42:10 UTC (rev 26472)
@@ -22,7 +22,7 @@
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.handlers.HandlerUtil;
-import org.jboss.tools.deltacloud.core.DeltaCloudInstance;
+import org.jboss.tools.deltacloud.core.DeltaCloud;
import org.jboss.tools.internal.deltacloud.ui.utils.UIUtils;
import org.jboss.tools.internal.deltacloud.ui.wizards.InstanceFilter;
@@ -35,20 +35,20 @@
public Object execute(ExecutionEvent event) throws ExecutionException {
ISelection selection = HandlerUtil.getCurrentSelection(event);
if (selection instanceof IStructuredSelection) {
- DeltaCloudInstance deltaCloudInstance = UIUtils.getFirstAdaptedElement(selection, DeltaCloudInstance.class);
- createInstancesFilter(deltaCloudInstance, HandlerUtil.getActiveShell(event));
+ DeltaCloud deltaCloud = UIUtils.getFirstAdaptedElement(selection, DeltaCloud.class);
+ createInstancesFilter(deltaCloud, HandlerUtil.getActiveShell(event));
}
return Status.OK_STATUS;
}
- private void createInstancesFilter(final DeltaCloudInstance instance, final Shell shell) {
- if (instance != null) {
+ private void createInstancesFilter(final DeltaCloud cloud, final Shell shell) {
+ if (cloud != null) {
Display.getDefault().asyncExec(new Runnable() {
@Override
public void run() {
- IWizard wizard = new InstanceFilter(instance.getDeltaCloud());
+ IWizard wizard = new InstanceFilter(cloud);
WizardDialog dialog = new WizardDialog(shell, wizard);
dialog.create();
dialog.open();
15 years, 5 months
JBoss Tools SVN: r26471 - trunk/build/parent.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-11-11 15:29:54 -0500 (Thu, 11 Nov 2010)
New Revision: 26471
Modified:
trunk/build/parent/pom.xml
Log:
drop suffix from published artifact name
Modified: trunk/build/parent/pom.xml
===================================================================
--- trunk/build/parent/pom.xml 2010-11-11 20:26:52 UTC (rev 26470)
+++ trunk/build/parent/pom.xml 2010-11-11 20:29:54 UTC (rev 26471)
@@ -859,7 +859,7 @@
<snapshotRepository>
<id>jboss-snapshots-repository</id>
<name>JBoss Snapshot Repository</name>
- <uniqueVersion>true</uniqueVersion>
+ <uniqueVersion>false</uniqueVersion>
<url>https://repository.jboss.org/nexus/content/repositories/snapshots/</url>
<layout>default</layout>
</snapshotRepository>
15 years, 5 months
JBoss Tools SVN: r26470 - in trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui: src/org/jboss/tools/deltacloud/ui/commands and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-11-11 15:26:52 -0500 (Thu, 11 Nov 2010)
New Revision: 26470
Added:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/OriginalInstanceView.java
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.xml
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/CreateInstanceHandler.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/CreateInstanceHandler2.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/DestroyInstanceHandler.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/EditConnectionHandler.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/FilterImagesHandler.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/FilterInstancesHandler.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/RebootInstanceHandler.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/RefreshCloudHandler.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/RefreshInstancesHandler.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/ShowInRemoteSystemExplorerHandler.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/StartInstanceHandler.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/StopInstanceHandler.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/InstanceView.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils/UIUtils.java
Log:
[JBIDE-7558] implemented refresh instances handler
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.xml
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.xml 2010-11-11 20:23:42 UTC (rev 26469)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.xml 2010-11-11 20:26:52 UTC (rev 26470)
@@ -284,8 +284,7 @@
variable="selection">
<iterate>
<instanceof
- value="org.jboss.tools.deltacloud.ui.views.CloudViewElement">
- </instanceof>
+ value="org.jboss.tools.deltacloud.ui.views.CVImageElement" />
</iterate>
</with>
</activeWhen>
@@ -297,9 +296,11 @@
<with
variable="selection">
i <iterate>
- <instanceof
- value="org.jboss.tools.deltacloud.ui.views.CloudViewElement">
- </instanceof>
+ <adapt
+ type="org.jboss.tools.deltacloud.core.DeltaCloudInstance">
+ <instanceof
+ value="org.jboss.tools.deltacloud.core.DeltaCloudInstance" />
+ </adapt>
</iterate>
</with>
</activeWhen>
@@ -373,8 +374,19 @@
tooltip="%command.destroyinstance.tooltip">
</command>
</menuContribution>
+ <!-- filters -->
<menuContribution
allPopups="true"
+ locationURI="popup:org.jboss.tools.deltacloud.ui.views.InstanceView?after=filters">
+ <command
+ commandId="org.jboss.tools.deltacloud.ui.filterinstances"
+ label="%command.filterinstances.label"
+ style="push"
+ tooltip="%command.filterinstances.tooltip">
+ </command>
+ </menuContribution>
+ <menuContribution
+ allPopups="true"
locationURI="popup:org.jboss.tools.deltacloud.ui.views.InstanceView?after=additions">
<command
commandId="org.eclipse.ui.file.refresh"
@@ -439,6 +451,7 @@
</command>
</menuContribution>
</extension>
+
<!-- DeltaCloudView context menu ================================== -->
<extension point="org.eclipse.ui.menus">
<menuContribution
@@ -592,7 +605,7 @@
variable="selection">
<iterate>
<instanceof
- value="org.jboss.tools.deltacloud.ui.views.CloudViewElement">
+ value="org.jboss.tools.deltacloud.core">
</instanceof>
</iterate>
</with>
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/CreateInstanceHandler.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/CreateInstanceHandler.java 2010-11-11 20:23:42 UTC (rev 26469)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/CreateInstanceHandler.java 2010-11-11 20:26:52 UTC (rev 26470)
@@ -38,7 +38,7 @@
public Object execute(ExecutionEvent event) throws ExecutionException {
ISelection selection = HandlerUtil.getCurrentSelection(event);
if (selection instanceof IStructuredSelection) {
- CVImageElement cvImage = UIUtils.getFirstElement(selection, CVImageElement.class);
+ CVImageElement cvImage = UIUtils.getFirstAdaptedElement(selection, CVImageElement.class);
createInstance(cvImage, HandlerUtil.getActiveShell(event));
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/CreateInstanceHandler2.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/CreateInstanceHandler2.java 2010-11-11 20:23:42 UTC (rev 26469)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/CreateInstanceHandler2.java 2010-11-11 20:26:52 UTC (rev 26470)
@@ -35,7 +35,7 @@
public Object execute(ExecutionEvent event) throws ExecutionException {
ISelection selection = HandlerUtil.getCurrentSelection(event);
if (selection instanceof IStructuredSelection) {
- CloudViewElement element = UIUtils.getFirstElement(selection, CloudViewElement.class);
+ CloudViewElement element = UIUtils.getFirstAdaptedElement(selection, CloudViewElement.class);
while (element != null && !(element instanceof CVCloudElement)) {
element = (CloudViewElement) element.getParent();
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/DestroyInstanceHandler.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/DestroyInstanceHandler.java 2010-11-11 20:23:42 UTC (rev 26469)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/DestroyInstanceHandler.java 2010-11-11 20:26:52 UTC (rev 26470)
@@ -40,7 +40,7 @@
ISelection selection = HandlerUtil.getCurrentSelection(event);
if (selection instanceof IStructuredSelection) {
if (isSingleInstanceSelected(selection)) {
- DeltaCloudInstance cvInstance = UIUtils.getFirstElement(selection, DeltaCloudInstance.class);
+ DeltaCloudInstance cvInstance = UIUtils.getFirstAdaptedElement(selection, DeltaCloudInstance.class);
destroyInstance(cvInstance);
} else {
destroyWithDialog((IStructuredSelection) selection);
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/EditConnectionHandler.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/EditConnectionHandler.java 2010-11-11 20:23:42 UTC (rev 26469)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/EditConnectionHandler.java 2010-11-11 20:26:52 UTC (rev 26470)
@@ -35,7 +35,7 @@
public Object execute(ExecutionEvent event) throws ExecutionException {
ISelection selection = HandlerUtil.getCurrentSelection(event);
if (selection instanceof IStructuredSelection) {
- CloudViewElement element = UIUtils.getFirstElement(selection, CloudViewElement.class);
+ CloudViewElement element = UIUtils.getFirstAdaptedElement(selection, CloudViewElement.class);
while (element != null && !(element instanceof CVCloudElement)) {
element = (CloudViewElement) element.getParent();
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/FilterImagesHandler.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/FilterImagesHandler.java 2010-11-11 20:23:42 UTC (rev 26469)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/FilterImagesHandler.java 2010-11-11 20:26:52 UTC (rev 26470)
@@ -37,7 +37,7 @@
public Object execute(ExecutionEvent event) throws ExecutionException {
ISelection selection = HandlerUtil.getCurrentSelection(event);
if (selection instanceof IStructuredSelection) {
- CloudViewElement cloudViewElement = UIUtils.getFirstElement(selection, CloudViewElement.class);
+ CloudViewElement cloudViewElement = UIUtils.getFirstAdaptedElement(selection, CloudViewElement.class);
createImagesFilter(cloudViewElement, HandlerUtil.getActiveShell(event));
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/FilterInstancesHandler.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/FilterInstancesHandler.java 2010-11-11 20:23:42 UTC (rev 26469)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/FilterInstancesHandler.java 2010-11-11 20:26:52 UTC (rev 26470)
@@ -22,9 +22,7 @@
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.handlers.HandlerUtil;
-import org.jboss.tools.deltacloud.core.DeltaCloud;
-import org.jboss.tools.deltacloud.ui.views.CVCloudElement;
-import org.jboss.tools.deltacloud.ui.views.CloudViewElement;
+import org.jboss.tools.deltacloud.core.DeltaCloudInstance;
import org.jboss.tools.internal.deltacloud.ui.utils.UIUtils;
import org.jboss.tools.internal.deltacloud.ui.wizards.InstanceFilter;
@@ -37,32 +35,25 @@
public Object execute(ExecutionEvent event) throws ExecutionException {
ISelection selection = HandlerUtil.getCurrentSelection(event);
if (selection instanceof IStructuredSelection) {
- CloudViewElement cloudViewElement = UIUtils.getFirstElement(selection, CloudViewElement.class);
- createInstancesFilter(cloudViewElement, HandlerUtil.getActiveShell(event));
+ DeltaCloudInstance deltaCloudInstance = UIUtils.getFirstAdaptedElement(selection, DeltaCloudInstance.class);
+ createInstancesFilter(deltaCloudInstance, HandlerUtil.getActiveShell(event));
}
return Status.OK_STATUS;
}
- private void createInstancesFilter(CloudViewElement element, final Shell shell) {
- if (element != null) {
- while (element != null && !(element instanceof CVCloudElement)) {
- element = (CloudViewElement) element.getParent();
- }
- if (element != null) {
- CVCloudElement cve = (CVCloudElement) element;
- final DeltaCloud cloud = (DeltaCloud) cve.getElement();
- Display.getDefault().asyncExec(new Runnable() {
+ private void createInstancesFilter(final DeltaCloudInstance instance, final Shell shell) {
+ if (instance != null) {
+ Display.getDefault().asyncExec(new Runnable() {
- @Override
- public void run() {
- IWizard wizard = new InstanceFilter(cloud);
- WizardDialog dialog = new WizardDialog(shell, wizard);
- dialog.create();
- dialog.open();
- }
- });
- }
+ @Override
+ public void run() {
+ IWizard wizard = new InstanceFilter(instance.getDeltaCloud());
+ WizardDialog dialog = new WizardDialog(shell, wizard);
+ dialog.create();
+ dialog.open();
+ }
+ });
}
}
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/RebootInstanceHandler.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/RebootInstanceHandler.java 2010-11-11 20:23:42 UTC (rev 26469)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/RebootInstanceHandler.java 2010-11-11 20:26:52 UTC (rev 26470)
@@ -39,7 +39,7 @@
ISelection selection = HandlerUtil.getCurrentSelection(event);
if (selection instanceof IStructuredSelection) {
if (isSingleInstanceSelected(selection)) {
- DeltaCloudInstance cvInstance = UIUtils.getFirstElement(selection, DeltaCloudInstance.class);
+ DeltaCloudInstance cvInstance = UIUtils.getFirstAdaptedElement(selection, DeltaCloudInstance.class);
rebootInstance(cvInstance);
} else {
rebootWithDialog((IStructuredSelection)selection);
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/RefreshCloudHandler.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/RefreshCloudHandler.java 2010-11-11 20:23:42 UTC (rev 26469)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/RefreshCloudHandler.java 2010-11-11 20:26:52 UTC (rev 26470)
@@ -32,7 +32,7 @@
public Object execute(ExecutionEvent event) throws ExecutionException {
ISelection selection = HandlerUtil.getCurrentSelection(event);
if (selection instanceof IStructuredSelection) {
- CloudViewElement cvImage = UIUtils.getFirstElement(selection, CloudViewElement.class);
+ CloudViewElement cvImage = UIUtils.getFirstAdaptedElement(selection, CloudViewElement.class);
refresh(cvImage);
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/RefreshInstancesHandler.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/RefreshInstancesHandler.java 2010-11-11 20:23:42 UTC (rev 26469)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/RefreshInstancesHandler.java 2010-11-11 20:26:52 UTC (rev 26470)
@@ -31,7 +31,7 @@
public Object execute(ExecutionEvent event) throws ExecutionException {
ISelection selection = HandlerUtil.getCurrentSelection(event);
if (selection instanceof IStructuredSelection) {
- DeltaCloudInstance deltaCloudInstance = UIUtils.getFirstElement(selection, DeltaCloudInstance.class);
+ DeltaCloudInstance deltaCloudInstance = UIUtils.getFirstAdaptedElement(selection, DeltaCloudInstance.class);
refresh(deltaCloudInstance);
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/ShowInRemoteSystemExplorerHandler.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/ShowInRemoteSystemExplorerHandler.java 2010-11-11 20:23:42 UTC (rev 26469)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/ShowInRemoteSystemExplorerHandler.java 2010-11-11 20:26:52 UTC (rev 26470)
@@ -48,7 +48,7 @@
public Object execute(ExecutionEvent event) throws ExecutionException {
ISelection selection = HandlerUtil.getCurrentSelection(event);
if (selection instanceof IStructuredSelection) {
- DeltaCloudInstance instance = UIUtils.getFirstElement(selection, DeltaCloudInstance.class);
+ DeltaCloudInstance instance = UIUtils.getFirstAdaptedElement(selection, DeltaCloudInstance.class);
launchRemoteSystemExplorer(instance);
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/StartInstanceHandler.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/StartInstanceHandler.java 2010-11-11 20:23:42 UTC (rev 26469)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/StartInstanceHandler.java 2010-11-11 20:26:52 UTC (rev 26470)
@@ -39,7 +39,7 @@
ISelection selection = HandlerUtil.getCurrentSelection(event);
if (selection instanceof IStructuredSelection) {
if (isSingleInstanceSelected(selection)) {
- DeltaCloudInstance cvinstance = UIUtils.getFirstElement(selection, DeltaCloudInstance.class);
+ DeltaCloudInstance cvinstance = UIUtils.getFirstAdaptedElement(selection, DeltaCloudInstance.class);
startInstance(cvinstance);
} else {
startWithDialog((IStructuredSelection) selection);
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/StopInstanceHandler.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/StopInstanceHandler.java 2010-11-11 20:23:42 UTC (rev 26469)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/StopInstanceHandler.java 2010-11-11 20:26:52 UTC (rev 26470)
@@ -38,7 +38,7 @@
ISelection selection = HandlerUtil.getCurrentSelection(event);
if (selection instanceof IStructuredSelection) {
if (isSingleInstanceSelected(selection)) {
- DeltaCloudInstance cvInstance = UIUtils.getFirstElement(selection, DeltaCloudInstance.class);
+ DeltaCloudInstance cvInstance = UIUtils.getFirstAdaptedElement(selection, DeltaCloudInstance.class);
stopInstance(cvInstance);
} else {
stopWithDialog((IStructuredSelection) selection);
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/InstanceView.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/InstanceView.java 2010-11-11 20:23:42 UTC (rev 26469)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/InstanceView.java 2010-11-11 20:26:52 UTC (rev 26470)
@@ -11,7 +11,6 @@
package org.jboss.tools.deltacloud.ui.views;
import org.eclipse.core.runtime.preferences.InstanceScope;
-import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.layout.TableColumnLayout;
import org.eclipse.jface.viewers.ColumnWeightData;
@@ -37,6 +36,7 @@
import org.eclipse.ui.IActionBars;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.part.ViewPart;
+import org.eclipse.ui.services.IEvaluationService;
import org.jboss.tools.deltacloud.core.DeltaCloud;
import org.jboss.tools.deltacloud.core.DeltaCloudInstance;
import org.jboss.tools.deltacloud.core.DeltaCloudManager;
@@ -60,7 +60,6 @@
private final static String CLOUD_SELECTOR_LABEL = "CloudSelector.label"; //$NON-NLS-1$
- private static final String REFRESH = "Refresh.label"; //$NON-NLS-1$
private static final String FILTERED_LABEL = "Filtered.label"; //$NON-NLS-1$
private static final String FILTERED_TOOLTIP = "FilteredImages.tooltip"; //$NON-NLS-1$
@@ -74,8 +73,6 @@
private InstanceViewLabelAndContentProvider contentProvider;
- private IAction rseAction;
-
private InstanceView parentView;
public InstanceView() {
@@ -334,26 +331,19 @@
viewer.setInput(finalList);
currCloud.addInstanceListListener(parentView);
viewer.refresh();
+ refreshToolbarCommandStates();
}
});
}
- refreshToolbarCommandStates();
}
/**
- * Refresh the states of the commands in the toolsbar. This is a workaround
- * since activation and enablement is declarative and I found no way to
- * trigger their update. CommandService#refreshElements(COMMANDID) did not
- * help.
+ * Refresh the states of the commands in the toolbar.
*/
private void refreshToolbarCommandStates() {
- viewer.getControl().getDisplay().syncExec(new Runnable() {
-
- @Override
- public void run() {
- viewer.setSelection(viewer.getSelection());
- }
- });
+ IEvaluationService evaluationService = (IEvaluationService) PlatformUI.getWorkbench().getService(
+ IEvaluationService.class);
+ evaluationService.requestEvaluation("org.jboss.tools.deltacloud.ui.commands.isStopped");
}
@Override
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/OriginalInstanceView.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/OriginalInstanceView.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/OriginalInstanceView.java 2010-11-11 20:26:52 UTC (rev 26470)
@@ -0,0 +1,646 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.jboss.tools.deltacloud.ui.views;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.core.runtime.preferences.InstanceScope;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.layout.TableColumnLayout;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.ColumnWeightData;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.wizard.IWizard;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.rse.core.IRSECoreRegistry;
+import org.eclipse.rse.core.IRSESystemType;
+import org.eclipse.rse.core.RSECorePlugin;
+import org.eclipse.rse.core.model.IHost;
+import org.eclipse.rse.core.model.ISystemRegistry;
+import org.eclipse.rse.core.model.SystemStartHere;
+import org.eclipse.rse.core.subsystems.IConnectorService;
+import org.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.VerifyEvent;
+import org.eclipse.swt.events.VerifyListener;
+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.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.IWorkbenchActionConstants;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.part.ViewPart;
+import org.jboss.tools.deltacloud.core.DeltaCloud;
+import org.jboss.tools.deltacloud.core.DeltaCloudInstance;
+import org.jboss.tools.deltacloud.core.DeltaCloudManager;
+import org.jboss.tools.deltacloud.core.ICloudManagerListener;
+import org.jboss.tools.deltacloud.core.IInstanceFilter;
+import org.jboss.tools.deltacloud.core.IInstanceListListener;
+import org.jboss.tools.deltacloud.ui.Activator;
+import org.jboss.tools.deltacloud.ui.IDeltaCloudPreferenceConstants;
+import org.jboss.tools.deltacloud.ui.SWTImagesFactory;
+import org.jboss.tools.internal.deltacloud.ui.wizards.InstanceFilter;
+import org.osgi.service.prefs.Preferences;
+
+public class OriginalInstanceView extends ViewPart implements ICloudManagerListener, IInstanceListListener {
+
+ private final static String CLOUD_SELECTOR_LABEL = "CloudSelector.label"; //$NON-NLS-1$
+ private final static String START_LABEL = "Start.label"; //$NON-NLS-1$
+ private final static String STOP_LABEL = "Stop.label"; //$NON-NLS-1$
+ private final static String REBOOT_LABEL = "Reboot.label"; //$NON-NLS-1$
+ private final static String DESTROY_LABEL = "Destroy.label"; //$NON-NLS-1$
+ private final static String RSE_LABEL = "ShowInRSE.label"; //$NON-NLS-1$
+ private final static String STARTING_INSTANCE_TITLE = "StartingInstance.title"; //$NON-NLS-1$
+ private final static String STARTING_INSTANCE_MSG = "StartingInstance.msg"; //$NON-NLS-1$
+ private final static String STOPPING_INSTANCE_TITLE = "StoppingInstance.title"; //$NON-NLS-1$
+ private final static String STOPPING_INSTANCE_MSG = "StoppingInstance.msg"; //$NON-NLS-1$
+ private final static String REBOOTING_INSTANCE_TITLE = "RebootingInstance.title"; //$NON-NLS-1$
+ private final static String REBOOTING_INSTANCE_MSG = "RebootingInstance.msg"; //$NON-NLS-1$
+ private final static String DESTROYING_INSTANCE_TITLE = "DestroyingInstance.title"; //$NON-NLS-1$
+ private final static String DESTROYING_INSTANCE_MSG = "DestroyingInstance.msg"; //$NON-NLS-1$
+ private final static String RSE_CONNECTING_MSG = "ConnectingRSE.msg"; //$NON-NLS-1$
+ private static final String REFRESH = "Refresh.label"; //$NON-NLS-1$
+ private static final String FILTER = "Filter.label"; //$NON-NLS-1$
+ private static final String FILTERED_LABEL = "Filtered.label"; //$NON-NLS-1$
+ private static final String FILTERED_TOOLTIP = "FilteredImages.tooltip"; //$NON-NLS-1$
+
+
+ private TableViewer viewer;
+ private Composite container;
+ private Combo cloudSelector;
+ private Label filterLabel;
+ private DeltaCloudInstance selectedElement;
+
+ private DeltaCloud[] clouds;
+ private DeltaCloud currCloud;
+
+ private InstanceViewLabelAndContentProvider contentProvider;
+
+ private Action refreshAction;
+ private Action filterAction;
+ private Action startAction;
+ private Action stopAction;
+ private Action destroyAction;
+ private Action rebootAction;
+ private Action rseAction;
+
+ private Map<String, Action> instanceActions;
+
+ private OriginalInstanceView parentView;
+
+ public OriginalInstanceView() {
+ parentView = this;
+ }
+
+ private ModifyListener cloudModifyListener = new ModifyListener() {
+
+ @Override
+ public void modifyText(ModifyEvent e) {
+ int index = cloudSelector.getSelectionIndex();
+ if (currCloud != null)
+ currCloud.removeInstanceListListener(parentView);
+ currCloud = clouds[index];
+ Preferences prefs = new InstanceScope().getNode(Activator.PLUGIN_ID);
+ try {
+ prefs.put(IDeltaCloudPreferenceConstants.LAST_CLOUD_INSTANCE_VIEW, currCloud.getName());
+ } catch(Exception exc) {
+ // do nothing
+ }
+ viewer.setInput(new DeltaCloudInstance[0]);
+ viewer.refresh();
+ Display.getCurrent().asyncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ viewer.setInput(currCloud);
+ currCloud.addInstanceListListener(parentView);
+ viewer.refresh();
+ }
+
+ });
+ }
+
+ };
+
+ private class ColumnListener extends SelectionAdapter {
+
+ private int column;
+ private TableViewer viewer;
+
+ public ColumnListener(int column, TableViewer viewer) {
+ this.column = column;
+ this.viewer = viewer;
+ }
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ InstanceComparator comparator = (InstanceComparator)viewer.getComparator();
+ Table t = viewer.getTable();
+ if (comparator.getColumn() == column) {
+ comparator.reverseDirection();
+ }
+ comparator.setColumn(column);
+ TableColumn tc = (TableColumn)e.getSource();
+ t.setSortColumn(tc);
+ t.setSortDirection(SWT.NONE);
+ viewer.refresh();
+ }
+
+ };
+
+ @Override
+ public void dispose() {
+ for (DeltaCloud cloud : clouds) {
+ cloud.removeInstanceListListener(this);
+ }
+ DeltaCloudManager.getDefault().removeCloudManagerListener(this);
+ super.dispose();
+ }
+
+ @Override
+ public void createPartControl(Composite parent) {
+ container = new Composite(parent, SWT.NULL);
+ FormLayout layout = new FormLayout();
+ layout.marginHeight = 0;
+ layout.marginWidth = 0;
+ container.setLayout(layout);
+
+ Label cloudSelectorLabel = new Label(container, SWT.NULL);
+ cloudSelectorLabel.setText(CVMessages.getString(CLOUD_SELECTOR_LABEL));
+
+ cloudSelector = new Combo(container, SWT.BORDER | SWT.READ_ONLY);
+ initializeCloudSelector();
+ cloudSelector.addModifyListener(cloudModifyListener);
+ // Following is a kludge so that on Linux the Combo is read-only but
+ // has a white background.
+ cloudSelector.addVerifyListener(new VerifyListener() {
+ @Override
+ public void verifyText(VerifyEvent e) {
+ e.doit = false;
+ }
+ });
+
+ filterLabel = new Label(container, SWT.NULL);
+ filterLabel.setText(CVMessages.getString(FILTERED_LABEL));
+ filterLabel.setToolTipText(CVMessages.getString(FILTERED_TOOLTIP));
+
+ Composite tableArea = new Composite(container, SWT.NULL);
+ TableColumnLayout tableLayout = new TableColumnLayout();
+ tableArea.setLayout(tableLayout);
+
+ viewer = new TableViewer(tableArea, SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
+ Table table = viewer.getTable();
+ table.setHeaderVisible(true);
+ table.setLinesVisible(true);
+ contentProvider = new InstanceViewLabelAndContentProvider();
+ viewer.setContentProvider(contentProvider);
+ viewer.setLabelProvider(contentProvider);
+ InstanceComparator comparator = new InstanceComparator(0);
+ viewer.setComparator(comparator);
+
+ for (int i = 0; i < InstanceViewLabelAndContentProvider.Column.getSize(); ++i) {
+ InstanceViewLabelAndContentProvider.Column c =
+ InstanceViewLabelAndContentProvider.Column.getColumn(i);
+ TableColumn tc = new TableColumn(table, SWT.NONE);
+ if (i == 0)
+ table.setSortColumn(tc);
+ tc.setText(CVMessages.getString(c.name()));
+ tableLayout.setColumnData(tc, new ColumnWeightData(c.getWeight(), true));
+ tc.addSelectionListener(new ColumnListener(i, viewer));
+ }
+ table.setSortDirection(SWT.NONE);
+
+ if (currCloud != null) {
+ currCloud.removeInstanceListListener(parentView);
+ viewer.setInput(currCloud);
+ currCloud.addInstanceListListener(parentView);
+ IInstanceFilter filter = currCloud.getInstanceFilter();
+ filterLabel.setVisible(!filter.toString().equals(IInstanceFilter.ALL_STRING));
+ }
+
+ Point p1 = cloudSelectorLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT);
+ Point p2 = cloudSelector.computeSize(SWT.DEFAULT, SWT.DEFAULT);
+ int centering = (p2.y - p1.y + 1) / 2;
+
+ FormData f = new FormData();
+ f.top = new FormAttachment(0, 5 + centering);
+ f.left = new FormAttachment(0, 30);
+ cloudSelectorLabel.setLayoutData(f);
+
+ f = new FormData();
+ f.top = new FormAttachment(0, 5);
+ f.left = new FormAttachment(cloudSelectorLabel, 5);
+ cloudSelector.setLayoutData(f);
+
+ f = new FormData();
+ f.top = new FormAttachment(0, 5 + centering);
+ f.right = new FormAttachment(100, -10);
+ filterLabel.setLayoutData(f);
+
+ f = new FormData();
+ f.top = new FormAttachment(cloudSelector, 8);
+ f.left = new FormAttachment(0, 0);
+ f.right = new FormAttachment(100, 0);
+ f.bottom = new FormAttachment(100, 0);
+ tableArea.setLayoutData(f);
+
+ // Create the help context id for the viewer's control
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(viewer.getControl(), "org.jboss.tools.deltacloud.ui.viewer");
+ makeActions();
+ hookContextMenu();
+ hookSelection();
+ contributeToActionBars();
+
+ DeltaCloudManager.getDefault().addCloudManagerListener(this);
+ }
+
+ private void hookSelection() {
+ viewer.addSelectionChangedListener(new ISelectionChangedListener() {
+ @Override
+ public void selectionChanged(SelectionChangedEvent event) {
+ handleSelection();
+ }
+ });
+ }
+
+ private void hookContextMenu() {
+ MenuManager menuMgr = new MenuManager("#PopupMenu");
+ menuMgr.setRemoveAllWhenShown(true);
+ menuMgr.addMenuListener(new IMenuListener() {
+ public void menuAboutToShow(IMenuManager manager) {
+ OriginalInstanceView.this.fillContextMenu(manager);
+ }
+ });
+ Menu menu = menuMgr.createContextMenu(viewer.getControl());
+ viewer.getControl().setMenu(menu);
+ getSite().registerContextMenu(menuMgr, viewer);
+ }
+
+ private void contributeToActionBars() {
+ IActionBars bars = getViewSite().getActionBars();
+ fillLocalPullDown(bars.getMenuManager());
+ fillLocalToolBar(bars.getToolBarManager());
+ }
+
+ private void handleSelection() {
+ IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
+ selectedElement = (DeltaCloudInstance)selection.getFirstElement();
+ instanceActions.get(DeltaCloudInstance.START).setEnabled(false);
+ instanceActions.get(DeltaCloudInstance.STOP).setEnabled(false);
+ instanceActions.get(DeltaCloudInstance.REBOOT).setEnabled(false);
+ instanceActions.get(DeltaCloudInstance.DESTROY).setEnabled(false);
+ if (selectedElement != null) {
+ List<String> actions = selectedElement.getActions();
+ for (String action : actions) {
+ instanceActions.get(action).setEnabled(true);
+ }
+ }
+ }
+
+ private void fillLocalPullDown(IMenuManager manager) {
+ manager.add(refreshAction);
+ manager.add(filterAction);
+ }
+
+ private void fillContextMenu(IMenuManager manager) {
+ List<String> actions = selectedElement.getActions();
+ manager.add(instanceActions.get(DeltaCloudInstance.START));
+ instanceActions.get(DeltaCloudInstance.START).setEnabled(false);
+ manager.add(instanceActions.get(DeltaCloudInstance.STOP));
+ instanceActions.get(DeltaCloudInstance.STOP).setEnabled(false);
+ manager.add(instanceActions.get(DeltaCloudInstance.REBOOT));
+ instanceActions.get(DeltaCloudInstance.REBOOT).setEnabled(false);
+ manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
+ manager.add(instanceActions.get(DeltaCloudInstance.DESTROY));
+ instanceActions.get(DeltaCloudInstance.DESTROY).setEnabled(false);
+ for (String action : actions) {
+ instanceActions.get(action).setEnabled(true);
+ }
+ manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
+ manager.add(rseAction);
+ if (selectedElement.getState().equals(DeltaCloudInstance.RUNNING) ||
+ selectedElement.getState().equals(DeltaCloudInstance.STOPPED))
+ rseAction.setEnabled(true);
+ else
+ rseAction.setEnabled(false);
+ // Other plug-ins can contribute there actions here
+ manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
+ }
+
+ private void fillLocalToolBar(IToolBarManager manager) {
+ manager.add(instanceActions.get(DeltaCloudInstance.START));
+ manager.add(instanceActions.get(DeltaCloudInstance.STOP));
+ manager.add(instanceActions.get(DeltaCloudInstance.REBOOT));
+ manager.add(instanceActions.get(DeltaCloudInstance.DESTROY));
+ }
+
+ private void makeActions() {
+ refreshAction = new Action() {
+ public void run() {
+ Thread t = new Thread(new Runnable() {
+
+ @Override
+ public void run() {
+ if (currCloud != null) {
+// currCloud.getInstances();
+ }
+ }
+
+ });
+ t.start();
+ }
+ };
+ refreshAction.setText(CVMessages.getString(REFRESH));
+ refreshAction.setToolTipText(CVMessages.getString(REFRESH));
+ refreshAction.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().
+ getImageDescriptor(ISharedImages.IMG_TOOL_REDO));
+
+ filterAction = new Action() {
+ public void run() {
+ Display.getDefault().asyncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ // TODO Auto-generated method stub
+ Shell shell = viewer.getControl().getShell();
+ IWizard wizard = new InstanceFilter(currCloud);
+ WizardDialog dialog = new WizardDialog(shell, wizard);
+ dialog.create();
+ dialog.open();
+ if (!currCloud.getInstanceFilter().toString().equals(IInstanceFilter.ALL_STRING))
+ filterLabel.setVisible(true);
+ else
+ filterLabel.setVisible(false);
+ }
+
+ });
+ }
+ };
+ filterAction.setText(CVMessages.getString(FILTER));
+ filterAction.setToolTipText(CVMessages.getString(FILTER));
+
+ startAction = new Action() {
+ public void run() {
+ ISelection selection = viewer.getSelection();
+ DeltaCloudInstance instance = (DeltaCloudInstance)((IStructuredSelection)selection).getFirstElement();
+ PerformInstanceActionThread t = new PerformInstanceActionThread(currCloud, instance, DeltaCloudInstance.START,
+ CVMessages.getString(STARTING_INSTANCE_TITLE),
+ CVMessages.getFormattedString(STARTING_INSTANCE_MSG, new String[]{instance.getName()}),
+ DeltaCloudInstance.RUNNING);
+ t.setUser(true);
+ t.schedule();
+ }
+ };
+ startAction.setText(CVMessages.getString(START_LABEL));
+ startAction.setToolTipText(CVMessages.getString(START_LABEL));
+ startAction.setImageDescriptor(SWTImagesFactory.DESC_START);
+ startAction.setDisabledImageDescriptor(SWTImagesFactory.DESC_STARTD);
+ startAction.setEnabled(false);
+
+ stopAction = new Action() {
+ public void run() {
+ ISelection selection = viewer.getSelection();
+ DeltaCloudInstance instance = (DeltaCloudInstance)((IStructuredSelection)selection).getFirstElement();
+ PerformInstanceActionThread t = new PerformInstanceActionThread(currCloud, instance, DeltaCloudInstance.STOP,
+ CVMessages.getString(STOPPING_INSTANCE_TITLE),
+ CVMessages.getFormattedString(STOPPING_INSTANCE_MSG, new String[]{instance.getName()}),
+ DeltaCloudInstance.STOPPED);
+ t.setUser(true);
+ t.schedule();
+ }
+ };
+ stopAction.setText(CVMessages.getString(STOP_LABEL));
+ stopAction.setToolTipText(CVMessages.getString(STOP_LABEL));
+ stopAction.setImageDescriptor(SWTImagesFactory.DESC_STOP);
+ stopAction.setDisabledImageDescriptor(SWTImagesFactory.DESC_STOPD);
+ stopAction.setEnabled(false);
+
+ rebootAction = new Action() {
+ public void run() {
+ ISelection selection = viewer.getSelection();
+ DeltaCloudInstance instance = (DeltaCloudInstance)((IStructuredSelection)selection).getFirstElement();
+ PerformInstanceActionThread t = new PerformInstanceActionThread(currCloud, instance, DeltaCloudInstance.REBOOT,
+ CVMessages.getString(REBOOTING_INSTANCE_TITLE),
+ CVMessages.getFormattedString(REBOOTING_INSTANCE_MSG, new String[]{instance.getName()}),
+ DeltaCloudInstance.RUNNING);
+ t.setUser(true);
+ t.schedule();
+ }
+ };
+ rebootAction.setText(CVMessages.getString(REBOOT_LABEL));
+ rebootAction.setToolTipText(CVMessages.getString(REBOOT_LABEL));
+ rebootAction.setImageDescriptor(SWTImagesFactory.DESC_REBOOT);
+ rebootAction.setDisabledImageDescriptor(SWTImagesFactory.DESC_REBOOTD);
+ rebootAction.setEnabled(false);
+
+ destroyAction = new Action() {
+ public void run() {
+ ISelection selection = viewer.getSelection();
+ DeltaCloudInstance instance = (DeltaCloudInstance)((IStructuredSelection)selection).getFirstElement();
+ PerformDestroyInstanceActionThread t = new PerformDestroyInstanceActionThread(currCloud, instance,
+ CVMessages.getString(DESTROYING_INSTANCE_TITLE),
+ CVMessages.getFormattedString(DESTROYING_INSTANCE_MSG, new String[]{instance.getName()}));
+ t.setUser(true);
+ t.schedule();
+ }
+ };
+ destroyAction.setText(CVMessages.getString(DESTROY_LABEL));
+ destroyAction.setToolTipText(CVMessages.getString(DESTROY_LABEL));
+ ISharedImages sharedImages = PlatformUI.getWorkbench().getSharedImages();
+ ImageDescriptor delete = ImageDescriptor.createFromImage(sharedImages.getImage(ISharedImages.IMG_ETOOL_DELETE));
+ ImageDescriptor delete_disabled = ImageDescriptor.createFromImage(sharedImages.getImage(ISharedImages.IMG_ETOOL_DELETE_DISABLED));
+ destroyAction.setImageDescriptor(delete);
+ destroyAction.setDisabledImageDescriptor(delete_disabled);
+ destroyAction.setEnabled(false);
+
+ rseAction = new Action() {
+ public void run() {
+ ISelection selection = viewer.getSelection();
+ DeltaCloudInstance instance = (DeltaCloudInstance)((IStructuredSelection)selection).getFirstElement();
+ String hostname = instance.getHostName();
+ ISystemRegistry registry = SystemStartHere.getSystemRegistry();
+ RSECorePlugin rsep = RSECorePlugin.getDefault();
+ IRSECoreRegistry coreRegistry = rsep.getCoreRegistry();
+ IRSESystemType[] sysTypes = coreRegistry.getSystemTypes();
+ IRSESystemType sshType = null;
+ for (IRSESystemType sysType : sysTypes) {
+ if (sysType.getId().equals(IRSESystemType.SYSTEMTYPE_SSH_ONLY_ID))
+ sshType = sysType;
+ }
+ String connectionName = instance.getName() + " [" + instance.getId() + "]"; //$NON-NLS-1$ //$NON-NLS-2$
+ try {
+ IHost host = registry.createHost(sshType, connectionName, hostname, null);
+ if (host != null) {
+ host.setDefaultUserId("root"); //$NON-NLS-1$
+ IConnectorService[] services = host.getConnectorServices();
+ if (services.length > 0) {
+ final IConnectorService service = services[0];
+ Job connect = new Job(CVMessages.getFormattedString(RSE_CONNECTING_MSG, connectionName)) {
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ try {
+ service.connect(monitor);
+ Display.getDefault().asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ try {
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView("org.eclipse.rse.ui.view.systemView");
+ } catch (PartInitException e) {
+ // TODO Auto-generated catch block
+ Activator.log(e);
+ }
+ }
+ });
+ return Status.OK_STATUS;
+ } catch(Exception e) {
+ return Status.CANCEL_STATUS;
+ }
+ }
+ };
+ connect.setUser(true);
+ connect.schedule();
+ }
+ } else {
+ // Assume failure is due to name already in use
+ Display.getDefault().asyncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ try {
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView("org.eclipse.rse.ui.view.systemView");
+ } catch (PartInitException e) {
+ Activator.log(e);
+ }
+ }
+
+ });
+ }
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ Activator.log(e);
+ }
+ }
+ };
+ rseAction.setText(CVMessages.getString(RSE_LABEL));
+ rseAction.setToolTipText(CVMessages.getString(RSE_LABEL));
+
+ instanceActions = new HashMap<String, Action>();
+ instanceActions.put(DeltaCloudInstance.START, startAction);
+ instanceActions.put(DeltaCloudInstance.STOP, stopAction);
+ instanceActions.put(DeltaCloudInstance.REBOOT, rebootAction);
+ instanceActions.put(DeltaCloudInstance.DESTROY, destroyAction);
+ }
+
+ @Override
+ public void setFocus() {
+ // TODO Auto-generated method stub
+
+ }
+
+ private void initializeCloudSelector() {
+ int defaultIndex = 0;
+ clouds = DeltaCloudManager.getDefault().getClouds();
+ String[] cloudNames = new String[clouds.length];
+ // If we have saved the last cloud used from a previous session,
+ // default to using that cloud to start unless it no longer exists
+ Preferences prefs = new InstanceScope().getNode(Activator.PLUGIN_ID);
+ String lastCloudUsed = prefs.get(IDeltaCloudPreferenceConstants.LAST_CLOUD_INSTANCE_VIEW, "");
+ for (int i = 0; i < clouds.length; ++i) {
+ cloudNames[i] = clouds[i].getName();
+ if (cloudNames[i].equals(lastCloudUsed))
+ defaultIndex = i;
+ }
+ cloudSelector.setItems(cloudNames);
+ if (clouds.length > 0) {
+ cloudSelector.setText(cloudNames[defaultIndex]);
+ currCloud = clouds[defaultIndex];
+ }
+ }
+
+ public void changeEvent(int type) {
+ String currName = null;
+ int currIndex = 0;
+ if (currCloud != null) {
+ currName = currCloud.getName();
+ currIndex = cloudSelector.getSelectionIndex();
+ }
+ clouds = DeltaCloudManager.getDefault().getClouds();
+ String[] cloudNames = new String[clouds.length];
+ int index = 0;
+ for (int i = 0; i < clouds.length; ++i) {
+ cloudNames[i] = clouds[i].getName();
+ if (cloudNames[i].equals(currName))
+ index = i;
+ }
+ if (type == ICloudManagerListener.RENAME_EVENT) {
+ index = currIndex; // no change in cloud displayed
+ }
+ cloudSelector.removeModifyListener(cloudModifyListener);
+ cloudSelector.setItems(cloudNames);
+ if (cloudNames.length > 0) {
+ cloudSelector.setText(cloudNames[index]);
+ currCloud = clouds[index];
+ viewer.setInput(currCloud);
+ } else {
+ currCloud = null;
+ cloudSelector.setText("");
+ viewer.setInput(new DeltaCloudInstance[0]);
+ }
+ cloudSelector.addModifyListener(cloudModifyListener);
+ }
+
+ public void listChanged(DeltaCloud cloud, DeltaCloudInstance[] list) {
+ // Run following under Display thread since this can be
+ // triggered by a non-display thread notifying listeners.
+ final DeltaCloudInstance[] finalList = list;
+ if (cloud.getName().equals(currCloud.getName())) {
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ // TODO Auto-generated method stub
+ currCloud.removeInstanceListListener(parentView);
+ viewer.setInput(finalList);
+ currCloud.addInstanceListListener(parentView);
+ viewer.refresh();
+ }
+ });
+ }
+ }
+
+}
Property changes on: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/OriginalInstanceView.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils/UIUtils.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils/UIUtils.java 2010-11-11 20:23:42 UTC (rev 26469)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils/UIUtils.java 2010-11-11 20:26:52 UTC (rev 26470)
@@ -84,7 +84,7 @@
*
* @return the first element
*/
- public static <T> T getFirstElement(final ISelection selection, final Class<T> expectedClass) {
+ public static <T> T getFirstAdaptedElement(final ISelection selection, final Class<T> expectedClass) {
if (selection == null) {
return null;
} else {
@@ -114,7 +114,7 @@
}
return ((IStructuredSelection) selection).toList().size() == 1
- && getFirstElement(selection, expectedClass) != null;
+ && getFirstAdaptedElement(selection, expectedClass) != null;
}
/**
15 years, 5 months
JBoss Tools SVN: r26469 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-11-11 15:23:42 -0500 (Thu, 11 Nov 2010)
New Revision: 26469
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/DeltaCloudImage.java
Log:
[JBIDE-7558] added reference to cloud in DeltaCloudImage
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-11-11 19:59:24 UTC (rev 26468)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java 2010-11-11 20:23:42 UTC (rev 26469)
@@ -451,7 +451,7 @@
try {
List<Image> list = client.listImages();
for (Iterator<Image> i = list.iterator(); i.hasNext();) {
- DeltaCloudImage image = new DeltaCloudImage(i.next());
+ DeltaCloudImage image = new DeltaCloudImage(i.next(), this);
images.add(image);
}
} catch (DeltaCloudClientException e) {
@@ -478,7 +478,7 @@
DeltaCloudImage retVal = null;
try {
Image image = client.listImages(imageId);
- retVal = new DeltaCloudImage(image);
+ retVal = new DeltaCloudImage(image, this);
} catch (Exception e) {
e.printStackTrace();
// do nothing and return null
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudImage.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudImage.java 2010-11-11 19:59:24 UTC (rev 26468)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudImage.java 2010-11-11 20:23:42 UTC (rev 26469)
@@ -16,11 +16,17 @@
public class DeltaCloudImage {
private Image image;
+ private DeltaCloud deltaCloud;
- public DeltaCloudImage(Image image) {
+ public DeltaCloudImage(Image image, DeltaCloud deltaCloud) {
this.image = image;
+ this.deltaCloud = deltaCloud;
}
+ public DeltaCloud getDeltaCloud() {
+ return deltaCloud;
+ }
+
public String getName() {
return image.getName();
}
15 years, 5 months
JBoss Tools SVN: r26468 - in trunk/build/product: images and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-11-11 14:59:24 -0500 (Thu, 11 Nov 2010)
New Revision: 26468
Removed:
trunk/build/product/images/48-jbds_icon.png
trunk/build/product/images/jbds.ico
trunk/build/product/jbds4.product
trunk/build/product/pom.xml
Log:
product/ is deperecated, obsolete, and replaced by http://svn.jboss.org/repos/devstudio/trunk/product/features/com.jboss.jbds/
Deleted: trunk/build/product/images/48-jbds_icon.png
===================================================================
(Binary files differ)
Deleted: trunk/build/product/images/jbds.ico
===================================================================
(Binary files differ)
Deleted: trunk/build/product/jbds4.product
===================================================================
--- trunk/build/product/jbds4.product 2010-11-11 19:59:11 UTC (rev 26467)
+++ trunk/build/product/jbds4.product 2010-11-11 19:59:24 UTC (rev 26468)
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?pde version="3.5"?>
-
-<product name="JBoss Developer Studio" uid="com.jboss.developer.studio" id="org.eclipse.platform.ide" application="org.eclipse.ui.ide.workbench" version="4.0.0.qualifier" useFeatures="true" includeLaunchers="true">
-
- <configIni use="default">
- </configIni>
-
- <launcherArgs>
- <vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts</vmArgsMac>
- </launcherArgs>
-
- <windowImages/>
-
- <launcher name="jbds">
- <solaris/>
- <win useIco="false">
- <bmp/>
- </win>
- </launcher>
-
- <vm>
- <linux>org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6</linux>
- <macos>org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6</macos>
- <solaris>org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6</solaris>
- <windows>org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6</windows>
- </vm>
-
- <plugins>
- </plugins>
-
- <features>
- <feature id="org.jboss.tools.xulrunner.feature" version="1.9.1.2_v201003050540R"/>
- <feature id="org.eclipse.rcp" version="3.6.0.v20100201-9GAcFGCFq7Lo_y4ElaEbOXNc"/>
- <feature id="org.eclipse.pde" version="3.6.0.v20090930-7b7kFHlFEx2XkxZQja7HFJ3"/>
- <feature id="org.eclipse.jdt" version="3.6.0.v20100308-1800-7z8XFRBFMTdeDrqFpIInkeg45027"/>
- </features>
-
-
-</product>
Deleted: trunk/build/product/pom.xml
===================================================================
--- trunk/build/product/pom.xml 2010-11-11 19:59:11 UTC (rev 26467)
+++ trunk/build/product/pom.xml 2010-11-11 19:59:24 UTC (rev 26468)
@@ -1,80 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
-http://maven.apache.org/xsd/maven-4.0.0.xsd"
- xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-
- <!--
- First, build the JBT plugins:
- cd ~/trunk; mvn clean install
- or
- cd ~/trunk; ant
-
- Next, run this to create RCP product from available plugins + .product definition file
- TODO: verify this works
- cd ~/trunk/build/product; mvn clean package
- -->
- <modelVersion>4.0.0</modelVersion>
- <parent>
-
- <groupId>org.jboss.tools</groupId>
- <artifactId>org.jboss.tools.parent.pom</artifactId>
- <version>0.0.1-SNAPSHOT</version>
- </parent>
- <groupId>org.jboss.tools</groupId>
- <artifactId>org.jboss.tools.product.pom</artifactId>
- <version>0.0.1-SNAPSHOT</version>
- <name>JBoss Tools Product</name>
- <packaging>eclipse-plugin</packaging>
- <build>
- <finalName>${project.artifactId}_${project.version}</finalName>
- <plugins>
- <plugin>
- <groupId>org.sonatype.tycho</groupId>
- <artifactId>maven-osgi-packaging-plugin</artifactId>
- <version>${tychoVersion}</version>
- <executions>
- <execution>
- <phase>package</phase>
- <id>product-export</id>
- <goals>
- <goal>product-export</goal>
- </goals>
- <configuration>
- <productConfigurationFile>jbds4.product
- </productConfigurationFile>
- <environments>
- <environment>
- <os>macosx</os>
- <ws>cocoa</ws>
- <arch>x86</arch>
- </environment>
- <environment>
- <os>macosx</os>
- <ws>carbon</ws>
- <arch>x86</arch>
- </environment>
- <environment>
- <os>win32</os>
- <ws>win32</ws>
- <arch>x86</arch>
- </environment>
- <environment>
- <os>linux</os>
- <ws>gtk</ws>
- <arch>x86</arch>
- </environment>
- <environment>
- <os>linux</os>
- <ws>gtk</ws>
- <arch>x86_64</arch>
- </environment>
- </environments>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-</project>
-
15 years, 5 months