JBoss Tools SVN: r44027 - trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-09-26 05:57:22 -0400 (Wed, 26 Sep 2012)
New Revision: 44027
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JBoss71ServerConnection.java
trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JMXProvider.java
Log:
JBIDE-12181 to trunk
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JBoss71ServerConnection.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JBoss71ServerConnection.java 2012-09-26 09:47:03 UTC (rev 44026)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JBoss71ServerConnection.java 2012-09-26 09:57:22 UTC (rev 44027)
@@ -11,7 +11,9 @@
package org.jboss.ide.eclipse.as.jmx.integration;
import java.io.IOException;
+import java.util.Collection;
import java.util.HashMap;
+import java.util.Iterator;
import java.util.Map;
import javax.management.MBeanServerConnection;
@@ -46,7 +48,8 @@
protected void initializeEnvironment(IServer s, String user, String pass) throws CredentialException {
this.user = user;
this.pass = pass;
- this.connectionToConnector = new HashMap<MBeanServerConnection, JMXConnector>();
+ if( this.connectionToConnector == null )
+ this.connectionToConnector = new HashMap<MBeanServerConnection, JMXConnector>();
}
protected MBeanServerConnection createConnection(IServer s) throws Exception {
@@ -81,17 +84,25 @@
protected void cleanupConnection(IServer server, MBeanServerConnection connection) {
super.cleanupConnection(server, connection);
- JMXConnector connector = null;
- synchronized(this) {
- connector = connectionToConnector.get(connection);
- if( connector != null ) {
- connectionToConnector.remove(connection);
+ }
+ protected void checkState(IServer server) {
+ super.checkState(server);
+ if( connectionToConnector != null && !isConnected() ) {
+ closeAllConnections();
+ }
+ }
+ private void closeAllConnections() {
+ Collection<JMXConnector> c = connectionToConnector.values();
+ Iterator<JMXConnector> i = c.iterator();
+ while(i.hasNext()) {
+ JMXConnector jmxc = i.next();
+ // Same logic here as in AS71Manager, because the close can block for 10+ minutes
+ if( jmxc != null ) {
+ closeClientJoin(jmxc);
}
}
-
- // Same logic here as in AS71Manager, because the close can block for 10+ minutes
- if( connector != null ) {
- closeClientJoin(connector);
+ synchronized(this) {
+ connectionToConnector.clear();
}
}
@@ -116,5 +127,4 @@
t.interrupt();
}
}
-
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JMXProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JMXProvider.java 2012-09-26 09:47:03 UTC (rev 44026)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JMXProvider.java 2012-09-26 09:57:22 UTC (rev 44027)
@@ -140,7 +140,7 @@
server.loadAdapter(JBossServer.class, new NullProgressMonitor()) != null
&& server.getServerState() == IServer.STATE_STARTED);
IConnectionWrapper connection = JBossJMXConnectionProviderModel.getDefault().getConnection(server);
- return preconditions && connection.isConnected();
+ return preconditions && connection != null && connection.isConnected();
}
public synchronized void selectionChanged(IStructuredSelection sel) {
12 years, 3 months
JBoss Tools SVN: r44024 - trunk/tests/scripts/installation-updates/src/main/groovy.
by jbosstools-commits@lists.jboss.org
Author: mickael_istria
Date: 2012-09-26 04:40:32 -0400 (Wed, 26 Sep 2012)
New Revision: 44024
Modified:
trunk/tests/scripts/installation-updates/src/main/groovy/getAndInstallEclipse.groovy
Log:
JBIDE-12717: Fix issue with file path
Modified: trunk/tests/scripts/installation-updates/src/main/groovy/getAndInstallEclipse.groovy
===================================================================
--- trunk/tests/scripts/installation-updates/src/main/groovy/getAndInstallEclipse.groovy 2012-09-26 07:49:48 UTC (rev 44023)
+++ trunk/tests/scripts/installation-updates/src/main/groovy/getAndInstallEclipse.groovy 2012-09-26 08:40:32 UTC (rev 44024)
@@ -45,7 +45,7 @@
src: cachedFile.getAbsolutePath(),
dest: new File().getAbsolutePath());
} else if (fileExtension.equals("tar.gz")) {
- File tarFile = new File(eclipseCacheDirectory, cachedFile.getAbsolutePath()[0..- (".gz".length() + 1)]);
+ File tarFile = new File(eclipseCacheDirectory, cachedFile.getName()[0..- (".gz".length() + 1)]);
if (!tarFile.isFile()) {
new AntBuilder().gunzip(src: cachedFile.getAbsolutePath(), dest: eclipseCacheDirectory.getAbsolutePath());
}
12 years, 3 months
JBoss Tools SVN: r44023 - in trunk: maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2012-09-26 03:49:48 -0400 (Wed, 26 Sep 2012)
New Revision: 44023
Modified:
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectExample.java
trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/ImportMavenArchetypeProjectExampleDelegate.java
Log:
JBIDE-12711 Prevent projectExample to maintain welcomeUrl across different project generations for maven archetypes
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectExample.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectExample.java 2012-09-26 07:46:23 UTC (rev 44022)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectExample.java 2012-09-26 07:49:48 UTC (rev 44023)
@@ -183,7 +183,7 @@
}
public String getWelcomeURL() {
- return welcomeURL;
+ return (welcomeURL == null) ? "" : welcomeURL;
}
public void setWelcomeURL(String welcomeURL) {
Modified: trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/ImportMavenArchetypeProjectExampleDelegate.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/ImportMavenArchetypeProjectExampleDelegate.java 2012-09-26 07:46:23 UTC (rev 44022)
+++ trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/ImportMavenArchetypeProjectExampleDelegate.java 2012-09-26 07:49:48 UTC (rev 44023)
@@ -50,6 +50,10 @@
projectDescription.setIncludedProjects(includedProjects);
}
projectDescription.getIncludedProjects().clear();
+ //JBIDE-12711 : reset welcomeURL for maven archetypes.
+ projectDescription.setWelcomeURL(null);
+ projectDescription.setWelcome(false);
+
String projectName = (String) propertiesMap.get(ProjectExamplesActivator.PROPERTY_PROJECT_NAME);
includedProjects.add(projectName);
String artifactId = (String) propertiesMap.get(ProjectExamplesActivator.PROPERTY_ARTIFACT_ID);
12 years, 3 months
JBoss Tools SVN: r44022 - in trunk: jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-09-26 03:46:23 -0400 (Wed, 26 Sep 2012)
New Revision: 44022
Added:
trunk/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/IConnectionProviderEventEmitter.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/AbstractJBossJMXConnectionProvider.java
trunk/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/providers/DefaultConnectionProvider.java
trunk/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/providers/DefaultConnectionWrapper.java
Log:
JBIDE-12722 to trunk
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/AbstractJBossJMXConnectionProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/AbstractJBossJMXConnectionProvider.java 2012-09-26 05:52:43 UTC (rev 44021)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/AbstractJBossJMXConnectionProvider.java 2012-09-26 07:46:23 UTC (rev 44022)
@@ -24,10 +24,12 @@
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
import org.jboss.ide.eclipse.as.core.Messages;
import org.jboss.tools.jmx.core.IConnectionProvider;
+import org.jboss.tools.jmx.core.IConnectionProviderEventEmitter;
import org.jboss.tools.jmx.core.IConnectionProviderListener;
import org.jboss.tools.jmx.core.IConnectionWrapper;
-public abstract class AbstractJBossJMXConnectionProvider implements IConnectionProvider, IServerLifecycleListener {
+public abstract class AbstractJBossJMXConnectionProvider implements
+ IConnectionProvider, IConnectionProviderEventEmitter, IServerLifecycleListener {
private ArrayList<IConnectionProviderListener> listeners =
new ArrayList<IConnectionProviderListener>();
@@ -124,7 +126,7 @@
listeners.remove(listener);
}
- void fireAdded(IConnectionWrapper wrapper) {
+ public void fireAdded(IConnectionWrapper wrapper) {
for(Iterator<IConnectionProviderListener> i = listeners.iterator(); i.hasNext();)
try {
i.next().connectionAdded(wrapper);
@@ -133,7 +135,7 @@
}
}
- void fireChanged(IConnectionWrapper wrapper) {
+ public void fireChanged(IConnectionWrapper wrapper) {
for(Iterator<IConnectionProviderListener> i = listeners.iterator(); i.hasNext();)
try {
i.next().connectionChanged(wrapper);
@@ -142,7 +144,7 @@
}
}
- void fireRemoved(IConnectionWrapper wrapper) {
+ public void fireRemoved(IConnectionWrapper wrapper) {
for(Iterator<IConnectionProviderListener> i = listeners.iterator(); i.hasNext();)
try {
i.next().connectionRemoved(wrapper);
Added: trunk/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/IConnectionProviderEventEmitter.java
===================================================================
--- trunk/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/IConnectionProviderEventEmitter.java (rev 0)
+++ trunk/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/IConnectionProviderEventEmitter.java 2012-09-26 07:46:23 UTC (rev 44022)
@@ -0,0 +1,16 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Rob Stryker
+ * 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
+ *
+ *******************************************************************************/
+package org.jboss.tools.jmx.core;
+
+
+public interface IConnectionProviderEventEmitter {
+ void fireAdded(IConnectionWrapper wrapper);
+ void fireChanged(IConnectionWrapper wrapper);
+ void fireRemoved(IConnectionWrapper wrapper);
+}
Modified: trunk/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/providers/DefaultConnectionProvider.java
===================================================================
--- trunk/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/providers/DefaultConnectionProvider.java 2012-09-26 05:52:43 UTC (rev 44021)
+++ trunk/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/providers/DefaultConnectionProvider.java 2012-09-26 07:46:23 UTC (rev 44022)
@@ -20,11 +20,11 @@
import java.util.List;
import java.util.Map;
-
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.jboss.tools.jmx.core.IConnectionProvider;
+import org.jboss.tools.jmx.core.IConnectionProviderEventEmitter;
import org.jboss.tools.jmx.core.IConnectionProviderListener;
import org.jboss.tools.jmx.core.IConnectionWrapper;
import org.jboss.tools.jmx.core.IMemento;
@@ -35,7 +35,7 @@
/**
* The default connection type that comes bundled
*/
-public class DefaultConnectionProvider implements IConnectionProvider {
+public class DefaultConnectionProvider implements IConnectionProvider, IConnectionProviderEventEmitter {
public static final String PROVIDER_ID = "org.jboss.tools.jmx.core.providers.DefaultConnectionProvider"; //$NON-NLS-1$
public static final String ID = "id"; //$NON-NLS-1$
public static final String URL = "url"; //$NON-NLS-1$
@@ -63,21 +63,21 @@
listeners.remove(listener);
}
- void fireAdded(IConnectionWrapper wrapper) {
+ public void fireAdded(IConnectionWrapper wrapper) {
for(Iterator<IConnectionProviderListener> i = listeners.iterator(); i.hasNext();)
try {
i.next().connectionAdded(wrapper);
} catch(RuntimeException re) {}
}
- void fireChanged(IConnectionWrapper wrapper) {
+ public void fireChanged(IConnectionWrapper wrapper) {
for(Iterator<IConnectionProviderListener> i = listeners.iterator(); i.hasNext();)
try {
i.next().connectionChanged(wrapper);
} catch(RuntimeException re) {}
}
- void fireRemoved(IConnectionWrapper wrapper) {
+ public void fireRemoved(IConnectionWrapper wrapper) {
for(Iterator<IConnectionProviderListener> i = listeners.iterator(); i.hasNext();)
try {
i.next().connectionRemoved(wrapper);
Modified: trunk/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/providers/DefaultConnectionWrapper.java
===================================================================
--- trunk/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/providers/DefaultConnectionWrapper.java 2012-09-26 05:52:43 UTC (rev 44021)
+++ trunk/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/providers/DefaultConnectionWrapper.java 2012-09-26 07:46:23 UTC (rev 44022)
@@ -26,6 +26,7 @@
import org.eclipse.core.runtime.Status;
import org.jboss.tools.jmx.core.ExtensionManager;
import org.jboss.tools.jmx.core.IConnectionProvider;
+import org.jboss.tools.jmx.core.IConnectionProviderEventEmitter;
import org.jboss.tools.jmx.core.IConnectionWrapper;
import org.jboss.tools.jmx.core.IJMXRunnable;
import org.jboss.tools.jmx.core.JMXActivator;
@@ -77,7 +78,7 @@
connector = JMXConnectorFactory.connect(new JMXServiceURL(descriptor.getURL()), environment);
connection = connector.getMBeanServerConnection();
isConnected = true;
- ((DefaultConnectionProvider)getProvider()).fireChanged(this);
+ ((IConnectionProviderEventEmitter)getProvider()).fireChanged(this);
}
public synchronized void disconnect() throws IOException {
@@ -87,7 +88,7 @@
try {
connector.close();
} finally {
- ((DefaultConnectionProvider)getProvider()).fireChanged(this);
+ ((IConnectionProviderEventEmitter)getProvider()).fireChanged(this);
}
connector = null;
connection = null;
12 years, 3 months
JBoss Tools SVN: r44021 - branches/jbosstools-4.0.0.Alpha2/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-09-26 01:52:43 -0400 (Wed, 26 Sep 2012)
New Revision: 44021
Modified:
branches/jbosstools-4.0.0.Alpha2/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEPublishMethod.java
Log:
JBIDE-12706 to alpha2 respin-b
Modified: branches/jbosstools-4.0.0.Alpha2/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEPublishMethod.java
===================================================================
--- branches/jbosstools-4.0.0.Alpha2/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEPublishMethod.java 2012-09-26 01:05:22 UTC (rev 44020)
+++ branches/jbosstools-4.0.0.Alpha2/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEPublishMethod.java 2012-09-26 05:52:43 UTC (rev 44021)
@@ -31,12 +31,12 @@
import org.jboss.ide.eclipse.as.core.extensions.events.ServerLogger;
import org.jboss.ide.eclipse.as.core.publishers.AbstractPublishMethod;
import org.jboss.ide.eclipse.as.core.publishers.AbstractServerToolsPublisher;
+import org.jboss.ide.eclipse.as.core.server.IDelegatingServerBehavior;
import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
import org.jboss.ide.eclipse.as.core.server.IDeployableServerBehaviour;
import org.jboss.ide.eclipse.as.core.server.IJBoss6Server;
import org.jboss.ide.eclipse.as.core.server.IPublishCopyCallbackHandler;
import org.jboss.ide.eclipse.as.core.server.internal.DelegatingServerBehavior;
-import org.jboss.ide.eclipse.as.core.server.internal.DeployableServerBehavior;
import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
import org.jboss.ide.eclipse.as.core.util.IEventCodes;
import org.jboss.ide.eclipse.as.core.util.IJBossRuntimeResourceConstants;
@@ -67,7 +67,8 @@
private IFileServiceSubSystem fileSubSystem = null;
private IPath remoteRootFolder;
- public void publishStart(DeployableServerBehavior behaviour,
+ @Override
+ public void publishStart(IDeployableServerBehaviour behaviour,
IProgressMonitor monitor) throws CoreException {
monitor.beginTask("Beginning Publish for server " + behaviour.getServer().getName(), 300);
super.publishStart(behaviour, AbstractServerToolsPublisher.getSubMon(monitor, 100));
@@ -85,10 +86,11 @@
Trace.trace(Trace.STRING_FINER, "Finished publish start for server " + getServer().getName());
}
- public int publishFinish(DeployableServerBehavior behaviour,
+ @Override
+ public int publishFinish(IDeployableServerBehaviour behaviour,
IProgressMonitor monitor) throws CoreException {
Trace.trace(Trace.STRING_FINER, "Beginning publishFinish for server " + getServer().getName());
- DelegatingServerBehavior b = (DelegatingServerBehavior) behaviour.getServer().loadAdapter(DelegatingServerBehavior.class, new NullProgressMonitor());
+ IDelegatingServerBehavior b = (IDelegatingServerBehavior) behaviour.getServer().loadAdapter(IDelegatingServerBehavior.class, new NullProgressMonitor());
if( b != null && getServer().getServerState() == IServer.STATE_STARTED ) {
startDeploymentScanner();
}
@@ -99,7 +101,7 @@
Trace.trace(Trace.STRING_FINER, "Starting remote deployment scanner for server " + getServer().getName());
String cmd = getDeploymentScannerCommand(new NullProgressMonitor(), true);
if( cmd != null )
- launchCommandNoResult((DelegatingServerBehavior)behaviour, 3000, cmd);
+ launchCommandNoResult((IDelegatingServerBehavior)behaviour, 3000, cmd);
}
protected void stopDeploymentScanner() {
@@ -242,6 +244,7 @@
}
public String getPublishDefaultRootFolder(IServer server) {
+ this.behaviour = ServerConverter.getDeployableServerBehavior(server);
return getRemoteRootFolder().toString();
}
public String getPublishDefaultRootTempFolder(IServer server) {
@@ -249,7 +252,7 @@
return getPublishDefaultRootFolder(server);
}
- private void launchCommandNoResult(DelegatingServerBehavior behaviour, int delay, String command) {
+ private void launchCommandNoResult(IDelegatingServerBehavior behaviour, int delay, String command) {
Trace.trace(Trace.STRING_FINER, "Launching remote command: " + command);
try {
ServerShellModel model = RSEHostShellModel.getInstance().getModel(behaviour.getServer());
12 years, 3 months
JBoss Tools SVN: r44020 - in trunk: cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker and 11 other directories.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2012-09-25 21:05:22 -0400 (Tue, 25 Sep 2012)
New Revision: 44020
Added:
trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/IPreferenceInfo.java
trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/PreferenceInfoManager.java
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.ui/src/org/jboss/tools/cdi/ui/marker/CDIProblemMarkerResolutionGenerator.java
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/marker/ConfigureProblemSeverityMarkerResolution.java
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/marker/ConfigureProblemSeverityResolutionGenerator.java
trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/ValidationErrorManager.java
trunk/common/tests/org.jboss.tools.common.validation.test/src/org/jboss/tools/common/validation/test/TestValidator.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/FacesConfigValidator.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/composite/CompositeComponentValidator.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ELValidator.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/validation/WebXMLCoreValidator.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamProjectPropertyValidator.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidationErrorManager.java
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/validation/SeamProjectPropertyValidatorWrapper.java
trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/validation/StrutsCoreValidator.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsMetamodelValidator.java
Log:
Configure Problem Severity should open project settings if they are enabled for the project https://issues.jboss.org/browse/JBIDE-12538
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 2012-09-25 20:39:44 UTC (rev 44019)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2012-09-26 01:05:22 UTC (rev 44020)
@@ -109,11 +109,13 @@
import org.jboss.tools.common.validation.ContextValidationHelper;
import org.jboss.tools.common.validation.EditorValidationContext;
import org.jboss.tools.common.validation.IJavaElementValidator;
+import org.jboss.tools.common.validation.IPreferenceInfo;
import org.jboss.tools.common.validation.IProjectValidationContext;
import org.jboss.tools.common.validation.IStringValidator;
import org.jboss.tools.common.validation.ITypedReporter;
import org.jboss.tools.common.validation.IValidatingProjectSet;
import org.jboss.tools.common.validation.IValidatingProjectTree;
+import org.jboss.tools.common.validation.PreferenceInfoManager;
import org.jboss.tools.common.validation.ValidationUtil;
import org.jboss.tools.common.validation.ValidatorManager;
import org.jboss.tools.jst.web.kb.internal.validation.KBValidator;
@@ -125,6 +127,8 @@
public static final String ID = "org.jboss.tools.cdi.core.CoreValidator"; //$NON-NLS-1$
public static final String PROBLEM_TYPE = "org.jboss.tools.cdi.core.cdiproblem"; //$NON-NLS-1$
public static final String PREFERENCE_PAGE_ID = "org.jboss.tools.cdi.ui.preferences.CDIValidatorPreferencePage"; //$NON-NLS-1$
+ public static final String PROPERTY_PAGE_ID = "org.jboss.tools.cdi.ui.propertyPages.CDIValidatorPreferencePage"; //$NON-NLS-1$
+
ICDIProject rootCdiProject;
Map<IProject, CDIValidationContext> cdiContexts = new HashMap<IProject, CDIValidationContext>();
@@ -2729,4 +2733,30 @@
protected boolean shouldCleanAllAnnotations() {
return true;
}
+
+ @Override
+ protected void registerPreferenceInfo() {
+ if(PreferenceInfoManager.getPreferenceInfo(PROBLEM_TYPE) == null){
+ PreferenceInfoManager.register(PROBLEM_TYPE, new CDIPreferenceInfo());
+ }
+ }
+
+ class CDIPreferenceInfo implements IPreferenceInfo{
+
+ @Override
+ public String getPreferencePageId() {
+ return PREFERENCE_PAGE_ID;
+ }
+
+ @Override
+ public String getPropertyPageId() {
+ return PROPERTY_PAGE_ID;
+ }
+
+ @Override
+ public String getPluginId() {
+ return CDICorePlugin.PLUGIN_ID;
+ }
+
+ }
}
\ No newline at end of file
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/CDIProblemMarkerResolutionGenerator.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/CDIProblemMarkerResolutionGenerator.java 2012-09-25 20:39:44 UTC (rev 44019)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/CDIProblemMarkerResolutionGenerator.java 2012-09-26 01:05:22 UTC (rev 44020)
@@ -1078,7 +1078,7 @@
CDIUIPlugin.getDefault().logError(e);
}
}
- return null;
+ return new IJavaCompletionProposal[]{};
}
Modified: trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/marker/ConfigureProblemSeverityMarkerResolution.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/marker/ConfigureProblemSeverityMarkerResolution.java 2012-09-25 20:39:44 UTC (rev 44019)
+++ trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/marker/ConfigureProblemSeverityMarkerResolution.java 2012-09-26 01:05:22 UTC (rev 44020)
@@ -12,18 +12,23 @@
import java.util.Iterator;
import java.util.List;
+import java.util.Set;
import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.debug.internal.ui.DebugUIPlugin;
+import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.JavaPluginImages;
import org.eclipse.jdt.ui.text.java.IJavaCompletionProposal;
import org.eclipse.jface.preference.IPreferenceNode;
import org.eclipse.jface.preference.IPreferencePage;
+import org.eclipse.jface.preference.PreferenceDialog;
import org.eclipse.jface.preference.PreferenceManager;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.contentassist.IContextInformation;
@@ -34,8 +39,10 @@
import org.eclipse.ui.dialogs.PreferencesUtil;
import org.eclipse.ui.internal.dialogs.WorkbenchPreferenceNode;
import org.eclipse.ui.progress.UIJob;
+import org.jboss.tools.common.preferences.SeverityPreferences;
import org.jboss.tools.common.quickfix.IBaseMarkerResolution;
import org.jboss.tools.common.ui.CommonUIMessages;
+import org.jboss.tools.common.ui.marker.AddSuppressWarningsMarkerResolution.SP;
import org.jboss.tools.common.ui.preferences.SeverityPreferencePage;
/**
@@ -46,13 +53,20 @@
private static final int PREFERENCE_SIZE = 40;
private static final String DOTS = "...";
+ private IProject project;
private String preferencePageId;
+ private String propertyPageId;
private String preferenceKey;
+ private String pluginId;
private String label;
+ private SP preferences = new SP();
- public ConfigureProblemSeverityMarkerResolution(String preferencePageId, String preferenceKey){
+ public ConfigureProblemSeverityMarkerResolution(IProject project, String preferencePageId, String propertyPageId, String preferenceKey, String pluginId){
+ this.project = project;
this.preferencePageId = preferencePageId;
+ this.propertyPageId = propertyPageId;
this.preferenceKey = preferenceKey;
+ this.pluginId = pluginId;
String preferenceName = getPreferenceLabel();
label = NLS.bind(CommonUIMessages.CONFIGURE_PROBLEM_SEVERITY, preferenceName);
}
@@ -64,11 +78,25 @@
public void run(IMarker marker) {
UIJob job = new UIJob(""){ //$NON-NLS-1$
public IStatus runInUIThread(IProgressMonitor monitor) {
- PreferencesUtil.createPreferenceDialogOn(DebugUIPlugin.getShell(),
+ IEclipsePreferences projectPreferences = preferences.getProjectPreferences(project);
+ String projectValue = null;
+ if(projectPreferences != null){
+ projectValue = projectPreferences.get(preferenceKey, null);
+ }
+ if(projectValue != null){
+ PreferencesUtil.createPropertyDialogOn(DebugUIPlugin.getShell(),
+ project,
+ ConfigureProblemSeverityMarkerResolution.this.propertyPageId,
+ new String[]{ConfigureProblemSeverityMarkerResolution.this.preferencePageId},
+ ConfigureProblemSeverityMarkerResolution.this.preferenceKey).open();
+ }else{
+ PreferencesUtil.createPreferenceDialogOn(DebugUIPlugin.getShell(),
ConfigureProblemSeverityMarkerResolution.this.preferencePageId,
new String[]{ConfigureProblemSeverityMarkerResolution.this.preferencePageId},
ConfigureProblemSeverityMarkerResolution.this.preferenceKey).open();
+ }
return Status.OK_STATUS;
+
}
};
job.setSystem(true);
@@ -165,4 +193,23 @@
public int getRelevance() {
return 0;
}
+
+ class SP extends SeverityPreferences{
+
+ @Override
+ protected Set<String> getSeverityOptionNames() {
+ return null;
+ }
+
+ @Override
+ protected String createSeverityOption(String shortName) {
+ return null;
+ }
+
+ @Override
+ protected String getPluginId() {
+ return pluginId;
+ }
+
+ }
}
Modified: trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/marker/ConfigureProblemSeverityResolutionGenerator.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/marker/ConfigureProblemSeverityResolutionGenerator.java 2012-09-25 20:39:44 UTC (rev 44019)
+++ trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/marker/ConfigureProblemSeverityResolutionGenerator.java 2012-09-26 01:05:22 UTC (rev 44020)
@@ -29,7 +29,10 @@
import org.eclipse.wst.sse.ui.internal.reconcile.TemporaryAnnotation;
import org.jboss.tools.common.EclipseUtil;
import org.jboss.tools.common.quickfix.IQuickFixGenerator;
+import org.jboss.tools.common.refactoring.MarkerResolutionUtils;
import org.jboss.tools.common.ui.CommonUIPlugin;
+import org.jboss.tools.common.validation.IPreferenceInfo;
+import org.jboss.tools.common.validation.PreferenceInfoManager;
import org.jboss.tools.common.validation.ValidationErrorManager;
import org.jboss.tools.common.validation.java.TempJavaProblemAnnotation;
@@ -49,22 +52,28 @@
IFile file = (IFile)marker.getResource();
if(file != null){
String preferenceKey = getPreferenceKey(marker);
- String preferencePageId = getPreferencePageId(marker);
- if(preferenceKey != null && preferencePageId != null){
- int severity = marker.getAttribute(IMarker.SEVERITY, 0);
- if(severity == IMarker.SEVERITY_WARNING){
- IJavaElement element = findJavaElement(file, position);
- if(element != null){
- if(element instanceof IMethod){
- ILocalVariable parameter = findParameter((IMethod)element, position);
- if(parameter != null){
+ String markerType = getProblemType(marker);
+ IPreferenceInfo info = PreferenceInfoManager.getPreferenceInfo(markerType);
+ if(info != null){
+ String propertyPageId = info.getPropertyPageId();
+ String preferencePageId = info.getPreferencePageId();
+ String pluginId = info.getPluginId();
+ if(preferenceKey != null && preferencePageId != null && propertyPageId != null && pluginId != null){
+ int severity = marker.getAttribute(IMarker.SEVERITY, 0);
+ if(severity == IMarker.SEVERITY_WARNING){
+ IJavaElement element = findJavaElement(file, position);
+ if(element != null){
+ if(element instanceof IMethod){
+ ILocalVariable parameter = findParameter((IMethod)element, position);
+ if(parameter != null){
resolutions.add(new AddSuppressWarningsMarkerResolution(file, parameter, preferenceKey));
+ }
}
+ resolutions.add(new AddSuppressWarningsMarkerResolution(file, element, preferenceKey));
}
- resolutions.add(new AddSuppressWarningsMarkerResolution(file, element, preferenceKey));
}
+ resolutions.add(new ConfigureProblemSeverityMarkerResolution(file.getProject(), preferencePageId, propertyPageId, preferenceKey, pluginId));
}
- resolutions.add(new ConfigureProblemSeverityMarkerResolution(preferencePageId, preferenceKey));
}
}
}
@@ -109,12 +118,7 @@
@Override
public boolean hasResolutions(IMarker marker) {
- try {
- return getPreferenceKey(marker) != null && getPreferencePageId(marker) != null;
- } catch (CoreException ex) {
- CommonUIPlugin.getDefault().logError(ex);
- }
- return false;
+ return true;
}
private String getPreferenceKey(IMarker marker)throws CoreException{
@@ -122,6 +126,14 @@
return attribute;
}
+ private String getProblemType(IMarker marker)throws CoreException{
+ return marker.getType();
+ }
+
+ private String getProblemType(Annotation annotation){
+ return annotation.getType();
+ }
+
private String getPreferencePageId(IMarker marker)throws CoreException{
String attribute = marker.getAttribute(ValidationErrorManager.PREFERENCE_PAGE_ID_NAME, null);
return attribute;
@@ -159,53 +171,50 @@
@Override
public boolean hasProposals(Annotation annotation, Position position) {
- return getPreferenceKey(annotation) != null && getPreferencePageId(annotation) != null;
+ return true;
}
@Override
public IJavaCompletionProposal[] getProposals(Annotation annotation, Position position) {
ArrayList<IJavaCompletionProposal> proposals = new ArrayList<IJavaCompletionProposal>();
String preferenceKey = getPreferenceKey(annotation);
- String preferencePageId = getPreferencePageId(annotation);
- if(preferenceKey != null && preferencePageId != null){
- if(annotation instanceof TempJavaProblemAnnotation){
- TempJavaProblemAnnotation tAnnotation = (TempJavaProblemAnnotation)annotation;
- if(JavaMarkerAnnotation.WARNING_ANNOTATION_TYPE.equals(tAnnotation.getType())){
- int offset = position.getOffset();
- IFile file = getFile(tAnnotation);
- if(file != null){
- IJavaElement element = findJavaElement(tAnnotation, offset);
- if(element != null){
- if(element instanceof IMethod){
- try{
- ILocalVariable parameter = findParameter((IMethod)element, offset);
- if(parameter != null){
- proposals.add(new AddSuppressWarningsMarkerResolution(file, parameter, preferenceKey, tAnnotation.getCompilationUnit()));
+ String problemType = getProblemType(annotation);
+ IPreferenceInfo info = PreferenceInfoManager.getPreferenceInfo(problemType);
+ if(info != null){
+ String preferencePageId = info.getPreferencePageId();
+ String propertyPageId = info.getPropertyPageId();
+ String pluginId = info.getPluginId();
+ if(preferenceKey != null && preferencePageId != null && propertyPageId != null && pluginId != null){
+ IFile file = MarkerResolutionUtils.getFile();
+ if(annotation instanceof TempJavaProblemAnnotation){
+ TempJavaProblemAnnotation tAnnotation = (TempJavaProblemAnnotation)annotation;
+
+ if(JavaMarkerAnnotation.WARNING_ANNOTATION_TYPE.equals(tAnnotation.getType())){
+ int offset = position.getOffset();
+
+ if(file != null){
+ IJavaElement element = findJavaElement(tAnnotation, offset);
+ if(element != null){
+ if(element instanceof IMethod){
+ try{
+ ILocalVariable parameter = findParameter((IMethod)element, offset);
+ if(parameter != null){
+ proposals.add(new AddSuppressWarningsMarkerResolution(file, parameter, preferenceKey, tAnnotation.getCompilationUnit()));
+ }
+ }catch(JavaModelException ex){
+ CommonUIPlugin.getDefault().logError(ex);
}
- }catch(JavaModelException ex){
- CommonUIPlugin.getDefault().logError(ex);
}
+ proposals.add(new AddSuppressWarningsMarkerResolution(file, element, preferenceKey, tAnnotation.getCompilationUnit()));
}
- proposals.add(new AddSuppressWarningsMarkerResolution(file, element, preferenceKey, tAnnotation.getCompilationUnit()));
}
}
}
+ proposals.add(new ConfigureProblemSeverityMarkerResolution(file.getProject(), preferencePageId, propertyPageId, preferenceKey, pluginId));
}
- proposals.add(new ConfigureProblemSeverityMarkerResolution(preferencePageId, preferenceKey));
}
return proposals.toArray(new IJavaCompletionProposal[]{});
}
- private IFile getFile(TempJavaProblemAnnotation annotation){
- if(annotation.getCompilationUnit() != null){
- try {
- return (IFile)annotation.getCompilationUnit().getUnderlyingResource();
- } catch (JavaModelException e) {
- CommonUIPlugin.getDefault().logError(e);
- }
- }
- return null;
- }
-
}
Added: trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/IPreferenceInfo.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/IPreferenceInfo.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/IPreferenceInfo.java 2012-09-26 01:05:22 UTC (rev 44020)
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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.common.validation;
+
+/**
+ * Preference info for quick fixes
+ * @author Daniel Azarov
+ */
+public interface IPreferenceInfo {
+ /**
+ * Return id of preference page
+ */
+ public String getPreferencePageId();
+
+ /**
+ * Return id of property page
+ */
+ public String getPropertyPageId();
+
+ /**
+ * Return id of plugin
+ */
+ public String getPluginId();
+}
Property changes on: trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/IPreferenceInfo.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/PreferenceInfoManager.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/PreferenceInfoManager.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/PreferenceInfoManager.java 2012-09-26 01:05:22 UTC (rev 44020)
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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.common.validation;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Preference Info Manager store info from validators and returns it to Quick fixes
+ * @author Daniel Azarov
+ */
+public class PreferenceInfoManager {
+ private static Map<String, IPreferenceInfo> infos = Collections.synchronizedMap(new HashMap<String, IPreferenceInfo>());
+
+ /*
+ * register IPreferenceInfo for problemType
+ * this method is designed to be called from validator
+ */
+ public static void register(String problemType, IPreferenceInfo info){
+ if(!infos.containsKey(problemType)){
+ infos.put(problemType, info);
+ }
+ }
+
+ /*
+ * returns IPreferenceInfo for problemType
+ */
+ public static IPreferenceInfo getPreferenceInfo(String problemType){
+ return infos.get(problemType);
+ }
+}
Property changes on: trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/PreferenceInfoManager.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/ValidationErrorManager.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/ValidationErrorManager.java 2012-09-25 20:39:44 UTC (rev 44019)
+++ trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/ValidationErrorManager.java 2012-09-26 01:05:22 UTC (rev 44020)
@@ -70,6 +70,7 @@
* Constructor
*/
public ValidationErrorManager() {
+ registerPreferenceInfo();
}
// /**
@@ -610,4 +611,12 @@
// reporter.removeAllMessages(validationManager, resource);
WorkbenchReporter.removeAllMessages(resource, new String[]{getMarkerOwner().getName()}, null);
}
+
+ /*
+ * register IPreferenceInfo in PreferenceInfoManager
+ * validator is supposed to have own implementation of IPreferenceInfo
+ * and register it in PreferenceInfoManager
+ * see CDICoreValidator.registerPreferenceInfo() as an example
+ */
+ protected abstract void registerPreferenceInfo();
}
\ No newline at end of file
Modified: trunk/common/tests/org.jboss.tools.common.validation.test/src/org/jboss/tools/common/validation/test/TestValidator.java
===================================================================
--- trunk/common/tests/org.jboss.tools.common.validation.test/src/org/jboss/tools/common/validation/test/TestValidator.java 2012-09-25 20:39:44 UTC (rev 44019)
+++ trunk/common/tests/org.jboss.tools.common.validation.test/src/org/jboss/tools/common/validation/test/TestValidator.java 2012-09-26 01:05:22 UTC (rev 44020)
@@ -105,4 +105,10 @@
protected String getPreferencePageId() {
return null;
}
+
+ @Override
+ protected void registerPreferenceInfo() {
+ // TODO Auto-generated method stub
+
+ }
}
\ No newline at end of file
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/FacesConfigValidator.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/FacesConfigValidator.java 2012-09-25 20:39:44 UTC (rev 44019)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/FacesConfigValidator.java 2012-09-26 01:05:22 UTC (rev 44020)
@@ -42,10 +42,12 @@
import org.jboss.tools.common.model.impl.XModelImpl;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.common.validation.ContextValidationHelper;
+import org.jboss.tools.common.validation.IPreferenceInfo;
import org.jboss.tools.common.validation.IProjectValidationContext;
import org.jboss.tools.common.validation.IValidatingProjectSet;
import org.jboss.tools.common.validation.IValidatingProjectTree;
import org.jboss.tools.common.validation.IValidator;
+import org.jboss.tools.common.validation.PreferenceInfoManager;
import org.jboss.tools.common.validation.ValidationErrorManager;
import org.jboss.tools.common.validation.ValidatorManager;
import org.jboss.tools.common.validation.internal.ProjectValidationContext;
@@ -74,6 +76,8 @@
public static final String ID = "org.jboss.tools.esb.validator.ESBCoreValidator"; //$NON-NLS-1$
public static final String PROBLEM_TYPE = "org.jboss.tools.jsf.facesconfigproblem"; //$NON-NLS-1$
public static final String PREFERENCE_PAGE_ID = CompositeComponentValidator.PREFERENCE_PAGE_ID;
+ public static final String PROPERTY_PAGE_ID = CompositeComponentValidator.PROPERTY_PAGE_ID;
+
public static String SHORT_ID = "jsf-verification"; //$NON-NLS-1$
@@ -432,6 +436,32 @@
return files;
}
+ @Override
+ protected void registerPreferenceInfo() {
+ if(PreferenceInfoManager.getPreferenceInfo(PROBLEM_TYPE) == null){
+ PreferenceInfoManager.register(PROBLEM_TYPE, new JSFPreferenceInfo());
+ }
+ }
+
+ class JSFPreferenceInfo implements IPreferenceInfo{
+
+ @Override
+ public String getPreferencePageId() {
+ return PREFERENCE_PAGE_ID;
+ }
+
+ @Override
+ public String getPropertyPageId() {
+ return PROPERTY_PAGE_ID;
+ }
+
+ @Override
+ public String getPluginId() {
+ return JSFModelPlugin.PLUGIN_ID;
+ }
+
+ }
+
}
class JSFCheckFromViewId extends JSFCheckToViewId {
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/composite/CompositeComponentValidator.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/composite/CompositeComponentValidator.java 2012-09-25 20:39:44 UTC (rev 44019)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/composite/CompositeComponentValidator.java 2012-09-26 01:05:22 UTC (rev 44020)
@@ -34,8 +34,10 @@
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
import org.jboss.tools.common.el.core.resolver.ELContext;
import org.jboss.tools.common.validation.ContextValidationHelper;
+import org.jboss.tools.common.validation.IPreferenceInfo;
import org.jboss.tools.common.validation.IProjectValidationContext;
import org.jboss.tools.common.validation.IValidatingProjectTree;
+import org.jboss.tools.common.validation.PreferenceInfoManager;
import org.jboss.tools.common.validation.ValidatorManager;
import org.jboss.tools.jsf.JSFModelPlugin;
import org.jboss.tools.jsf.project.JSFNature;
@@ -67,7 +69,7 @@
public static final String PROBLEM_TYPE = "org.jboss.tools.jsf.compositeproblem"; //$NON-NLS-1$
public static final String SHORT_ID = "jboss.jsf.core"; //$NON-NLS-1$
public static final String PREFERENCE_PAGE_ID = "org.jboss.tools.jsf.ui.preferences.JSFValidationPreferencePage"; //$NON-NLS-1$
-
+ public static final String PROPERTY_PAGE_ID = "org.jboss.tools.jsf.ui.propertyPages.JSFValidationPreferencePage"; //$NON-NLS-1$
private static final String COMPOSITE_COMPONENT_URI_PREFIX = "http://java.sun.com/jsf/composite/"; //$NON-NLS-1$
public static final String MESSAGE_ID_ATTRIBUTE_NAME = "JSF2_message_id"; //$NON-NLS-1$
@@ -397,4 +399,30 @@
// TODO
return null;
}
+
+ @Override
+ protected void registerPreferenceInfo() {
+ if(PreferenceInfoManager.getPreferenceInfo(PROBLEM_TYPE) == null){
+ PreferenceInfoManager.register(PROBLEM_TYPE, new CompositeComponentPreferenceInfo());
+ }
+ }
+
+ class CompositeComponentPreferenceInfo implements IPreferenceInfo{
+
+ @Override
+ public String getPreferencePageId() {
+ return PREFERENCE_PAGE_ID;
+ }
+
+ @Override
+ public String getPropertyPageId() {
+ return PROPERTY_PAGE_ID;
+ }
+
+ @Override
+ public String getPluginId() {
+ return JSFModelPlugin.PLUGIN_ID;
+ }
+
+ }
}
\ No newline at end of file
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/validation/WebXMLCoreValidator.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/validation/WebXMLCoreValidator.java 2012-09-25 20:39:44 UTC (rev 44019)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/validation/WebXMLCoreValidator.java 2012-09-26 01:05:22 UTC (rev 44020)
@@ -32,10 +32,12 @@
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.common.validation.ContextValidationHelper;
+import org.jboss.tools.common.validation.IPreferenceInfo;
import org.jboss.tools.common.validation.IProjectValidationContext;
import org.jboss.tools.common.validation.IValidatingProjectSet;
import org.jboss.tools.common.validation.IValidatingProjectTree;
import org.jboss.tools.common.validation.IValidator;
+import org.jboss.tools.common.validation.PreferenceInfoManager;
import org.jboss.tools.common.validation.ValidationErrorManager;
import org.jboss.tools.common.validation.ValidatorManager;
import org.jboss.tools.common.validation.internal.ProjectValidationContext;
@@ -52,6 +54,7 @@
public static final String ID = "org.jboss.tools.esb.validator.ESBCoreValidator"; //$NON-NLS-1$
public static final String PROBLEM_TYPE = "org.jboss.tools.jst.web.webxmlproblem"; //$NON-NLS-1$
public static final String PREFERENCE_PAGE_ID = "org.jboss.tools.jst.web.ui.WebXMLValidatorPreferencePage"; //$NON-NLS-1$
+ public static final String PROPERTY_PAGE_ID = "org.jboss.tools.jst.web.ui.propertyPages.WebXMLValidatorPreferencePage"; //$NON-NLS-1$
public static String SHORT_ID = "verification"; //$NON-NLS-1$
@@ -290,4 +293,30 @@
return PREFERENCE_PAGE_ID;
}
+ @Override
+ protected void registerPreferenceInfo() {
+ if(PreferenceInfoManager.getPreferenceInfo(PROBLEM_TYPE) == null){
+ PreferenceInfoManager.register(PROBLEM_TYPE, new WebXMLPreferenceInfo());
+ }
+ }
+
+ class WebXMLPreferenceInfo implements IPreferenceInfo{
+
+ @Override
+ public String getPreferencePageId() {
+ return PREFERENCE_PAGE_ID;
+ }
+
+ @Override
+ public String getPropertyPageId() {
+ return PROPERTY_PAGE_ID;
+ }
+
+ @Override
+ public String getPluginId() {
+ return WebModelPlugin.PLUGIN_ID;
+ }
+
+ }
+
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ELValidator.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ELValidator.java 2012-09-25 20:39:44 UTC (rev 44019)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ELValidator.java 2012-09-26 01:05:22 UTC (rev 44020)
@@ -64,10 +64,12 @@
import org.jboss.tools.common.validation.ContextValidationHelper;
import org.jboss.tools.common.validation.EditorValidationContext;
import org.jboss.tools.common.validation.IELValidationDelegate;
+import org.jboss.tools.common.validation.IPreferenceInfo;
import org.jboss.tools.common.validation.IProjectValidationContext;
import org.jboss.tools.common.validation.IStringValidator;
import org.jboss.tools.common.validation.ITypedReporter;
import org.jboss.tools.common.validation.IValidatingProjectTree;
+import org.jboss.tools.common.validation.PreferenceInfoManager;
import org.jboss.tools.common.validation.ValidatorManager;
import org.jboss.tools.jst.web.kb.PageContextFactory;
import org.jboss.tools.jst.web.kb.WebKbPlugin;
@@ -83,6 +85,8 @@
public static final String ID = "org.jboss.tools.jst.web.kb.ELValidator"; //$NON-NLS-1$
public static final String PROBLEM_TYPE = "org.jboss.tools.jst.web.kb.elproblem"; //$NON-NLS-1$
public static final String PREFERENCE_PAGE_ID = "org.jboss.tools.jst.web.ui.preferences.ELValidatorPreferencePage"; //$NON-NLS-1$
+ public static final String PROPERTY_PAGE_ID = "org.jboss.tools.jst.web.ui.properties.ELValidatorPreferencePage"; //$NON-NLS-1$
+
private static final String EXTENSION_POINT_ID = "org.jboss.tools.jst.web.kb.elValidationDelegate"; //$NON-NLS-1$
@@ -676,4 +680,30 @@
protected String getMessageBundleName() {
return BUNDLE_NAME;
}
+
+ @Override
+ protected void registerPreferenceInfo() {
+ if(PreferenceInfoManager.getPreferenceInfo(PROBLEM_TYPE) == null){
+ PreferenceInfoManager.register(PROBLEM_TYPE, new ELPreferenceInfo());
+ }
+ }
+
+ class ELPreferenceInfo implements IPreferenceInfo{
+
+ @Override
+ public String getPreferencePageId() {
+ return PREFERENCE_PAGE_ID;
+ }
+
+ @Override
+ public String getPropertyPageId() {
+ return PROPERTY_PAGE_ID;
+ }
+
+ @Override
+ public String getPluginId() {
+ return WebKbPlugin.PLUGIN_ID;
+ }
+
+ }
}
\ No newline at end of file
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java 2012-09-25 20:39:44 UTC (rev 44019)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java 2012-09-26 01:05:22 UTC (rev 44020)
@@ -40,10 +40,12 @@
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.common.text.ITextSourceReference;
import org.jboss.tools.common.validation.ContextValidationHelper;
+import org.jboss.tools.common.validation.IPreferenceInfo;
import org.jboss.tools.common.validation.IProjectValidationContext;
import org.jboss.tools.common.validation.IValidatingProjectSet;
import org.jboss.tools.common.validation.IValidatingProjectTree;
import org.jboss.tools.common.validation.IValidator;
+import org.jboss.tools.common.validation.PreferenceInfoManager;
import org.jboss.tools.common.validation.ValidationUtil;
import org.jboss.tools.common.validation.ValidatorManager;
import org.jboss.tools.common.validation.internal.SimpleValidatingProjectTree;
@@ -1114,4 +1116,30 @@
return marker;
}
+ @Override
+ protected void registerPreferenceInfo() {
+ if(PreferenceInfoManager.getPreferenceInfo(PROBLEM_TYPE) == null){
+ PreferenceInfoManager.register(PROBLEM_TYPE, new SeamPreferenceInfo());
+ }
+ }
+
+ class SeamPreferenceInfo implements IPreferenceInfo{
+
+ @Override
+ public String getPreferencePageId() {
+ return PREFERENCE_PAGE_ID;
+ }
+
+ @Override
+ public String getPropertyPageId() {
+ return PROPERTY_PAGE_ID;
+ }
+
+ @Override
+ public String getPluginId() {
+ return SeamCorePlugin.PLUGIN_ID;
+ }
+
+ }
+
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamProjectPropertyValidator.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamProjectPropertyValidator.java 2012-09-25 20:39:44 UTC (rev 44019)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamProjectPropertyValidator.java 2012-09-26 01:05:22 UTC (rev 44020)
@@ -118,6 +118,12 @@
public String getMarkerType() {
return ValidationErrorManager.DEFAULT_VALIDATION_MARKER;
}
+
+ @Override
+ protected void registerPreferenceInfo() {
+ // TODO Auto-generated method stub
+
+ }
};
errorManager.init(project, null, null, this, reporter);
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidationErrorManager.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidationErrorManager.java 2012-09-25 20:39:44 UTC (rev 44019)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidationErrorManager.java 2012-09-26 01:05:22 UTC (rev 44020)
@@ -21,6 +21,8 @@
public static final String MARKED_SEAM_PROJECT_MESSAGE_GROUP = "markedSeamProject"; //$NON-NLS-1$
public static final String PREFERENCE_PAGE_ID = "org.jboss.tools.seam.ui.preferences.SeamValidatorPreferencePage"; //$NON-NLS-1$
+ public static final String PROPERTY_PAGE_ID = "org.jboss.tools.seam.ui.propertyPages.SeamValidatorPreferencePage"; //$NON-NLS-1$
+
/* (non-Javadoc)
* @see org.jboss.tools.jst.web.kb.internal.validation.ValidationErrorManager#getPreference(org.eclipse.core.resources.IProject, java.lang.String)
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/validation/SeamProjectPropertyValidatorWrapper.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/validation/SeamProjectPropertyValidatorWrapper.java 2012-09-25 20:39:44 UTC (rev 44019)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/validation/SeamProjectPropertyValidatorWrapper.java 2012-09-26 01:05:22 UTC (rev 44020)
@@ -95,6 +95,12 @@
public String getMarkerType() {
return ValidationErrorManager.DEFAULT_VALIDATION_MARKER;
}
+
+ @Override
+ protected void registerPreferenceInfo() {
+ // TODO Auto-generated method stub
+
+ }
};
//errorManager.init(project, null, this, reporter);
Modified: trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/validation/StrutsCoreValidator.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/validation/StrutsCoreValidator.java 2012-09-25 20:39:44 UTC (rev 44019)
+++ trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/validation/StrutsCoreValidator.java 2012-09-26 01:05:22 UTC (rev 44020)
@@ -29,10 +29,12 @@
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.common.validation.ContextValidationHelper;
+import org.jboss.tools.common.validation.IPreferenceInfo;
import org.jboss.tools.common.validation.IProjectValidationContext;
import org.jboss.tools.common.validation.IValidatingProjectSet;
import org.jboss.tools.common.validation.IValidatingProjectTree;
import org.jboss.tools.common.validation.IValidator;
+import org.jboss.tools.common.validation.PreferenceInfoManager;
import org.jboss.tools.common.validation.ValidationErrorManager;
import org.jboss.tools.common.validation.ValidatorManager;
import org.jboss.tools.common.validation.internal.ProjectValidationContext;
@@ -53,6 +55,7 @@
public static final String ID = "org.jboss.tools.struts.validation.StrutsCoreValidator"; //$NON-NLS-1$
public static final String PROBLEM_TYPE = "org.jboss.tools.struts.strutsproblem"; //$NON-NLS-1$
public static final String PREFERENCE_PAGE_ID = "org.jboss.tools.struts.ui.StrutsValidatorPreferencePage"; //$NON-NLS-1$
+ public static final String PROPERTY_PAGE_ID = "org.jboss.tools.struts.ui.propertyPages.StrutsValidatorPreferencePage"; //$NON-NLS-1$
public static String SHORT_ID = "verification"; //$NON-NLS-1$
@@ -275,4 +278,27 @@
return PREFERENCE_PAGE_ID;
}
+ @Override
+ protected void registerPreferenceInfo() {
+ if(PreferenceInfoManager.getPreferenceInfo(PROBLEM_TYPE) == null){
+ PreferenceInfoManager.register(PROBLEM_TYPE, new StrutsPreferenceInfo());
+ }
+ }
+
+ class StrutsPreferenceInfo implements IPreferenceInfo{
+
+ public String getPreferencePageId() {
+ return PREFERENCE_PAGE_ID;
+ }
+
+ public String getPropertyPageId() {
+ return PROPERTY_PAGE_ID;
+ }
+
+ public String getPluginId() {
+ return StrutsModelPlugin.PLUGIN_ID;
+ }
+
+ }
+
}
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsMetamodelValidator.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsMetamodelValidator.java 2012-09-25 20:39:44 UTC (rev 44019)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsMetamodelValidator.java 2012-09-26 01:05:22 UTC (rev 44020)
@@ -295,4 +295,10 @@
return new SimpleValidatingProjectTree(project);
}
+ @Override
+ protected void registerPreferenceInfo() {
+ // TODO Auto-generated method stub
+
+ }
+
}
12 years, 3 months
JBoss Tools SVN: r44019 - trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2012-09-25 16:39:44 -0400 (Tue, 25 Sep 2012)
New Revision: 44019
Modified:
trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/ValidationErrorManager.java
Log:
https://issues.jboss.org/browse/JBIDE-12595 Disabling JAX-RS validator doesn't affect resources validation
Modified: trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/ValidationErrorManager.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/ValidationErrorManager.java 2012-09-25 18:38:24 UTC (rev 44018)
+++ trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/ValidationErrorManager.java 2012-09-25 20:39:44 UTC (rev 44019)
@@ -29,6 +29,7 @@
import org.eclipse.jface.text.IDocument;
import org.eclipse.osgi.util.NLS;
import org.eclipse.ui.editors.text.TextFileDocumentProvider;
+import org.eclipse.wst.validation.internal.MarkerManager;
import org.eclipse.wst.validation.internal.operations.WorkbenchReporter;
import org.eclipse.wst.validation.internal.plugin.ValidationPlugin;
import org.eclipse.wst.validation.internal.provisional.core.IMessage;
@@ -494,6 +495,7 @@
CommonPlugin.getDefault().logError("Wrong offset [" + offset + "] of the problem marker [" + MessageFormat.format(message, messageArguments) + "] for resource: " + target.getFullPath().toOSString(), e); //$NON-NLS-1$ //$NON-NLS-2$//$NON-NLS-3$
}
}
+ MarkerManager.getDefault().getMarkers().add(getMarkerType()); // We need to register the marker type in WST since this type is not equaled to ValidatorManager's type. WST need this type to remove markers when the validator is disabled. See https://issues.jboss.org/browse/JBIDE-12595
return addError(message, severity, messageArguments, lineNumber, length, offset, target, documentProvider, markerId, markerOwner, getMaxNumberOfMarkersPerFile(target.getProject()), getMarkerType());
}
12 years, 3 months
JBoss Tools SVN: r44018 - trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/preferences.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2012-09-25 14:38:24 -0400 (Tue, 25 Sep 2012)
New Revision: 44018
Modified:
trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/preferences/RuntimePreferencePage.java
Log:
JBIDE-12716 - Remove button does not work properly
Modified: trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/preferences/RuntimePreferencePage.java
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/preferences/RuntimePreferencePage.java 2012-09-25 18:36:56 UTC (rev 44017)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/preferences/RuntimePreferencePage.java 2012-09-25 18:38:24 UTC (rev 44018)
@@ -419,6 +419,7 @@
newRuntimePaths[i++] = path;
}
runtimePaths = newRuntimePaths;
+ runtimePathViewer.setInput(runtimePaths);
configureSearch();
runtimePathViewer.refresh();
}
12 years, 3 months