JBoss Tools SVN: r40792 - 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-05-04 10:10:26 -0400 (Fri, 04 May 2012)
New Revision: 40792
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JMXProvider.java
Log:
JBIDE-11740
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-05-04 13:02:15 UTC (rev 40791)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JMXProvider.java 2012-05-04 14:10:26 UTC (rev 40792)
@@ -38,6 +38,7 @@
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.ui.internal.view.servers.AbstractServerAction;
import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
+import org.jboss.ide.eclipse.as.core.server.internal.extendedproperties.ServerExtendedProperties;
import org.jboss.ide.eclipse.as.core.util.ServerUtil;
import org.jboss.ide.eclipse.as.ui.JBossServerUISharedImages;
import org.jboss.ide.eclipse.as.ui.UIUtil;
@@ -86,9 +87,14 @@
if( quick != null && selection != null && selection.toArray().length == 1 ) {
if( selection.getFirstElement() instanceof IServer ) {
IServer server = (IServer)selection.getFirstElement();
- if( ServerUtil.isJBossServerType(server.getServerType()) && !ServerUtil.isJBoss7(server)) {
- if( menu instanceof MenuManager ) {
- ((MenuManager)quick).add(showInJMXViewAction);
+
+ ServerExtendedProperties properties = (ServerExtendedProperties) server.loadAdapter(ServerExtendedProperties.class, null);
+ if( properties != null ) {
+ int i = properties.getJMXProviderType();
+ if( i != ServerExtendedProperties.JMX_NULL_PROVIDER ) {
+ if( menu instanceof MenuManager ) {
+ ((MenuManager)quick).add(showInJMXViewAction);
+ }
}
}
}
12 years, 8 months
JBoss Tools SVN: r40791 - trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-05-04 09:02:15 -0400 (Fri, 04 May 2012)
New Revision: 40791
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/DeploymentModuleOptionCompositeAssistant.java
Log:
JBIDE-11664 trunk
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/DeploymentModuleOptionCompositeAssistant.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/DeploymentModuleOptionCompositeAssistant.java 2012-05-04 12:33:29 UTC (rev 40790)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/DeploymentModuleOptionCompositeAssistant.java 2012-05-04 13:02:15 UTC (rev 40791)
@@ -774,7 +774,8 @@
ModifyListener ml =new ModifyListener() {
public void modifyText(ModifyEvent e) {
- viewer.setInput("");
+ resetFilterTextState();
+ viewer.setInput(""); //$NON-NLS-1$
}
};
filterCombo.addModifyListener(ml);
@@ -783,6 +784,13 @@
return root;
}
+ public void resetFilterTextState() {
+ int ind = filterCombo.getSelectionIndex();
+ boolean enabled = ind != -1 &&
+ filterCombo.getItem(ind).equals(BY_MODNAME);
+ filterText.setEnabled(enabled);
+ }
+
private void refreshViewer() {
page.refreshPossibleModules();
viewer.setInput(""); //$NON-NLS-1$
12 years, 8 months
JBoss Tools SVN: r40790 - trunk/as/plugins/org.jboss.ide.eclipse.as.core.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-05-04 08:33:29 -0400 (Fri, 04 May 2012)
New Revision: 40790
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml
Log:
JBIDE-11542 to trunk
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml 2012-05-04 12:17:57 UTC (rev 40789)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml 2012-05-04 12:33:29 UTC (rev 40790)
@@ -511,7 +511,7 @@
id="org.jboss.ide.eclipse.as.core.server.stopLaunchConfiguration"
modes="run"
name="Stop Server"
- public="true">
+ public="false">
</launchConfigurationType>
<launchConfigurationType
category="JBoss"
12 years, 8 months
JBoss Tools SVN: r40789 - in trunk/as/plugins: org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-05-04 08:17:57 -0400 (Fri, 04 May 2012)
New Revision: 40789
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IModuleArtifact2.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/EarArtifactAdapter.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IServerModuleStateVerifier.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBoss6ModuleStateVerifier.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossLT6ModuleStateVerifier.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossLaunchAdapter.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/DelegatingJBoss7ServerBehavior.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ModuleStateVerifier.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7DeploymentScannerAdditions.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/launch/JBTWebLaunchableClient.java
Log:
JBIDE-11514 - moved the discovering of the module tree up into the artifact, rather than at the verifier level.
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/EarArtifactAdapter.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/EarArtifactAdapter.java 2012-05-04 11:50:06 UTC (rev 40788)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/EarArtifactAdapter.java 2012-05-04 12:17:57 UTC (rev 40789)
@@ -15,9 +15,11 @@
import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants;
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IModuleArtifact;
+import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.ServerUtil;
import org.eclipse.wst.server.core.model.ModuleArtifactAdapterDelegate;
import org.eclipse.wst.server.core.model.ModuleDelegate;
+import org.jboss.ide.eclipse.as.core.server.IModuleArtifact2;
public class EarArtifactAdapter extends ModuleArtifactAdapterDelegate {
@@ -53,18 +55,21 @@
return null;
}
- public static class EarModuleArtifact implements IModuleArtifact {
+ public static class EarModuleArtifact implements IModuleArtifact2 {
private IModule earModule;
- private IModuleArtifact webArtifact;
- public EarModuleArtifact(IModule ear, IModuleArtifact web) {
+ private IModuleArtifact childArtifact;
+ public EarModuleArtifact(IModule ear, IModuleArtifact child) {
this.earModule = ear;
- this.webArtifact = web;
+ this.childArtifact = child;
}
public IModule getModule() {
return earModule;
}
- public IModuleArtifact getWebArtifact() {
- return webArtifact;
+ public IModuleArtifact getChildArtifact() {
+ return childArtifact;
}
+ public IModule[] getModuleTree(IServer server) {
+ return new IModule[]{earModule, childArtifact.getModule()};
+ }
}
}
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IModuleArtifact2.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IModuleArtifact2.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IModuleArtifact2.java 2012-05-04 12:17:57 UTC (rev 40789)
@@ -0,0 +1,21 @@
+/*******************************************************************************
+ * 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.ide.eclipse.as.core.server;
+
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IModuleArtifact;
+import org.eclipse.wst.server.core.IServer;
+
+public interface IModuleArtifact2 extends IModuleArtifact {
+ public IModule getModule();
+ public IModule[] getModuleTree(IServer server);
+ public IModuleArtifact getChildArtifact();
+}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IServerModuleStateVerifier.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IServerModuleStateVerifier.java 2012-05-04 11:50:06 UTC (rev 40788)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IServerModuleStateVerifier.java 2012-05-04 12:17:57 UTC (rev 40789)
@@ -23,17 +23,17 @@
/**
* Check to see if the module is started on the server
*/
- public boolean isModuleStarted(IServer server, IModule module, IProgressMonitor monitor);
+ public boolean isModuleStarted(IServer server, IModule module[], IProgressMonitor monitor);
/**
* Wait until the module is started on the server
*/
- public void waitModuleStarted(IServer server, IModule module, IProgressMonitor monitor);
+ public void waitModuleStarted(IServer server, IModule module[], IProgressMonitor monitor);
/**
* Wait until the module is started on the server with a max delay as provided
*/
- public void waitModuleStarted(IServer server, IModule module, int maxDelay);
+ public void waitModuleStarted(IServer server, IModule module[], int maxDelay);
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBoss6ModuleStateVerifier.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBoss6ModuleStateVerifier.java 2012-05-04 11:50:06 UTC (rev 40788)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBoss6ModuleStateVerifier.java 2012-05-04 12:17:57 UTC (rev 40789)
@@ -18,13 +18,16 @@
public class JBoss6ModuleStateVerifier extends JBossLT6ModuleStateVerifier implements IServerModuleStateVerifier {
- protected boolean checkNestedWebModuleStarted(IServer server, IModule module, MBeanServerConnection connection) throws Exception {
+ @Override
+ protected boolean checkNestedWebModuleStarted(IServer server, IModule module[], MBeanServerConnection connection) throws Exception {
boolean val = checkStandaloneWebModuleStarted(server, module, connection);
return val;
}
- protected boolean checkStandaloneWebModuleStarted(IServer server, IModule module, MBeanServerConnection connection) throws Exception {
- String mbeanName = "jboss.web:J2EEApplication=none,J2EEServer=none,j2eeType=WebModule,name=//localhost/" + module.getName(); //$NON-NLS-1$
+ @Override
+ protected boolean checkStandaloneWebModuleStarted(IServer server, IModule[] module, MBeanServerConnection connection) throws Exception {
+ String name =module[module.length-1].getName();
+ String mbeanName = "jboss.web:J2EEApplication=none,J2EEServer=none,j2eeType=WebModule,name=//localhost/" + name; //$NON-NLS-1$
String stateAttribute = "state"; //$NON-NLS-1$
Object result = getAttributeResult(connection, mbeanName, stateAttribute);
if(result == null || !(result instanceof Integer) || ((Integer)result).intValue() != 1 ) {
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossLT6ModuleStateVerifier.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossLT6ModuleStateVerifier.java 2012-05-04 11:50:06 UTC (rev 40788)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossLT6ModuleStateVerifier.java 2012-05-04 12:17:57 UTC (rev 40789)
@@ -10,9 +10,6 @@
******************************************************************************/
package org.jboss.ide.eclipse.as.core.server.internal;
-import java.util.ArrayList;
-import java.util.Arrays;
-
import javax.management.InstanceNotFoundException;
import javax.management.MBeanServerConnection;
import javax.management.ObjectName;
@@ -36,7 +33,7 @@
public JBossLT6ModuleStateVerifier() {
// Nothing
}
- public boolean isModuleStarted(final IServer server, final IModule module,
+ public boolean isModuleStarted(final IServer server, final IModule[] module,
final IProgressMonitor monitor) {
final boolean[] result = new boolean[1];
result[0] = false;
@@ -56,7 +53,7 @@
return result[0];
}
- public void waitModuleStarted(IServer server, IModule module, int maxDelay) {
+ public void waitModuleStarted(IServer server, IModule[] module, int maxDelay) {
final NullProgressMonitor monitor = new NullProgressMonitor();
Thread t = new Thread(){
public void run() {
@@ -81,12 +78,12 @@
t.interrupt();
}
}
- public void waitModuleStarted(IServer server, IModule module,
+ public void waitModuleStarted(IServer server, IModule[] module,
IProgressMonitor monitor) {
waitJMX(server, module);
}
- protected void waitJMX(final IServer server, final IModule module) {
+ protected void waitJMX(final IServer server, final IModule[] module) {
IServerJMXRunnable r = new IServerJMXRunnable() {
public void run(MBeanServerConnection connection) throws Exception {
jmxWaitForDeploymentStarted(server, module, connection, null);
@@ -102,7 +99,7 @@
}
}
- protected void jmxWaitForDeploymentStarted(final IServer server, final IModule module,
+ protected void jmxWaitForDeploymentStarted(final IServer server, final IModule[] module,
final MBeanServerConnection connection, IProgressMonitor monitor) throws Exception {
monitor = monitor == null ? new NullProgressMonitor() : monitor;
monitor.beginTask("Ensuring Deployments are Loaded", 10000); //$NON-NLS-1$
@@ -120,26 +117,26 @@
}
}
- protected boolean checkDeploymentStarted(final IServer server, final IModule module,
+ protected boolean checkDeploymentStarted(final IServer server, final IModule[] module,
final MBeanServerConnection connection, IProgressMonitor monitor) throws Exception {
- String typeId = module.getModuleType().getId();
+ String typeId = module[module.length-1].getModuleType().getId();
if( typeId.equals("wst.web") || typeId.equals("jst.web")) { //$NON-NLS-1$ //$NON-NLS-2$
return checkWebModuleStarted(server, module, connection);
}
return true;
}
- protected boolean checkWebModuleStarted(IServer server, IModule module, MBeanServerConnection connection) throws Exception {
- IModule earParent = findEarParent(server, module);
- if( earParent == null ) {
- return checkStandaloneWebModuleStarted(server, module, connection);
- } else {
+ protected boolean checkWebModuleStarted(IServer server, IModule[] module, MBeanServerConnection connection) throws Exception {
+ if( module.length > 1) {
return checkNestedWebModuleStarted(server, module, connection);
+ } else {
+ return checkStandaloneWebModuleStarted(server, module, connection);
}
}
- protected boolean checkNestedWebModuleStarted(IServer server, IModule module, MBeanServerConnection connection) throws Exception {
- String mbeanName = "jboss.deployment:id=\"jboss.web.deployment:war=/" + module.getName() + "\",type=Component"; //$NON-NLS-1$//$NON-NLS-2$
+ protected boolean checkNestedWebModuleStarted(IServer server, IModule[] module, MBeanServerConnection connection) throws Exception {
+ String n = module[module.length-1].getName();
+ String mbeanName = "jboss.deployment:id=\"jboss.web.deployment:war=/" + n + "\",type=Component"; //$NON-NLS-1$//$NON-NLS-2$
String stateAttribute = "State"; //$NON-NLS-1$
Object result = getAttributeResult(connection, mbeanName, stateAttribute);
if( result == null || !result.toString().equals("DEPLOYED")) //$NON-NLS-1$
@@ -147,8 +144,9 @@
return true;
}
- protected boolean checkStandaloneWebModuleStarted(IServer server, IModule module, MBeanServerConnection connection) throws Exception {
- String mbeanName = "jboss.web:J2EEApplication=none,J2EEServer=none,j2eeType=WebModule,name=//localhost/" + module.getName(); //$NON-NLS-1$
+ protected boolean checkStandaloneWebModuleStarted(IServer server, IModule[] module, MBeanServerConnection connection) throws Exception {
+ String n = module[module.length-1].getName();
+ String mbeanName = "jboss.web:J2EEApplication=none,J2EEServer=none,j2eeType=WebModule,name=//localhost/" + n; //$NON-NLS-1$
String stateAttribute = "state"; //$NON-NLS-1$
Object result = getAttributeResult(connection, mbeanName, stateAttribute);
if(result == null || !(result instanceof Integer) || ((Integer)result).intValue() != 1 ) {
@@ -165,21 +163,4 @@
return false;
}
}
-
- /* TODO Unify findEarParent with findRootModule */
- protected IModule findEarParent(IServer server, IModule module) {
- try {
- IModule[] deployed = server.getModules();
- ArrayList<IModule> deployedAsList = new ArrayList<IModule>();
- deployedAsList.addAll(Arrays.asList(deployed));
- IModule[] possibleParents = server.getRootModules(module, new NullProgressMonitor());
- for( int i = 0; i < possibleParents.length; i++ ) {
- if( possibleParents[i].getModuleType().getId().equals("jst.ear") && deployedAsList.contains(possibleParents[i])) //$NON-NLS-1$
- return possibleParents[i];
- }
- } catch(CoreException ce) {
- // Should never be reached
- }
- return null;
- }
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossLaunchAdapter.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossLaunchAdapter.java 2012-05-04 11:50:06 UTC (rev 40788)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossLaunchAdapter.java 2012-05-04 12:17:57 UTC (rev 40789)
@@ -20,7 +20,6 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
-import org.eclipse.jst.j2ee.project.WebUtilities;
import org.eclipse.jst.server.core.EJBBean;
import org.eclipse.jst.server.core.JndiLaunchable;
import org.eclipse.jst.server.core.JndiObject;
@@ -35,8 +34,8 @@
import org.eclipse.wst.server.core.model.LaunchableAdapterDelegate;
import org.eclipse.wst.server.core.model.ServerDelegate;
import org.eclipse.wst.server.core.util.WebResource;
-import org.jboss.ide.eclipse.as.core.modules.EarArtifactAdapter.EarModuleArtifact;
import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
+import org.jboss.ide.eclipse.as.core.server.IModuleArtifact2;
import org.jboss.ide.eclipse.as.core.server.IMultiModuleURLProvider;
import org.jboss.ide.eclipse.as.core.util.IJBossRuntimeConstants;
import org.jboss.ide.eclipse.as.core.util.IJBossRuntimeResourceConstants;
@@ -63,17 +62,16 @@
public Object getLaunchable(IServer server, IModuleArtifact moduleObject) {
if (server != null) {
ServerDelegate delegate = (ServerDelegate)server.loadAdapter(ServerDelegate.class,null);
- if( moduleObject instanceof EarModuleArtifact ) {
- EarModuleArtifact earArt = ((EarModuleArtifact)moduleObject);
- IModuleArtifact webArtifact = earArt.getWebArtifact();
+ if( moduleObject instanceof IModuleArtifact2 ) {
+ IModuleArtifact2 rootArt = ((IModuleArtifact2)moduleObject);
+ IModuleArtifact childArt = rootArt.getChildArtifact();
+ IModule[] tree = rootArt.getModuleTree(server);
if( delegate instanceof IMultiModuleURLProvider) {
- URL root = ((IMultiModuleURLProvider)delegate).getModuleRootURL(new IModule[]{
- earArt.getModule(), webArtifact.getModule()
- });
- return prepareHttpLaunchable(moduleObject, delegate, server, root);
+ URL root = ((IMultiModuleURLProvider)delegate).getModuleRootURL(tree);
+ return prepareHttpLaunchable(rootArt, delegate, server, root);
} else {
// Cannot calculate root url from application.xml for this server type.
- moduleObject = webArtifact;
+ moduleObject = childArt;
}
}
if ((moduleObject instanceof Servlet) ||(moduleObject instanceof WebResource)) {
@@ -214,5 +212,13 @@
public IModule getModule() {
return artifact.getModule();
}
+ public IModuleArtifact getArtifact() {
+ return artifact;
+ }
+ public IModule[] getModuleTree(IServer server) {
+ return artifact instanceof IModuleArtifact2 ?
+ ((IModuleArtifact2)artifact).getModuleTree(server) :
+ new IModule[]{getModule()};
+ }
}
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/DelegatingJBoss7ServerBehavior.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/DelegatingJBoss7ServerBehavior.java 2012-05-04 11:50:06 UTC (rev 40788)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/DelegatingJBoss7ServerBehavior.java 2012-05-04 12:17:57 UTC (rev 40789)
@@ -25,7 +25,6 @@
import org.eclipse.debug.core.DebugEvent;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.IDebugEventSetListener;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.core.model.IProcess;
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IServer;
@@ -41,7 +40,6 @@
import org.jboss.ide.eclipse.as.core.server.internal.DelegatingServerBehavior;
import org.jboss.ide.eclipse.as.core.server.internal.PollThread;
import org.jboss.ide.eclipse.as.core.server.internal.extendedproperties.ServerExtendedProperties;
-import org.jboss.ide.eclipse.as.core.server.internal.launch.DelegatingStartLaunchConfiguration;
import org.jboss.ide.eclipse.as.core.util.LaunchCommandPreferences;
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
@@ -129,7 +127,7 @@
if( props != null && props.canVerifyRemoteModuleState()) {
IServerModuleStateVerifier verifier = props.getModuleStateVerifier();
if( verifier != null ) {
- verifier.waitModuleStarted(getServer(), module[module.length-1], 20000);
+ verifier.waitModuleStarted(getServer(), module, 20000);
}
}
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ModuleStateVerifier.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ModuleStateVerifier.java 2012-05-04 11:50:06 UTC (rev 40788)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ModuleStateVerifier.java 2012-05-04 12:17:57 UTC (rev 40789)
@@ -11,10 +11,6 @@
******************************************************************************/
package org.jboss.ide.eclipse.as.core.server.internal.v7;
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
@@ -34,7 +30,7 @@
import org.jboss.ide.eclipse.as.management.core.JBoss7ManagerUtil;
public class JBoss7ModuleStateVerifier implements IServerModuleStateVerifier {
- public void waitModuleStarted(IServer server, IModule module, int maxDelay) {
+ public void waitModuleStarted(IServer server, IModule[] module, int maxDelay) {
final NullProgressMonitor monitor = new NullProgressMonitor();
Thread t = new Thread(){
public void run() {
@@ -60,16 +56,15 @@
}
}
- public boolean isModuleStarted(IServer server, IModule module,
+ public boolean isModuleStarted(IServer server, IModule[] module,
IProgressMonitor monitor) {
- IModule rootModule = findRootModule(server, module);
try {
- return isRootModuleStarted(server, rootModule, monitor);
+ return isRootModuleStarted(server, module[0], monitor);
} catch(Exception e ) {
String er = "Error occurred while checking module state for {0} on server {1}"; //$NON-NLS-1$
IStatus s = new Status(
IStatus.WARNING, JBossServerCorePlugin.PLUGIN_ID,
- NLS.bind(er, rootModule.getName(), server.getName()), e);
+ NLS.bind(er, module[0].getName(), server.getName()), e);
ServerLogger.getDefault().log(server, s);
return false;
}
@@ -95,23 +90,22 @@
}
- public void waitModuleStarted(IServer server, IModule module, IProgressMonitor monitor) {
- IModule rootModule = findRootModule(server, module);
+ public void waitModuleStarted(IServer server, IModule[] module, IProgressMonitor monitor) {
try {
JBoss7Server jbossServer = ServerConverter.checkedGetJBossServer(server, JBoss7Server.class);
IJBoss7ManagerService service = JBoss7ManagerUtil.getService(server);
- IPath deployPath = PublishUtil.getDeployPath(new IModule[]{rootModule}, jbossServer);
+ IPath deployPath = PublishUtil.getDeployPath(new IModule[]{module[0]}, jbossServer);
boolean waitedOnce = false;
while (!monitor.isCanceled()) {
- boolean done = isRootModuleStarted(server, rootModule, service, deployPath, monitor);
+ boolean done = isRootModuleStarted(server, module[0], service, deployPath, monitor);
if (done) {
return;
}
if(!waitedOnce) {
String info = "Module {0} on {1} not yet fully deployed. Waiting..."; //$NON-NLS-1$
IStatus s = new Status( IStatus.INFO, JBossServerCorePlugin.PLUGIN_ID,
- NLS.bind(info, rootModule.getName(), server.getName()),null);
+ NLS.bind(info, module[0].getName(), server.getName()),null);
ServerLogger.getDefault().log(server, s);
}
waitedOnce = true;
@@ -125,33 +119,14 @@
String warning = "Module {0} on {1} still not ready to be shown in browser. Aborting delay."; //$NON-NLS-1$
IStatus s = new Status(
IStatus.WARNING, JBossServerCorePlugin.PLUGIN_ID,
- NLS.bind(warning, rootModule.getName(), server.getName()), null);
+ NLS.bind(warning, module[0].getName(), server.getName()), null);
ServerLogger.getDefault().log(server, s);
} catch (Exception e) {
String er = "Error occurred while waiting for {0} to start on server {1}"; //$NON-NLS-1$
IStatus s = new Status(
IStatus.WARNING, JBossServerCorePlugin.PLUGIN_ID,
- NLS.bind(er, rootModule.getName(), server.getName()), e);
+ NLS.bind(er, module[0].getName(), server.getName()), e);
ServerLogger.getDefault().log(server, s);
}
}
-
- private IModule findRootModule(IServer server, IModule module) {
- IModule[] rootMods = null;
- try {
- rootMods = server.getRootModules(module, new NullProgressMonitor());
- } catch( CoreException ce ) {
- return module; // No need to log this
- }
- if( rootMods == null || rootMods.length == 0 )
- return module;
- List<IModule> serverHas = Arrays.asList(server.getModules());
- for( int i = 0; i < rootMods.length; i++ ) {
- if( serverHas.contains(rootMods[i]))
- // Grab the first parent module that's already on the server
- return rootMods[i];
- }
- return module;
- }
-
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7DeploymentScannerAdditions.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7DeploymentScannerAdditions.java 2012-05-04 11:50:06 UTC (rev 40788)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7DeploymentScannerAdditions.java 2012-05-04 12:17:57 UTC (rev 40789)
@@ -15,7 +15,10 @@
import java.util.Iterator;
import java.util.Map;
+import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.ServerEvent;
@@ -116,9 +119,14 @@
return AS7DeploymentScannerUtility.SCANNER_PREFIX + i;
}
- public void serverChanged(ServerEvent event) {
+ public void serverChanged(final ServerEvent event) {
if( accepts(event.getServer()) && serverSwitchesToState(event, IServer.STATE_STARTED)){
- modifyDeploymentScanners(event);
+ new Job("Update AS7 Deployment Scanners") { //$NON-NLS-1$
+ protected IStatus run(IProgressMonitor monitor) {
+ modifyDeploymentScanners(event);
+ return Status.OK_STATUS;
+ }
+ }.schedule();
}
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/launch/JBTWebLaunchableClient.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/launch/JBTWebLaunchableClient.java 2012-05-04 11:50:06 UTC (rev 40788)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/launch/JBTWebLaunchableClient.java 2012-05-04 12:17:57 UTC (rev 40789)
@@ -57,7 +57,7 @@
public IStatus launch2(IServer server, Object launchable, String launchMode, ILaunch launch) {
final JBTCustomHttpLaunchable http = (JBTCustomHttpLaunchable) launchable;
- wait(server, http.getModule());
+ wait(server, http.getModuleTree(server));
if(server.getServerState() == server.STATE_STARTED) {
Display.getDefault().asyncExec(new Runnable(){
@@ -73,7 +73,7 @@
return null;
}
- protected void wait(final IServer server, final IModule module) {
+ protected void wait(final IServer server, final IModule[] module) {
// Wait for the server to be started. No remote polling necessary.
// Framework poller is handling that. Here just wait in the state event framework
waitServerStarted(server);
12 years, 8 months
JBoss Tools SVN: r40788 - in trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor: preferences and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: vpakan(a)redhat.com
Date: 2012-05-04 07:50:06 -0400 (Fri, 04 May 2012)
New Revision: 40788
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/XhtmlFilePerformanceTest.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/PreferencesTestCase.java
Log:
Fixes for 3.3.0.Beta3
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/XhtmlFilePerformanceTest.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/XhtmlFilePerformanceTest.java 2012-05-04 11:30:47 UTC (rev 40787)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/XhtmlFilePerformanceTest.java 2012-05-04 11:50:06 UTC (rev 40788)
@@ -57,7 +57,11 @@
final SWTBotEclipseEditor xhtmlTextEditor = bot.editorByTitle(XhtmlFilePerformanceTest.TEST_PAGE_NAME).toTextEditor();
String insertText = "!!!123 Test Title Inserted 321!!!";
String origText = xhtmlTextEditor.getText();
- xhtmlTextEditor.insertText(9, 5, "<h1>" + insertText + "<h1/>");
+ SWTJBTExt.selectTextInSourcePane(new SWTBotExt(),
+ XhtmlFilePerformanceTest.TEST_PAGE_NAME,
+ "<h1>",
+ 0, 0);
+ xhtmlTextEditor.insertText("<h1>" + insertText + "</h1>");
xhtmlTextEditor.save();
bot.sleep(Timing.time2S());
bot.toolbarButtonWithTooltip(SWTJBTExt.isRunningOnMacOs() ?
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/PreferencesTestCase.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/PreferencesTestCase.java 2012-05-04 11:30:47 UTC (rev 40787)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/preferences/PreferencesTestCase.java 2012-05-04 11:50:06 UTC (rev 40788)
@@ -17,7 +17,6 @@
import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotCheckBox;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotCombo;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotToolbarToggleButton;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
import org.jboss.tools.ui.bot.ext.SWTJBTExt;
import org.jboss.tools.ui.bot.ext.types.IDELabel;
@@ -26,7 +25,7 @@
public abstract class PreferencesTestCase extends VPEAutoTestCase{
- protected static final String TOGGLE_SELECTION_BAR_TOOLTIP = "Toggle Selection Bar (" + //$NON-NLS-1$
+ protected static final String TOGGLE_SELECTION_BAR_TOOLTIP = "Toggle selection tag bar (" + //$NON-NLS-1$
(SWTJBTExt.isRunningOnMacOs() ? "⌘6" : "Ctrl+6") + ")"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
protected static final String SHOW_NON_VISUAL_TAGS = "Show non-visual tags"; //$NON-NLS-1$
protected static final String SHOW_BORDER_FOR_UNKNOWN_TAGS = "Show border for unknown tags"; //$NON-NLS-1$
@@ -42,6 +41,7 @@
protected static final String I18N_BUTTON_TOOLTIP = "Externalize selected string... (" + //$NON-NLS-1$
(SWTJBTExt.isRunningOnMacOs() ? "⌘7" : "Ctrl+7") + ")"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
protected static final String SHOW_VISUAL_TOOLBAR_PREFS_CHECKBOX_NAME = "Show toolbar within the editor (otherwise in Eclipse's toolbar)"; //$NON-NLS-1$
+ protected static final String SHOW_SELECTION_TAG_BAR = "Show selection tag bar"; //$NON-NLS-1$
@Override
protected void closeUnuseDialogs() {
@@ -91,10 +91,6 @@
}
void setPreferencesToDefault(boolean fromEditor) throws WidgetNotFoundException{
- SWTBotToolbarToggleButton tbShowSelectionBar = bot.toolbarToggleButtonWithTooltip(TOGGLE_SELECTION_BAR_TOOLTIP);
- if (!tbShowSelectionBar.isChecked()){
- tbShowSelectionBar.click();
- }
if (fromEditor){
bot.toolbarButtonWithTooltip(PREF_TOOLTIP).click(); //$NON-NLS-1$
bot.shell(PREF_FILTER_SHELL_TITLE).activate(); //$NON-NLS-1$
@@ -108,10 +104,14 @@
.expandNode(IDELabel.PreferencesDialog.JBOSS_TOOLS_WEB_EDITORS) //$NON-NLS-1$
.expandNode(IDELabel.PreferencesDialog.JBOSS_TOOLS_WEB_EDITORS_VPE).select();
}
- SWTBotCheckBox checkBox = bot.checkBox(SHOW_BORDER_FOR_UNKNOWN_TAGS);
+ SWTBotCheckBox checkBox = bot.checkBox(SHOW_SELECTION_TAG_BAR);
if (!checkBox.isChecked()) {
checkBox.click();
}
+ checkBox = bot.checkBox(SHOW_BORDER_FOR_UNKNOWN_TAGS);
+ if (!checkBox.isChecked()) {
+ checkBox.click();
+ }
checkBox = bot.checkBox(SHOW_NON_VISUAL_TAGS);
if (checkBox.isChecked()) {
checkBox.click();
12 years, 8 months
JBoss Tools SVN: r40787 - in trunk/maven: plugins/org.jboss.tools.maven.seam/src/org/jboss/tools/maven/seam/configurators and 12 other directories.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2012-05-04 07:30:47 -0400 (Fri, 04 May 2012)
New Revision: 40787
Added:
trunk/maven/plugins/org.jboss.tools.maven.seam/src/org/jboss/tools/maven/seam/configurators/MavenSeamConstants.java
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/seam/missing-seam/
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/seam/missing-seam/pom.xml
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/seam/missing-seam/src/
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/seam/missing-seam/src/main/
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/seam/missing-seam/src/main/java/
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/seam/missing-seam/src/main/resources/
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/seam/missing-seam/src/main/webapp/
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/seam/missing-seam/src/test/
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/seam/missing-seam/src/test/java/
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/seam/missing-seam/src/test/resources/
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/seam/violation/
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/seam/violation/add-seam.pom
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/seam/violation/pom.xml
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/seam/violation/src/
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/seam/violation/src/main/
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/seam/violation/src/main/java/
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/seam/violation/src/main/resources/
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/seam/violation/src/main/webapp/
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/seam/violation/src/main/webapp/WEB-INF/
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/seam/violation/src/main/webapp/WEB-INF/faces-config.xml
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/seam/violation/src/test/
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/seam/violation/src/test/java/
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/seam/violation/src/test/resources/
Modified:
trunk/maven/plugins/org.jboss.tools.maven.seam/plugin.properties
trunk/maven/plugins/org.jboss.tools.maven.seam/plugin.xml
trunk/maven/plugins/org.jboss.tools.maven.seam/src/org/jboss/tools/maven/seam/configurators/SeamProjectConfigurator.java
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/src/org/jboss/tools/maven/configurators/tests/AbstractMavenConfiguratorTest.java
Log:
JBIDE-11570 : different fixes :
- do nothing if seam jar is not resolved
- apply the proper JSF Facet version, as per the Seam Facet version requirements (currently hardcoded to JSF 1.2)
- catch Constraint violation exceptions and turn them into error markers.
Modified: trunk/maven/plugins/org.jboss.tools.maven.seam/plugin.properties
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.seam/plugin.properties 2012-05-04 11:26:10 UTC (rev 40786)
+++ trunk/maven/plugins/org.jboss.tools.maven.seam/plugin.properties 2012-05-04 11:30:47 UTC (rev 40787)
@@ -2,4 +2,5 @@
Bundle-Vendor = JBoss by Red Hat
Bundle-Name = JBoss Maven Seam Configurator
Seam_Project_configurator = Seam
-Fix_classpath = Fixing classpath
\ No newline at end of file
+Fix_classpath = Fixing classpath
+Maven_Configuration_Problems=Maven Configuration Problems
\ No newline at end of file
Modified: trunk/maven/plugins/org.jboss.tools.maven.seam/plugin.xml
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.seam/plugin.xml 2012-05-04 11:26:10 UTC (rev 40786)
+++ trunk/maven/plugins/org.jboss.tools.maven.seam/plugin.xml 2012-05-04 11:30:47 UTC (rev 40787)
@@ -36,6 +36,21 @@
secondaryTo="org.eclipse.m2e.jdt.javaConfigurator"/>
</extension>
+ <extension
+ point="org.eclipse.ui.ide.markerSupport">
+ <markerTypeCategory
+ name="%Maven_Configuration_Problems">
+ <markerTypeReference
+ id="org.jbosstools.maven.configuration.seam">
+ </markerTypeReference>
+ </markerTypeCategory>
+ </extension>
-
+ <extension point="org.eclipse.core.resources.markers"
+ id="org.jbosstools.maven.configuration.seam"
+ name="%Maven_Configuration_Problem">
+ <super type="org.eclipse.m2e.core.maven2Problem.configuration"/>
+ <persistent value="true"/>
+ </extension>
+
</plugin>
Added: trunk/maven/plugins/org.jboss.tools.maven.seam/src/org/jboss/tools/maven/seam/configurators/MavenSeamConstants.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.seam/src/org/jboss/tools/maven/seam/configurators/MavenSeamConstants.java (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.seam/src/org/jboss/tools/maven/seam/configurators/MavenSeamConstants.java 2012-05-04 11:30:47 UTC (rev 40787)
@@ -0,0 +1,20 @@
+/*******************************************************************************
+ * 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.maven.seam.configurators;
+
+public class MavenSeamConstants {
+
+ public static final String SEAM_CONFIGURATION_ERROR_MARKER_ID = "org.jbosstools.maven.configuration.seam";
+ /**
+ * Private constructor to prevent instanciation.
+ */
+ private MavenSeamConstants() {};
+}
Modified: trunk/maven/plugins/org.jboss.tools.maven.seam/src/org/jboss/tools/maven/seam/configurators/SeamProjectConfigurator.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.seam/src/org/jboss/tools/maven/seam/configurators/SeamProjectConfigurator.java 2012-05-04 11:26:10 UTC (rev 40786)
+++ trunk/maven/plugins/org.jboss.tools.maven.seam/src/org/jboss/tools/maven/seam/configurators/SeamProjectConfigurator.java 2012-05-04 11:30:47 UTC (rev 40787)
@@ -19,11 +19,13 @@
import org.apache.maven.artifact.resolver.filter.ScopeArtifactFilter;
import org.apache.maven.project.MavenProject;
import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ProjectScope;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.core.runtime.preferences.IScopeContext;
@@ -35,7 +37,7 @@
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jst.j2ee.application.internal.operations.RemoveComponentFromEnterpriseApplicationOperation;
-import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities;
+import org.eclipse.jst.j2ee.project.EarUtilities;
import org.eclipse.jst.j2ee.project.JavaEEProjectUtilities;
import org.eclipse.jst.jsf.core.internal.project.facet.IJSFFacetInstallDataModelProperties;
import org.eclipse.m2e.core.internal.IMavenConstants;
@@ -83,15 +85,10 @@
private static final String JBOSS_SEAM_ARTIFACT_ID = "jboss-seam"; //$NON-NLS-1$
protected static final IProjectFacet dynamicWebFacet;
- protected static final IProjectFacetVersion dynamicWebVersion;
protected static final IProjectFacet javaFacet;
- protected static final IProjectFacetVersion javaVersion;
protected static final IProjectFacet jsfFacet;
- protected static final IProjectFacetVersion jsfVersion;
protected static final IProjectFacet earFacet;
- protected static final IProjectFacetVersion earVersion;
protected static final IProjectFacet ejbFacet;
- protected static final IProjectFacetVersion ejbVersion;
protected static final IProjectFacet m2Facet;
protected static final IProjectFacetVersion m2Version;
private static final IProjectFacet seamFacet;
@@ -103,17 +100,12 @@
static {
seamFacet = ProjectFacetsManager.getProjectFacet("jst.seam"); //$NON-NLS-1$
javaFacet = ProjectFacetsManager.getProjectFacet("jst.java"); //$NON-NLS-1$
- javaVersion = javaFacet.getVersion("5.0"); //$NON-NLS-1$
dynamicWebFacet = ProjectFacetsManager.getProjectFacet("jst.web"); //$NON-NLS-1$
- dynamicWebVersion = dynamicWebFacet.getVersion("2.5"); //$NON-NLS-1$
jsfFacet = ProjectFacetsManager.getProjectFacet("jst.jsf"); //$NON-NLS-1$
- jsfVersion = jsfFacet.getVersion("1.2"); //$NON-NLS-1$
earFacet = ProjectFacetsManager.getProjectFacet("jst.ear"); //$NON-NLS-1$
- earVersion = earFacet.getVersion("5.0"); //$NON-NLS-1$
m2Facet = ProjectFacetsManager.getProjectFacet("jboss.m2"); //$NON-NLS-1$
m2Version = m2Facet.getVersion("1.0"); //$NON-NLS-1$
ejbFacet = ProjectFacetsManager.getProjectFacet("jst.ejb"); //$NON-NLS-1$
- ejbVersion = ejbFacet.getVersion("3.0"); //$NON-NLS-1$
portletFacet = ProjectFacetsManager.getProjectFacet("jboss.portlet"); //$NON-NLS-1$
jsfportletFacet = ProjectFacetsManager.getProjectFacet("jboss.jsfportlet"); //$NON-NLS-1$
seamPortletFacet = ProjectFacetsManager.getProjectFacet("jboss.seamportlet"); //$NON-NLS-1$
@@ -150,10 +142,11 @@
if (rootSeamProject != null && isSeamSettingChangedByUser(rootSeamProject)) {
return;
}
+ clearMarkers(project);
String packaging = mavenProject.getPackaging();
String seamVersion = getSeamVersion(mavenProject);
if (seamVersion != null) {
- IProject[] earProjects = J2EEProjectUtilities.getReferencingEARProjects(project);
+ IProject[] earProjects = EarUtilities.getReferencingEARProjects(project);
String deploying = packaging;
if (earProjects.length > 0) {
deploying = "ear"; //$NON-NLS-1$
@@ -162,6 +155,7 @@
if (fproj == null) {
return;
}
+ IProjectFacetVersion seamFacetVersion = getSeamFacetVersion(seamVersion);
if ("war".equals(packaging)) { //$NON-NLS-1$
IDataModel model = createSeamDataModel(deploying, seamVersion, project);
//JBIDE-10785 : refresh parent to prevent
@@ -170,9 +164,9 @@
MavenUtil.refreshParent(mavenProject);
}
- installWarFacets(fproj, model, seamVersion, monitor);
+ installWarFacets(fproj, model, seamFacetVersion, monitor);
} else if ("ear".equals(packaging)) { //$NON-NLS-1$
- installEarFacets(fproj, monitor);
+ installEarFacets(fproj, seamFacetVersion, monitor);
installM2Facet(fproj, monitor);
IProject webProject = getReferencingSeamWebProject(project);
if (webProject != null) {
@@ -223,7 +217,7 @@
} else if ("ejb".equals(packaging)) { //$NON-NLS-1$
installM2Facet(fproj,monitor);
- installEjbFacets(fproj, monitor);
+ installEjbFacets(fproj, seamFacetVersion, monitor);
addSeamSupport(project, earProjects);
storeSettings(project);
@@ -284,34 +278,52 @@
return facetVersion;
}
- private void installEarFacets(IFacetedProject fproj,IProgressMonitor monitor) throws CoreException {
+ private void installEarFacets(IFacetedProject fproj, IProjectFacetVersion seamFv, IProgressMonitor monitor) throws CoreException {
if (!fproj.hasProjectFacet(earFacet)) {
- fproj.installProjectFacet(earVersion, null, monitor);
+ IProjectFacetVersion earVersion = findTargetFacetVersion(seamFv, earFacet);
+ fproj.installProjectFacet(earVersion , null, monitor);
}
}
- private void installEjbFacets(IFacetedProject fproj,IProgressMonitor monitor) throws CoreException {
+ private void installEjbFacets(IFacetedProject fproj, IProjectFacetVersion seamFv, IProgressMonitor monitor) throws CoreException {
if (!fproj.hasProjectFacet(javaFacet)) {
- fproj.installProjectFacet(javaVersion, null, monitor);
+ IProjectFacetVersion javaVersion = findTargetFacetVersion(seamFv, javaFacet);
+ fproj.installProjectFacet(javaVersion , null, monitor);
}
if (!fproj.hasProjectFacet(ejbFacet)) {
+ IProjectFacetVersion ejbVersion = findTargetFacetVersion(seamFv, ejbFacet);
fproj.installProjectFacet(ejbVersion, null, monitor);
}
}
- private void installWarFacets(IFacetedProject fproj,IDataModel model, String seamVersion,IProgressMonitor monitor) throws CoreException {
+ private void installWarFacets(IFacetedProject fproj,IDataModel model, IProjectFacetVersion seamFacetVersion, IProgressMonitor monitor) throws CoreException {
+ //Seam requires the JSF facet (!!!)
+ boolean hasConflicts = false;
+ for (IProjectFacetVersion fv : fproj.getProjectFacets()) {
+ if (seamFacetVersion.conflictsWith(fv)) {
+ addErrorMarker(fproj.getProject(), seamFacetVersion + " can not be installed as it conflicts with "+ fv);
+ hasConflicts = true;
+ }
+ }
+
+ if (hasConflicts) {
+ return;
+ }
+
if (!fproj.hasProjectFacet(javaFacet)) {
+ IProjectFacetVersion javaVersion = findTargetFacetVersion(seamFacetVersion, javaFacet);
fproj.installProjectFacet(javaVersion, null, monitor);
}
if (!fproj.hasProjectFacet(dynamicWebFacet)) {
+ IProjectFacetVersion dynamicWebVersion = findTargetFacetVersion(seamFacetVersion, dynamicWebFacet);
fproj.installProjectFacet(dynamicWebVersion, null, monitor);
}
- //Seam requires the JSF facet (!!!)
- installJSFFacet(fproj, monitor);
+ IProjectFacetVersion jsfVersion = findTargetFacetVersion(seamFacetVersion, jsfFacet);
+ installJSFFacet(fproj, jsfVersion, monitor);
installM2Facet(fproj, monitor);
+
if (!fproj.hasProjectFacet(seamFacet)) {
- IProjectFacetVersion seamFacetVersion = getSeamFacetVersion(seamVersion);
fproj.installProjectFacet(seamFacetVersion, model, monitor);
} else {
String deploying = model.getStringProperty(ISeamFacetDataModelProperties.JBOSS_AS_DEPLOY_AS);
@@ -341,6 +353,23 @@
}
}
+ private void clearMarkers(IProject project) throws CoreException {
+ markerManager.deleteMarkers(project, MavenSeamConstants.SEAM_CONFIGURATION_ERROR_MARKER_ID);
+ }
+
+ private IProjectFacetVersion findTargetFacetVersion(IProjectFacetVersion seamFv, IProjectFacet targetFacet) throws CoreException {
+ // Super simplified way to find the target Facet version :
+ // we take the first one that doesn't conflict with the target Seam Facet Version
+ if (seamFv != null) {
+ for (IProjectFacetVersion jsfFv : targetFacet.getSortedVersions(true)) {
+ if (!seamFv.conflictsWith(jsfFv)) {
+ return jsfFv;
+ }
+ }
+ }
+ return null;
+ }
+
private void setModelProperty(IDataModel model, IEclipsePreferences prefs, String property) {
String value = model.getStringProperty(property);
if (value != null && value.trim().length() > 0) {
@@ -348,10 +377,10 @@
}
}
- private void installJSFFacet(IFacetedProject fproj, IProgressMonitor monitor)
+ private void installJSFFacet(IFacetedProject fproj, IProjectFacetVersion jsfVersion, IProgressMonitor monitor)
throws CoreException {
- if (!fproj.hasProjectFacet(jsfFacet)) {
- IDataModel model = MavenJSFActivator.getDefault().createJSFDataModel(fproj,jsfVersion);
+ if (jsfFacet != null && !fproj.hasProjectFacet(jsfFacet)) {
+ IDataModel model = MavenJSFActivator.getDefault().createJSFDataModel(fproj,jsfVersion );
//Fix for JBIDE-9454, to prevent complete overwrite of web.xml
model.setBooleanProperty(IJSFFacetInstallDataModelProperties.CONFIGURE_SERVLET,false);
fproj.installProjectFacet(jsfVersion, model, monitor);
@@ -398,7 +427,25 @@
}
- private IProject getReferencingSeamWebProject(IProject earProject)
+ private IProject getReferencingSeamWebProject(IProject earProject) throws CoreException {
+ Criteria criteria = new Criteria() {
+ public boolean applies(IProject project) {
+ return project != null && JavaEEProjectUtilities.isDynamicWebProject(project);
+ }
+ };
+ return getReferencingSeamProject(earProject, criteria);
+ }
+
+ private IProject getReferencingSeamEJBProject(IProject earProject) throws CoreException {
+ Criteria criteria = new Criteria() {
+ public boolean applies(IProject project) {
+ return project != null && JavaEEProjectUtilities.isEJBProject(project);
+ }
+ };
+ return getReferencingSeamProject(earProject, criteria);
+ }
+
+ private IProject getReferencingSeamProject(IProject earProject, Criteria criteria)
throws CoreException {
IVirtualComponent component = ComponentCore.createComponent(earProject);
if (component != null) {
@@ -406,7 +453,7 @@
for (int i = 0; i < references.length; i++) {
IVirtualComponent refComponent = references[i].getReferencedComponent();
IProject refProject = refComponent.getProject();
- if (JavaEEProjectUtilities.isDynamicWebProject(refProject)) {
+ if (criteria.applies(refProject)) {
if (refProject.hasNature(IMavenConstants.NATURE_ID)) {
IFile pom = refProject.getFile(IMavenConstants.POM_FILE_NAME);
if (pom.exists()) {
@@ -429,48 +476,13 @@
}
return null;
}
-
- private IProject getReferencingSeamEJBProject(IProject earProject)
- throws CoreException {
- IVirtualComponent component = ComponentCore.createComponent(earProject);
- if (component != null) {
- IVirtualReference[] references = component.getReferences();
- for (int i = 0; i < references.length; i++) {
- IVirtualComponent refComponent = references[i].getReferencedComponent();
- IProject refProject = refComponent.getProject();
- if (JavaEEProjectUtilities.isEJBProject(refProject)) {
- if (refProject.hasNature(IMavenConstants.NATURE_ID)) {
- IFile pom = refProject
- .getFile(IMavenConstants.POM_FILE_NAME);
- if (pom.exists()) {
- MavenProjectManager projectManager = MavenPluginActivator
- .getDefault().getMavenProjectManager();
- IMavenProjectFacade facade = projectManager.create(
- pom, true, null);
- if (facade != null) {
- MavenProject mavenProject = facade
- .getMavenProject(null);
- if (mavenProject != null) {
- String version = getSeamVersion(mavenProject);
- if (version != null) {
- return refProject;
- }
- }
- }
- }
- }
- }
- }
- }
- return null;
- }
private String getSeamVersion(MavenProject mavenProject) {
List<Artifact> artifacts = new ArrayList<Artifact>();
ArtifactFilter filter = new ScopeArtifactFilter(Artifact.SCOPE_TEST);
for (Artifact artifact : mavenProject.getArtifacts()) {
- if (filter.include(artifact)) {
+ if (filter.include(artifact) && artifact.isResolved()) {
artifacts.add(artifact);
}
}
@@ -633,7 +645,18 @@
protected void updateEARDD(IProgressMonitor monitor) {
//super.updateEARDD(monitor);
}
+ }
+
+ private static interface Criteria {
+ boolean applies(IProject project);
+ }
+ @SuppressWarnings("restriction")
+ private void addErrorMarker(IProject project, String message) {
+ markerManager.addMarker(project,
+ MavenSeamConstants.SEAM_CONFIGURATION_ERROR_MARKER_ID,
+ message
+ ,-1, IMarker.SEVERITY_ERROR);
}
}
Added: trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/seam/missing-seam/pom.xml
===================================================================
--- trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/seam/missing-seam/pom.xml (rev 0)
+++ trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/seam/missing-seam/pom.xml 2012-05-04 11:30:47 UTC (rev 40787)
@@ -0,0 +1,15 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>foo.bar</groupId>
+ <artifactId>missing-seam</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ <packaging>war</packaging>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam</artifactId>
+ <version>missing</version>
+ <type>ejb</type>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
Added: trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/seam/violation/add-seam.pom
===================================================================
--- trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/seam/violation/add-seam.pom (rev 0)
+++ trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/seam/violation/add-seam.pom 2012-05-04 11:30:47 UTC (rev 40787)
@@ -0,0 +1,38 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>foo.bar</groupId>
+ <artifactId>violation</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ <packaging>war</packaging>
+ <dependencies>
+ <dependency>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ <version>1.2_15</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam</artifactId>
+ <version>2.3.0.Beta1</version>
+ <type>ejb</type>
+ </dependency>
+ </dependencies>
+ <repositories>
+ <!-- You should seriously consider using a repository manager or declare repositories in your settings.xml.
+ See http://www.sonatype.com/people/2009/02/why-putting-repositories-in-your-p... -->
+ <repository>
+ <!-- The JBoss Public repository is a composite repository of several major repositories.
+ See http://community.jboss.org/wiki/MavenGettingStarted-Users -->
+ <id>jboss-public-repository</id>
+ <url>http://repository.jboss.org/nexus/content/groups/public</url>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <!-- You can disable snapshot resolution to speed up your builds -->
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </repository>
+
+ </repositories>
+</project>
\ No newline at end of file
Added: trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/seam/violation/pom.xml
===================================================================
--- trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/seam/violation/pom.xml (rev 0)
+++ trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/seam/violation/pom.xml 2012-05-04 11:30:47 UTC (rev 40787)
@@ -0,0 +1,32 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>foo.bar</groupId>
+ <artifactId>violation</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ <packaging>war</packaging>
+ <dependencies>
+ <dependency>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ <version>1.2_15</version>
+ </dependency>
+ </dependencies>
+ <repositories>
+ <!-- You should seriously consider using a repository manager or declare repositories in your settings.xml.
+ See http://www.sonatype.com/people/2009/02/why-putting-repositories-in-your-p... -->
+ <repository>
+ <!-- The JBoss Public repository is a composite repository of several major repositories.
+ See http://community.jboss.org/wiki/MavenGettingStarted-Users -->
+ <id>jboss-public-repository</id>
+ <url>http://repository.jboss.org/nexus/content/groups/public</url>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <!-- You can disable snapshot resolution to speed up your builds -->
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </repository>
+
+ </repositories>
+</project>
\ No newline at end of file
Added: trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/seam/violation/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/seam/violation/src/main/webapp/WEB-INF/faces-config.xml (rev 0)
+++ trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/seam/violation/src/main/webapp/WEB-INF/faces-config.xml 2012-05-04 11:30:47 UTC (rev 40787)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<faces-config
+ xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"
+ version="1.2">
+
+</faces-config>
Modified: trunk/maven/tests/org.jboss.tools.maven.configurators.tests/src/org/jboss/tools/maven/configurators/tests/AbstractMavenConfiguratorTest.java
===================================================================
--- trunk/maven/tests/org.jboss.tools.maven.configurators.tests/src/org/jboss/tools/maven/configurators/tests/AbstractMavenConfiguratorTest.java 2012-05-04 11:26:10 UTC (rev 40786)
+++ trunk/maven/tests/org.jboss.tools.maven.configurators.tests/src/org/jboss/tools/maven/configurators/tests/AbstractMavenConfiguratorTest.java 2012-05-04 11:30:47 UTC (rev 40787)
@@ -13,8 +13,10 @@
import java.io.File;
import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IncrementalProjectBuilder;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.jst.common.project.facet.core.JavaFacet;
import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.m2e.core.project.IProjectConfigurationManager;
@@ -88,4 +90,18 @@
protected void updateProject(IProject project) throws Exception {
updateProject(project, null, -1);
}
+
+ protected void assertHasError(IProject project, String errorMessage) {
+ try {
+ for (IMarker m : findErrorMarkers(project)) {
+ String message = (String)m.getAttribute(IMarker.MESSAGE);
+ if (errorMessage.equals(message)){
+ return;
+ }
+ }
+ } catch (CoreException e) {
+ fail(e.getMessage());
+ }
+ fail("Error Message '"+ errorMessage +"' was not found on "+project.getName());
+ }
}
12 years, 8 months
JBoss Tools SVN: r40785 - trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-05-04 05:07:32 -0400 (Fri, 04 May 2012)
New Revision: 40785
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBInitialSelectionProvider.java
Log:
JBIDE-11205
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBInitialSelectionProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBInitialSelectionProvider.java 2012-05-04 09:03:28 UTC (rev 40784)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBInitialSelectionProvider.java 2012-05-04 09:07:32 UTC (rev 40785)
@@ -42,9 +42,8 @@
types.addAll(Arrays.asList(serverTypes));
// Find the last-selected one
- IEclipsePreferences defaults = DefaultScope.INSTANCE.getNode(JBossServerUIPlugin.PLUGIN_ID);
IEclipsePreferences prefs = InstanceScope.INSTANCE.getNode(JBossServerUIPlugin.PLUGIN_ID);
- String last = prefs.get(LAST_SERVER_CREATED_KEY, defaults.get(DEFAULT_INITIAL_SERVER_TYPE, null));
+ String last = prefs.get(LAST_SERVER_CREATED_KEY, null);
IServer lastServer = last == null ? null : ServerCore.findServer(last);
IServerType lastType = lastServer == null ? null : lastServer.getServerType();
@@ -61,7 +60,8 @@
}
public IServerType getDefaultServerType() {
- String newestJBoss = IJBossToolingConstants.SERVER_AS_71;
+ IEclipsePreferences defaults = DefaultScope.INSTANCE.getNode(JBossServerUIPlugin.PLUGIN_ID);
+ String newestJBoss = defaults.get(DEFAULT_INITIAL_SERVER_TYPE, IJBossToolingConstants.SERVER_AS_71);
return ServerCore.findServerType(newestJBoss);
}
12 years, 8 months
JBoss Tools SVN: r40784 - trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-05-04 05:03:28 -0400 (Fri, 04 May 2012)
New Revision: 40784
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBInitialSelectionProvider.java
Log:
JBIDE-11205
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBInitialSelectionProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBInitialSelectionProvider.java 2012-05-04 07:57:03 UTC (rev 40783)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBInitialSelectionProvider.java 2012-05-04 09:03:28 UTC (rev 40784)
@@ -13,6 +13,7 @@
import java.util.ArrayList;
import java.util.Arrays;
+import org.eclipse.core.runtime.preferences.DefaultScope;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.wst.server.core.IServer;
@@ -30,7 +31,9 @@
*
*/
public class JBInitialSelectionProvider extends InitialSelectionProvider implements IServerLifecycleListener {
-
+ private static String LAST_SERVER_CREATED_KEY = "org.jboss.ide.eclipse.as.ui.wizards.LAST_SERVER_CREATED"; //$NON-NLS-1$
+ private static String DEFAULT_INITIAL_SERVER_TYPE = "DEFAULT_SERVER_TYPE"; //$NON-NLS-1$
+
public JBInitialSelectionProvider() {
}
@@ -39,8 +42,10 @@
types.addAll(Arrays.asList(serverTypes));
// Find the last-selected one
+ IEclipsePreferences defaults = DefaultScope.INSTANCE.getNode(JBossServerUIPlugin.PLUGIN_ID);
IEclipsePreferences prefs = InstanceScope.INSTANCE.getNode(JBossServerUIPlugin.PLUGIN_ID);
- String last = prefs.get(LAST_SERVER_CREATED_KEY, null);
+ String last = prefs.get(LAST_SERVER_CREATED_KEY, defaults.get(DEFAULT_INITIAL_SERVER_TYPE, null));
+
IServer lastServer = last == null ? null : ServerCore.findServer(last);
IServerType lastType = lastServer == null ? null : lastServer.getServerType();
if( lastType != null && types.contains(lastType))
@@ -60,8 +65,6 @@
return ServerCore.findServerType(newestJBoss);
}
- private static String LAST_SERVER_CREATED_KEY = "org.jboss.ide.eclipse.as.ui.wizards.LAST_SERVER_CREATED"; //$NON-NLS-1$
-
public void serverAdded(IServer server) {
if( server != null ) {
IEclipsePreferences prefs = InstanceScope.INSTANCE.getNode(JBossServerUIPlugin.PLUGIN_ID);
12 years, 8 months
JBoss Tools SVN: r40783 - trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-05-04 03:57:03 -0400 (Fri, 04 May 2012)
New Revision: 40783
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/ServerModeSectionComposite.java
Log:
JBIDE-11776 NPE for deploy only servers
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/ServerModeSectionComposite.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/ServerModeSectionComposite.java 2012-05-04 06:07:12 UTC (rev 40782)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/ServerModeSectionComposite.java 2012-05-04 07:57:03 UTC (rev 40783)
@@ -168,6 +168,9 @@
}
protected boolean showListenOnAllHostsCheckbox() {
IRuntime rt = callback.getRuntime();
+ if( rt == null )
+ return false;
+
JBossExtendedProperties props2 = (JBossExtendedProperties)rt
.loadAdapter(JBossExtendedProperties.class,
new NullProgressMonitor());
12 years, 8 months