JBoss Tools SVN: r41680 - trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view.
by jbosstools-commits@lists.jboss.org
Author: jjankovi
Date: 2012-06-04 10:13:56 -0400 (Mon, 04 Jun 2012)
New Revision: 41680
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ErrorLogView.java
Log:
ErrorLogView has now viewObject set
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ErrorLogView.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ErrorLogView.java 2012-06-04 13:45:17 UTC (rev 41679)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ErrorLogView.java 2012-06-04 14:13:56 UTC (rev 41680)
@@ -6,6 +6,7 @@
import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
import org.jboss.tools.ui.bot.ext.gen.ActionItem;
+import org.jboss.tools.ui.bot.ext.gen.ActionItem.View.GeneralErrorLog;
import org.jboss.tools.ui.bot.ext.helper.ContextMenuHelper;
/**
@@ -16,6 +17,10 @@
*/
public class ErrorLogView extends ViewBase {
+ public ErrorLogView() {
+ viewObject = GeneralErrorLog.LABEL;
+ }
+
/**
* logs all error log messages into a logger
*/
13 years, 4 months
JBoss Tools SVN: r41679 - trunk/forge/plugins/org.jboss.tools.forge.runtime.ext/src/org/jboss/tools/forge/runtime/ext.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2012-06-04 09:45:17 -0400 (Mon, 04 Jun 2012)
New Revision: 41679
Modified:
trunk/forge/plugins/org.jboss.tools.forge.runtime.ext/src/org/jboss/tools/forge/runtime/ext/AllCommandsInterceptor.java
Log:
JBIDE-11168: Command 'cd #' not working on windows
Modified: trunk/forge/plugins/org.jboss.tools.forge.runtime.ext/src/org/jboss/tools/forge/runtime/ext/AllCommandsInterceptor.java
===================================================================
--- trunk/forge/plugins/org.jboss.tools.forge.runtime.ext/src/org/jboss/tools/forge/runtime/ext/AllCommandsInterceptor.java 2012-06-04 13:41:50 UTC (rev 41678)
+++ trunk/forge/plugins/org.jboss.tools.forge.runtime.ext/src/org/jboss/tools/forge/runtime/ext/AllCommandsInterceptor.java 2012-06-04 13:45:17 UTC (rev 41679)
@@ -52,14 +52,27 @@
}
private String handleWorkspaceShortCut(String str) {
- if (str.startsWith("#")) {
- return System.getProperty("forge.workspace") + str.substring(1);
+ String result = str;
+ if (str.startsWith("#")) {
+ result = encloseWithDoubleQuotesIfNeeded(System.getProperty("forge.workspace")) + str.substring(1);
}
- return str;
+ return result;
}
private void sendEscaped(String str) {
shell.print(ESCAPE + str + ESCAPE);
}
+ private String encloseWithDoubleQuotesIfNeeded(String str) {
+ if (str.contains(" ") && !isEnclosedWithDoubleQuotes(str)) {
+ return "\"" + str + "\"";
+ } else {
+ return str;
+ }
+ }
+
+ private boolean isEnclosedWithDoubleQuotes(String str) {
+ return str.charAt(0) == '\"' && str.charAt(str.length() - 1) == '\"';
+ }
+
}
13 years, 4 months
JBoss Tools SVN: r41678 - branches/jbosstools-3.3.x/forge/plugins/org.jboss.tools.forge.runtime.ext/src/org/jboss/tools/forge/runtime/ext.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2012-06-04 09:41:50 -0400 (Mon, 04 Jun 2012)
New Revision: 41678
Modified:
branches/jbosstools-3.3.x/forge/plugins/org.jboss.tools.forge.runtime.ext/src/org/jboss/tools/forge/runtime/ext/AllCommandsInterceptor.java
Log:
JBIDE-11168: Command 'cd #' not working on windows
Modified: branches/jbosstools-3.3.x/forge/plugins/org.jboss.tools.forge.runtime.ext/src/org/jboss/tools/forge/runtime/ext/AllCommandsInterceptor.java
===================================================================
--- branches/jbosstools-3.3.x/forge/plugins/org.jboss.tools.forge.runtime.ext/src/org/jboss/tools/forge/runtime/ext/AllCommandsInterceptor.java 2012-06-04 13:17:36 UTC (rev 41677)
+++ branches/jbosstools-3.3.x/forge/plugins/org.jboss.tools.forge.runtime.ext/src/org/jboss/tools/forge/runtime/ext/AllCommandsInterceptor.java 2012-06-04 13:41:50 UTC (rev 41678)
@@ -52,14 +52,27 @@
}
private String handleWorkspaceShortCut(String str) {
- if (str.startsWith("#")) {
- return System.getProperty("forge.workspace") + str.substring(1);
+ String result = str;
+ if (str.startsWith("#")) {
+ result = encloseWithDoubleQuotesIfNeeded(System.getProperty("forge.workspace")) + str.substring(1);
}
- return str;
+ return result;
}
private void sendEscaped(String str) {
shell.print(ESCAPE + str + ESCAPE);
}
+ private String encloseWithDoubleQuotesIfNeeded(String str) {
+ if (str.contains(" ") && !isEnclosedWithDoubleQuotes(str)) {
+ return "\"" + str + "\"";
+ } else {
+ return str;
+ }
+ }
+
+ private boolean isEnclosedWithDoubleQuotes(String str) {
+ return str.charAt(0) == '\"' && str.charAt(str.length() - 1) == '\"';
+ }
+
}
13 years, 4 months
JBoss Tools SVN: r41677 - in trunk/as/plugins: org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-06-04 09:17:36 -0400 (Mon, 04 Jun 2012)
New Revision: 41677
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ServerUtil.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/SelectServerActionDelegate.java
Log:
jbide-12060 and jbide-12059 to trunk
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ServerUtil.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ServerUtil.java 2012-06-04 13:17:25 UTC (rev 41676)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ServerUtil.java 2012-06-04 13:17:36 UTC (rev 41677)
@@ -94,6 +94,9 @@
}
public static boolean isJBossServerType(IServerType type) {
+ if( type == null )
+ return false;
+
// If we start with AS or EAP serverIds and are NOT deploy-only server
return !type.getId().equals(IJBossToolingConstants.DEPLOY_ONLY_SERVER) &&
(type.getId().startsWith(IJBossToolingConstants.SERVER_AS_PREFIX)
@@ -105,6 +108,8 @@
}
public static boolean isJBoss7(IServerType type) {
+ if( type == null )
+ return false;
return type.getId().equals(IJBossToolingConstants.SERVER_AS_70)
|| type.getId().equals(IJBossToolingConstants.SERVER_AS_71)
|| type.getId().equals(IJBossToolingConstants.SERVER_EAP_60);
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/SelectServerActionDelegate.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/SelectServerActionDelegate.java 2012-06-04 13:17:25 UTC (rev 41676)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/SelectServerActionDelegate.java 2012-06-04 13:17:36 UTC (rev 41677)
@@ -56,7 +56,7 @@
private void update0() {
if(action == null) return;
IServer server = ServerManager.getInstance().getSelectedServer();
- if( server != null ) {
+ if( server != null && server.getServerType() != null ) {
ImageDescriptor id = ImageResource.getImageDescriptor(server.getServerType().getId());
action.setImageDescriptor(id);
}
13 years, 4 months
JBoss Tools SVN: r41676 - in branches/jbosstools-3.3.x/as/plugins: org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-06-04 09:17:25 -0400 (Mon, 04 Jun 2012)
New Revision: 41676
Modified:
branches/jbosstools-3.3.x/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ServerUtil.java
branches/jbosstools-3.3.x/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/SelectServerActionDelegate.java
Log:
jbide-12060 and jbide-12059 for cr1, null safety
Modified: branches/jbosstools-3.3.x/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ServerUtil.java
===================================================================
--- branches/jbosstools-3.3.x/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ServerUtil.java 2012-06-04 13:17:06 UTC (rev 41675)
+++ branches/jbosstools-3.3.x/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ServerUtil.java 2012-06-04 13:17:25 UTC (rev 41676)
@@ -94,6 +94,9 @@
}
public static boolean isJBossServerType(IServerType type) {
+ if( type == null )
+ return false;
+
// If we start with AS or EAP serverIds and are NOT deploy-only server
return !type.getId().equals(IJBossToolingConstants.DEPLOY_ONLY_SERVER) &&
(type.getId().startsWith(IJBossToolingConstants.SERVER_AS_PREFIX)
@@ -105,6 +108,8 @@
}
public static boolean isJBoss7(IServerType type) {
+ if( type == null )
+ return false;
return type.getId().equals(IJBossToolingConstants.SERVER_AS_70)
|| type.getId().equals(IJBossToolingConstants.SERVER_AS_71)
|| type.getId().equals(IJBossToolingConstants.SERVER_EAP_60);
Modified: branches/jbosstools-3.3.x/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/SelectServerActionDelegate.java
===================================================================
--- branches/jbosstools-3.3.x/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/SelectServerActionDelegate.java 2012-06-04 13:17:06 UTC (rev 41675)
+++ branches/jbosstools-3.3.x/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/SelectServerActionDelegate.java 2012-06-04 13:17:25 UTC (rev 41676)
@@ -56,7 +56,7 @@
private void update0() {
if(action == null) return;
IServer server = ServerManager.getInstance().getSelectedServer();
- if( server != null ) {
+ if( server != null && server.getServerType() != null ) {
ImageDescriptor id = ImageResource.getImageDescriptor(server.getServerType().getId());
action.setImageDescriptor(id);
}
13 years, 4 months
JBoss Tools SVN: r41675 - in trunk/forge/plugins: org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/console and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2012-06-04 09:17:06 -0400 (Mon, 04 Jun 2012)
New Revision: 41675
Modified:
trunk/forge/plugins/org.jboss.tools.forge.runtime.ext/src/org/jboss/tools/forge/runtime/ext/EventHandler.java
trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/console/RmPostProcessor.java
Log:
JBIDE-11124: Removing project via forge is not working properly
Modified: trunk/forge/plugins/org.jboss.tools.forge.runtime.ext/src/org/jboss/tools/forge/runtime/ext/EventHandler.java
===================================================================
--- trunk/forge/plugins/org.jboss.tools.forge.runtime.ext/src/org/jboss/tools/forge/runtime/ext/EventHandler.java 2012-06-04 12:41:51 UTC (rev 41674)
+++ trunk/forge/plugins/org.jboss.tools.forge.runtime.ext/src/org/jboss/tools/forge/runtime/ext/EventHandler.java 2012-06-04 13:17:06 UTC (rev 41675)
@@ -1,8 +1,5 @@
package org.jboss.tools.forge.runtime.ext;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
import javax.enterprise.event.Observes;
import javax.inject.Inject;
@@ -27,20 +24,7 @@
if (project != null) {
projectName = project.getProjectRoot().getFullyQualifiedName();
}
- String parameterString = "";
- try {
- Method method = event.getClass().getMethod("getParameters", new Class[] {});
- Object object = method.invoke(event, new Object[] {});
- if (object instanceof Object[]) {
- Object[] parameters = (Object[])object;
- for (Object parameter : parameters) {
- parameterString += parameter + " ";
- }
- }
- } catch (NoSuchMethodException e) {
- } catch (InvocationTargetException e) {
- } catch (IllegalAccessException e) {}
-
+ String parameterString = getParameterString(event);
String command = event.getCommand().getParent().getName() + " " + event.getCommand().getName();
sendEscaped(
" EC: " + command +
@@ -50,6 +34,23 @@
" PAR: " + parameterString);
}
+ private String getParameterString(CommandExecuted event) {
+ return flattenObjectArray(event.getParameters());
+ }
+
+ private String flattenObjectArray(Object[] objects) {
+ String result = "";
+ for (Object object : objects) {
+ if (object instanceof Object[]) {
+ result += '[' + flattenObjectArray((Object[])object) + ']';
+ } else {
+ result += object;
+ result += ' ';
+ }
+ }
+ return result.trim();
+ }
+
private void sendEscaped(String str) {
shell.print(ESCAPE + str + ESCAPE);
}
Modified: trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/console/RmPostProcessor.java
===================================================================
--- trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/console/RmPostProcessor.java 2012-06-04 12:41:51 UTC (rev 41674)
+++ trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/console/RmPostProcessor.java 2012-06-04 13:17:06 UTC (rev 41675)
@@ -1,49 +1,49 @@
package org.jboss.tools.forge.ui.console;
+import java.io.File;
+import java.util.ArrayList;
import java.util.Map;
+import java.util.StringTokenizer;
-import org.eclipse.core.filesystem.EFS;
-import org.eclipse.core.filesystem.IFileInfo;
-import org.eclipse.core.filesystem.IFileStore;
-import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
import org.jboss.tools.forge.ui.ForgeUIPlugin;
public class RmPostProcessor implements ForgeCommandPostProcessor {
- private String getResourceToDelete(Map<String, String> commandDetails) {
- return commandDetails.get("crn");
+ private ArrayList<String> getResourcesToDelete(Map<String, String> commandDetails) {
+ String crn = commandDetails.get("crn");
+ String par = commandDetails.get("par");
+ int start = par.lastIndexOf('[');
+ int end = par.lastIndexOf(']');
+ if (start == -1 || end == -1) return null;
+ par = par.substring(start + 1, end);
+ ArrayList<String> result = new ArrayList<String>();
+ StringTokenizer tokenizer = new StringTokenizer(par);
+ while (tokenizer.hasMoreTokens()) {
+ result.add(crn + File.separator + tokenizer.nextToken());
+ }
+ return result;
}
@Override
public void postProcess(Map<String, String> commandDetails) {
- String crn = getResourceToDelete(commandDetails);
- if (crn == null) return;
- IPath path = new Path(crn);
- IFileStore fileStore = EFS.getLocalFileSystem().getStore(new Path(crn));
- IFileInfo fileInfo = fileStore.fetchInfo();
- if (!fileInfo.exists()) return;
- IResource resource = null;
- if (fileInfo.isDirectory()) {
- resource = ResourcesPlugin.getWorkspace().getRoot().getContainerForLocation(path);
- } else {
- resource = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(path);
+ ArrayList<String> resourceNames = getResourcesToDelete(commandDetails);
+ if (resourceNames == null) return;
+ IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
+ for (String resourceName : resourceNames) {
+ for (IProject project : projects) {
+ if (project.exists() && resourceName.equals(project.getLocation().toOSString())) {
+ try {
+ project.delete(false, false, null);
+ } catch (CoreException e) {
+ ForgeUIPlugin.log(e);
+ }
+ }
+ }
}
- if (resource != null) {
- delete(resource);
- }
}
- private void delete(IResource resource) {
- try {
- resource.delete(true, null);
- } catch (CoreException e) {
- ForgeUIPlugin.log(e);
- }
- }
-
}
13 years, 4 months
JBoss Tools SVN: r41674 - in branches/jbosstools-3.3.x/forge/plugins: org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/console and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2012-06-04 08:41:51 -0400 (Mon, 04 Jun 2012)
New Revision: 41674
Modified:
branches/jbosstools-3.3.x/forge/plugins/org.jboss.tools.forge.runtime.ext/src/org/jboss/tools/forge/runtime/ext/EventHandler.java
branches/jbosstools-3.3.x/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/console/RmPostProcessor.java
Log:
JBIDE-11124: Removing project via forge is not working properly
Modified: branches/jbosstools-3.3.x/forge/plugins/org.jboss.tools.forge.runtime.ext/src/org/jboss/tools/forge/runtime/ext/EventHandler.java
===================================================================
--- branches/jbosstools-3.3.x/forge/plugins/org.jboss.tools.forge.runtime.ext/src/org/jboss/tools/forge/runtime/ext/EventHandler.java 2012-06-04 12:20:52 UTC (rev 41673)
+++ branches/jbosstools-3.3.x/forge/plugins/org.jboss.tools.forge.runtime.ext/src/org/jboss/tools/forge/runtime/ext/EventHandler.java 2012-06-04 12:41:51 UTC (rev 41674)
@@ -1,8 +1,5 @@
package org.jboss.tools.forge.runtime.ext;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
import javax.enterprise.event.Observes;
import javax.inject.Inject;
@@ -27,20 +24,7 @@
if (project != null) {
projectName = project.getProjectRoot().getFullyQualifiedName();
}
- String parameterString = "";
- try {
- Method method = event.getClass().getMethod("getParameters", new Class[] {});
- Object object = method.invoke(event, new Object[] {});
- if (object instanceof Object[]) {
- Object[] parameters = (Object[])object;
- for (Object parameter : parameters) {
- parameterString += parameter + " ";
- }
- }
- } catch (NoSuchMethodException e) {
- } catch (InvocationTargetException e) {
- } catch (IllegalAccessException e) {}
-
+ String parameterString = getParameterString(event);
String command = event.getCommand().getParent().getName() + " " + event.getCommand().getName();
sendEscaped(
" EC: " + command +
@@ -50,6 +34,23 @@
" PAR: " + parameterString);
}
+ private String getParameterString(CommandExecuted event) {
+ return flattenObjectArray(event.getParameters());
+ }
+
+ private String flattenObjectArray(Object[] objects) {
+ String result = "";
+ for (Object object : objects) {
+ if (object instanceof Object[]) {
+ result += '[' + flattenObjectArray((Object[])object) + ']';
+ } else {
+ result += object;
+ result += ' ';
+ }
+ }
+ return result.trim();
+ }
+
private void sendEscaped(String str) {
shell.print(ESCAPE + str + ESCAPE);
}
Modified: branches/jbosstools-3.3.x/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/console/RmPostProcessor.java
===================================================================
--- branches/jbosstools-3.3.x/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/console/RmPostProcessor.java 2012-06-04 12:20:52 UTC (rev 41673)
+++ branches/jbosstools-3.3.x/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/console/RmPostProcessor.java 2012-06-04 12:41:51 UTC (rev 41674)
@@ -1,49 +1,49 @@
package org.jboss.tools.forge.ui.console;
+import java.io.File;
+import java.util.ArrayList;
import java.util.Map;
+import java.util.StringTokenizer;
-import org.eclipse.core.filesystem.EFS;
-import org.eclipse.core.filesystem.IFileInfo;
-import org.eclipse.core.filesystem.IFileStore;
-import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
import org.jboss.tools.forge.ui.ForgeUIPlugin;
public class RmPostProcessor implements ForgeCommandPostProcessor {
- private String getResourceToDelete(Map<String, String> commandDetails) {
- return commandDetails.get("crn");
+ private ArrayList<String> getResourcesToDelete(Map<String, String> commandDetails) {
+ String crn = commandDetails.get("crn");
+ String par = commandDetails.get("par");
+ int start = par.lastIndexOf('[');
+ int end = par.lastIndexOf(']');
+ if (start == -1 || end == -1) return null;
+ par = par.substring(start + 1, end);
+ ArrayList<String> result = new ArrayList<String>();
+ StringTokenizer tokenizer = new StringTokenizer(par);
+ while (tokenizer.hasMoreTokens()) {
+ result.add(crn + File.separator + tokenizer.nextToken());
+ }
+ return result;
}
@Override
public void postProcess(Map<String, String> commandDetails) {
- String crn = getResourceToDelete(commandDetails);
- if (crn == null) return;
- IPath path = new Path(crn);
- IFileStore fileStore = EFS.getLocalFileSystem().getStore(new Path(crn));
- IFileInfo fileInfo = fileStore.fetchInfo();
- if (!fileInfo.exists()) return;
- IResource resource = null;
- if (fileInfo.isDirectory()) {
- resource = ResourcesPlugin.getWorkspace().getRoot().getContainerForLocation(path);
- } else {
- resource = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(path);
+ ArrayList<String> resourceNames = getResourcesToDelete(commandDetails);
+ if (resourceNames == null) return;
+ IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
+ for (String resourceName : resourceNames) {
+ for (IProject project : projects) {
+ if (project.exists() && resourceName.equals(project.getLocation().toOSString())) {
+ try {
+ project.delete(false, false, null);
+ } catch (CoreException e) {
+ ForgeUIPlugin.log(e);
+ }
+ }
+ }
}
- if (resource != null) {
- delete(resource);
- }
}
- private void delete(IResource resource) {
- try {
- resource.delete(true, null);
- } catch (CoreException e) {
- ForgeUIPlugin.log(e);
- }
- }
-
}
13 years, 4 months
JBoss Tools SVN: r41673 - in trunk/as: tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-06-04 08:20:52 -0400 (Mon, 04 Jun 2012)
New Revision: 41673
Added:
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/DeployAndTempDeployFolderTest.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7Server.java
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTestSuite.java
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/util/ServerRuntimeUtils.java
Log:
JBIDE-12090 to trunk
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7Server.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7Server.java 2012-06-04 12:20:39 UTC (rev 41672)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7Server.java 2012-06-04 12:20:52 UTC (rev 41673)
@@ -66,7 +66,6 @@
public String getDeployFolder(String type) {
if( type.equals(DEPLOY_SERVER) ) {
- // TODO make sure this is correct?! Upstream APIs have this wrong for as7
IRuntime rt = getServer().getRuntime();
if( rt == null )
return null;
@@ -76,10 +75,13 @@
return getDeployFolder(this, type);
}
- // Just force it to be in metadata location, for now
public String getTempDeployFolder() {
- IRuntime rt = getServer().getRuntime();
- IPath p = rt.getLocation().append(AS7_STANDALONE).append(FOLDER_TMP);
- return ServerUtil.makeGlobal(rt, p).toString();
+ String type = getDeployLocationType();
+ if( DEPLOY_SERVER.equals(type)) {
+ IRuntime rt = getServer().getRuntime();
+ IPath p = rt.getLocation().append(AS7_STANDALONE).append(FOLDER_TMP);
+ return ServerUtil.makeGlobal(rt, p).toString();
+ }
+ return getTempDeployFolder(this, type);
}
}
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTestSuite.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTestSuite.java 2012-06-04 12:20:39 UTC (rev 41672)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTestSuite.java 2012-06-04 12:20:52 UTC (rev 41673)
@@ -31,6 +31,7 @@
import org.jboss.ide.eclipse.as.test.classpath.RuntimeServerModelTest;
import org.jboss.ide.eclipse.as.test.defects.WebDeployableArtifactUtilDefectTest;
import org.jboss.ide.eclipse.as.test.projectcreation.TestEar5WithJBossRuntime;
+import org.jboss.ide.eclipse.as.test.publishing.DeployAndTempDeployFolderTest;
import org.jboss.ide.eclipse.as.test.publishing.JBIDE2512aTest;
import org.jboss.ide.eclipse.as.test.publishing.JBIDE2512bTest;
import org.jboss.ide.eclipse.as.test.publishing.JBIDE4184Test;
@@ -73,6 +74,7 @@
suite.addTestSuite(StringSubstitutionTest.class);
// Publishing tests
+ suite.addTestSuite(DeployAndTempDeployFolderTest.class);
suite.addTestSuite(BehaviourModelDefectTest.class);
suite.addTestSuite(WebDeployableArtifactUtilDefectTest.class);
suite.addTestSuite(MockJSTPublisherTest.class);
Added: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/DeployAndTempDeployFolderTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/DeployAndTempDeployFolderTest.java (rev 0)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/DeployAndTempDeployFolderTest.java 2012-06-04 12:20:52 UTC (rev 41673)
@@ -0,0 +1,64 @@
+package org.jboss.ide.eclipse.as.test.publishing;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.IServerWorkingCopy;
+import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
+import org.jboss.ide.eclipse.as.core.util.ServerConverter;
+import org.jboss.ide.eclipse.as.test.ASTest;
+import org.jboss.ide.eclipse.as.test.util.ServerRuntimeUtils;
+import org.jboss.ide.eclipse.as.test.util.wtp.ProjectUtility;
+
+public class DeployAndTempDeployFolderTest extends TestCase {
+ public void tearDown() throws Exception {
+ ServerRuntimeUtils.deleteAllServers();
+ ServerRuntimeUtils.deleteAllRuntimes();
+ ProjectUtility.deleteAllProjects();
+ ASTest.clearStateLocation();
+ }
+
+ private IDeployableServer initAS7Server(String type) throws CoreException {
+ IServer s = ServerRuntimeUtils.createMockJBoss7Server();
+ IServerWorkingCopy wc = s.createWorkingCopy();
+ wc.setAttribute(IDeployableServer.DEPLOY_DIRECTORY_TYPE, type);
+ s = wc.save(true, null);
+ IDeployableServer ds = ServerConverter.getDeployableServer(s);
+ return ds;
+ }
+
+ public void testAS7xServer() throws CoreException {
+ IDeployableServer ds = initAS7Server(IDeployableServer.DEPLOY_SERVER);
+ assertEquals("/standalone/deployments", ds.getDeployFolder());
+ assertEquals("/standalone/tmp", ds.getTempDeployFolder());
+ }
+
+ public void testAS7xMetadata() throws CoreException {
+ IDeployableServer ds = initAS7Server(IDeployableServer.DEPLOY_METADATA);
+ assertTrue(ds.getDeployFolder().endsWith("org.jboss.ide.eclipse.as.core/org.jboss.ide.eclipse.as.70/deploy"));
+ assertTrue(ds.getTempDeployFolder().endsWith("org.jboss.ide.eclipse.as.core/org.jboss.ide.eclipse.as.70/tempDeploy"));
+ }
+
+ public void testAS7xCustomGlobal() throws CoreException {
+ IServer s = ServerRuntimeUtils.createMockJBoss7Server("/rtHome", "/home/test1", "/home/test2");
+ IServerWorkingCopy wc = s.createWorkingCopy();
+ wc.setAttribute(IDeployableServer.DEPLOY_DIRECTORY_TYPE, IDeployableServer.DEPLOY_CUSTOM);
+ s = wc.save(true, null);
+ IDeployableServer ds = ServerConverter.getDeployableServer(s);
+ assertTrue("/home/test1".equals(ds.getDeployFolder()));
+ assertTrue("/home/test2".equals(ds.getTempDeployFolder()));
+ }
+
+ public void testAS7xCustomRelative() throws CoreException {
+ IServer s = ServerRuntimeUtils.createMockJBoss7Server("/rtHome", "home/test1", "home/test2");
+ IServerWorkingCopy wc = s.createWorkingCopy();
+ wc.setAttribute(IDeployableServer.DEPLOY_DIRECTORY_TYPE, IDeployableServer.DEPLOY_CUSTOM);
+ s = wc.save(true, null);
+ IDeployableServer ds = ServerConverter.getDeployableServer(s);
+ assertTrue("/rtHome/home/test1".equals(ds.getDeployFolder()));
+ assertTrue("/rtHome/home/test2".equals(ds.getTempDeployFolder()));
+ }
+
+
+}
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/util/ServerRuntimeUtils.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/util/ServerRuntimeUtils.java 2012-06-04 12:20:39 UTC (rev 41672)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/util/ServerRuntimeUtils.java 2012-06-04 12:20:52 UTC (rev 41673)
@@ -129,7 +129,11 @@
}
public static IServer createMockJBoss7Server(String deployLocation, String tempDeployLocation) throws CoreException {
- IRuntime runtime = RuntimeUtils.createRuntime(IJBossToolingConstants.AS_70, "/", "default");
+ return createMockJBoss7Server("/", deployLocation, tempDeployLocation);
+ }
+
+ public static IServer createMockJBoss7Server(String rtLoc, String deployLocation, String tempDeployLocation) throws CoreException {
+ IRuntime runtime = RuntimeUtils.createRuntime(IJBossToolingConstants.AS_70, rtLoc, "default");
IServer s = ServerCreationUtils.createServer2(runtime, IJBossToolingConstants.SERVER_AS_70);
IServerWorkingCopy swc = s.createWorkingCopy();
swc.setServerConfiguration(null);
@@ -138,7 +142,7 @@
IServer server = swc.save(true, null);
return server;
}
-
+
public static IServer useMockPublishMethod(IServer server) throws CoreException {
IServerWorkingCopy wc = server.createWorkingCopy();
wc.setAttribute(IDeployableServer.SERVER_MODE, "mock");
13 years, 4 months
JBoss Tools SVN: r41672 - in branches/jbosstools-3.3.x/as: tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-06-04 08:20:39 -0400 (Mon, 04 Jun 2012)
New Revision: 41672
Added:
branches/jbosstools-3.3.x/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/DeployAndTempDeployFolderTest.java
Modified:
branches/jbosstools-3.3.x/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7Server.java
branches/jbosstools-3.3.x/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTestSuite.java
branches/jbosstools-3.3.x/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/util/ServerRuntimeUtils.java
Log:
JBIDE-12090 to cr1
Modified: branches/jbosstools-3.3.x/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7Server.java
===================================================================
--- branches/jbosstools-3.3.x/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7Server.java 2012-06-04 11:17:21 UTC (rev 41671)
+++ branches/jbosstools-3.3.x/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7Server.java 2012-06-04 12:20:39 UTC (rev 41672)
@@ -66,7 +66,6 @@
public String getDeployFolder(String type) {
if( type.equals(DEPLOY_SERVER) ) {
- // TODO make sure this is correct?! Upstream APIs have this wrong for as7
IRuntime rt = getServer().getRuntime();
if( rt == null )
return null;
@@ -76,10 +75,13 @@
return getDeployFolder(this, type);
}
- // Just force it to be in metadata location, for now
public String getTempDeployFolder() {
- IRuntime rt = getServer().getRuntime();
- IPath p = rt.getLocation().append(AS7_STANDALONE).append(FOLDER_TMP);
- return ServerUtil.makeGlobal(rt, p).toString();
+ String type = getDeployLocationType();
+ if( DEPLOY_SERVER.equals(type)) {
+ IRuntime rt = getServer().getRuntime();
+ IPath p = rt.getLocation().append(AS7_STANDALONE).append(FOLDER_TMP);
+ return ServerUtil.makeGlobal(rt, p).toString();
+ }
+ return getTempDeployFolder(this, type);
}
}
Modified: branches/jbosstools-3.3.x/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTestSuite.java
===================================================================
--- branches/jbosstools-3.3.x/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTestSuite.java 2012-06-04 11:17:21 UTC (rev 41671)
+++ branches/jbosstools-3.3.x/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTestSuite.java 2012-06-04 12:20:39 UTC (rev 41672)
@@ -31,6 +31,7 @@
import org.jboss.ide.eclipse.as.test.classpath.RuntimeServerModelTest;
import org.jboss.ide.eclipse.as.test.defects.WebDeployableArtifactUtilDefectTest;
import org.jboss.ide.eclipse.as.test.projectcreation.TestEar5WithJBossRuntime;
+import org.jboss.ide.eclipse.as.test.publishing.DeployAndTempDeployFolderTest;
import org.jboss.ide.eclipse.as.test.publishing.JBIDE2512aTest;
import org.jboss.ide.eclipse.as.test.publishing.JBIDE2512bTest;
import org.jboss.ide.eclipse.as.test.publishing.JBIDE4184Test;
@@ -73,6 +74,7 @@
suite.addTestSuite(StringSubstitutionTest.class);
// Publishing tests
+ suite.addTestSuite(DeployAndTempDeployFolderTest.class);
suite.addTestSuite(BehaviourModelDefectTest.class);
suite.addTestSuite(WebDeployableArtifactUtilDefectTest.class);
suite.addTestSuite(MockJSTPublisherTest.class);
Added: branches/jbosstools-3.3.x/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/DeployAndTempDeployFolderTest.java
===================================================================
--- branches/jbosstools-3.3.x/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/DeployAndTempDeployFolderTest.java (rev 0)
+++ branches/jbosstools-3.3.x/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/DeployAndTempDeployFolderTest.java 2012-06-04 12:20:39 UTC (rev 41672)
@@ -0,0 +1,64 @@
+package org.jboss.ide.eclipse.as.test.publishing;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.IServerWorkingCopy;
+import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
+import org.jboss.ide.eclipse.as.core.util.ServerConverter;
+import org.jboss.ide.eclipse.as.test.ASTest;
+import org.jboss.ide.eclipse.as.test.util.ServerRuntimeUtils;
+import org.jboss.ide.eclipse.as.test.util.wtp.ProjectUtility;
+
+public class DeployAndTempDeployFolderTest extends TestCase {
+ public void tearDown() throws Exception {
+ ServerRuntimeUtils.deleteAllServers();
+ ServerRuntimeUtils.deleteAllRuntimes();
+ ProjectUtility.deleteAllProjects();
+ ASTest.clearStateLocation();
+ }
+
+ private IDeployableServer initAS7Server(String type) throws CoreException {
+ IServer s = ServerRuntimeUtils.createMockJBoss7Server();
+ IServerWorkingCopy wc = s.createWorkingCopy();
+ wc.setAttribute(IDeployableServer.DEPLOY_DIRECTORY_TYPE, type);
+ s = wc.save(true, null);
+ IDeployableServer ds = ServerConverter.getDeployableServer(s);
+ return ds;
+ }
+
+ public void testAS7xServer() throws CoreException {
+ IDeployableServer ds = initAS7Server(IDeployableServer.DEPLOY_SERVER);
+ assertEquals("/standalone/deployments", ds.getDeployFolder());
+ assertEquals("/standalone/tmp", ds.getTempDeployFolder());
+ }
+
+ public void testAS7xMetadata() throws CoreException {
+ IDeployableServer ds = initAS7Server(IDeployableServer.DEPLOY_METADATA);
+ assertTrue(ds.getDeployFolder().endsWith("org.jboss.ide.eclipse.as.core/org.jboss.ide.eclipse.as.70/deploy"));
+ assertTrue(ds.getTempDeployFolder().endsWith("org.jboss.ide.eclipse.as.core/org.jboss.ide.eclipse.as.70/tempDeploy"));
+ }
+
+ public void testAS7xCustomGlobal() throws CoreException {
+ IServer s = ServerRuntimeUtils.createMockJBoss7Server("/rtHome", "/home/test1", "/home/test2");
+ IServerWorkingCopy wc = s.createWorkingCopy();
+ wc.setAttribute(IDeployableServer.DEPLOY_DIRECTORY_TYPE, IDeployableServer.DEPLOY_CUSTOM);
+ s = wc.save(true, null);
+ IDeployableServer ds = ServerConverter.getDeployableServer(s);
+ assertTrue("/home/test1".equals(ds.getDeployFolder()));
+ assertTrue("/home/test2".equals(ds.getTempDeployFolder()));
+ }
+
+ public void testAS7xCustomRelative() throws CoreException {
+ IServer s = ServerRuntimeUtils.createMockJBoss7Server("/rtHome", "home/test1", "home/test2");
+ IServerWorkingCopy wc = s.createWorkingCopy();
+ wc.setAttribute(IDeployableServer.DEPLOY_DIRECTORY_TYPE, IDeployableServer.DEPLOY_CUSTOM);
+ s = wc.save(true, null);
+ IDeployableServer ds = ServerConverter.getDeployableServer(s);
+ assertTrue("/rtHome/home/test1".equals(ds.getDeployFolder()));
+ assertTrue("/rtHome/home/test2".equals(ds.getTempDeployFolder()));
+ }
+
+
+}
Modified: branches/jbosstools-3.3.x/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/util/ServerRuntimeUtils.java
===================================================================
--- branches/jbosstools-3.3.x/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/util/ServerRuntimeUtils.java 2012-06-04 11:17:21 UTC (rev 41671)
+++ branches/jbosstools-3.3.x/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/util/ServerRuntimeUtils.java 2012-06-04 12:20:39 UTC (rev 41672)
@@ -129,7 +129,11 @@
}
public static IServer createMockJBoss7Server(String deployLocation, String tempDeployLocation) throws CoreException {
- IRuntime runtime = RuntimeUtils.createRuntime(IJBossToolingConstants.AS_70, "/", "default");
+ return createMockJBoss7Server("/", deployLocation, tempDeployLocation);
+ }
+
+ public static IServer createMockJBoss7Server(String rtLoc, String deployLocation, String tempDeployLocation) throws CoreException {
+ IRuntime runtime = RuntimeUtils.createRuntime(IJBossToolingConstants.AS_70, rtLoc, "default");
IServer s = ServerCreationUtils.createServer2(runtime, IJBossToolingConstants.SERVER_AS_70);
IServerWorkingCopy swc = s.createWorkingCopy();
swc.setServerConfiguration(null);
@@ -138,7 +142,7 @@
IServer server = swc.save(true, null);
return server;
}
-
+
public static IServer useMockPublishMethod(IServer server) throws CoreException {
IServerWorkingCopy wc = server.createWorkingCopy();
wc.setAttribute(IDeployableServer.SERVER_MODE, "mock");
13 years, 4 months
JBoss Tools SVN: r41671 - in trunk/as/plugins: org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-06-04 07:17:21 -0400 (Mon, 04 Jun 2012)
New Revision: 41671
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.ui/src/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/IDeploymentTypeUI.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/LocalBehaviorUI.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossServerWizardFragment.java
Log:
JBIDE-12042 to trunk
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.rse.ui/src/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.rse.ui/src/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI.java 2012-06-04 11:16:59 UTC (rev 41670)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.rse.ui/src/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI.java 2012-06-04 11:17:21 UTC (rev 41671)
@@ -61,12 +61,15 @@
import org.eclipse.wst.server.core.IRuntime;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.IServerWorkingCopy;
+import org.jboss.ide.eclipse.as.core.extensions.polling.WebPortPoller;
import org.jboss.ide.eclipse.as.core.publishers.PublishUtil;
import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethodType;
import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
+import org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7ManagerServicePoller;
import org.jboss.ide.eclipse.as.core.util.DeploymentPreferenceLoader;
+import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
import org.jboss.ide.eclipse.as.core.util.ServerUtil;
import org.jboss.ide.eclipse.as.rse.core.RSEPublishMethod;
@@ -471,8 +474,21 @@
}
@Override
- public void performFinish(IProgressMonitor monitor) throws CoreException {
- // TODO Auto-generated method stub
-
+ public void performFinish(IServerModeUICallback callback, IProgressMonitor monitor) throws CoreException {
+ // Override the pollers to more sane defaults for RSE
+ // For now, hard code these options. One day, we might need an additional
+ // adapter factory for rse-specific initialization questions on a per-server basis
+ IServerWorkingCopy wc = callback.getServer();
+ // an as7-only key
+ boolean exposed = wc.getAttribute(IJBossToolingConstants.EXPOSE_MANAGEMENT_SERVICE, false);
+ if( !exposed ) {
+ // as<7 || ( as==7 && !exposed) uses poller
+ wc.setAttribute(IJBossToolingConstants.STARTUP_POLLER_KEY, WebPortPoller.WEB_POLLER_ID);
+ wc.setAttribute(IJBossToolingConstants.SHUTDOWN_POLLER_KEY, WebPortPoller.WEB_POLLER_ID);
+ } else {
+ // as7 && exposed
+ wc.setAttribute(IJBossToolingConstants.STARTUP_POLLER_KEY, JBoss7ManagerServicePoller.POLLER_ID);
+ wc.setAttribute(IJBossToolingConstants.SHUTDOWN_POLLER_KEY, JBoss7ManagerServicePoller.POLLER_ID);
+ }
}
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/IDeploymentTypeUI.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/IDeploymentTypeUI.java 2012-06-04 11:16:59 UTC (rev 41670)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/IDeploymentTypeUI.java 2012-06-04 11:17:21 UTC (rev 41671)
@@ -49,7 +49,12 @@
/**
* Allow the mode composite to take some action on finish
+ *
+ * This is only called from the WIZARD, NOT the editor!
+ * This means only NEW servers set to some mode will have this API called.
+ * This also means only NEW severs created via UI will benefit.
+ *
* @since 2.3
*/
- public void performFinish(IProgressMonitor monitor) throws CoreException;
+ public void performFinish(IServerModeUICallback callback, IProgressMonitor monitor) throws CoreException;
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/LocalBehaviorUI.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/LocalBehaviorUI.java 2012-06-04 11:16:59 UTC (rev 41670)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/LocalBehaviorUI.java 2012-06-04 11:17:21 UTC (rev 41671)
@@ -52,7 +52,7 @@
}
}
- public void performFinish(IProgressMonitor monitor) throws CoreException {
+ public void performFinish(IServerModeUICallback callback, IProgressMonitor monitor) throws CoreException {
// Do Nothing
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossServerWizardFragment.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossServerWizardFragment.java 2012-06-04 11:16:59 UTC (rev 41670)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossServerWizardFragment.java 2012-06-04 11:17:21 UTC (rev 41671)
@@ -223,7 +223,7 @@
if( modeComposite != null ) {
IDeploymentTypeUI ui = modeComposite.getCurrentBehaviourUI();
if( ui != null )
- ui.performFinish(monitor);
+ ui.performFinish(DeploymentTypeUIUtil.getCallback(getTaskModel(), handle, this), monitor);
}
}
13 years, 4 months