JBoss Tools SVN: r34667 - workspace/snjeza/discovery.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2011-09-13 07:09:13 -0400 (Tue, 13 Sep 2011)
New Revision: 34667
Modified:
workspace/snjeza/discovery/org.jboss.tools.central.discovery_3.3.0.jar
Log:
Modified: workspace/snjeza/discovery/org.jboss.tools.central.discovery_3.3.0.jar
===================================================================
(Binary files differ)
14 years, 7 months
JBoss Tools SVN: r34666 - workspace/snjeza/discovery.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2011-09-13 07:06:12 -0400 (Tue, 13 Sep 2011)
New Revision: 34666
Modified:
workspace/snjeza/discovery/org.jboss.tools.central.discovery_3.3.0.jar
Log:
Modified: workspace/snjeza/discovery/org.jboss.tools.central.discovery_3.3.0.jar
===================================================================
(Binary files differ)
14 years, 7 months
JBoss Tools SVN: r34665 - branches/jbosstools-3.3.0.M3/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2011-09-13 06:27:09 -0400 (Tue, 13 Sep 2011)
New Revision: 34665
Modified:
branches/jbosstools-3.3.0.M3/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaManyToManyMapping.java
branches/jbosstools-3.3.0.M3/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaManyToOneMapping.java
branches/jbosstools-3.3.0.M3/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaOneToManyMapping.java
branches/jbosstools-3.3.0.M3/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaOneToOneMapping.java
Log:
https://issues.jboss.org/browse/JBIDE-9375
Initialize ForeignKey
Modified: branches/jbosstools-3.3.0.M3/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaManyToManyMapping.java
===================================================================
--- branches/jbosstools-3.3.0.M3/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaManyToManyMapping.java 2011-09-13 10:25:10 UTC (rev 34664)
+++ branches/jbosstools-3.3.0.M3/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaManyToManyMapping.java 2011-09-13 10:27:09 UTC (rev 34665)
@@ -36,6 +36,7 @@
public HibernateJavaManyToManyMapping(JavaPersistentAttribute parent) {
super(parent);
+ this.foreignKey = buildForeignKey();
}
@Override
Modified: branches/jbosstools-3.3.0.M3/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaManyToOneMapping.java
===================================================================
--- branches/jbosstools-3.3.0.M3/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaManyToOneMapping.java 2011-09-13 10:25:10 UTC (rev 34664)
+++ branches/jbosstools-3.3.0.M3/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaManyToOneMapping.java 2011-09-13 10:27:09 UTC (rev 34665)
@@ -34,6 +34,7 @@
public HibernateJavaManyToOneMapping(JavaPersistentAttribute parent) {
super(parent);
+ this.foreignKey = buildForeignKey();
}
@Override
Modified: branches/jbosstools-3.3.0.M3/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaOneToManyMapping.java
===================================================================
--- branches/jbosstools-3.3.0.M3/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaOneToManyMapping.java 2011-09-13 10:25:10 UTC (rev 34664)
+++ branches/jbosstools-3.3.0.M3/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaOneToManyMapping.java 2011-09-13 10:27:09 UTC (rev 34665)
@@ -37,6 +37,7 @@
*/
public HibernateJavaOneToManyMapping(JavaPersistentAttribute parent) {
super(parent);
+ this.foreignKey = buildForeignKey();
}
@Override
Modified: branches/jbosstools-3.3.0.M3/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaOneToOneMapping.java
===================================================================
--- branches/jbosstools-3.3.0.M3/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaOneToOneMapping.java 2011-09-13 10:25:10 UTC (rev 34664)
+++ branches/jbosstools-3.3.0.M3/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaOneToOneMapping.java 2011-09-13 10:27:09 UTC (rev 34665)
@@ -33,6 +33,7 @@
public HibernateJavaOneToOneMapping(JavaPersistentAttribute parent) {
super(parent);
+ this.foreignKey = buildForeignKey();
}
@Override
14 years, 7 months
JBoss Tools SVN: r34664 - trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2011-09-13 06:25:10 -0400 (Tue, 13 Sep 2011)
New Revision: 34664
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaManyToManyMapping.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaManyToOneMapping.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaOneToManyMapping.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaOneToOneMapping.java
Log:
https://issues.jboss.org/browse/JBIDE-9375
Initialize ForeignKey
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaManyToManyMapping.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaManyToManyMapping.java 2011-09-13 09:54:39 UTC (rev 34663)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaManyToManyMapping.java 2011-09-13 10:25:10 UTC (rev 34664)
@@ -36,6 +36,7 @@
public HibernateJavaManyToManyMapping(JavaPersistentAttribute parent) {
super(parent);
+ this.foreignKey = buildForeignKey();
}
@Override
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaManyToOneMapping.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaManyToOneMapping.java 2011-09-13 09:54:39 UTC (rev 34663)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaManyToOneMapping.java 2011-09-13 10:25:10 UTC (rev 34664)
@@ -34,6 +34,7 @@
public HibernateJavaManyToOneMapping(JavaPersistentAttribute parent) {
super(parent);
+ this.foreignKey = buildForeignKey();
}
@Override
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaOneToManyMapping.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaOneToManyMapping.java 2011-09-13 09:54:39 UTC (rev 34663)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaOneToManyMapping.java 2011-09-13 10:25:10 UTC (rev 34664)
@@ -37,6 +37,7 @@
*/
public HibernateJavaOneToManyMapping(JavaPersistentAttribute parent) {
super(parent);
+ this.foreignKey = buildForeignKey();
}
@Override
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaOneToOneMapping.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaOneToOneMapping.java 2011-09-13 09:54:39 UTC (rev 34663)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaOneToOneMapping.java 2011-09-13 10:25:10 UTC (rev 34664)
@@ -33,6 +33,7 @@
public HibernateJavaOneToOneMapping(JavaPersistentAttribute parent) {
super(parent);
+ this.foreignKey = buildForeignKey();
}
@Override
14 years, 7 months
JBoss Tools SVN: r34663 - in trunk/as/plugins: org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-09-13 05:54:39 -0400 (Tue, 13 Sep 2011)
New Revision: 34663
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/Status.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/Application.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IOpenshiftService.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/OpenshiftService.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/internal/test/core/ApplicationIntegrationTest.java
Log:
[JBIDE-9510] started implementing IOpenshiftService#getStatus(Application). Will not get any further since server responds with <code>null</code> data object
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/Application.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/Application.java 2011-09-13 09:01:04 UTC (rev 34662)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/Application.java 2011-09-13 09:54:39 UTC (rev 34663)
@@ -46,5 +46,8 @@
public void stop() throws OpenshiftException {
service.stopApplication(name, cartridge);
}
-
+
+ public Status getStatus() throws OpenshiftException {
+ return service.getStatus(this);
+ }
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IOpenshiftService.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IOpenshiftService.java 2011-09-13 09:01:04 UTC (rev 34662)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IOpenshiftService.java 2011-09-13 09:54:39 UTC (rev 34663)
@@ -31,6 +31,8 @@
public Application stopApplication(String name, Cartridge cartridge) throws OpenshiftException;
+ public Status getStatus(Application application) throws OpenshiftException;
+
public Domain changeDomain(String domainName, SSHKey sshKey) throws OpenshiftException;
public Domain createDomain(String name, SSHKey keyPair) throws OpenshiftException;
@@ -38,5 +40,4 @@
public SSHKey createKey(String passPhrase, String privateKeyPath, String publicKeyPath) throws OpenshiftException;
public SSHKey loadKey(String privateKeyPath, String publicKeyPath) throws OpenshiftException;
-
}
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/Status.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/Status.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/Status.java 2011-09-13 09:54:39 UTC (rev 34663)
@@ -0,0 +1,21 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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.ide.eclipse.as.openshift.core;
+
+/**
+ * @author André Dietisheim
+ */
+public class Status implements IOpenshiftObject {
+
+ public Status() {
+ }
+
+}
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/Status.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/OpenshiftService.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/OpenshiftService.java 2011-09-13 09:01:04 UTC (rev 34662)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/OpenshiftService.java 2011-09-13 09:54:39 UTC (rev 34663)
@@ -23,6 +23,7 @@
import org.jboss.ide.eclipse.as.openshift.core.OpenshiftEndpointException;
import org.jboss.ide.eclipse.as.openshift.core.OpenshiftException;
import org.jboss.ide.eclipse.as.openshift.core.SSHKey;
+import org.jboss.ide.eclipse.as.openshift.core.Status;
import org.jboss.ide.eclipse.as.openshift.core.UserInfo;
import org.jboss.ide.eclipse.as.openshift.core.internal.marshalling.ApplicationRequestJsonMarshaller;
import org.jboss.ide.eclipse.as.openshift.core.internal.marshalling.DomainRequestJsonMarshaller;
@@ -122,7 +123,7 @@
public Domain changeDomain(String newName, SSHKey sshKey) throws OpenshiftException {
return requestDomainAction(new ChangeDomainRequest(newName, sshKey, username, true));
}
-
+
protected Domain requestDomainAction(AbstractDomainRequest request) throws OpenshiftException {
String url = request.getUrlString(BASE_URL);
try {
@@ -145,36 +146,52 @@
@Override
public Application createApplication(String name, Cartridge cartridge) throws OpenshiftException {
- return requestApplicationAction(name, cartridge,
- new ApplicationRequest(name, cartridge, ApplicationAction.CONFIGURE, username, true));
+ return requestApplicationAction(new ApplicationRequest(name, cartridge, ApplicationAction.CONFIGURE, username,
+ true));
}
@Override
public Application destroyApplication(String name, Cartridge cartridge) throws OpenshiftException {
- return requestApplicationAction(name, cartridge,
- new ApplicationRequest(name, cartridge, ApplicationAction.DECONFIGURE, username, true));
+ return requestApplicationAction(new ApplicationRequest(name, cartridge, ApplicationAction.DECONFIGURE,
+ username, true));
}
@Override
public Application startApplication(String name, Cartridge cartridge) throws OpenshiftException {
- return requestApplicationAction(name, cartridge,
- new ApplicationRequest(name, cartridge, ApplicationAction.START, username, true));
+ return requestApplicationAction(new ApplicationRequest(name, cartridge, ApplicationAction.START, username, true));
}
@Override
public Application restartApplication(String name, Cartridge cartridge) throws OpenshiftException {
- return requestApplicationAction(name, cartridge,
- new ApplicationRequest(name, cartridge, ApplicationAction.RESTART, username, true));
+ return requestApplicationAction(new ApplicationRequest(name, cartridge, ApplicationAction.RESTART, username,
+ true));
}
-
+
@Override
public Application stopApplication(String name, Cartridge cartridge) throws OpenshiftException {
- return requestApplicationAction(name, cartridge,
- new ApplicationRequest(name, cartridge, ApplicationAction.STOP, username, true));
+ return requestApplicationAction(new ApplicationRequest(name, cartridge, ApplicationAction.STOP, username, true));
}
- protected Application requestApplicationAction(String name, Cartridge cartridge,
- ApplicationRequest applicationRequest) throws OpenshiftException {
+ /**
+ * This seems not implemented yet on the server. The service simply returns
+ * a <code>null</code> data object. example response:
+ * <p>
+ * {"messages":"","debug":"","data":null,"api":"1.1.1","api_c":[
+ * "placeholder"
+ * ],"result":"Success","broker":"1.1.1","broker_c":["namespace"
+ * ,"rhlogin","ssh"
+ * ,"app_uuid","debug","alter","cartridge","cart_type","action"
+ * ,"app_name","api"],"exit_code":0}
+ */
+ @Override
+ public Status getStatus(Application application) throws OpenshiftException {
+ throw new UnsupportedOperationException();
+ // requestApplicationAction(
+ // new ApplicationRequest(application.getName(),
+ // application.getCartridge(), ApplicationAction.STOP, username, true));
+ }
+
+ protected Application requestApplicationAction(ApplicationRequest applicationRequest) throws OpenshiftException {
String url = applicationRequest.getUrlString(BASE_URL);
try {
String applicationRequestString =
@@ -184,21 +201,23 @@
response = JsonSanitizer.sanitize(response);
OpenshiftResponse<Application> openshiftResponse =
- new ApplicationResponseUnmarshaller(name, cartridge, this).unmarshall(response);
+ new ApplicationResponseUnmarshaller(applicationRequest.getName(),
+ applicationRequest.getCartridge(), this).unmarshall(response);
return openshiftResponse.getData();
} catch (MalformedURLException e) {
throw new OpenshiftException(
e, "Could not {0} application \"{1}\" at \"{2}\": Invalid url \"{2}\"",
- applicationRequest.getAction().toHumanReadable(), name, url);
+ applicationRequest.getAction().toHumanReadable(), applicationRequest.getName(), url);
} catch (UnauthorizedException e) {
throw new InvalidCredentialsOpenshiftException(
url, e,
"Could not {0} application \"{1}\" at \"{2}\": Invalid credentials user \"{3}\", password \"{4}\"",
- applicationRequest.getAction().toHumanReadable(), name, url, username, password);
+ applicationRequest.getAction().toHumanReadable(), applicationRequest.getName(), url, username,
+ password);
} catch (HttpClientException e) {
throw new OpenshiftEndpointException(
url, e, "Could not {0} application \"{1}\" at \"{2}\"",
- applicationRequest.getAction().toHumanReadable(), name, url);
+ applicationRequest.getAction().toHumanReadable(), applicationRequest.getName(), url);
}
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/internal/test/core/ApplicationIntegrationTest.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/internal/test/core/ApplicationIntegrationTest.java 2011-09-13 09:01:04 UTC (rev 34662)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/internal/test/core/ApplicationIntegrationTest.java 2011-09-13 09:54:39 UTC (rev 34663)
@@ -18,8 +18,10 @@
import org.jboss.ide.eclipse.as.openshift.core.IOpenshiftService;
import org.jboss.ide.eclipse.as.openshift.core.InvalidCredentialsOpenshiftException;
import org.jboss.ide.eclipse.as.openshift.core.OpenshiftException;
+import org.jboss.ide.eclipse.as.openshift.core.Status;
import org.jboss.ide.eclipse.as.openshift.internal.core.OpenshiftService;
import org.junit.Before;
+import org.junit.Ignore;
import org.junit.Test;
/**
@@ -27,8 +29,8 @@
*/
public class ApplicationIntegrationTest {
- private OpenshiftService openshiftService;
- private OpenshiftService invalidCredentialsOpenshiftService;
+ private IOpenshiftService openshiftService;
+ private IOpenshiftService invalidCredentialsOpenshiftService;
private static final String USERNAME = "toolsjboss(a)gmail.com";
private static final String PASSWORD = "1q2w3e";
@@ -39,11 +41,13 @@
this.invalidCredentialsOpenshiftService = new OpenshiftService(USERNAME, "bogus");
}
+ @Ignore
@Test(expected = InvalidCredentialsOpenshiftException.class)
public void createApplicationWithInvalidCredentialsThrowsException() throws Exception {
invalidCredentialsOpenshiftService.createApplication(createRandomApplicationName(), Cartridge.JBOSSAS_7);
}
+ @Ignore
@Test
public void canCreateApplication() throws Exception {
String applicationName = createRandomApplicationName();
@@ -58,6 +62,7 @@
}
}
+ @Ignore
@Test
public void canDestroyApplication() throws Exception {
String applicationName = createRandomApplicationName();
@@ -65,6 +70,7 @@
openshiftService.destroyApplication(applicationName, Cartridge.JBOSSAS_7);
}
+ @Ignore
@Test(expected = OpenshiftException.class)
public void createDuplicateApplicationThrowsException() throws Exception {
String applicationName = createRandomApplicationName();
@@ -76,6 +82,7 @@
}
}
+ @Ignore
@Test
public void canStopApplication() throws Exception {
String applicationName = createRandomApplicationName();
@@ -87,6 +94,7 @@
}
}
+ @Ignore
@Test
public void canStartStoppedApplication() throws Exception {
String applicationName = createRandomApplicationName();
@@ -99,6 +107,7 @@
}
}
+ @Ignore
@Test
public void canStartStartedApplication() throws Exception {
String applicationName = createRandomApplicationName();
@@ -116,6 +125,7 @@
}
}
+ @Ignore
@Test
public void canStopStoppedApplication() throws Exception {
String applicationName = createRandomApplicationName();
@@ -134,6 +144,7 @@
}
}
+ @Ignore
@Test
public void canRestartApplication() throws Exception {
String applicationName = createRandomApplicationName();
@@ -151,6 +162,18 @@
}
}
+ @Test
+ public void canGetStatus() throws Exception {
+ String applicationName = createRandomApplicationName();
+ try {
+ Application application = openshiftService.createApplication(applicationName, Cartridge.JBOSSAS_7);
+ Status status = openshiftService.getStatus(application);
+ assertNotNull(status);
+ } finally {
+ silentlyDestroyApplication(applicationName, openshiftService);
+ }
+ }
+
private String createRandomApplicationName() {
return String.valueOf(System.currentTimeMillis());
}
14 years, 7 months
JBoss Tools SVN: r34662 - in trunk/as/plugins: org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-09-13 05:01:04 -0400 (Tue, 13 Sep 2011)
New Revision: 34662
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/Application.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IOpenshiftService.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/OpenshiftService.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/internal/test/core/ApplicationIntegrationTest.java
Log:
[JBIDE-9510] implement restart application
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/Application.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/Application.java 2011-09-13 00:45:04 UTC (rev 34661)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/Application.java 2011-09-13 09:01:04 UTC (rev 34662)
@@ -39,6 +39,10 @@
service.startApplication(name, cartridge);
}
+ public void restart() throws OpenshiftException {
+ service.restartApplication(name, cartridge);
+ }
+
public void stop() throws OpenshiftException {
service.stopApplication(name, cartridge);
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IOpenshiftService.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IOpenshiftService.java 2011-09-13 00:45:04 UTC (rev 34661)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IOpenshiftService.java 2011-09-13 09:01:04 UTC (rev 34662)
@@ -27,6 +27,8 @@
public Application startApplication(String name, Cartridge cartridge) throws OpenshiftException;
+ public Application restartApplication(String name, Cartridge cartridge) throws OpenshiftException;
+
public Application stopApplication(String name, Cartridge cartridge) throws OpenshiftException;
public Domain changeDomain(String domainName, SSHKey sshKey) throws OpenshiftException;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/OpenshiftService.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/OpenshiftService.java 2011-09-13 00:45:04 UTC (rev 34661)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/internal/core/OpenshiftService.java 2011-09-13 09:01:04 UTC (rev 34662)
@@ -162,6 +162,12 @@
}
@Override
+ public Application restartApplication(String name, Cartridge cartridge) throws OpenshiftException {
+ return requestApplicationAction(name, cartridge,
+ new ApplicationRequest(name, cartridge, ApplicationAction.RESTART, username, true));
+ }
+
+ @Override
public Application stopApplication(String name, Cartridge cartridge) throws OpenshiftException {
return requestApplicationAction(name, cartridge,
new ApplicationRequest(name, cartridge, ApplicationAction.STOP, username, true));
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/internal/test/core/ApplicationIntegrationTest.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/internal/test/core/ApplicationIntegrationTest.java 2011-09-13 00:45:04 UTC (rev 34661)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/internal/test/core/ApplicationIntegrationTest.java 2011-09-13 09:01:04 UTC (rev 34662)
@@ -99,6 +99,58 @@
}
}
+ @Test
+ public void canStartStartedApplication() throws Exception {
+ String applicationName = createRandomApplicationName();
+ try {
+ /**
+ * freshly created apps are started
+ *
+ * @link
+ * https://github.com/openshift/os-client-tools/blob/master/express/doc/API
+ */
+ openshiftService.createApplication(applicationName, Cartridge.JBOSSAS_7);
+ openshiftService.startApplication(applicationName, Cartridge.JBOSSAS_7);
+ } finally {
+ silentlyDestroyApplication(applicationName, openshiftService);
+ }
+ }
+
+ @Test
+ public void canStopStoppedApplication() throws Exception {
+ String applicationName = createRandomApplicationName();
+ try {
+ /**
+ * freshly created apps are started
+ *
+ * @link
+ * https://github.com/openshift/os-client-tools/blob/master/express/doc/API
+ */
+ openshiftService.createApplication(applicationName, Cartridge.JBOSSAS_7);
+ openshiftService.stopApplication(applicationName, Cartridge.JBOSSAS_7);
+ openshiftService.stopApplication(applicationName, Cartridge.JBOSSAS_7);
+ } finally {
+ silentlyDestroyApplication(applicationName, openshiftService);
+ }
+ }
+
+ @Test
+ public void canRestartApplication() throws Exception {
+ String applicationName = createRandomApplicationName();
+ try {
+ /**
+ * freshly created apps are started
+ *
+ * @link
+ * https://github.com/openshift/os-client-tools/blob/master/express/doc/API
+ */
+ openshiftService.createApplication(applicationName, Cartridge.JBOSSAS_7);
+ openshiftService.restartApplication(applicationName, Cartridge.JBOSSAS_7);
+ } finally {
+ silentlyDestroyApplication(applicationName, openshiftService);
+ }
+ }
+
private String createRandomApplicationName() {
return String.valueOf(System.currentTimeMillis());
}
14 years, 7 months
JBoss Tools SVN: r34661 - in trunk/cdi/plugins: org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2011-09-12 20:45:04 -0400 (Mon, 12 Sep 2011)
New Revision: 34661
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/IFilterable.java
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/InformationControlManager.java
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/xpl/AbstractInformationControl.java
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/xpl/HierarchyInformationControl.java
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/xpl/InformationPresenter.java
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/CDISeamExtMessages.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink/GenericInjectedPointHyperlink.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink/GenericInjectedPointListHyperlink.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink/SeamConfigInjectedPointHyperlink.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/messages.properties
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/AlternativeInjectedPointListHyperlink.java
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/InjectedPointHyperlink.java
Log:
Dialog "Show All Generic Beans" should look like "Open Implementation" in JDT https://issues.jboss.org/browse/JBIDE-9673
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/CDISeamExtMessages.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/CDISeamExtMessages.java 2011-09-13 00:16:42 UTC (rev 34660)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/CDISeamExtMessages.java 2011-09-13 00:45:04 UTC (rev 34661)
@@ -23,6 +23,7 @@
public static String CDI_SEAM_CONFIG_OPEN_TAG;
public static String CDI_INJECTED_POINT_HYPERLINK_SHOW_GENERIC_BEANS;
+ public static String CDI_SHOW_ALL_GENERIC_CONFIGURATION_POINTS_TITLE;
public static String CDI_INJECTED_POINT_HYPERLINK_SHOW_SEAM_CONFIG_BEANS;
public static String OPEN_GENERIC_BEAN;
public static String OPEN_GENERIC_PRODUCER_BEAN;
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink/GenericInjectedPointHyperlink.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink/GenericInjectedPointHyperlink.java 2011-09-13 00:16:42 UTC (rev 34660)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink/GenericInjectedPointHyperlink.java 2011-09-13 00:45:04 UTC (rev 34661)
@@ -17,9 +17,10 @@
import org.jboss.tools.cdi.core.IProducerField;
import org.jboss.tools.cdi.core.IProducerMethod;
import org.jboss.tools.cdi.seam.text.ext.CDISeamExtMessages;
+import org.jboss.tools.cdi.text.ext.hyperlink.IFilterable;
import org.jboss.tools.cdi.text.ext.hyperlink.InjectedPointHyperlink;
-public class GenericInjectedPointHyperlink extends InjectedPointHyperlink {
+public class GenericInjectedPointHyperlink extends InjectedPointHyperlink implements IFilterable{
public GenericInjectedPointHyperlink(IRegion region, IBean bean, IDocument document) {
super(region, bean, document);
@@ -29,18 +30,16 @@
public String getHyperlinkText() {
String text="";
if (bean != null) {
- String name = bean.getBeanClass().getElementName();
- if (bean instanceof IProducerField) {
- name += "."+((IProducerField)bean).getField().getElementName();
- text = NLS.bind(CDISeamExtMessages.OPEN_GENERIC_PRODUCER_BEAN, name);
- } else if (bean instanceof IProducerMethod) {
- name += "."+((IProducerMethod)bean).getMethod().getElementName()+"()";
- text = NLS.bind(CDISeamExtMessages.OPEN_GENERIC_PRODUCER_BEAN, name);
- } else {
- text = NLS.bind(CDISeamExtMessages.OPEN_GENERIC_BEAN, name);
- }
+ String str = bean.getSimpleJavaName();
+ String beanTypeName = bean.getBeanClass().getFullyQualifiedName();
+ String beanPackage = beanTypeName.substring(0,beanTypeName.lastIndexOf("."));
+ return str+" - "+beanPackage;
}
return text;
}
+ public String getFullyQualifiedName() {
+ return bean.getBeanClass().getFullyQualifiedName();
+ }
+
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink/GenericInjectedPointListHyperlink.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink/GenericInjectedPointListHyperlink.java 2011-09-13 00:16:42 UTC (rev 34660)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink/GenericInjectedPointListHyperlink.java 2011-09-13 00:45:04 UTC (rev 34661)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.cdi.seam.text.ext.hyperlink;
+import java.util.ArrayList;
import java.util.List;
import org.eclipse.jface.text.IDocument;
@@ -19,6 +20,8 @@
import org.jboss.tools.cdi.core.IBean;
import org.jboss.tools.cdi.seam.text.ext.CDISeamExtMessages;
import org.jboss.tools.cdi.text.ext.hyperlink.AlternativeInjectedPointListHyperlink;
+import org.jboss.tools.cdi.text.ext.hyperlink.InformationControlManager;
+import org.jboss.tools.cdi.text.ext.hyperlink.InjectedPointHyperlink;
public class GenericInjectedPointListHyperlink extends
AlternativeInjectedPointListHyperlink {
@@ -37,5 +40,29 @@
protected IHyperlink createHyperlink(IRegion region, IBean bean) {
return new GenericInjectedPointHyperlink(region, bean, getDocument());
}
+
+ protected void doHyperlink(IRegion region) {
+ List<IHyperlink> hyperlinks = new ArrayList<IHyperlink>();
+
+ int index=0;
+ for(IBean bean : beans){
+ hyperlinks.add(createHyperlink(region, bean));
+ }
+
+ if(hyperlinks.size() == 0){
+ openFileFailed();
+ return;
+ }
+
+ if(hyperlinks.size() == 1){
+ hyperlinks.get(0).open();
+ }else{
+ showHyperlinks(hyperlinks);
+ }
+ }
+
+ private void showHyperlinks(List<IHyperlink> hyperlinks){
+ InformationControlManager.showHyperlinks(CDISeamExtMessages.CDI_SHOW_ALL_GENERIC_CONFIGURATION_POINTS_TITLE, viewer, hyperlinks);
+ }
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink/SeamConfigInjectedPointHyperlink.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink/SeamConfigInjectedPointHyperlink.java 2011-09-13 00:16:42 UTC (rev 34660)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink/SeamConfigInjectedPointHyperlink.java 2011-09-13 00:45:04 UTC (rev 34661)
@@ -24,7 +24,7 @@
super(region, bean, document);
}
- protected void doHyperlink(IRegion region) {
+ public void doHyperlink(IRegion region) {
bean.open();
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/messages.properties
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/messages.properties 2011-09-13 00:16:42 UTC (rev 34660)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/messages.properties 2011-09-13 00:45:04 UTC (rev 34661)
@@ -2,6 +2,7 @@
CDI_SEAM_RESOURCE_LOADING_HYPERLINK=Open Resource ''{0}''
CDI_SEAM_CONFIG_OPEN_TAG=Open Java Source Corresponding to ''{0}'' tag
CDI_INJECTED_POINT_HYPERLINK_SHOW_GENERIC_BEANS=Show All Generic Configuration Points...
+CDI_SHOW_ALL_GENERIC_CONFIGURATION_POINTS_TITLE=Show All Generic Configuration Points
CDI_INJECTED_POINT_HYPERLINK_SHOW_SEAM_CONFIG_BEANS=Show All Seam Config Bean Definitions...
OPEN_GENERIC_BEAN=Open Generic Configuration Point {0}
OPEN_GENERIC_PRODUCER_BEAN=Open Generic Configuration Point {0}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/AlternativeInjectedPointListHyperlink.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/AlternativeInjectedPointListHyperlink.java 2011-09-13 00:16:42 UTC (rev 34660)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/AlternativeInjectedPointListHyperlink.java 2011-09-13 00:45:04 UTC (rev 34661)
@@ -21,8 +21,8 @@
public class AlternativeInjectedPointListHyperlink extends AbstractHyperlink{
private IRegion region;
- private List<IBean> beans;
- private ITextViewer viewer;
+ protected List<IBean> beans;
+ protected ITextViewer viewer;
public AlternativeInjectedPointListHyperlink(IRegion region, List<IBean> beans, ITextViewer viewer, IDocument document){
this.beans = beans;
Added: trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/IFilterable.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/IFilterable.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/IFilterable.java 2011-09-13 00:45:04 UTC (rev 34661)
@@ -0,0 +1,15 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.cdi.text.ext.hyperlink;
+
+public interface IFilterable {
+ public String getFullyQualifiedName();
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/IFilterable.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/InformationControlManager.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/InformationControlManager.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/InformationControlManager.java 2011-09-13 00:45:04 UTC (rev 34661)
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.cdi.text.ext.hyperlink;
+
+import java.util.List;
+
+import org.eclipse.jface.text.AbstractInformationControlManager;
+import org.eclipse.jface.text.IInformationControl;
+import org.eclipse.jface.text.IInformationControlCreator;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.hyperlink.IHyperlink;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Shell;
+import org.jboss.tools.cdi.text.ext.hyperlink.xpl.HierarchyInformationControl;
+import org.jboss.tools.cdi.text.ext.hyperlink.xpl.InformationPresenter;
+
+public class InformationControlManager {
+ public static void showHyperlinks(String title, ITextViewer viwer, List<IHyperlink> hyperlinks){
+ InformationPresenter presenter= new InformationPresenter(viwer, getHierarchyPresenterControlCreator(title, hyperlinks));
+ presenter.setAnchor(AbstractInformationControlManager.ANCHOR_GLOBAL);
+ presenter.setSizeConstraints(60, 10, true, false);
+ presenter.install(viwer.getTextWidget());
+ presenter.showInformation();
+ }
+
+ private static IInformationControlCreator getHierarchyPresenterControlCreator(final String title, final List<IHyperlink> hyperlinks) {
+ return new IInformationControlCreator() {
+ public IInformationControl createInformationControl(Shell parent) {
+ int shellStyle= SWT.RESIZE;
+ int treeStyle= SWT.V_SCROLL | SWT.H_SCROLL;
+ HierarchyInformationControl iControl = new HierarchyInformationControl(parent, title, shellStyle, treeStyle, hyperlinks);
+ iControl.setInput(hyperlinks);
+ return iControl;
+ }
+ };
+ }
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/InformationControlManager.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/InjectedPointHyperlink.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/InjectedPointHyperlink.java 2011-09-13 00:16:42 UTC (rev 34660)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/InjectedPointHyperlink.java 2011-09-13 00:45:04 UTC (rev 34661)
@@ -25,7 +25,6 @@
import org.jboss.tools.cdi.core.IInterceptor;
import org.jboss.tools.cdi.core.IProducerField;
import org.jboss.tools.cdi.core.IProducerMethod;
-import org.jboss.tools.cdi.internal.core.impl.CDIElement;
import org.jboss.tools.cdi.text.ext.CDIExtensionsMessages;
import org.jboss.tools.cdi.text.ext.CDIExtensionsPlugin;
import org.jboss.tools.common.text.ext.hyperlink.AbstractHyperlink;
@@ -52,7 +51,7 @@
return region;
}
- protected void doHyperlink(IRegion region) {
+ public void doHyperlink(IRegion region) {
IEditorPart part = null;
if(bean != null && bean.getBeanClass() != null){
Added: trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/xpl/AbstractInformationControl.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/xpl/AbstractInformationControl.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/xpl/AbstractInformationControl.java 2011-09-13 00:45:04 UTC (rev 34661)
@@ -0,0 +1,732 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * 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:
+ * IBM Corporation - initial API and implementation
+ * Red Hat, Inc.
+ *******************************************************************************/
+package org.jboss.tools.cdi.text.ext.hyperlink.xpl;
+
+import java.util.List;
+
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.internal.ui.JavaPlugin;
+import org.eclipse.jdt.internal.ui.util.StringMatcher;
+import org.eclipse.jdt.ui.actions.CustomFiltersActionGroup;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.jface.dialogs.PopupDialog;
+import org.eclipse.jface.text.IInformationControl;
+import org.eclipse.jface.text.IInformationControlExtension;
+import org.eclipse.jface.text.IInformationControlExtension2;
+import org.eclipse.jface.text.hyperlink.IHyperlink;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.events.FocusListener;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.KeyListener;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.MouseAdapter;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseMoveListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Item;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.IWorkbenchCommandConstants;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.commands.ActionHandler;
+import org.eclipse.ui.commands.HandlerSubmission;
+import org.eclipse.ui.commands.ICommand;
+import org.eclipse.ui.commands.ICommandManager;
+import org.eclipse.ui.commands.IKeySequenceBinding;
+import org.eclipse.ui.commands.Priority;
+import org.eclipse.ui.keys.KeySequence;
+
+/**
+ * Abstract class for Show hierarchy in light-weight controls.
+ *
+ * @since 2.1
+ */
+public abstract class AbstractInformationControl extends PopupDialog implements IInformationControl, IInformationControlExtension, IInformationControlExtension2, DisposeListener {
+
+ /** The control's text widget */
+ private Text fFilterText;
+ /** The control's table widget */
+ private TableViewer fTableViewer;
+ /** The current string matcher */
+ protected StringMatcher fStringMatcher;
+ private ICommand fInvokingCommand;
+ private KeySequence[] fInvokingCommandKeySequences;
+
+ /**
+ * Fields that support the dialog menu
+ * @since 3.0
+ * @since 3.2 - now appended to framework menu
+ */
+ private Composite fViewMenuButtonComposite;
+
+ private CustomFiltersActionGroup fCustomFiltersActionGroup;
+
+ private IAction fShowViewMenuAction;
+ private HandlerSubmission fShowViewMenuHandlerSubmission;
+
+ /**
+ * Field for table style since it must be remembered by the instance.
+ *
+ * @since 3.2
+ */
+ private int fTableStyle;
+
+ /**
+ * The initially selected type.
+ * @since 3.5
+ */
+ protected IType fInitiallySelectedType;
+
+ /**
+ * Creates a table information control with the given shell as parent. The given
+ * styles are applied to the shell and the table widget.
+ *
+ * @param parent the parent shell
+ * @param shellStyle the additional styles for the shell
+ * @param tableStyle the additional styles for the table widget
+ * @param invokingCommandId the id of the command that invoked this control or <code>null</code>
+ * @param showStatusField <code>true</code> iff the control has a status field at the bottom
+ */
+ public AbstractInformationControl(Shell parent, int shellStyle, int tableStyle, String invokingCommandId, boolean showStatusField) {
+ super(parent, shellStyle, true, true, false, true, true, null, null);
+ if (invokingCommandId != null) {
+ ICommandManager commandManager= PlatformUI.getWorkbench().getCommandSupport().getCommandManager();
+ fInvokingCommand= commandManager.getCommand(invokingCommandId);
+ if (fInvokingCommand != null && !fInvokingCommand.isDefined())
+ fInvokingCommand= null;
+ else
+ // Pre-fetch key sequence - do not change because scope will change later.
+ getInvokingCommandKeySequences();
+ }
+ fTableStyle= tableStyle;
+ // Title and status text must be set to get the title label created, so force empty values here.
+ if (hasHeader())
+ setTitleText(""); //$NON-NLS-1$
+ setInfoText(""); // //$NON-NLS-1$
+
+ // Create all controls early to preserve the life cycle of the original implementation.
+ create();
+
+ // Status field text can only be computed after widgets are created.
+ setInfoText(getStatusFieldText());
+ }
+
+ /**
+ * Create the main content for this information control.
+ *
+ * @param parent The parent composite
+ * @return The control representing the main content.
+ * @since 3.2
+ */
+ @Override
+ protected Control createDialogArea(Composite parent) {
+ fTableViewer= createTableViewer(parent, fTableStyle);
+
+ fCustomFiltersActionGroup= new CustomFiltersActionGroup(getId(), fTableViewer);
+
+ final Table table= fTableViewer.getTable();
+ table.addKeyListener(new KeyListener() {
+ public void keyPressed(KeyEvent e) {
+ if (e.character == 0x1B) // ESC
+ dispose();
+ }
+ public void keyReleased(KeyEvent e) {
+ // do nothing
+ }
+ });
+
+ table.addSelectionListener(new SelectionListener() {
+ public void widgetSelected(SelectionEvent e) {
+ // do nothing
+ }
+ public void widgetDefaultSelected(SelectionEvent e) {
+ gotoSelectedElement();
+ }
+ });
+
+ table.addMouseMoveListener(new MouseMoveListener() {
+ TableItem fLastItem= null;
+ public void mouseMove(MouseEvent e) {
+ if (table.equals(e.getSource())) {
+ Object o= table.getItem(new Point(e.x, e.y));
+ if (fLastItem == null ^ o == null) {
+ table.setCursor(o == null ? null : table.getDisplay().getSystemCursor(SWT.CURSOR_HAND));
+ }
+ if (o instanceof TableItem) {
+ Rectangle clientArea = table.getClientArea();
+ if (!o.equals(fLastItem)) {
+ fLastItem= (TableItem)o;
+ table.setSelection(new TableItem[] { fLastItem });
+ } else if (e.y - clientArea.y < table.getItemHeight() / 4) {
+ // Scroll up
+ Point p= table.toDisplay(e.x, e.y);
+ Item item= fTableViewer.scrollUp(p.x, p.y);
+ if (item instanceof TableItem) {
+ fLastItem= (TableItem)item;
+ table.setSelection(new TableItem[] { fLastItem });
+ }
+ } else if (clientArea.y + clientArea.height - e.y < table.getItemHeight() / 4) {
+ // Scroll down
+ Point p= table.toDisplay(e.x, e.y);
+ Item item= fTableViewer.scrollDown(p.x, p.y);
+ if (item instanceof TableItem) {
+ fLastItem= (TableItem)item;
+ table.setSelection(new TableItem[] { fLastItem });
+ }
+ }
+ } else if (o == null) {
+ fLastItem= null;
+ }
+ }
+ }
+ });
+
+ table.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseUp(MouseEvent e) {
+
+ if (table.getSelectionCount() < 1)
+ return;
+
+ if (e.button != 1)
+ return;
+
+ if (table.equals(e.getSource())) {
+ Object o= table.getItem(new Point(e.x, e.y));
+ TableItem selection= table.getSelection()[0];
+ if (selection.equals(o))
+ gotoSelectedElement();
+ }
+ }
+ });
+
+ installFilter();
+
+ addDisposeListener(this);
+ return fTableViewer.getControl();
+ }
+
+ /**
+ * Creates a table information control with the given shell as parent. The given
+ * styles are applied to the shell and the table widget.
+ *
+ * @param parent the parent shell
+ * @param shellStyle the additional styles for the shell
+ * @param tableStyle the additional styles for the table widget
+ */
+ public AbstractInformationControl(Shell parent, int shellStyle, int tableStyle) {
+ this(parent, shellStyle, tableStyle, null, false);
+ }
+
+ protected abstract TableViewer createTableViewer(Composite parent, int style);
+
+ /**
+ * Returns the name of the dialog settings section.
+ *
+ * @return the name of the dialog settings section
+ */
+ protected abstract String getId();
+
+ protected TableViewer getTableViewer() {
+ return fTableViewer;
+ }
+
+ /**
+ * Returns <code>true</code> if the control has a header, <code>false</code> otherwise.
+ * <p>
+ * The default is to return <code>false</code>.
+ * </p>
+ *
+ * @return <code>true</code> if the control has a header
+ */
+ protected boolean hasHeader() {
+ // default is to have no header
+ return false;
+ }
+
+ protected Text getFilterText() {
+ return fFilterText;
+ }
+
+ protected Text createFilterText(Composite parent) {
+ fFilterText= new Text(parent, SWT.NONE);
+ Dialog.applyDialogFont(fFilterText);
+
+ GridData data= new GridData(GridData.FILL_HORIZONTAL);
+ data.horizontalAlignment= GridData.FILL;
+ data.verticalAlignment= GridData.CENTER;
+ fFilterText.setLayoutData(data);
+
+ fFilterText.addKeyListener(new KeyListener() {
+ public void keyPressed(KeyEvent e) {
+ if (e.keyCode == 0x0D) // return
+ gotoSelectedElement();
+ if (e.keyCode == SWT.ARROW_DOWN)
+ fTableViewer.getTable().setFocus();
+ if (e.keyCode == SWT.ARROW_UP)
+ fTableViewer.getTable().setFocus();
+ if (e.character == 0x1B) // ESC
+ dispose();
+ }
+ public void keyReleased(KeyEvent e) {
+ // do nothing
+ }
+ });
+
+ return fFilterText;
+ }
+
+ protected void createHorizontalSeparator(Composite parent) {
+ Label separator= new Label(parent, SWT.SEPARATOR | SWT.HORIZONTAL | SWT.LINE_DOT);
+ separator.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ }
+
+ protected void updateStatusFieldText() {
+ setInfoText(getStatusFieldText());
+ }
+
+ protected String getStatusFieldText() {
+ return ""; //$NON-NLS-1$
+ }
+
+ private void installFilter() {
+ fFilterText.setText(""); //$NON-NLS-1$
+
+ fFilterText.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ fTableViewer.refresh();
+ }
+ });
+ }
+
+
+ protected StringMatcher getMatcher() {
+ return fStringMatcher;
+ }
+
+ /**
+ * Implementers can modify
+ *
+ * @return the selected element
+ */
+ protected Object getSelectedElement() {
+ if (fTableViewer == null)
+ return null;
+
+ return ((IStructuredSelection) fTableViewer.getSelection()).getFirstElement();
+ }
+
+ private void gotoSelectedElement() {
+ Object selectedElement= getSelectedElement();
+ if (selectedElement instanceof IHyperlink) {
+ ((IHyperlink)selectedElement).open();
+// IJavaElement jElement = CDIUtil.getJavaElement((IBean)selectedElement);
+// if(jElement != null){
+// try {
+// dispose();
+// IEditorPart part= EditorUtility.openInEditor(jElement, true);
+// if (part != null)
+// EditorUtility.revealInEditor(part, jElement);
+// } catch (CoreException ex) {
+// JavaPlugin.log(ex);
+// }
+// }
+ }
+ }
+
+ /**
+ * Selects the first element in the table which
+ * matches the current filter pattern.
+ */
+ protected void selectFirstMatch() {
+ Object selectedElement= fTableViewer.testFindItem(fInitiallySelectedType);
+ TableItem element;
+ final Table table = fTableViewer.getTable();
+ if (selectedElement instanceof TableItem)
+ element= findElement(new TableItem[] { (TableItem)selectedElement });
+ else
+ element= findElement(table.getItems());
+
+ if (element != null) {
+ table.setSelection(element);
+ table.showItem(element);
+ } else
+ fTableViewer.setSelection(StructuredSelection.EMPTY);
+ }
+
+ private TableItem findElement(TableItem[] items) {
+ return findElement(items, null, true);
+ }
+
+ private TableItem findElement(TableItem[] items, TableItem[] toBeSkipped, boolean allowToGoUp) {
+ if (fStringMatcher == null)
+ return items.length > 0 ? items[0] : null;
+
+ ILabelProvider labelProvider= (ILabelProvider)fTableViewer.getLabelProvider();
+
+ // First search at same level
+ for (int i= 0; i < items.length; i++) {
+ final TableItem item= items[i];
+ IHyperlink element= (IHyperlink)item.getData();
+ if (element != null) {
+ String label= labelProvider.getText(element);
+ if (fStringMatcher.match(label))
+ return item;
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setInformation(String information) {
+ // this method is ignored, see IInformationControlExtension2
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public abstract void setInput(Object information);
+
+ /**
+ * Fills the view menu.
+ * Clients can extend or override.
+ *
+ * @param viewMenu the menu manager that manages the menu
+ * @since 3.0
+ */
+ protected void fillViewMenu(IMenuManager viewMenu) {
+ //fCustomFiltersActionGroup.fillViewMenu(viewMenu);
+ }
+
+ /*
+ * Overridden to call the old framework method.
+ *
+ * @see org.eclipse.jface.dialogs.PopupDialog#fillDialogMenu(IMenuManager)
+ * @since 3.2
+ */
+ @Override
+ protected void fillDialogMenu(IMenuManager dialogMenu) {
+ super.fillDialogMenu(dialogMenu);
+ fillViewMenu(dialogMenu);
+ }
+
+ protected void inputChanged(Object newInput, Object newSelection) {
+ fFilterText.setText(""); //$NON-NLS-1$
+ fInitiallySelectedType= null;
+ if (newSelection instanceof IJavaElement) {
+ IJavaElement javaElement= ((IJavaElement)newSelection);
+ if (javaElement.getElementType() == IJavaElement.TYPE)
+ fInitiallySelectedType= (IType)javaElement;
+ else
+ fInitiallySelectedType= (IType)javaElement.getAncestor(IJavaElement.TYPE);
+ }
+ fTableViewer.setInput(newInput);
+ if (newSelection != null)
+ fTableViewer.setSelection(new StructuredSelection(newSelection));
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setVisible(boolean visible) {
+ if (visible) {
+ open();
+ } else {
+ removeHandlerAndKeyBindingSupport();
+ saveDialogBounds(getShell());
+ getShell().setVisible(false);
+ }
+ }
+
+ /*
+ * @see org.eclipse.jface.dialogs.PopupDialog#open()
+ * @since 3.3
+ */
+ @Override
+ public int open() {
+ addHandlerAndKeyBindingSupport();
+ return super.open();
+ }
+
+ protected Control getFocusControl() {
+ return fFilterText;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public final void dispose() {
+ close();
+ }
+
+ /**
+ * {@inheritDoc}
+ * @param event can be null
+ * <p>
+ * Subclasses may extend.
+ * </p>
+ */
+ public void widgetDisposed(DisposeEvent event) {
+ removeHandlerAndKeyBindingSupport();
+ fTableViewer= null;
+ fFilterText= null;
+ }
+
+ /**
+ * Adds handler and key binding support.
+ *
+ * @since 3.2
+ */
+ protected void addHandlerAndKeyBindingSupport() {
+ // Register action with command support
+ if (fShowViewMenuHandlerSubmission == null) {
+ fShowViewMenuHandlerSubmission= new HandlerSubmission(null, getShell(), null, fShowViewMenuAction.getActionDefinitionId(), new ActionHandler(fShowViewMenuAction), Priority.MEDIUM);
+ PlatformUI.getWorkbench().getCommandSupport().addHandlerSubmission(fShowViewMenuHandlerSubmission);
+ }
+ }
+
+ /**
+ * Removes handler and key binding support.
+ *
+ * @since 3.2
+ */
+ protected void removeHandlerAndKeyBindingSupport() {
+ // Remove handler submission
+ if (fShowViewMenuHandlerSubmission != null)
+ PlatformUI.getWorkbench().getCommandSupport().removeHandlerSubmission(fShowViewMenuHandlerSubmission);
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean hasContents() {
+ return fTableViewer != null && fTableViewer.getInput() != null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setSizeConstraints(int maxWidth, int maxHeight) {
+ // ignore
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Point computeSizeHint() {
+ // return the shell's size - note that it already has the persisted size if persisting
+ // is enabled.
+ return getShell().getSize();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setLocation(Point location) {
+ /*
+ * If the location is persisted, it gets managed by PopupDialog - fine. Otherwise, the location is
+ * computed in Window#getInitialLocation, which will center it in the parent shell / main
+ * monitor, which is wrong for two reasons:
+ * - we want to center over the editor / subject control, not the parent shell
+ * - the center is computed via the initalSize, which may be also wrong since the size may
+ * have been updated since via min/max sizing of AbstractInformationControlManager.
+ * In that case, override the location with the one computed by the manager. Note that
+ * the call to constrainShellSize in PopupDialog.open will still ensure that the shell is
+ * entirely visible.
+ */
+ if (!getPersistLocation() || getDialogSettings() == null)
+ getShell().setLocation(location);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setSize(int width, int height) {
+ getShell().setSize(width, height);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void addDisposeListener(DisposeListener listener) {
+ getShell().addDisposeListener(listener);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void removeDisposeListener(DisposeListener listener) {
+ getShell().removeDisposeListener(listener);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setForegroundColor(Color foreground) {
+ applyForegroundColor(foreground, getContents());
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setBackgroundColor(Color background) {
+ applyBackgroundColor(background, getContents());
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isFocusControl() {
+ return getShell().getDisplay().getActiveShell() == getShell();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setFocus() {
+ getShell().forceFocus();
+ fFilterText.setFocus();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void addFocusListener(FocusListener listener) {
+ getShell().addFocusListener(listener);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void removeFocusListener(FocusListener listener) {
+ getShell().removeFocusListener(listener);
+ }
+
+ final protected ICommand getInvokingCommand() {
+ return fInvokingCommand;
+ }
+
+ final protected KeySequence[] getInvokingCommandKeySequences() {
+ if (fInvokingCommandKeySequences == null) {
+ if (getInvokingCommand() != null) {
+ List<IKeySequenceBinding> list= getInvokingCommand().getKeySequenceBindings();
+ if (!list.isEmpty()) {
+ fInvokingCommandKeySequences= new KeySequence[list.size()];
+ for (int i= 0; i < fInvokingCommandKeySequences.length; i++) {
+ fInvokingCommandKeySequences[i]= list.get(i).getKeySequence();
+ }
+ return fInvokingCommandKeySequences;
+ }
+ }
+ }
+ return fInvokingCommandKeySequences;
+ }
+
+ /*
+ * @see org.eclipse.jface.dialogs.PopupDialog#getDialogSettings()
+ */
+ @Override
+ protected IDialogSettings getDialogSettings() {
+ String sectionName= getId();
+
+ IDialogSettings settings= JavaPlugin.getDefault().getDialogSettings().getSection(sectionName);
+ if (settings == null)
+ settings= JavaPlugin.getDefault().getDialogSettings().addNewSection(sectionName);
+
+ return settings;
+ }
+
+ /*
+ * Overridden to insert the filter text into the title and menu area.
+ *
+ * @since 3.2
+ */
+ @Override
+ protected Control createTitleMenuArea(Composite parent) {
+ fViewMenuButtonComposite= (Composite) super.createTitleMenuArea(parent);
+
+ // If there is a header, then the filter text must be created
+ // underneath the title and menu area.
+
+ if (hasHeader()) {
+ fFilterText= createFilterText(parent);
+ }
+
+ // Create show view menu action
+ fShowViewMenuAction= new Action("showViewMenu") { //$NON-NLS-1$
+ /*
+ * @see org.eclipse.jface.action.Action#run()
+ */
+ @Override
+ public void run() {
+ showDialogMenu();
+ }
+ };
+ fShowViewMenuAction.setEnabled(true);
+ fShowViewMenuAction.setActionDefinitionId(IWorkbenchCommandConstants.WINDOW_SHOW_VIEW_MENU);
+
+ return fViewMenuButtonComposite;
+ }
+
+ /*
+ * Overridden to insert the filter text into the title control
+ * if there is no header specified.
+ * @since 3.2
+ */
+ @Override
+ protected Control createTitleControl(Composite parent) {
+ if (hasHeader()) {
+ return super.createTitleControl(parent);
+ }
+ fFilterText= createFilterText(parent);
+ return fFilterText;
+ }
+
+ /*
+ * @see org.eclipse.jface.dialogs.PopupDialog#setTabOrder(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ protected void setTabOrder(Composite composite) {
+ if (hasHeader()) {
+ composite.setTabList(new Control[] { fFilterText, fTableViewer.getTable() });
+ } else {
+ fViewMenuButtonComposite.setTabList(new Control[] { fFilterText });
+ composite.setTabList(new Control[] { fViewMenuButtonComposite, fTableViewer.getTable() });
+ }
+ }
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/xpl/AbstractInformationControl.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/xpl/HierarchyInformationControl.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/xpl/HierarchyInformationControl.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/xpl/HierarchyInformationControl.java 2011-09-13 00:45:04 UTC (rev 34661)
@@ -0,0 +1,279 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * 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:
+ * IBM Corporation - initial API and implementation
+ * Red Hat, Inc.
+ *******************************************************************************/
+package org.jboss.tools.cdi.text.ext.hyperlink.xpl;
+
+import java.util.List;
+
+import org.eclipse.jdt.ui.actions.IJavaEditorActionDefinitionIds;
+import org.eclipse.jface.text.hyperlink.IHyperlink;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.KeyAdapter;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.dialogs.SearchPattern;
+import org.eclipse.ui.keys.KeySequence;
+import org.eclipse.ui.keys.SWTKeySupport;
+import org.jboss.tools.cdi.text.ext.hyperlink.IFilterable;
+
+/**
+ * Show hierarchy in light-weight control.
+ *
+ * @since 3.0
+ */
+public class HierarchyInformationControl extends AbstractInformationControl {
+ private List<IHyperlink> hyperlinks;
+
+ private BeanTableLabelProvider fLabelProvider;
+ private KeyAdapter fKeyAdapter;
+
+ private IHyperlink fFocus; // bean to filter for or null if type hierarchy
+
+ public HierarchyInformationControl(Shell parent, String title, int shellStyle, int tableStyle, List<IHyperlink> hyperlinks) {
+ super(parent, shellStyle, tableStyle, IJavaEditorActionDefinitionIds.OPEN_HIERARCHY, true);
+ this.hyperlinks = hyperlinks;
+ setTitleText(title);
+ }
+
+ private KeyAdapter getKeyAdapter() {
+ if (fKeyAdapter == null) {
+ fKeyAdapter= new KeyAdapter() {
+ @Override
+ public void keyPressed(KeyEvent e) {
+ int accelerator = SWTKeySupport.convertEventToUnmodifiedAccelerator(e);
+ KeySequence keySequence = KeySequence.getInstance(SWTKeySupport.convertAcceleratorToKeyStroke(accelerator));
+ KeySequence[] sequences= getInvokingCommandKeySequences();
+ if (sequences == null)
+ return;
+
+ for (int i= 0; i < sequences.length; i++) {
+ if (sequences[i].equals(keySequence)) {
+ e.doit= false;
+ toggleHierarchy();
+ return;
+ }
+ }
+ }
+ };
+ }
+ return fKeyAdapter;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected boolean hasHeader() {
+ return true;
+ }
+
+ @Override
+ protected Text createFilterText(Composite parent) {
+ // text set later
+ Text text= super.createFilterText(parent);
+ text.addKeyListener(getKeyAdapter());
+ return text;
+ }
+
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jdt.internal.ui.text.JavaOutlineInformationControl#createTableViewer(org.eclipse.swt.widgets.Composite, int)
+ */
+ @Override
+ protected TableViewer createTableViewer(Composite parent, int style) {
+ Table table = new Table(parent, SWT.SINGLE | (style & ~SWT.MULTI));
+ GridData gd= new GridData(GridData.FILL_BOTH);
+ gd.heightHint= table.getItemHeight() * 12;
+ table.setLayoutData(gd);
+
+ TableViewer tableViewer= new TableViewer(table);
+
+ tableViewer.addFilter(new BeanFilter());
+
+ fLabelProvider= new BeanTableLabelProvider();
+ fLabelProvider.setFilter(new ViewerFilter() {
+ @Override
+ public boolean select(Viewer viewer, Object parentElement, Object element) {
+ return hasFocusBean((IHyperlink) element);
+ }
+ });
+
+ tableViewer.setLabelProvider(fLabelProvider);
+
+ tableViewer.getTable().addKeyListener(getKeyAdapter());
+
+ return tableViewer;
+ }
+
+ protected boolean hasFocusBean(IHyperlink hyperlink) {
+ if (fFocus == null) {
+ return true;
+ }
+ if (hyperlink.equals(fFocus)) {
+ return true;
+ }
+
+ return false;
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void setInput(Object information) {
+ if(!(information instanceof List)){
+ inputChanged(null, null);
+ return;
+ }
+
+ hyperlinks = (List<IHyperlink>)information;
+
+ BeanTableContentProvider contentProvider= new BeanTableContentProvider(hyperlinks);
+ getTableViewer().setContentProvider(contentProvider);
+
+
+ inputChanged(hyperlinks, null);
+ }
+
+ protected void toggleHierarchy() {
+ TableViewer tableViewer= getTableViewer();
+
+ tableViewer.getTable().setRedraw(false);
+
+ // reveal selection
+ Object selectedElement= getSelectedElement();
+ if (selectedElement != null)
+ getTableViewer().reveal(selectedElement);
+ else
+ selectFirstMatch();
+
+ tableViewer.getTable().setRedraw(true);
+
+ updateStatusFieldText();
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected Object getSelectedElement() {
+ Object selectedElement= super.getSelectedElement();
+ return selectedElement;
+ }
+
+ @Override
+ protected String getId() {
+ return "org.jboss.tools.cdi.text.ext.InformationControl";
+ }
+
+ public static class BeanTableContentProvider implements IStructuredContentProvider{
+ private List<IHyperlink> hyperlinks;
+
+ public BeanTableContentProvider(List<IHyperlink> beans){
+ this.hyperlinks = beans;
+ }
+
+ @Override
+ public void dispose() {
+ }
+
+ @Override
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ }
+
+ @Override
+ public Object[] getElements(Object inputElement) {
+ return hyperlinks.toArray();
+ }
+
+ }
+
+ public static class BeanTableLabelProvider implements ILabelProvider{
+ @Override
+ public void addListener(ILabelProviderListener listener) {
+ }
+
+ public void setFilter(ViewerFilter viewerFilter) {
+ }
+
+ @Override
+ public void dispose() {
+ }
+
+ @Override
+ public boolean isLabelProperty(Object element, String property) {
+ return false;
+ }
+
+ @Override
+ public void removeListener(ILabelProviderListener listener) {
+ }
+
+ @Override
+ public Image getImage(Object element) {
+ return null;
+ }
+
+ @Override
+ public String getText(Object element) {
+ if(element instanceof IHyperlink){
+ return ((IHyperlink)element).getHyperlinkText();
+ }
+ return "";
+ }
+
+ }
+
+ public class BeanFilter extends ViewerFilter {
+ SearchPattern patternMatcher = new SearchPattern();
+ public boolean isConsistentItem(Object item) {
+ return true;
+ }
+
+ public boolean select(Viewer viewer, Object parentElement,
+ Object element) {
+
+ if (element instanceof IFilterable) {
+ String beanTypeName = ((IFilterable)element).getFullyQualifiedName();
+ if(getFilterText().getText().isEmpty())
+ patternMatcher.setPattern("*");
+ else
+ patternMatcher.setPattern(getFilterText().getText());
+ boolean result = patternMatcher.matches(beanTypeName);
+ if (!result) {
+ String pattern = patternMatcher.getPattern();
+ if (pattern.indexOf(".") < 0) {
+ int lastIndex = beanTypeName.lastIndexOf(".");
+ if (lastIndex >= 0
+ && (lastIndex + 1) < beanTypeName.length())
+ return patternMatcher.matches(beanTypeName.substring(lastIndex + 1));
+ }
+ }
+ return result;
+ }
+ return false;
+ }
+ }
+}
+
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/xpl/HierarchyInformationControl.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/xpl/InformationPresenter.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/xpl/InformationPresenter.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/xpl/InformationPresenter.java 2011-09-13 00:45:04 UTC (rev 34661)
@@ -0,0 +1,212 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * 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:
+ * IBM Corporation - initial API and implementation
+ * Red Hat, Inc.
+ *******************************************************************************/
+package org.jboss.tools.cdi.text.ext.hyperlink.xpl;
+
+import org.eclipse.jface.text.AbstractInformationControlManager;
+import org.eclipse.jface.text.IInformationControl;
+import org.eclipse.jface.text.IInformationControlCreator;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.IViewportListener;
+import org.eclipse.jface.util.Geometry;
+import org.eclipse.swt.events.ControlEvent;
+import org.eclipse.swt.events.ControlListener;
+import org.eclipse.swt.events.FocusEvent;
+import org.eclipse.swt.events.FocusListener;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.KeyListener;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseListener;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+
+public class InformationPresenter extends AbstractInformationControlManager{
+ private ITextViewer viwer;
+
+ public InformationPresenter(ITextViewer viwer, IInformationControlCreator creator) {
+ super(creator);
+ this.viwer = viwer;
+ setCloser(new Closer());
+ }
+
+ @Override
+ public void showInformation() {
+ IInformationControl iControl = getInformationControl();
+ Point sizeConstraints= computeSizeConstraints(viwer.getTextWidget(), null, iControl);
+ iControl.setSizeConstraints(sizeConstraints.x, sizeConstraints.y);
+ Point size= null;
+ Rectangle bounds= restoreInformationControlBounds();
+
+ if (bounds != null) {
+ if (bounds.width > -1 && bounds.height > -1)
+ size= Geometry.getSize(bounds);
+ }
+
+ if (size == null)
+ size= iControl.computeSizeHint();
+
+ size= Geometry.max(size, sizeConstraints);
+
+ iControl.setSize(size.x, size.y);
+ iControl.setVisible(true);
+ }
+
+ @Override
+ protected void computeInformation() {
+ setInformation("Information", new Rectangle(1,1,100,100));
+ }
+
+ class Closer implements IInformationControlCloser, ControlListener, MouseListener, FocusListener, IViewportListener, KeyListener {
+
+ /** The subject control. */
+ private Control fSubjectControl;
+ /** The information control. */
+ private IInformationControl fInformationControlToClose;
+ /** Indicates whether this closer is active. */
+ private boolean fIsActive= false;
+
+ /*
+ * @see IInformationControlCloser#setSubjectControl(Control)
+ */
+ public void setSubjectControl(Control control) {
+ fSubjectControl= control;
+ }
+
+ /*
+ * @see IInformationControlCloser#setInformationControl(IInformationControl)
+ */
+ public void setInformationControl(IInformationControl control) {
+ fInformationControlToClose= control;
+ }
+
+ /*
+ * @see IInformationControlCloser#start(Rectangle)
+ */
+ public void start(Rectangle informationArea) {
+
+ if (fIsActive)
+ return;
+ fIsActive= true;
+
+ if (fSubjectControl != null && !fSubjectControl.isDisposed()) {
+ fSubjectControl.addControlListener(this);
+ fSubjectControl.addMouseListener(this);
+ fSubjectControl.addFocusListener(this);
+ fSubjectControl.addKeyListener(this);
+ }
+
+ if (fInformationControlToClose != null)
+ fInformationControlToClose.addFocusListener(this);
+
+ viwer.addViewportListener(this);
+ }
+
+ /*
+ * @see IInformationControlCloser#stop()
+ */
+ public void stop() {
+
+ if (!fIsActive)
+ return;
+ fIsActive= false;
+
+ viwer.removeViewportListener(this);
+
+ if (fInformationControlToClose != null)
+ fInformationControlToClose.removeFocusListener(this);
+
+ if (fSubjectControl != null && !fSubjectControl.isDisposed()) {
+ fSubjectControl.removeControlListener(this);
+ fSubjectControl.removeMouseListener(this);
+ fSubjectControl.removeFocusListener(this);
+ fSubjectControl.removeKeyListener(this);
+ }
+ }
+
+ /*
+ * @see ControlListener#controlResized(ControlEvent)
+ */
+ public void controlResized(ControlEvent e) {
+ hideInformationControl();
+ }
+
+ /*
+ * @see ControlListener#controlMoved(ControlEvent)
+ */
+ public void controlMoved(ControlEvent e) {
+ hideInformationControl();
+ }
+
+ /*
+ * @see MouseListener#mouseDown(MouseEvent)
+ */
+ public void mouseDown(MouseEvent e) {
+ hideInformationControl();
+ }
+
+ /*
+ * @see MouseListener#mouseUp(MouseEvent)
+ */
+ public void mouseUp(MouseEvent e) {
+ }
+
+ /*
+ * @see MouseListener#mouseDoubleClick(MouseEvent)
+ */
+ public void mouseDoubleClick(MouseEvent e) {
+ hideInformationControl();
+ }
+
+ /*
+ * @see FocusListener#focusGained(FocusEvent)
+ */
+ public void focusGained(FocusEvent e) {
+ }
+
+ /*
+ * @see FocusListener#focusLost(FocusEvent)
+ */
+ public void focusLost(FocusEvent e) {
+ Display d= fSubjectControl.getDisplay();
+ d.asyncExec(new Runnable() {
+ // Without the asyncExec, mouse clicks to the workbench window are swallowed.
+ public void run() {
+ if (fInformationControlToClose == null || !fInformationControlToClose.isFocusControl())
+ hideInformationControl();
+ }
+ });
+ }
+
+ /*
+ * @see IViewportListenerListener#viewportChanged(int)
+ */
+ public void viewportChanged(int topIndex) {
+ hideInformationControl();
+ }
+
+ /*
+ * @see KeyListener#keyPressed(KeyEvent)
+ */
+ public void keyPressed(KeyEvent e) {
+ hideInformationControl();
+ }
+
+ /*
+ * @see KeyListener#keyReleased(KeyEvent)
+ */
+ public void keyReleased(KeyEvent e) {
+ }
+ }
+
+
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/xpl/InformationPresenter.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
14 years, 7 months
JBoss Tools SVN: r34660 - in trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core: validation and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-09-12 20:16:42 -0400 (Mon, 12 Sep 2011)
New Revision: 34660
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/DisposerMethod.java
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ClassBean.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
Log:
JBIDE-9699
https://issues.jboss.org/browse/JBIDE-9699
Parameters of disposer methods are loaded to model as injection points.
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ClassBean.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ClassBean.java 2011-09-13 00:13:54 UTC (rev 34659)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ClassBean.java 2011-09-13 00:16:42 UTC (rev 34660)
@@ -89,6 +89,8 @@
bm = new InitializerMethod();
} else if(m.isObserver()) {
bm = new ObserverMethod();
+ } else if(m.isDisposer()) {
+ bm = new DisposerMethod();
} else {
//add other cases
bm = new BeanMethod();
Added: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/DisposerMethod.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/DisposerMethod.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/DisposerMethod.java 2011-09-13 00:16:42 UTC (rev 34660)
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.cdi.internal.core.impl;
+
+import org.jboss.tools.cdi.internal.core.impl.definition.ParameterDefinition;
+
+/**
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
+public class DisposerMethod extends BeanMethod {
+
+ @Override
+ protected Parameter newParameter(ParameterDefinition p) {
+ return new InjectionPointParameter();
+ }
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/DisposerMethod.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2011-09-13 00:13:54 UTC (rev 34659)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2011-09-13 00:16:42 UTC (rev 34660)
@@ -1493,6 +1493,10 @@
}
private void validateInjectionPoint(IInjectionPoint injection) {
+ if(injection instanceof IInjectionPointParameter && injection.isAnnotationPresent(CDIConstants.DISPOSES_ANNOTATION_TYPE_NAME)) {
+ //Disposer is validated separately
+ return;
+ }
/*
* 3.11. The qualifier @Named at injection points
* - injection point other than injected field declares a @Named annotation that does not specify the value member
14 years, 7 months
JBoss Tools SVN: r34659 - trunk/cdi/plugins/org.jboss.tools.cdi.ui.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2011-09-12 20:13:54 -0400 (Mon, 12 Sep 2011)
New Revision: 34659
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.properties
Log:
Fixed CDI perspective name
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.properties
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.properties 2011-09-12 23:46:48 UTC (rev 34658)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.properties 2011-09-13 00:13:54 UTC (rev 34659)
@@ -18,4 +18,4 @@
NewWizards.file=File beans.xml
NewWizards.file.description=Create a new beans.xml File
-perspective.name=Context and Dependency Injection (CDI)
\ No newline at end of file
+perspective.name=CDI
\ No newline at end of file
14 years, 7 months
JBoss Tools SVN: r34658 - trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-09-12 19:46:48 -0400 (Mon, 12 Sep 2011)
New Revision: 34658
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
Log:
JBIDE-9698
https://issues.jboss.org/browse/JBIDE-9698
Validation of injected parameters in observer method provided.
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2011-09-12 23:43:06 UTC (rev 34657)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2011-09-12 23:46:48 UTC (rev 34658)
@@ -1511,7 +1511,10 @@
}
}
- IAnnotationDeclaration declaration = injection.getInjectAnnotation();
+ ITextSourceReference declaration = injection.getInjectAnnotation();
+ if(declaration == null && injection instanceof IInjectionPointParameter) {
+ declaration = injection;
+ }
/*
* 5.2.2. Legal injection point types
14 years, 7 months