JBoss Tools SVN: r26336 - trunk/build/aggregate/site.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-11-08 13:41:53 -0500 (Mon, 08 Nov 2010)
New Revision: 26336
Modified:
trunk/build/aggregate/site/pom.xml
Log:
bump up to maven-antrun-plugin 1.6
Modified: trunk/build/aggregate/site/pom.xml
===================================================================
--- trunk/build/aggregate/site/pom.xml 2010-11-08 18:20:15 UTC (rev 26335)
+++ trunk/build/aggregate/site/pom.xml 2010-11-08 18:41:53 UTC (rev 26336)
@@ -29,7 +29,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
- <version>1.3</version>
+ <version>1.6</version>
<executions>
<execution>
<id>install</id>
15 years, 5 months
JBoss Tools SVN: r26335 - trunk/build.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-11-08 13:20:15 -0500 (Mon, 08 Nov 2010)
New Revision: 26335
Modified:
trunk/build/pom.xml
Log:
remove extraneous comments and unneeded fluff
Modified: trunk/build/pom.xml
===================================================================
--- trunk/build/pom.xml 2010-11-08 18:19:01 UTC (rev 26334)
+++ trunk/build/pom.xml 2010-11-08 18:20:15 UTC (rev 26335)
@@ -627,28 +627,5 @@
</profiles>
- <modules>
-
- <!-- this order is important! make sure you've run genpom.xml first! -->
- <!-- dgolovin's order -->
- <!--module>../tests</module> <module>../freemarker</module> <module>../jmx</module>
- <module>../archives</module> <module>../as</module> <module>../common</module>
- <module>../jst</module> <module>../xulrunner</module> <module>../vpe</module>
- <module>../jsf</module> <module>../hibernatetools</module> <module>../portlet</module>
- <module>../workingset</module> <module>../struts</module> <module>../profiler</module>
- <module>../smooks</module> <module>../cdi</module> <module>../birt</module>
- <module>../bpel</module> <module>../esb</module> <module>../seam</module>
- <module>../examples</module> <module>../maven</module> <module>../tptp</module>
- <module>../ws</module> <module>../modeshape</module> <module>../flow</module>
- <module>../jbpm</module -->
- <!-- NOTE: To build drools, must first bootstrap with ant script: cd drools;
- ant -q -->
- <!-- IF YOU REMOVE A MODULE, be sure to also remove it from site/site.xml
- and build/aggregate/site/site.xml or the build will break! -->
- <!--module>../drools</module -->
-
- <!--module>../site</module -->
-
- </modules>
</project>
15 years, 5 months
JBoss Tools SVN: r26334 - trunk.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-11-08 13:19:01 -0500 (Mon, 08 Nov 2010)
New Revision: 26334
Modified:
trunk/pom.xml
Log:
make root pom.xml a pointer to build/* poms instead of duplicating content in build/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2010-11-08 17:30:40 UTC (rev 26333)
+++ trunk/pom.xml 2010-11-08 18:19:01 UTC (rev 26334)
@@ -9,64 +9,8 @@
<modules>
<module>build/parent</module>
<module>build/libs</module>
-
- <!-- this order is important! make sure you've run genpom.xml first! -->
- <!-- dgolovin's order -->
- <module>tests</module>
- <module>freemarker</module>
- <module>jmx</module>
- <module>archives</module>
- <module>as</module>
- <module>common</module>
- <module>jst</module>
- <!-- Built as external Hudson job, http://hudson.qa.jboss.com/hudson/view/DevStudio_Tycho/job/xulrunner-1.9.2/,
- so not needed here <module>xulrunner</module> -->
- <module>vpe</module>
- <module>jsf</module>
-
- <module>hibernatetools</module>
- <module>portlet</module>
- <module>workingset</module>
-
- <module>struts</module>
-
- <module>profiler</module>
- <module>smooks</module>
- <module>cdi</module>
- <module>birt</module>
- <module>bpel</module>
- <module>esb</module>
- <module>seam</module>
- <module>examples</module>
- <module>maven</module>
- <module>tptp</module>
- <module>ws</module>
- <module>modeshape</module>
- <module>flow</module>
- <module>jbpm</module>
- <module>gwt</module>
- <module>deltacloud</module>
- <!-- NOTE: To build drools, must first bootstrap with ant script: cd drools;
- ant -q -->
- <!-- IF YOU REMOVE A MODULE, be sure to also remove it from site/site.xml
- and build/aggregate/site/site.xml or the build will break! -->
- <!-- module>drools</module -->
- <module>runtime</module>
- <module>usage</module>
- <module>site</module>
+ <module>build</module>
</modules>
- <profiles>
- <profile>
- <id>emma-coverage</id>
- <activation>
- <property>
- <name>coverage</name>
- </property>
- </activation>
- <modules>
- <module>build/reports/emma-coverage</module>
- </modules>
- </profile>
- </profiles>
+
</project>
15 years, 5 months
JBoss Tools SVN: r26333 - in trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test: uiutils/wizards and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: jlukas(a)redhat.com
Date: 2010-11-08 12:30:40 -0500 (Mon, 08 Nov 2010)
New Revision: 26333
Modified:
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/BottomUpWebService.java
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/JbossWSTest.java
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/SampleWebService.java
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/TopDownWebService.java
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/TwoBUWSInOneProject.java
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/uiutils/wizards/Wizard.java
Log:
making ws tests running faster
Modified: trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/BottomUpWebService.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/BottomUpWebService.java 2010-11-08 15:48:01 UTC (rev 26332)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/BottomUpWebService.java 2010-11-08 17:30:40 UTC (rev 26333)
@@ -8,15 +8,37 @@
public class BottomUpWebService extends JbossWSTest {
@Test
- public void bottomUpJbossWS() {
+ public void bottomUpJbossWS1() {
int testlevel=4;
- for (int i=0;i<testlevel;i++) {
- for (int j=0;j<testlevel;j++) {
- bottomUpJbossWebService(i, j);
- }
+ for (int j=0;j<testlevel;j++) {
+ bottomUpJbossWebService(0, j);
}
}
+ @Test
+ public void bottomUpJbossWS2() {
+ int testlevel=4;
+ for (int j=0;j<testlevel;j++) {
+ bottomUpJbossWebService(1, j);
+ }
+ }
+
+ @Test
+ public void bottomUpJbossWS3() {
+ int testlevel=4;
+ for (int j=0;j<testlevel;j++) {
+ bottomUpJbossWebService(2, j);
+ }
+ }
+
+ @Test
+ public void bottomUpJbossWS4() {
+ int testlevel=4;
+ for (int j=0;j<testlevel;j++) {
+ bottomUpJbossWebService(3, j);
+ }
+ }
+
protected void bottomUpJbossWebService(int serverType, int clientType) {
log.info(" * Running test ServiceType: '"+wizardConfigTexts.get(serverType)+"', ClientType: '"+wizardConfigTexts.get(clientType)+"'");
createEARProject(EAR_PROJECT_NAME);
Modified: trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/JbossWSTest.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/JbossWSTest.java 2010-11-08 15:48:01 UTC (rev 26332)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/JbossWSTest.java 2010-11-08 17:30:40 UTC (rev 26333)
@@ -10,9 +10,21 @@
******************************************************************************/
package org.jboss.tools.ws.ui.bot.test;
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.io.StringWriter;
+import java.io.Writer;
+import java.net.HttpURLConnection;
+import java.net.MalformedURLException;
+import java.net.URL;
import java.text.MessageFormat;
import java.util.HashMap;
import java.util.Map;
+import java.util.logging.Level;
+import java.util.logging.Logger;
import org.eclipse.swtbot.swt.finder.SWTBot;
import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
@@ -24,7 +36,6 @@
import org.jboss.tools.ui.bot.ext.gen.ActionItem.NewObject.WebServicesWebService;
import org.jboss.tools.ui.bot.ext.gen.ActionItem.NewObject.WebServicesWebServiceClient;
import org.jboss.tools.ui.bot.ext.gen.ActionItem.NewObject.WebServlet;
-import org.jboss.tools.ui.bot.ext.parts.SWTBotBrowserExt;
import org.jboss.tools.ui.bot.ext.parts.SWTBotHyperlinkExt;
import org.jboss.tools.ui.bot.ext.parts.SWTBotScaleExt;
import org.jboss.tools.ui.bot.ext.types.IDELabel;
@@ -76,6 +87,7 @@
"<soap:Body>{0}</soap:Body>" +
"</soap:Envelope>";;
+ private static final Logger L = Logger.getLogger(JbossWSTest.class.getName());
public JbossWSTest() {
}
@@ -102,7 +114,7 @@
// enable Finish button
open.finish(wiz);
projectExplorer.selectProject(projectName);
- // create servlet which will inovke service
+ // create servlet which will invoke service
createInvokingServlet(servletName);
}
@@ -177,42 +189,105 @@
}
protected void assertServiceDeployed(String wsdlURL) {
- SWTBotBrowserExt b = bot.browser();
- b.goURL("http://localhost:8080/jbossws/services");
- util.waitForBrowserLoadsPage(b,JBOSSWS_CRED_LOGIN,JBOSSWS_CRED_PASS);
- boolean wsdlOK = b.followLink(wsdlURL);
- assertTrue(
- "Service was not sucessfully deployed, WSDL '"+wsdlURL+"' is not listed in JbossWS endpoint registry",
- wsdlOK);
- util.waitForBrowserLoadsPage(b);
- b.back();
- util.waitForBrowserLoadsPage(b);
+ HttpURLConnection connection = null;
+ try {
+ URL u = new URL(wsdlURL);
+ connection = (HttpURLConnection) u.openConnection();
+ assertEquals("Service was not sucessfully deployed, WSDL '" + wsdlURL + "' was not found",
+ HttpURLConnection.HTTP_OK, connection.getResponseCode());
+ } catch (MalformedURLException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } finally {
+ if (connection != null) {
+ connection.disconnect();
+ }
+ }
}
protected void assertServiceNotDeployed(String wsdlURL) {
- SWTBotBrowserExt b = bot.browser();
- b.goURL("http://localhost:8080/jbossws/services");
- util.waitForBrowserLoadsPage(b,JBOSSWS_CRED_LOGIN,JBOSSWS_CRED_PASS);
- boolean wsdlOK = !b.getText().contains(wsdlURL);
- assertTrue(
- "Project was not sucessfully undeployed, WSDL '"+wsdlURL+"' is listed in JbossWS endpoint registry",
- wsdlOK);
+ HttpURLConnection connection = null;
+ try {
+ URL u = new URL(wsdlURL);
+ connection = (HttpURLConnection) u.openConnection();
+ assertEquals("Project was not sucessfully undeployed, WSDL '" + wsdlURL + "' is still available",
+ HttpURLConnection.HTTP_NOT_FOUND, connection.getResponseCode());
+ } catch (MalformedURLException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } finally {
+ if (connection != null) {
+ connection.disconnect();
+ }
+ }
}
protected void assertServiceResponseToClient(String startServlet, String response) {
- SWTBotBrowserExt b = bot.browser();
- b.goURL(startServlet);
- util.waitForBrowserLoadsPage(b);
- String servletReturned = b.getText();
- boolean servletRetOK = servletReturned.contains(response);
- assertTrue(
- "Unexpected Client servlet response, error calling web service, response is : "
- + servletReturned, servletRetOK);
-
+ InputStream is = null;
+ try {
+ URL u = new URL(startServlet);
+ is = u.openStream();
+ String rsp = readStream(is);
+ assertContains(response, rsp);
+ } catch (MalformedURLException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } finally {
+ if (is != null) {
+ try {
+ is.close();
+ } catch (IOException e) {
+ //ignore
+ e.printStackTrace();
+ }
+ }
+ }
}
public static String getSoapRequest(String body) {
return MessageFormat.format(SOAP_REQUEST_TEMPLATE, body);
}
+ protected String readStream(InputStream is) {
+ Reader r = null;
+ Writer w = null;
+ try {
+ char[] buffer = new char[1024];
+ r = new BufferedReader(new InputStreamReader(is, "UTF-8"));
+ w = new StringWriter();
+ int n;
+ while ((n = r.read(buffer)) != -1) {
+ w.write(buffer, 0, n);
+ }
+ } catch (IOException e) {
+ L.log(Level.WARNING, e.getMessage(), e);
+ } finally {
+ if (r != null) {
+ try {
+ r.close();
+ } catch (IOException e) {
+ //ignore
+ L.log(Level.WARNING, e.getMessage(), e);
+ }
+ }
+ if (w != null) {
+ try {
+ w.close();
+ } catch (IOException e) {
+ //ignore
+ L.log(Level.WARNING, e.getMessage(), e);
+ }
+ }
+ }
+ return w != null ? w.toString() : "";
+ }
}
Modified: trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/SampleWebService.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/SampleWebService.java 2010-11-08 15:48:01 UTC (rev 26332)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/SampleWebService.java 2010-11-08 17:30:40 UTC (rev 26333)
@@ -10,13 +10,7 @@
******************************************************************************/
package org.jboss.tools.ws.ui.bot.test;
-import java.io.BufferedReader;
import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.Reader;
-import java.io.StringWriter;
-import java.io.Writer;
import java.net.MalformedURLException;
import java.net.URL;
import java.text.MessageFormat;
@@ -190,38 +184,5 @@
}
return "";
}
-
- private String readStream(InputStream is) {
- Reader r = null;
- Writer w = null;
- try {
- char[] buffer = new char[1024];
- r = new BufferedReader(new InputStreamReader(is, "UTF-8"));
- w = new StringWriter();
- int n;
- while ((n = r.read(buffer)) != -1) {
- w.write(buffer, 0, n);
- }
- } catch (IOException e) {
- L.log(Level.WARNING, e.getMessage(), e);
- } finally {
- if (r != null) {
- try {
- r.close();
- } catch (IOException e) {
- //ignore
- L.log(Level.WARNING, e.getMessage(), e);
- }
- }
- if (w != null) {
- try {
- w.close();
- } catch (IOException e) {
- //ignore
- L.log(Level.WARNING, e.getMessage(), e);
- }
- }
- }
- return w != null ? w.toString() : "";
- }
+
}
Modified: trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/TopDownWebService.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/TopDownWebService.java 2010-11-08 15:48:01 UTC (rev 26332)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/TopDownWebService.java 2010-11-08 17:30:40 UTC (rev 26333)
@@ -12,14 +12,29 @@
public class TopDownWebService extends JbossWSTest {
@Test
- public void topDownJbossWS() {
+ public void topDownJbossWS1() {
int testLevel = 3;
- for (int i=0;i<testLevel;i++) {
- for (int j=0;j<testLevel;j++) {
- topDownJbossWebService(i, j);
- }
- }
+ for (int j=0;j<testLevel;j++) {
+ topDownJbossWebService(0, j);
+ }
}
+
+ @Test
+ public void topDownJbossWS2() {
+ int testLevel = 3;
+ for (int j=0;j<testLevel;j++) {
+ topDownJbossWebService(1, j);
+ }
+ }
+
+ @Test
+ public void topDownJbossWS3() {
+ int testLevel = 3;
+ for (int j=0;j<testLevel;j++) {
+ topDownJbossWebService(2, j);
+ }
+ }
+
private void topDownJbossWebService(int serverType, int clientType) {
log.info(" * Running test ServiceType: '"+wizardConfigTexts.get(serverType)+"', ClientType: '"+wizardConfigTexts.get(clientType)+"'");
createEARProject(EAR_PROJECT_NAME);
Modified: trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/TwoBUWSInOneProject.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/TwoBUWSInOneProject.java 2010-11-08 15:48:01 UTC (rev 26332)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/TwoBUWSInOneProject.java 2010-11-08 17:30:40 UTC (rev 26333)
@@ -10,10 +10,6 @@
@SWTBotTestRequires(server=@Server(),perspective="Java EE")
public class TwoBUWSInOneProject extends JbossWSTest {
- @AfterClass
- public static void after() {
- bot.sleep(Long.MAX_VALUE);
- }
@Test
public void twoServices() {
createEARProject(EAR_PROJECT_NAME);
Modified: trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/uiutils/wizards/Wizard.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/uiutils/wizards/Wizard.java 2010-11-08 15:48:01 UTC (rev 26332)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/uiutils/wizards/Wizard.java 2010-11-08 17:30:40 UTC (rev 26333)
@@ -30,6 +30,7 @@
for (int i = 0; i < item.length - 1; i++) {
ti = ti != null ? ti.expandNode(item[i]).select() : tree.expandNode(item[i]).select();
}
+ sleep(100);
if (ti != null) {
ti.select(item[item.length - 1]);
} else {
15 years, 5 months
JBoss Tools SVN: r26332 - trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/impl.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-11-08 10:48:01 -0500 (Mon, 08 Nov 2010)
New Revision: 26332
Modified:
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/impl/BusinessRulesProcessor.java
Log:
JBIDE-7193
https://jira.jboss.org/browse/JBIDE-7193
Modified: trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/impl/BusinessRulesProcessor.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/impl/BusinessRulesProcessor.java 2010-11-08 15:47:10 UTC (rev 26331)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/impl/BusinessRulesProcessor.java 2010-11-08 15:48:01 UTC (rev 26332)
@@ -25,6 +25,14 @@
int kind = getKind();
return kind < 0 || kind == DECISION_TABLE_BASED;
}
+ String ATTR_RULE_MAX_THREADS = "rule max threads";
+ if(ATTR_RULE_MAX_THREADS.equals(name)) {
+ String a = getAttributeValue("rule multithread evaluation");
+ if("true".equals(a)) return true;
+ String b = getAttributeValue(ATTR_RULE_MAX_THREADS);
+ return b != null && b.length() > 0;
+
+ }
return super.isAttributeEditable(name);
}
15 years, 5 months
JBoss Tools SVN: r26331 - trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-11-08 10:47:10 -0500 (Mon, 08 Nov 2010)
New Revision: 26331
Modified:
trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb-actions.meta
Log:
JBIDE-7193
https://jira.jboss.org/browse/JBIDE-7193
Modified: trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb-actions.meta
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb-actions.meta 2010-11-08 15:29:25 UTC (rev 26330)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb-actions.meta 2010-11-08 15:47:10 UTC (rev 26331)
@@ -489,7 +489,11 @@
<Editor name="List"/>
</XModelAttribute>
<XModelAttribute PROPERTIES="pre=true;category=advanced"
- name="rule max threads" xmlname="ruleMaxThreads"/>
+ name="rule max threads" xmlname="ruleMaxThreads">
+ <Constraint loader="Int">
+ <value name="minimum=1"/>
+ </Constraint>
+ </XModelAttribute>
<XModelAttribute PROPERTIES="category=general" name="process" xmlname="process">
<Constraint loader="ListString">
<value name="process"/>
15 years, 5 months
JBoss Tools SVN: r26330 - trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2010-11-08 10:29:25 -0500 (Mon, 08 Nov 2010)
New Revision: 26330
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JSPProblemMarkerResolutionTest.java
Log:
https://jira.jboss.org/browse/JBIDE-7491
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JSPProblemMarkerResolutionTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JSPProblemMarkerResolutionTest.java 2010-11-08 14:10:45 UTC (rev 26329)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JSPProblemMarkerResolutionTest.java 2010-11-08 15:29:25 UTC (rev 26330)
@@ -4,6 +4,7 @@
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IncrementalProjectBuilder;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.ui.IMarkerResolution;
@@ -35,15 +36,16 @@
project = setup.importProject();
}
this.project = project.getProject();
+ this.project.build(IncrementalProjectBuilder.FULL_BUILD, null);
JobUtils.waitForIdle();
}
public void testProblemMarkerResolutionInJSP() throws CoreException {
IFile jspFile = project.getFile("WebContent/pages/test_page1.jsp");
- assertMarkerIsCreated(jspFile, "org.eclipse.jst.jsp.core.validationMarker", "Unknown tag.*");
+ assertMarkerIsCreated(jspFile, "org.eclipse.jst.jsp.core.validationMarker", "Unknown tag (h:commandButton).");
- IMarker[] markers = findMarkers(jspFile, "org.eclipse.jst.jsp.core.validationMarker", "Unknown tag.*");
+ IMarker[] markers = findMarkers(jspFile, "org.eclipse.jst.jsp.core.validationMarker", "Unknown tag (h:commandButton).");
assertEquals(1, markers.length);
@@ -59,15 +61,15 @@
refreshProject(project);
- assertMarkerIsNotCreated(jspFile, "org.eclipse.jst.jsp.core.validationMarker", "Unknown tag.*");
+ assertMarkerIsNotCreated(jspFile, "org.eclipse.jst.jsp.core.validationMarker", "Unknown tag (h:commandButton).");
}
public void testProblemMarkerResolutionInXHTML() throws CoreException {
IFile jspFile = project.getFile("WebContent/pages/test_page2.xhtml");
- assertMarkerIsCreated(jspFile, "org.eclipse.wst.html.core.validationMarker", "Unknown tag.*");
+ assertMarkerIsCreated(jspFile, "org.eclipse.wst.html.core.validationMarker", "Unknown tag (ui:insert).");
- IMarker[] markers = findMarkers(jspFile, "org.eclipse.wst.html.core.validationMarker", "Unknown tag.*");
+ IMarker[] markers = findMarkers(jspFile, "org.eclipse.wst.html.core.validationMarker", "Unknown tag (ui:insert).");
assertEquals(3, markers.length);
@@ -83,12 +85,13 @@
refreshProject(project);
- assertMarkerIsNotCreated(jspFile, "org.eclipse.wst.html.core.validationMarker", "Unknown tag.*");
+ assertMarkerIsNotCreated(jspFile, "org.eclipse.wst.html.core.validationMarker", "Unknown tag (ui:insert).");
}
private void refreshProject(IProject project){
try {
project.refreshLocal(IResource.DEPTH_INFINITE, null);
+ project.build(IncrementalProjectBuilder.FULL_BUILD, null);
JobUtils.waitForIdle();
JobUtils.delay(2000);
} catch (CoreException e) {
15 years, 5 months
JBoss Tools SVN: r26329 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-11-08 09:10:45 -0500 (Mon, 08 Nov 2010)
New Revision: 26329
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/ImageView.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/InstanceView.java
Log:
[JBIDE-7516] refactoring code
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/ImageView.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/ImageView.java 2010-11-08 13:19:04 UTC (rev 26328)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/ImageView.java 2010-11-08 14:10:45 UTC (rev 26329)
@@ -102,15 +102,10 @@
int index = cloudSelector.getSelectionIndex();
if (index >= 0) {
currCloud = clouds[index];
- Preferences prefs = new InstanceScope().getNode(Activator.PLUGIN_ID);
- try {
- prefs.put(IDeltaCloudPreferenceConstants.LAST_CLOUD_IMAGE_VIEW, currCloud.getName());
- } catch (Exception exc) {
- // do nothing
- }
+ storeSelectedCloud();
- viewer.setInput(new DeltaCloudImage[0]);
- viewer.refresh();
+// viewer.setInput(new DeltaCloudImage[0]);
+// viewer.refresh();
Display.getCurrent().asyncExec(new Runnable() {
@Override
@@ -124,6 +119,15 @@
});
}
}
+
+ private void storeSelectedCloud() {
+ Preferences prefs = new InstanceScope().getNode(Activator.PLUGIN_ID);
+ try {
+ prefs.put(IDeltaCloudPreferenceConstants.LAST_CLOUD_IMAGE_VIEW, currCloud.getName());
+ } catch (Exception exc) {
+ // do nothing
+ }
+ }
};
private class ColumnListener extends SelectionAdapter {
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-08 13:19:04 UTC (rev 26328)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/InstanceView.java 2010-11-08 14:10:45 UTC (rev 26329)
@@ -12,7 +12,6 @@
import java.util.HashMap;
import java.util.List;
-import java.util.Map;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
@@ -20,6 +19,7 @@
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.IAction;
import org.eclipse.jface.action.IMenuListener;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.IToolBarManager;
@@ -81,6 +81,14 @@
public class InstanceView extends ViewPart implements ICloudManagerListener, IInstanceListListener {
+ /**
+ * The ID of the view as specified by the extension.
+ */
+ public static final String ID = "org.jboss.tools.deltacloud.ui.views.InstanceView";
+
+// private static final String CONTEXT_MENU_ID = "popup:" + ID;
+// private static final String VIEW_MENU_ID = "menu:" + ID;
+
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$
@@ -100,29 +108,28 @@
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 IAction refreshAction;
+ private IAction filterAction;
+ private IAction startAction;
+ private IAction stopAction;
+ private IAction destroyAction;
+ private IAction rebootAction;
+ private IAction rseAction;
+
+ private HashMap<String, IAction> instanceActions;
+
private InstanceView parentView;
public InstanceView() {
@@ -134,17 +141,13 @@
@Override
public void modifyText(ModifyEvent e) {
int index = cloudSelector.getSelectionIndex();
- if (currCloud != null)
+ 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();
+ storeSelectedCloud();
+// viewer.setInput(new DeltaCloudInstance[0]);
+// viewer.refresh();
Display.getCurrent().asyncExec(new Runnable() {
@Override
@@ -153,37 +156,47 @@
currCloud.addInstanceListListener(parentView);
viewer.refresh();
}
-
+
});
}
-
+
+ private void storeSelectedCloud() {
+ Preferences prefs = new InstanceScope().getNode(Activator.PLUGIN_ID);
+ try {
+ prefs.put(IDeltaCloudPreferenceConstants.LAST_CLOUD_INSTANCE_VIEW, currCloud.getName());
+ } catch (Exception exc) {
+ // do nothing
+ }
+ }
+
};
-
+
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();
+ InstanceComparator comparator = (InstanceComparator) viewer.getComparator();
Table t = viewer.getTable();
if (comparator.getColumn() == column) {
comparator.reverseDirection();
}
comparator.setColumn(column);
- TableColumn tc = (TableColumn)e.getSource();
+ TableColumn tc = (TableColumn) e.getSource();
t.setSortColumn(tc);
t.setSortDirection(SWT.NONE);
viewer.refresh();
}
-
+
};
-
+
@Override
public void dispose() {
for (DeltaCloud cloud : clouds) {
@@ -192,7 +205,7 @@
DeltaCloudManager.getDefault().removeCloudManagerListener(this);
super.dispose();
}
-
+
@Override
public void createPartControl(Composite parent) {
container = new Composite(parent, SWT.NULL);
@@ -200,52 +213,16 @@
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;
- }
- });
-
+
+ Label cloudSelectorLabel = createCloudSelector();
+
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);
-
+ createTableViewer(tableArea);
+
if (currCloud != null) {
currCloud.removeInstanceListListener(parentView);
viewer.setInput(currCloud);
@@ -262,7 +239,7 @@
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);
@@ -279,17 +256,62 @@
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 createTableViewer(Composite tableArea) {
+ TableColumnLayout tableLayout = new TableColumnLayout();
+ tableArea.setLayout(tableLayout);
+
+ viewer = new TableViewer(tableArea, SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER | SWT.MULTI);
+ 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);
+ }
+
+ private Label createCloudSelector() {
+ 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;
+ }
+ });
+ return cloudSelectorLabel;
+ }
+
private void hookSelection() {
viewer.addSelectionChangedListener(new ISelectionChangedListener() {
@Override
@@ -298,7 +320,7 @@
}
});
}
-
+
private void hookContextMenu() {
MenuManager menuMgr = new MenuManager("#PopupMenu");
menuMgr.setRemoveAllWhenShown(true);
@@ -320,7 +342,7 @@
private void handleSelection() {
IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
- selectedElement = (DeltaCloudInstance)selection.getFirstElement();
+ selectedElement = (DeltaCloudInstance) selection.getFirstElement();
instanceActions.get(DeltaCloudInstance.START).setEnabled(false);
instanceActions.get(DeltaCloudInstance.STOP).setEnabled(false);
instanceActions.get(DeltaCloudInstance.REBOOT).setEnabled(false);
@@ -332,7 +354,7 @@
}
}
}
-
+
private void fillLocalPullDown(IMenuManager manager) {
manager.add(refreshAction);
manager.add(filterAction);
@@ -362,7 +384,7 @@
// 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));
@@ -371,134 +393,32 @@
}
private void makeActions() {
- refreshAction = new Action() {
- public void run() {
- Thread t = new Thread(new Runnable() {
+ this.refreshAction = createRefreshAction();
+ this.filterAction = createFilterAction();
+ this.startAction = createStartAction();
+ this.stopAction = createStopAction();
+ this.rebootAction = createRebootAction();
+ this.destroyAction = createDestroyAction();
+ this.rseAction = createRseAction();
- @Override
- public void run() {
- if (currCloud != null) {
- currCloud.getInstances();
- }
- }
+ instanceActions = new HashMap<String, IAction>();
+ instanceActions.put(DeltaCloudInstance.START, startAction);
+ instanceActions.put(DeltaCloudInstance.STOP, stopAction);
+ instanceActions.put(DeltaCloudInstance.REBOOT, rebootAction);
+ instanceActions.put(DeltaCloudInstance.DESTROY, destroyAction);
+ }
- });
- 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() {
+ private IAction createRseAction() {
+ IAction rseAction = 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();
+ 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;
+ IRSESystemType sshType = null;
for (IRSESystemType sysType : sysTypes) {
if (sysType.getId().equals(IRSESystemType.SYSTEMTYPE_SSH_ONLY_ID))
sshType = sysType;
@@ -520,15 +440,18 @@
@Override
public void run() {
try {
- PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView("org.eclipse.rse.ui.view.systemView");
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow()
+ .getActivePage()
+ .showView("org.eclipse.rse.ui.view.systemView");
} catch (PartInitException e) {
- // TODO Auto-generated catch block
+ // TODO Auto-generated catch
+ // block
Activator.log(e);
}
}
});
return Status.OK_STATUS;
- } catch(Exception e) {
+ } catch (Exception e) {
return Status.CANCEL_STATUS;
}
}
@@ -543,12 +466,13 @@
@Override
public void run() {
try {
- PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView("org.eclipse.rse.ui.view.systemView");
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
+ .showView("org.eclipse.rse.ui.view.systemView");
} catch (PartInitException e) {
Activator.log(e);
}
}
-
+
});
}
} catch (Exception e) {
@@ -559,20 +483,153 @@
};
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);
+ return rseAction;
}
-
+
+ private IAction createDestroyAction() {
+ IAction 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);
+ return destroyAction;
+ }
+
+ private IAction createStopAction() {
+ IAction 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);
+ return stopAction;
+ }
+
+ private IAction createRebootAction() {
+ IAction 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);
+ return rebootAction;
+ }
+
+ private IAction createStartAction() {
+ IAction 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);
+ return startAction;
+ }
+
+ private IAction createFilterAction() {
+ IAction filterAction = new Action() {
+ public void run() {
+ Display.getDefault().asyncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ 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));
+ return filterAction;
+ }
+
+ private IAction createRefreshAction() {
+ IAction 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));
+ return refreshAction;
+ }
+
@Override
public void setFocus() {
- // TODO Auto-generated method stub
+ viewer.getControl().setFocus();
+ }
- }
-
private void initializeCloudSelector() {
int defaultIndex = 0;
clouds = DeltaCloudManager.getDefault().getClouds();
@@ -592,7 +649,7 @@
currCloud = clouds[defaultIndex];
}
}
-
+
public void changeEvent(int type) {
String currName = null;
int currIndex = 0;
@@ -621,7 +678,7 @@
currCloud = null;
cloudSelector.setText("");
viewer.setInput(new DeltaCloudInstance[0]);
- }
+ }
cloudSelector.addModifyListener(cloudModifyListener);
}
@@ -633,7 +690,6 @@
Display.getDefault().syncExec(new Runnable() {
@Override
public void run() {
- // TODO Auto-generated method stub
currCloud.removeInstanceListListener(parentView);
viewer.setInput(finalList);
currCloud.addInstanceListListener(parentView);
15 years, 5 months
JBoss Tools SVN: r26328 - in trunk/esb/plugins/org.jboss.tools.esb.ui: src/org/jboss/tools/esb/ui/wizard and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-11-08 08:19:04 -0500 (Mon, 08 Nov 2010)
New Revision: 26328
Added:
trunk/esb/plugins/org.jboss.tools.esb.ui/templates/esb_1_3.xml
trunk/esb/plugins/org.jboss.tools.esb.ui/templates/esb_1_3a.xml
Modified:
trunk/esb/plugins/org.jboss.tools.esb.ui/plugin.xml
trunk/esb/plugins/org.jboss.tools.esb.ui/src/org/jboss/tools/esb/ui/wizard/NewActionWizardPage.java
Log:
JBIDE-7500
https://jira.jboss.org/browse/JBIDE-7500
Modified: trunk/esb/plugins/org.jboss.tools.esb.ui/plugin.xml
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.ui/plugin.xml 2010-11-08 13:16:34 UTC (rev 26327)
+++ trunk/esb/plugins/org.jboss.tools.esb.ui/plugin.xml 2010-11-08 13:19:04 UTC (rev 26328)
@@ -188,10 +188,14 @@
</include>
<include file="templates/esb_1_2.xml" translations="templates/esb_1_1.properties">
</include>
+ <include file="templates/esb_1_3.xml" translations="templates/esb_1_1.properties">
+ </include>
<include file="templates/esb_1_1a.xml" translations="templates/esb_1_1.properties">
</include>
<include file="templates/esb_1_2a.xml" translations="templates/esb_1_1.properties">
</include>
+ <include file="templates/esb_1_3a.xml" translations="templates/esb_1_1.properties">
+ </include>
</extension>
Modified: trunk/esb/plugins/org.jboss.tools.esb.ui/src/org/jboss/tools/esb/ui/wizard/NewActionWizardPage.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.ui/src/org/jboss/tools/esb/ui/wizard/NewActionWizardPage.java 2010-11-08 13:16:34 UTC (rev 26327)
+++ trunk/esb/plugins/org.jboss.tools.esb.ui/src/org/jboss/tools/esb/ui/wizard/NewActionWizardPage.java 2010-11-08 13:19:04 UTC (rev 26328)
@@ -17,15 +17,15 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jdt.core.IBuffer;
import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.core.Signature;
import org.eclipse.jdt.internal.corext.codemanipulation.StubUtility;
import org.eclipse.jdt.internal.ui.IJavaHelpContextIds;
import org.eclipse.jdt.ui.CodeGeneration;
-import org.eclipse.jdt.ui.wizards.NewTypeWizardPage.ImportsManager;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridLayout;
@@ -98,7 +98,7 @@
List<String> labels = new ArrayList<String>();
labels.add("As AbstractActionPipelineProcessor implementation");
labels.add("As annotated POJO");
- List values = new ArrayList();
+ List<String> values = new ArrayList<String>();
values.add("false");
values.add("true");
RadioFieldEditor radio = new RadioFieldEditor(name, "", labels, values, defaultValue);
@@ -181,8 +181,38 @@
}
void modifyJavaSourceForPOJO(IType type, ImportsManager imports) {
+ StringBuffer buf = new StringBuffer();
+
+ IMethod process = null;
try {
- StringBuffer buf= new StringBuffer();
+ IMethod[] ms = type.getMethods();
+ for (int i = 0; i < ms.length; i++) {
+ if(ms[i].getElementName().equals("process")) { //$NON-NLS-1$
+ process = ms[i];
+ }
+ }
+ } catch (JavaModelException e) {
+ //
+ }
+
+ if(process != null) {
+ try {
+ ICompilationUnit w = type.getCompilationUnit();
+ IBuffer b = w.getBuffer();
+ String lineDelimiter = StubUtility.getLineDelimiterUsed(type.getJavaProject());
+ int offset = process.getSourceRange().getOffset();
+ String tab = "\t"; //$NON-NLS-1$
+ imports.addImport(PROCESS); //$NON-NLS-1$
+ buf.append(tab).append("@Process").append(lineDelimiter); //$NON-NLS-1$
+ b.replace(offset, 0, buf.toString());
+ } catch (JavaModelException e) {
+ ESBCorePlugin.log(e);
+ }
+ return;
+ }
+
+
+ try {
final String lineDelim= "\n"; // OK, since content is formatted afterwards //$NON-NLS-1$
String comment= CodeGeneration.getMethodComment(type.getCompilationUnit(), type.getTypeQualifiedName('.'), "process", new String[] {"message"}, new String[0], Signature.createTypeSignature("void", true), null, lineDelim); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
if (comment != null) {
Added: trunk/esb/plugins/org.jboss.tools.esb.ui/templates/esb_1_3.xml
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.ui/templates/esb_1_3.xml (rev 0)
+++ trunk/esb/plugins/org.jboss.tools.esb.ui/templates/esb_1_3.xml 2010-11-08 13:19:04 UTC (rev 26328)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE meta-template PUBLIC "-//Red Hat Inc.//DTD Meta Templates 1.0//EN"
+ "http://www.redhat.com/templates/dtds/meta-template_1_0.dtd">
+
+<meta-templates uri="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml... http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml...">
+
+ <meta-template axis="action@class" displayName="Action Class" xEntity="NONE">
+ <super-class name="org.jboss.soa.esb.actions.AbstractActionPipelineProcessor"/>
+ </meta-template>
+
+</meta-templates>
\ No newline at end of file
Property changes on: trunk/esb/plugins/org.jboss.tools.esb.ui/templates/esb_1_3.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/esb/plugins/org.jboss.tools.esb.ui/templates/esb_1_3a.xml
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.ui/templates/esb_1_3a.xml (rev 0)
+++ trunk/esb/plugins/org.jboss.tools.esb.ui/templates/esb_1_3a.xml 2010-11-08 13:19:04 UTC (rev 26328)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE meta-template PUBLIC "-//Red Hat Inc.//DTD Meta Templates 1.0//EN"
+ "http://www.redhat.com/templates/dtds/meta-template_1_0.dtd">
+
+<meta-templates uri="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml... http://anonsvn.jboss.org/repos/labs/labs/jbossesb/trunk/product/etc/schem...">
+
+ <meta-template axis="action@class" displayName="Action Class" xEntity="NONE">
+ <super-class name="org.jboss.soa.esb.actions.AbstractActionPipelineProcessor"/>
+ </meta-template>
+
+</meta-templates>
\ No newline at end of file
Property changes on: trunk/esb/plugins/org.jboss.tools.esb.ui/templates/esb_1_3a.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 5 months
JBoss Tools SVN: r26327 - trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-11-08 08:16:34 -0500 (Mon, 08 Nov 2010)
New Revision: 26327
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/JavaHyperlinkLineFieldEditor.java
Log:
https://jira.jboss.org/browse/JBIDE-7500
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/JavaHyperlinkLineFieldEditor.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/JavaHyperlinkLineFieldEditor.java 2010-11-08 13:09:09 UTC (rev 26326)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/JavaHyperlinkLineFieldEditor.java 2010-11-08 13:16:34 UTC (rev 26327)
@@ -182,7 +182,9 @@
wizard.performFinish();
}
}
- dialog.close();
+ if(dialog.getShell() != null && !dialog.getShell().isDisposed()) {
+ dialog.close();
+ }
} else {
try {
JavaUI.openInEditor(javaElement);
15 years, 5 months