JBoss Tools SVN: r38358 - in trunk/as: plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers and 8 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-02-01 02:10:22 -0500 (Wed, 01 Feb 2012)
New Revision: 38358
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IPublishCopyCallbackHandler.java
Removed:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration/ILaunchConfigConfigurator.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/WTPZippedPublisher.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/AbstractServerToolsPublisher.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JSTPublisherXMLToucher.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/LocalPublishMethod.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBossServerPublishMethod.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DelegatingServerBehavior.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration/AbstractLaunchConfigurator.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/DeploymentMarkerUtils.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7JSTPublisher.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/xpl/LocalCopyCallback.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/xpl/PublishCopyUtil.java
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEJBoss7LaunchConfigurator.java
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSELaunchConfigurator.java
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEPublishMethod.java
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSERemotePublishHandler.java
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/launch/LaunchConfigTests.java
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/MockPublishMethod.java
Log:
JBIDE-10769 - moved an inner-class interface out to its own class.
Modified: trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/WTPZippedPublisher.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/WTPZippedPublisher.java 2012-02-01 06:57:47 UTC (rev 38357)
+++ trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/WTPZippedPublisher.java 2012-02-01 07:10:22 UTC (rev 38358)
@@ -28,8 +28,8 @@
import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethod;
import org.jboss.ide.eclipse.as.core.server.IJBossServerPublisher;
+import org.jboss.ide.eclipse.as.core.server.IPublishCopyCallbackHandler;
import org.jboss.ide.eclipse.as.core.server.internal.v7.DeploymentMarkerUtils;
-import org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil.IPublishCopyCallbackHandler;
import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/AbstractServerToolsPublisher.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/AbstractServerToolsPublisher.java 2012-02-01 06:57:47 UTC (rev 38357)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/AbstractServerToolsPublisher.java 2012-02-01 07:10:22 UTC (rev 38358)
@@ -40,9 +40,9 @@
import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethod;
import org.jboss.ide.eclipse.as.core.server.IJBossServerPublisher;
+import org.jboss.ide.eclipse.as.core.server.IPublishCopyCallbackHandler;
import org.jboss.ide.eclipse.as.core.server.internal.DeployableServerBehavior;
import org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil;
-import org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil.IPublishCopyCallbackHandler;
import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
import org.jboss.ide.eclipse.as.wtp.core.util.ServerModelUtilities;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JSTPublisherXMLToucher.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JSTPublisherXMLToucher.java 2012-02-01 06:57:47 UTC (rev 38357)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JSTPublisherXMLToucher.java 2012-02-01 07:10:22 UTC (rev 38358)
@@ -17,7 +17,7 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.wst.server.core.IModule;
-import org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil.IPublishCopyCallbackHandler;
+import org.jboss.ide.eclipse.as.core.server.IPublishCopyCallbackHandler;
import org.jboss.ide.eclipse.as.core.util.FileUtil;
import org.jboss.ide.eclipse.as.core.util.IConstants;
import org.jboss.ide.eclipse.as.core.util.IJBossRuntimeResourceConstants;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/LocalPublishMethod.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/LocalPublishMethod.java 2012-02-01 06:57:47 UTC (rev 38357)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/LocalPublishMethod.java 2012-02-01 07:10:22 UTC (rev 38358)
@@ -14,8 +14,8 @@
import org.eclipse.core.runtime.Path;
import org.eclipse.wst.server.core.IServer;
import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
+import org.jboss.ide.eclipse.as.core.server.IPublishCopyCallbackHandler;
import org.jboss.ide.eclipse.as.core.server.xpl.LocalCopyCallback;
-import org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil.IPublishCopyCallbackHandler;
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBossServerPublishMethod.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBossServerPublishMethod.java 2012-02-01 06:57:47 UTC (rev 38357)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBossServerPublishMethod.java 2012-02-01 07:10:22 UTC (rev 38358)
@@ -16,7 +16,6 @@
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IServer;
import org.jboss.ide.eclipse.as.core.server.internal.DeployableServerBehavior;
-import org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil.IPublishCopyCallbackHandler;
public interface IJBossServerPublishMethod {
// public IJBossServerPublishMethodType getPublishMethodType();
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IPublishCopyCallbackHandler.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IPublishCopyCallbackHandler.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IPublishCopyCallbackHandler.java 2012-02-01 07:10:22 UTC (rev 38358)
@@ -0,0 +1,70 @@
+package org.jboss.ide.eclipse.as.core.server;
+
+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.wst.server.core.model.IModuleFile;
+
+public interface IPublishCopyCallbackHandler {
+ /**
+ * Copy the file (mf) to a file related to the relative path (path).
+ *
+ * For example if this path is "/someFolder/file.txt" you may want to
+ * copy the file to /home/someone/deployfolder/project.war/someFolder/file.txt
+ *
+ * @param mf
+ * @param path
+ * @param monitor
+ * @return a list of error status objects.
+ * @throws CoreException
+ */
+ public IStatus[] copyFile(IModuleFile mf, IPath path, IProgressMonitor monitor) throws CoreException;
+
+ /**
+ * Delete a directory for this path relative to where the module belongs.
+ * For example if this path is "/someFolder" you may want to
+ * delete the folder /home/someone/deployfolder/project.war/someFolder
+ *
+ * @param dir
+ * @param monitor
+ * @return a list of error status objects.
+ */
+ public IStatus[] deleteResource(IPath path, IProgressMonitor monitor) throws CoreException ;
+
+
+ /**
+ * Return true if the given path exists and is a file.
+ * Return false if hte given path does not exist, or, is a folder.
+ *
+ * @param path
+ * @param monitor
+ * @return
+ * @throws CoreException
+ */
+ public boolean isFile(IPath path, IProgressMonitor monitor) throws CoreException;
+
+ /**
+ * Make a directory for this path relative to where the module belongs.
+ * For example if this path is "/someFolder" you may want to
+ * make the folder /home/someone/deployfolder/project.war/someFolder
+ *
+ * @param dir
+ * @param monitor
+ * @return a list of error status objects.
+ */
+ public IStatus[] makeDirectoryIfRequired(IPath dir, IProgressMonitor monitor) throws CoreException;
+
+ /**
+ * Verify whether any changes made require a module restart
+ * @return
+ */
+ public boolean shouldRestartModule();
+
+ /**
+ * For touching / updating timestamp
+ * @param path
+ * @return
+ */
+ public IStatus[] touchResource(IPath path);
+}
\ No newline at end of file
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DelegatingServerBehavior.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DelegatingServerBehavior.java 2012-02-01 06:57:47 UTC (rev 38357)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DelegatingServerBehavior.java 2012-02-01 07:10:22 UTC (rev 38358)
@@ -29,10 +29,10 @@
import org.jboss.ide.eclipse.as.core.server.IJBossBehaviourDelegate;
import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethod;
import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethodType;
+import org.jboss.ide.eclipse.as.core.server.IPublishCopyCallbackHandler;
import org.jboss.ide.eclipse.as.core.server.internal.BehaviourModel.Behaviour;
import org.jboss.ide.eclipse.as.core.server.internal.BehaviourModel.BehaviourImpl;
import org.jboss.ide.eclipse.as.core.server.internal.launch.DelegatingStartLaunchConfiguration;
-import org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil.IPublishCopyCallbackHandler;
import org.jboss.ide.eclipse.as.core.util.DeploymentPreferenceLoader;
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
import org.jboss.ide.eclipse.as.wtp.core.util.ServerModelUtilities;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration/AbstractLaunchConfigurator.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration/AbstractLaunchConfigurator.java 2012-02-01 06:57:47 UTC (rev 38357)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration/AbstractLaunchConfigurator.java 2012-02-01 07:10:22 UTC (rev 38358)
@@ -16,6 +16,7 @@
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.wst.server.core.IServer;
import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
+import org.jboss.ide.eclipse.as.core.server.ILaunchConfigConfigurator;
import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration/ILaunchConfigConfigurator.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration/ILaunchConfigConfigurator.java 2012-02-01 06:57:47 UTC (rev 38357)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration/ILaunchConfigConfigurator.java 2012-02-01 07:10:22 UTC (rev 38358)
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-
-package org.jboss.ide.eclipse.as.core.server.internal.launch.configuration;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-
-/**
- * @author André Dietisheim
- */
-public interface ILaunchConfigConfigurator {
-
- public abstract void configure(ILaunchConfigurationWorkingCopy launchConfig) throws CoreException;
-
-}
\ No newline at end of file
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/DeploymentMarkerUtils.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/DeploymentMarkerUtils.java 2012-02-01 06:57:47 UTC (rev 38357)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/DeploymentMarkerUtils.java 2012-02-01 07:10:22 UTC (rev 38358)
@@ -33,7 +33,7 @@
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.IJBossServerPublishMethod;
-import org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil.IPublishCopyCallbackHandler;
+import org.jboss.ide.eclipse.as.core.server.IPublishCopyCallbackHandler;
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
/**
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7JSTPublisher.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7JSTPublisher.java 2012-02-01 06:57:47 UTC (rev 38357)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7JSTPublisher.java 2012-02-01 07:10:22 UTC (rev 38358)
@@ -24,7 +24,7 @@
import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethod;
import org.jboss.ide.eclipse.as.core.server.IJBossServerPublisher;
-import org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil.IPublishCopyCallbackHandler;
+import org.jboss.ide.eclipse.as.core.server.IPublishCopyCallbackHandler;
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
public class JBoss7JSTPublisher extends AbstractServerToolsPublisher {
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/xpl/LocalCopyCallback.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/xpl/LocalCopyCallback.java 2012-02-01 06:57:47 UTC (rev 38357)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/xpl/LocalCopyCallback.java 2012-02-01 07:10:22 UTC (rev 38358)
@@ -25,8 +25,8 @@
import org.jboss.ide.eclipse.as.core.extensions.events.IEventCodes;
import org.jboss.ide.eclipse.as.core.publishers.AbstractServerToolsPublisher;
import org.jboss.ide.eclipse.as.core.publishers.PublishUtil;
+import org.jboss.ide.eclipse.as.core.server.IPublishCopyCallbackHandler;
import org.jboss.ide.eclipse.as.core.server.internal.DeployableServerBehavior;
-import org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil.IPublishCopyCallbackHandler;
import org.jboss.ide.eclipse.as.core.util.FileUtil;
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
import org.jboss.ide.eclipse.as.core.util.StreamUtils;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/xpl/PublishCopyUtil.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/xpl/PublishCopyUtil.java 2012-02-01 06:57:47 UTC (rev 38357)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/xpl/PublishCopyUtil.java 2012-02-01 07:10:22 UTC (rev 38358)
@@ -33,6 +33,7 @@
import org.jboss.ide.eclipse.as.core.modules.ResourceModuleResourceUtil;
import org.jboss.ide.eclipse.as.core.publishers.AbstractServerToolsPublisher;
import org.jboss.ide.eclipse.as.core.publishers.patterns.IModulePathFilter;
+import org.jboss.ide.eclipse.as.core.server.IPublishCopyCallbackHandler;
/**
* Utility class with an assortment of useful file methods.
* <p>
@@ -48,69 +49,6 @@
* @since 2.0
*/
public final class PublishCopyUtil {
- public interface IPublishCopyCallbackHandler {
- /**
- * Copy the file (mf) to a file related to the relative path (path).
- *
- * For example if this path is "/someFolder/file.txt" you may want to
- * copy the file to /home/someone/deployfolder/project.war/someFolder/file.txt
- *
- * @param mf
- * @param path
- * @param monitor
- * @return a list of error status objects.
- * @throws CoreException
- */
- public IStatus[] copyFile(IModuleFile mf, IPath path, IProgressMonitor monitor) throws CoreException;
-
- /**
- * Delete a directory for this path relative to where the module belongs.
- * For example if this path is "/someFolder" you may want to
- * delete the folder /home/someone/deployfolder/project.war/someFolder
- *
- * @param dir
- * @param monitor
- * @return a list of error status objects.
- */
- public IStatus[] deleteResource(IPath path, IProgressMonitor monitor) throws CoreException ;
-
-
- /**
- * Return true if the given path exists and is a file.
- * Return false if hte given path does not exist, or, is a folder.
- *
- * @param path
- * @param monitor
- * @return
- * @throws CoreException
- */
- public boolean isFile(IPath path, IProgressMonitor monitor) throws CoreException;
-
- /**
- * Make a directory for this path relative to where the module belongs.
- * For example if this path is "/someFolder" you may want to
- * make the folder /home/someone/deployfolder/project.war/someFolder
- *
- * @param dir
- * @param monitor
- * @return a list of error status objects.
- */
- public IStatus[] makeDirectoryIfRequired(IPath dir, IProgressMonitor monitor) throws CoreException;
-
- /**
- * Verify whether any changes made require a module restart
- * @return
- */
- public boolean shouldRestartModule();
-
- /**
- * For touching / updating timestamp
- * @param path
- * @return
- */
- public IStatus[] touchResource(IPath path);
- }
-
private static final IStatus[] EMPTY_STATUS = new IStatus[0];
private IPublishCopyCallbackHandler handler;
public PublishCopyUtil(IPublishCopyCallbackHandler handler) {
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEJBoss7LaunchConfigurator.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEJBoss7LaunchConfigurator.java 2012-02-01 06:57:47 UTC (rev 38357)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEJBoss7LaunchConfigurator.java 2012-02-01 07:10:22 UTC (rev 38358)
@@ -16,8 +16,8 @@
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.wst.server.core.IServer;
import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
+import org.jboss.ide.eclipse.as.core.server.ILaunchConfigConfigurator;
import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
-import org.jboss.ide.eclipse.as.core.server.internal.launch.configuration.ILaunchConfigConfigurator;
import org.jboss.ide.eclipse.as.core.util.IJBossRuntimeConstants;
import org.jboss.ide.eclipse.as.core.util.IJBossRuntimeResourceConstants;
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSELaunchConfigurator.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSELaunchConfigurator.java 2012-02-01 06:57:47 UTC (rev 38357)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSELaunchConfigurator.java 2012-02-01 07:10:22 UTC (rev 38358)
@@ -12,7 +12,7 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.jboss.ide.eclipse.as.core.server.internal.launch.configuration.ILaunchConfigConfigurator;
+import org.jboss.ide.eclipse.as.core.server.ILaunchConfigConfigurator;
/**
* @author André Dietisheim
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEPublishMethod.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEPublishMethod.java 2012-02-01 06:57:47 UTC (rev 38357)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEPublishMethod.java 2012-02-01 07:10:22 UTC (rev 38358)
@@ -30,10 +30,10 @@
import org.jboss.ide.eclipse.as.core.publishers.AbstractPublishMethod;
import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
import org.jboss.ide.eclipse.as.core.server.IJBoss6Server;
+import org.jboss.ide.eclipse.as.core.server.IPublishCopyCallbackHandler;
import org.jboss.ide.eclipse.as.core.server.internal.DelegatingServerBehavior;
import org.jboss.ide.eclipse.as.core.server.internal.DeployableServerBehavior;
import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
-import org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil.IPublishCopyCallbackHandler;
import org.jboss.ide.eclipse.as.core.util.IJBossRuntimeResourceConstants;
import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSERemotePublishHandler.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSERemotePublishHandler.java 2012-02-01 06:57:47 UTC (rev 38357)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSERemotePublishHandler.java 2012-02-01 07:10:22 UTC (rev 38358)
@@ -29,9 +29,9 @@
import org.eclipse.wst.server.core.model.IModuleFile;
import org.jboss.ide.eclipse.as.core.extensions.events.IEventCodes;
import org.jboss.ide.eclipse.as.core.publishers.PublishUtil;
+import org.jboss.ide.eclipse.as.core.server.IPublishCopyCallbackHandler;
import org.jboss.ide.eclipse.as.core.server.internal.DeployableServerBehavior;
import org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil;
-import org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil.IPublishCopyCallbackHandler;
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
public class RSERemotePublishHandler implements IPublishCopyCallbackHandler {
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/launch/LaunchConfigTests.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/launch/LaunchConfigTests.java 2012-02-01 06:57:47 UTC (rev 38357)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/launch/LaunchConfigTests.java 2012-02-01 07:10:22 UTC (rev 38358)
@@ -18,9 +18,9 @@
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.wst.server.core.IServer;
import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
+import org.jboss.ide.eclipse.as.core.server.ILaunchConfigConfigurator;
import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
import org.jboss.ide.eclipse.as.core.server.internal.launch.configuration.AbstractStartLaunchConfigurator;
-import org.jboss.ide.eclipse.as.core.server.internal.launch.configuration.ILaunchConfigConfigurator;
import org.jboss.ide.eclipse.as.core.server.internal.launch.configuration.JBossLaunchConfigProperties;
import org.jboss.ide.eclipse.as.test.util.ServerRuntimeUtils;
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/MockPublishMethod.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/MockPublishMethod.java 2012-02-01 06:57:47 UTC (rev 38357)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/MockPublishMethod.java 2012-02-01 07:10:22 UTC (rev 38358)
@@ -22,7 +22,7 @@
import org.eclipse.wst.server.core.model.IModuleFile;
import org.jboss.ide.eclipse.as.core.publishers.AbstractPublishMethod;
import org.jboss.ide.eclipse.as.core.publishers.PublishUtil;
-import org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil.IPublishCopyCallbackHandler;
+import org.jboss.ide.eclipse.as.core.server.IPublishCopyCallbackHandler;
public class MockPublishMethod extends AbstractPublishMethod {
12 years, 11 months
JBoss Tools SVN: r38357 - in trunk: as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-02-01 01:57:47 -0500 (Wed, 01 Feb 2012)
New Revision: 38357
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBossLaunchDelegate.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/ILaunchConfigConfigurator.java
Removed:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/IJBossLaunchDelegate.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/ILaunchConfigConfigurator.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/TwiddleLaunchConfiguration.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/BehaviourModel.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/DelegatingStartLaunchConfiguration.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/LocalJBossStartLaunchDelegate.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7StartLaunchDelegate.java
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/AbstractRSELaunchDelegate.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressLaunchDelegate.java
Log:
JBIDE-10769 - moving files around, launch interfaces this time, into public folder
Copied: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBossLaunchDelegate.java (from rev 38327, trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/IJBossLaunchDelegate.java)
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBossLaunchDelegate.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBossLaunchDelegate.java 2012-02-01 06:57:47 UTC (rev 38357)
@@ -0,0 +1,27 @@
+package org.jboss.ide.eclipse.as.core.server;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.wst.server.core.IServer;
+import org.jboss.ide.eclipse.as.core.server.internal.launch.DelegatingStartLaunchConfiguration;
+
+public interface IJBossLaunchDelegate {
+ public void actualLaunch(DelegatingStartLaunchConfiguration launchConfig, ILaunchConfiguration configuration,
+ String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException;
+
+ public boolean preLaunchCheck(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor)
+ throws CoreException;
+
+ public void preLaunch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor)
+ throws CoreException;
+
+ public void postLaunch(ILaunchConfiguration configuration, String mode,
+ ILaunch launch, IProgressMonitor monitor) throws CoreException;
+
+ public void setupLaunchConfiguration(ILaunchConfigurationWorkingCopy workingCopy, IServer server)
+ throws CoreException;
+
+}
Copied: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/ILaunchConfigConfigurator.java (from rev 38327, trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/ILaunchConfigConfigurator.java)
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/ILaunchConfigConfigurator.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/ILaunchConfigConfigurator.java 2012-02-01 06:57:47 UTC (rev 38357)
@@ -0,0 +1,10 @@
+package org.jboss.ide.eclipse.as.core.server;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+
+public interface ILaunchConfigConfigurator {
+
+ public abstract void configure(ILaunchConfigurationWorkingCopy launchConfig) throws CoreException;
+
+}
\ No newline at end of file
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/BehaviourModel.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/BehaviourModel.java 2012-02-01 06:51:11 UTC (rev 38356)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/BehaviourModel.java 2012-02-01 06:57:47 UTC (rev 38357)
@@ -12,9 +12,9 @@
import org.eclipse.wst.server.core.IServer;
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
import org.jboss.ide.eclipse.as.core.server.IJBossBehaviourDelegate;
+import org.jboss.ide.eclipse.as.core.server.IJBossLaunchDelegate;
import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethod;
import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethodType;
-import org.jboss.ide.eclipse.as.core.server.internal.launch.IJBossLaunchDelegate;
import org.jboss.ide.eclipse.as.core.util.DeploymentPreferenceLoader;
public class BehaviourModel {
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/DelegatingStartLaunchConfiguration.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/DelegatingStartLaunchConfiguration.java 2012-02-01 06:51:11 UTC (rev 38356)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/DelegatingStartLaunchConfiguration.java 2012-02-01 06:57:47 UTC (rev 38357)
@@ -24,6 +24,7 @@
import org.eclipse.wst.server.core.ServerUtil;
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
import org.jboss.ide.eclipse.as.core.publishers.LocalPublishMethod;
+import org.jboss.ide.eclipse.as.core.server.IJBossLaunchDelegate;
import org.jboss.ide.eclipse.as.core.server.internal.BehaviourModel;
import org.jboss.ide.eclipse.as.core.server.internal.DeployableServerBehavior;
import org.jboss.ide.eclipse.as.core.util.DeploymentPreferenceLoader;
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/IJBossLaunchDelegate.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/IJBossLaunchDelegate.java 2012-02-01 06:51:11 UTC (rev 38356)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/IJBossLaunchDelegate.java 2012-02-01 06:57:47 UTC (rev 38357)
@@ -1,26 +0,0 @@
-package org.jboss.ide.eclipse.as.core.server.internal.launch;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.wst.server.core.IServer;
-
-public interface IJBossLaunchDelegate {
- public void actualLaunch(DelegatingStartLaunchConfiguration launchConfig, ILaunchConfiguration configuration,
- String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException;
-
- public boolean preLaunchCheck(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor)
- throws CoreException;
-
- public void preLaunch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor)
- throws CoreException;
-
- public void postLaunch(ILaunchConfiguration configuration, String mode,
- ILaunch launch, IProgressMonitor monitor) throws CoreException;
-
- public void setupLaunchConfiguration(ILaunchConfigurationWorkingCopy workingCopy, IServer server)
- throws CoreException;
-
-}
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/ILaunchConfigConfigurator.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/ILaunchConfigConfigurator.java 2012-02-01 06:51:11 UTC (rev 38356)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/ILaunchConfigConfigurator.java 2012-02-01 06:57:47 UTC (rev 38357)
@@ -1,10 +0,0 @@
-package org.jboss.ide.eclipse.as.core.server.internal.launch;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-
-public interface ILaunchConfigConfigurator {
-
- public abstract void configure(ILaunchConfigurationWorkingCopy launchConfig) throws CoreException;
-
-}
\ No newline at end of file
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/LocalJBossStartLaunchDelegate.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/LocalJBossStartLaunchDelegate.java 2012-02-01 06:51:11 UTC (rev 38356)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/LocalJBossStartLaunchDelegate.java 2012-02-01 06:57:47 UTC (rev 38357)
@@ -25,6 +25,7 @@
import org.eclipse.jdt.launching.StandardClasspathProvider;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.ServerCore;
+import org.jboss.ide.eclipse.as.core.server.IJBossLaunchDelegate;
import org.jboss.ide.eclipse.as.core.server.internal.AbstractLocalJBossServerRuntime;
import org.jboss.ide.eclipse.as.core.server.internal.DelegatingServerBehavior;
import org.jboss.ide.eclipse.as.core.server.internal.LocalJBossBehaviorDelegate;
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/TwiddleLaunchConfiguration.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/TwiddleLaunchConfiguration.java 2012-02-01 06:51:11 UTC (rev 38356)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/TwiddleLaunchConfiguration.java 2012-02-01 06:57:47 UTC (rev 38357)
@@ -1,110 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.ide.eclipse.as.core.server.internal.launch;
-
-
-import static org.jboss.ide.eclipse.as.core.util.IJBossRuntimeConstants.RMIAdaptor;
-import static org.jboss.ide.eclipse.as.core.util.IJBossRuntimeConstants.SHUTDOWN_ADAPTER_ARG;
-import static org.jboss.ide.eclipse.as.core.util.IJBossRuntimeConstants.SHUTDOWN_PASS_ARG;
-import static org.jboss.ide.eclipse.as.core.util.IJBossRuntimeConstants.SHUTDOWN_SERVER_ARG;
-import static org.jboss.ide.eclipse.as.core.util.IJBossRuntimeConstants.SHUTDOWN_USER_ARG;
-import static org.jboss.ide.eclipse.as.core.util.IJBossRuntimeConstants.SPACE;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunchConfigurationType;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.server.core.IServer;
-import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
-import org.jboss.ide.eclipse.as.core.Messages;
-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.launch.configuration.JBossLaunchConfigProperties;
-import org.jboss.ide.eclipse.as.core.util.IJBossRuntimeConstants;
-import org.jboss.ide.eclipse.as.core.util.IJBossRuntimeResourceConstants;
-import org.jboss.ide.eclipse.as.core.util.LaunchConfigUtils;
-import org.jboss.ide.eclipse.as.core.util.RuntimeUtils;
-import org.jboss.ide.eclipse.as.core.util.ServerConverter;
-import org.jboss.ide.eclipse.as.core.util.ServerUtil;
-
-public class TwiddleLaunchConfiguration {
-
- public static final String TWIDDLE_LAUNCH_TYPE = "org.jboss.ide.eclipse.as.core.server.twiddleConfiguration"; //$NON-NLS-1$
-
- protected static final String TWIDDLE_JAR_LOC =
- IJBossRuntimeResourceConstants.BIN + File.separator + IJBossRuntimeResourceConstants.TWIDDLE_JAR;
-
- public static ILaunchConfigurationWorkingCopy createLaunchConfiguration(IServer server, String args) throws CoreException {
- JBossServer jbs = ServerConverter.checkedGetJBossServer(server);
- String serverHome = ServerUtil.checkedGetServerHome(jbs);
- IJBossServerRuntime jbrt = RuntimeUtils.checkedGetJBossServerRuntime(server);
-
- ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
- ILaunchConfigurationType launchConfigType = launchManager.getLaunchConfigurationType(TWIDDLE_LAUNCH_TYPE);
-
- String launchName = TwiddleLaunchConfiguration.class.getName();
- launchName = launchManager.generateUniqueLaunchConfigurationNameFrom(launchName);
- ILaunchConfigurationWorkingCopy wc = launchConfigType.newInstance(null, launchName);
- new JBossLaunchConfigProperties().setProgramArguments(args, wc);
- new JBossLaunchConfigProperties().setMainType(IJBossRuntimeConstants.TWIDDLE_MAIN_TYPE, wc);
- new JBossLaunchConfigProperties().setWorkingDirectory(serverHome + Path.SEPARATOR + IJBossRuntimeResourceConstants.BIN, wc);
- new JBossLaunchConfigProperties().setServerId(server.getId(), wc);
-
- ArrayList<IRuntimeClasspathEntry> classpath = new ArrayList<IRuntimeClasspathEntry>();
- LaunchConfigUtils.addCPEntry(TWIDDLE_JAR_LOC, serverHome, classpath);
- // Twiddle requires more classes and I'm too lazy to actually figure OUT which ones it needs.
- LaunchConfigUtils.addDirectory(serverHome, classpath, IJBossRuntimeResourceConstants.LIB);
- LaunchConfigUtils.addDirectory(serverHome, classpath, IJBossRuntimeResourceConstants.LIB + File.separator + IJBossRuntimeResourceConstants.ENDORSED);
- LaunchConfigUtils.addDirectory(serverHome, classpath, IJBossRuntimeResourceConstants.CLIENT);
- LaunchConfigUtils.addJREEntry(jbrt.getVM(), classpath);
- List<String> runtimeClassPaths = LaunchConfigUtils.toStrings(classpath);
- new JBossLaunchConfigProperties().setClasspath(runtimeClassPaths, wc);
- new JBossLaunchConfigProperties().setUseDefaultClassPath(false, wc);
-
- return wc;
- }
-
- public static String getDefaultArgs(IServer server) throws CoreException {
- JBossServer jbs = ServerConverter.findJBossServer(server.getId());
- if (jbs == null) {
- throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
- NLS.bind(Messages.ServerNotFound, server.getName())));
- }
- String twiddleArgs = SHUTDOWN_SERVER_ARG
- + SPACE
- + jbs.getHost() + ":" + jbs.getJNDIPort() //$NON-NLS-1$
- + SPACE
- + SHUTDOWN_ADAPTER_ARG
- + SPACE
- + RMIAdaptor
- + SPACE;
- if( jbs.getUsername() != null )
- twiddleArgs += SHUTDOWN_USER_ARG
- + SPACE + jbs.getUsername()
- + SPACE;
- if( jbs.getPassword() != null )
- twiddleArgs += SHUTDOWN_PASS_ARG
- + SPACE
- + jbs.getPassword()
- + SPACE;
- return twiddleArgs;
- }
-}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7StartLaunchDelegate.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7StartLaunchDelegate.java 2012-02-01 06:51:11 UTC (rev 38356)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7StartLaunchDelegate.java 2012-02-01 06:57:47 UTC (rev 38357)
@@ -17,9 +17,9 @@
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.core.model.IProcess;
import org.eclipse.wst.server.core.IServer;
+import org.jboss.ide.eclipse.as.core.server.IJBossLaunchDelegate;
import org.jboss.ide.eclipse.as.core.server.internal.DelegatingServerBehavior;
import org.jboss.ide.eclipse.as.core.server.internal.LocalJBossBehaviorDelegate;
-import org.jboss.ide.eclipse.as.core.server.internal.launch.IJBossLaunchDelegate;
import org.jboss.ide.eclipse.as.core.server.internal.launch.LocalJBossStartLaunchDelegate;
import org.jboss.ide.eclipse.as.core.util.JBossServerBehaviorUtils;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/AbstractRSELaunchDelegate.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/AbstractRSELaunchDelegate.java 2012-02-01 06:51:11 UTC (rev 38356)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/AbstractRSELaunchDelegate.java 2012-02-01 06:57:47 UTC (rev 38357)
@@ -23,10 +23,10 @@
import org.eclipse.rse.services.shells.IHostShell;
import org.eclipse.rse.services.shells.IHostShellChangeEvent;
import org.eclipse.rse.services.shells.IHostShellOutputListener;
+import org.jboss.ide.eclipse.as.core.server.IJBossLaunchDelegate;
import org.jboss.ide.eclipse.as.core.server.internal.DelegatingServerBehavior;
import org.jboss.ide.eclipse.as.core.server.internal.DeployableServerBehavior;
import org.jboss.ide.eclipse.as.core.server.internal.launch.AbstractJBossStartLaunchConfiguration;
-import org.jboss.ide.eclipse.as.core.server.internal.launch.IJBossLaunchDelegate;
import org.jboss.ide.eclipse.as.core.util.ThreadUtils;
import org.jboss.ide.eclipse.as.rse.core.RSEHostShellModel.ServerShellModel;
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressLaunchDelegate.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressLaunchDelegate.java 2012-02-01 06:51:11 UTC (rev 38356)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressLaunchDelegate.java 2012-02-01 06:57:47 UTC (rev 38357)
@@ -18,9 +18,9 @@
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.wst.server.core.IServer;
import org.jboss.ide.eclipse.as.core.Trace;
+import org.jboss.ide.eclipse.as.core.server.IJBossLaunchDelegate;
import org.jboss.ide.eclipse.as.core.server.internal.DelegatingServerBehavior;
import org.jboss.ide.eclipse.as.core.server.internal.launch.DelegatingStartLaunchConfiguration;
-import org.jboss.ide.eclipse.as.core.server.internal.launch.IJBossLaunchDelegate;
import org.jboss.ide.eclipse.as.core.util.JBossServerBehaviorUtils;
import org.jboss.ide.eclipse.as.core.util.LaunchCommandPreferences;
12 years, 11 months
JBoss Tools SVN: r38356 - in trunk/as: plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors and 16 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-02-01 01:51:11 -0500 (Wed, 01 Feb 2012)
New Revision: 38356
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBossBehaviourDelegate.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IPollResultListener.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IProcessProvider.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IServerLogListener.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IMemento.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/XMLMemento.java
Removed:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/.settings/.api_filters
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/events/IServerLogListener.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/IJBossBehaviourDelegate.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/IPollResultListener.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/IProcessProvider.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/TwiddleLauncher.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/internal/FileUtils.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/internal/IMemento.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/internal/XMLMemento.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs/TwiddleDialog.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathCategory.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathModel.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathQuery.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/events/ServerLogger.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/polling/ProcessTerminatedPoller.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/ResourceModuleResourceUtil.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PublishUtil.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/AbstractBehaviourDelegate.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/AbstractJBossBehaviourDelegate.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/BehaviourModel.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DelegatingServerBehavior.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/LocalJBossBehaviorDelegate.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/PollThread.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration/LocalStopLaunchConfigurator.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/xpl/LocalCopyCallback.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/xpl/PublishCopyUtil.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/DeploymentPreferenceLoader.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/FileUtil.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/PollThreadUtils.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ServerCreationUtils.java
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.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEJBossStartLaunchDelegate.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/ServerLogView.java
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/MockArgsTests.java
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/util/ServerRuntimeUtils.java
Log:
JBIDE-10769 - moving files around, will continue
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.core/.settings/.api_filters
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/.settings/.api_filters 2012-02-01 05:23:23 UTC (rev 38355)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/.settings/.api_filters 2012-02-01 06:51:11 UTC (rev 38356)
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<component id="org.jboss.ide.eclipse.as.core" version="2">
- <resource path="jbosscore/org/jboss/ide/eclipse/as/core/server/internal/IJBossBehaviourDelegate.java" type="org.jboss.ide.eclipse.as.core.server.internal.IJBossBehaviourDelegate">
- <filter id="403804204">
- <message_arguments>
- <message_argument value="org.jboss.ide.eclipse.as.core.server.internal.IJBossBehaviourDelegate"/>
- <message_argument value="getPathFilter(IModule[])"/>
- </message_arguments>
- </filter>
- </resource>
-</component>
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathCategory.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathCategory.java 2012-02-01 05:23:23 UTC (rev 38355)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathCategory.java 2012-02-01 06:51:11 UTC (rev 38356)
@@ -13,7 +13,7 @@
import java.util.HashMap;
import org.eclipse.wst.server.core.IServer;
-import org.jboss.ide.eclipse.as.core.util.internal.IMemento;
+import org.jboss.ide.eclipse.as.core.util.IMemento;
/**
* A class representing an XPath Category, which
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathModel.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathModel.java 2012-02-01 05:23:23 UTC (rev 38355)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathModel.java 2012-02-01 06:51:11 UTC (rev 38356)
@@ -36,9 +36,9 @@
import org.jboss.ide.eclipse.as.core.server.internal.ServerAttributeHelper;
import org.jboss.ide.eclipse.as.core.util.IConstants;
import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
+import org.jboss.ide.eclipse.as.core.util.IMemento;
import org.jboss.ide.eclipse.as.core.util.ServerUtil;
-import org.jboss.ide.eclipse.as.core.util.internal.IMemento;
-import org.jboss.ide.eclipse.as.core.util.internal.XMLMemento;
+import org.jboss.ide.eclipse.as.core.util.XMLMemento;
/**
* The class representing the model for all xpath storage and searching
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathQuery.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathQuery.java 2012-02-01 05:23:23 UTC (rev 38355)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathQuery.java 2012-02-01 06:51:11 UTC (rev 38356)
@@ -28,7 +28,7 @@
import org.jaxen.XPath;
import org.jaxen.dom4j.Dom4jXPath;
import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathFileResult.XPathResultNode;
-import org.jboss.ide.eclipse.as.core.util.internal.IMemento;
+import org.jboss.ide.eclipse.as.core.util.IMemento;
/**
* A simple value object to hold the XPath query data
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/events/IServerLogListener.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/events/IServerLogListener.java 2012-02-01 05:23:23 UTC (rev 38355)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/events/IServerLogListener.java 2012-02-01 06:51:11 UTC (rev 38356)
@@ -1,18 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.ide.eclipse.as.core.extensions.events;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.wst.server.core.IServer;
-
-public interface IServerLogListener {
- public void logging(IStatus status, IServer server);
-}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/events/ServerLogger.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/events/ServerLogger.java 2012-02-01 05:23:23 UTC (rev 38355)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/events/ServerLogger.java 2012-02-01 06:51:11 UTC (rev 38356)
@@ -20,6 +20,7 @@
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.ServerCore;
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
+import org.jboss.ide.eclipse.as.core.server.IServerLogListener;
import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
import org.osgi.service.prefs.BackingStoreException;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/polling/ProcessTerminatedPoller.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/polling/ProcessTerminatedPoller.java 2012-02-01 05:23:23 UTC (rev 38355)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/polling/ProcessTerminatedPoller.java 2012-02-01 06:51:11 UTC (rev 38356)
@@ -15,9 +15,9 @@
import org.eclipse.debug.core.model.IProcess;
import org.eclipse.wst.server.core.IServer;
+import org.jboss.ide.eclipse.as.core.server.IProcessProvider;
import org.jboss.ide.eclipse.as.core.server.IServerStatePoller;
import org.jboss.ide.eclipse.as.core.server.internal.DelegatingServerBehavior;
-import org.jboss.ide.eclipse.as.core.server.internal.IProcessProvider;
import org.jboss.ide.eclipse.as.core.server.internal.ServerStatePollerType;
/**
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/ResourceModuleResourceUtil.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/ResourceModuleResourceUtil.java 2012-02-01 05:23:23 UTC (rev 38355)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/ResourceModuleResourceUtil.java 2012-02-01 06:51:11 UTC (rev 38356)
@@ -125,6 +125,29 @@
return newResources;
}
+ public static int countMembers(IModule module) {
+ try {
+ ModuleDelegate delegate = (ModuleDelegate)module.loadAdapter(ModuleDelegate.class, new NullProgressMonitor());
+ return delegate == null ? 0 : countMembers(delegate.members());
+ } catch( CoreException ce ) {}
+ return 0;
+ }
+
+ public static int countMembers(IModuleResource[] resources) {
+ int count = 0;
+ if( resources == null ) return 0;
+ for( int i = 0; i < resources.length; i++ ) {
+ if( resources[i] instanceof IModuleFile ) {
+ count++;
+ } else if( resources[i] instanceof IModuleFolder ) {
+ count += countMembers(((IModuleFolder)resources[i]).members());
+ }
+ }
+ return count;
+ }
+
+
+
/**
* Utility method for just quickly discovering the filtered member list
* @since 2.3
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PublishUtil.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PublishUtil.java 2012-02-01 05:23:23 UTC (rev 38355)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PublishUtil.java 2012-02-01 06:51:11 UTC (rev 38356)
@@ -61,26 +61,6 @@
}
- public static int countMembers(IModule module) {
- try {
- ModuleDelegate delegate = (ModuleDelegate)module.loadAdapter(ModuleDelegate.class, new NullProgressMonitor());
- return delegate == null ? 0 : countMembers(delegate.members());
- } catch( CoreException ce ) {}
- return 0;
- }
- public static int countMembers(IModuleResource[] resources) {
- int count = 0;
- if( resources == null ) return 0;
- for( int i = 0; i < resources.length; i++ ) {
- if( resources[i] instanceof IModuleFile ) {
- count++;
- } else if( resources[i] instanceof IModuleFolder ) {
- count += countMembers(((IModuleFolder)resources[i]).members());
- }
- }
- return count;
- }
-
/**
* All preferences are stored in the "local" setting as it was decided
* having to replicate deploy paths for each publish method was not good
Copied: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBossBehaviourDelegate.java (from rev 38327, trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/IJBossBehaviourDelegate.java)
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBossBehaviourDelegate.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBossBehaviourDelegate.java 2012-02-01 06:51:11 UTC (rev 38356)
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.ide.eclipse.as.core.server;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.wst.server.core.IModule;
+import org.jboss.ide.eclipse.as.core.publishers.patterns.IModulePathFilter;
+import org.jboss.ide.eclipse.as.core.server.internal.DelegatingServerBehavior;
+
+public interface IJBossBehaviourDelegate {
+
+ public String getBehaviourTypeId();
+
+ public void setActualBehaviour(DelegatingServerBehavior actualBehaviour);
+
+ public void stop(boolean force);
+
+ public void publishStart(final IProgressMonitor monitor) throws CoreException;
+
+ public void publishFinish(final IProgressMonitor monitor) throws CoreException;
+
+ public void onServerStarting();
+
+ public void onServerStopping();
+
+ public void onServerStarted();
+
+ public void onServerStopped();
+
+ public IStatus canChangeState(String launchMode);
+
+ public String getDefaultStopArguments() throws CoreException;
+
+ /**
+ * @since 2.3
+ */
+ public IModulePathFilter getPathFilter(IModule[] moduleTree);
+
+ public void dispose();
+}
Copied: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IPollResultListener.java (from rev 38327, trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/IPollResultListener.java)
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IPollResultListener.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IPollResultListener.java 2012-02-01 06:51:11 UTC (rev 38356)
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.core.server;
+
+public interface IPollResultListener {
+
+ /**
+ * Called if the poller did
+ * @param expectedState
+ * @param currentState
+ */
+ public void stateAsserted(boolean expectedState, boolean currentState);
+
+ public void stateNotAsserted(boolean expectedState, boolean currentState);
+}
Copied: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IProcessProvider.java (from rev 38327, trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/IProcessProvider.java)
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IProcessProvider.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IProcessProvider.java 2012-02-01 06:51:11 UTC (rev 38356)
@@ -0,0 +1,18 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.ide.eclipse.as.core.server;
+
+import org.eclipse.debug.core.model.IProcess;
+
+public interface IProcessProvider {
+ public IProcess getProcess();
+}
\ No newline at end of file
Copied: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IServerLogListener.java (from rev 38327, trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/events/IServerLogListener.java)
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IServerLogListener.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IServerLogListener.java 2012-02-01 06:51:11 UTC (rev 38356)
@@ -0,0 +1,18 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.core.server;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.wst.server.core.IServer;
+
+public interface IServerLogListener {
+ public void logging(IStatus status, IServer server);
+}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/AbstractBehaviourDelegate.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/AbstractBehaviourDelegate.java 2012-02-01 05:23:23 UTC (rev 38355)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/AbstractBehaviourDelegate.java 2012-02-01 06:51:11 UTC (rev 38356)
@@ -17,6 +17,7 @@
import org.eclipse.wst.server.core.IModule;
import org.jboss.ide.eclipse.as.core.modules.ResourceModuleResourceUtil;
import org.jboss.ide.eclipse.as.core.publishers.patterns.IModulePathFilter;
+import org.jboss.ide.eclipse.as.core.server.IJBossBehaviourDelegate;
/**
* A complete stub implementation of the interface
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/AbstractJBossBehaviourDelegate.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/AbstractJBossBehaviourDelegate.java 2012-02-01 05:23:23 UTC (rev 38355)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/AbstractJBossBehaviourDelegate.java 2012-02-01 06:51:11 UTC (rev 38356)
@@ -15,6 +15,7 @@
import org.eclipse.core.runtime.Status;
import org.eclipse.wst.server.core.IServer;
import org.jboss.ide.eclipse.as.core.server.IJBoss6Server;
+import org.jboss.ide.eclipse.as.core.server.IPollResultListener;
import org.jboss.ide.eclipse.as.core.server.IServerStatePoller;
import org.jboss.ide.eclipse.as.core.util.IJBossRuntimeConstants;
import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/BehaviourModel.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/BehaviourModel.java 2012-02-01 05:23:23 UTC (rev 38355)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/BehaviourModel.java 2012-02-01 06:51:11 UTC (rev 38356)
@@ -11,6 +11,7 @@
import org.eclipse.core.runtime.Platform;
import org.eclipse.wst.server.core.IServer;
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
+import org.jboss.ide.eclipse.as.core.server.IJBossBehaviourDelegate;
import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethod;
import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethodType;
import org.jboss.ide.eclipse.as.core.server.internal.launch.IJBossLaunchDelegate;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DelegatingServerBehavior.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DelegatingServerBehavior.java 2012-02-01 05:23:23 UTC (rev 38355)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DelegatingServerBehavior.java 2012-02-01 06:51:11 UTC (rev 38356)
@@ -26,6 +26,7 @@
import org.jboss.ide.eclipse.as.core.publishers.PublishUtil;
import org.jboss.ide.eclipse.as.core.publishers.patterns.IModulePathFilter;
import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
+import org.jboss.ide.eclipse.as.core.server.IJBossBehaviourDelegate;
import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethod;
import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethodType;
import org.jboss.ide.eclipse.as.core.server.internal.BehaviourModel.Behaviour;
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/IJBossBehaviourDelegate.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/IJBossBehaviourDelegate.java 2012-02-01 05:23:23 UTC (rev 38355)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/IJBossBehaviourDelegate.java 2012-02-01 06:51:11 UTC (rev 38356)
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-
-package org.jboss.ide.eclipse.as.core.server.internal;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.wst.server.core.IModule;
-import org.jboss.ide.eclipse.as.core.publishers.patterns.IModulePathFilter;
-
-public interface IJBossBehaviourDelegate {
-
- public String getBehaviourTypeId();
-
- public void setActualBehaviour(DelegatingServerBehavior actualBehaviour);
-
- public void stop(boolean force);
-
- public void publishStart(final IProgressMonitor monitor) throws CoreException;
-
- public void publishFinish(final IProgressMonitor monitor) throws CoreException;
-
- public void onServerStarting();
-
- public void onServerStopping();
-
- public void onServerStarted();
-
- public void onServerStopped();
-
- public IStatus canChangeState(String launchMode);
-
- public String getDefaultStopArguments() throws CoreException;
-
- /**
- * @since 2.3
- */
- public IModulePathFilter getPathFilter(IModule[] moduleTree);
-
- public void dispose();
-}
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/IPollResultListener.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/IPollResultListener.java 2012-02-01 05:23:23 UTC (rev 38355)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/IPollResultListener.java 2012-02-01 06:51:11 UTC (rev 38356)
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.ide.eclipse.as.core.server.internal;
-
-public interface IPollResultListener {
-
- /**
- * Called if the poller did
- * @param expectedState
- * @param currentState
- */
- public void stateAsserted(boolean expectedState, boolean currentState);
-
- public void stateNotAsserted(boolean expectedState, boolean currentState);
-}
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/IProcessProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/IProcessProvider.java 2012-02-01 05:23:23 UTC (rev 38355)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/IProcessProvider.java 2012-02-01 06:51:11 UTC (rev 38356)
@@ -1,18 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-
-package org.jboss.ide.eclipse.as.core.server.internal;
-
-import org.eclipse.debug.core.model.IProcess;
-
-public interface IProcessProvider {
- public IProcess getProcess();
-}
\ No newline at end of file
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/LocalJBossBehaviorDelegate.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/LocalJBossBehaviorDelegate.java 2012-02-01 05:23:23 UTC (rev 38355)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/LocalJBossBehaviorDelegate.java 2012-02-01 06:51:11 UTC (rev 38356)
@@ -38,6 +38,7 @@
import org.jboss.ide.eclipse.as.core.publishers.AbstractServerToolsPublisher;
import org.jboss.ide.eclipse.as.core.publishers.LocalPublishMethod;
import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
+import org.jboss.ide.eclipse.as.core.server.IProcessProvider;
import org.jboss.ide.eclipse.as.core.server.IServerStatePoller;
import org.jboss.ide.eclipse.as.core.server.internal.launch.configuration.LocalStopLaunchConfigurator;
import org.jboss.ide.eclipse.as.core.util.IJBossRuntimeConstants;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/PollThread.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/PollThread.java 2012-02-01 05:23:23 UTC (rev 38355)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/PollThread.java 2012-02-01 06:51:11 UTC (rev 38356)
@@ -19,6 +19,7 @@
import org.jboss.ide.eclipse.as.core.Messages;
import org.jboss.ide.eclipse.as.core.extensions.events.IEventCodes;
import org.jboss.ide.eclipse.as.core.extensions.events.ServerLogger;
+import org.jboss.ide.eclipse.as.core.server.IPollResultListener;
import org.jboss.ide.eclipse.as.core.server.IProvideCredentials;
import org.jboss.ide.eclipse.as.core.server.IServerStatePoller;
import org.jboss.ide.eclipse.as.core.server.IServerStatePoller.PollingException;
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/TwiddleLauncher.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/TwiddleLauncher.java 2012-02-01 05:23:23 UTC (rev 38355)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/TwiddleLauncher.java 2012-02-01 06:51:11 UTC (rev 38356)
@@ -1,209 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.ide.eclipse.as.core.server.internal.launch;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.core.IStreamListener;
-import org.eclipse.debug.core.model.IProcess;
-import org.eclipse.debug.core.model.IStreamMonitor;
-import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
-import org.eclipse.wst.server.core.IServer;
-import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
-import org.jboss.ide.eclipse.as.core.Messages;
-
-public class TwiddleLauncher {
-
- /**
- * Create one launch for each String of arguments.
- * Each element in the array is a COMPLETE LIST of arguments.
- * For example:
- * twiddleArgs[0] = "-s localhost:1099 -a jmx/rmi/RMIAdaptor get \"whatever\""
- * twiddleArgs[1] = "-s localhost:1099 -a jmx/rmi/RMIAdaptor get \"whatever2\""
- *
- * @param twiddleArgs
- * @param jbServer
- * @param seed
- * @return
- */
- public static ProcessData[] launchTwiddles(String[] twiddleArgs, IServer server, boolean addPrefix) throws CoreException {
- ILaunchConfigurationWorkingCopy wc;
- ArrayList<ProcessData> list = new ArrayList<ProcessData>();
- for( int i = 0; i < twiddleArgs.length; i++ ) {
- String args2 = addPrefix ? TwiddleLaunchConfiguration.getDefaultArgs(server) + twiddleArgs[i] : twiddleArgs[i];
- wc = TwiddleLaunchConfiguration.createLaunchConfiguration(server, args2);
- ILaunch launch = wc.launch(ILaunchManager.RUN_MODE, new NullProgressMonitor(), false, false);
- list.addAll(Arrays.asList(toProcessDatas(launch.getProcesses())));
- }
-
- ProcessData[] ret = new ProcessData[list.size()];
- list.toArray(ret);
-
- return ret;
- }
-
- protected static ProcessData[] toProcessDatas(IProcess[] processes) {
- ProcessData[] datas = new ProcessData[processes.length];
- for( int i = 0; i < processes.length; i++ ) {
- datas[i] = new ProcessData(processes[i], ""); //$NON-NLS-1$
- datas[i].startListening();
- }
- return datas;
- }
-
- private boolean canceled = false;
- private int delay = 500;
-
- public void setCanceled() {
- canceled = true;
- }
-
- public ProcessData[] getTwiddleResults(IServer server, String args, boolean addPrefix ) {
- ProcessData[] processes;
- try {
- processes = TwiddleLauncher.launchTwiddles(new String[] { args }, server, addPrefix);
- } catch( CoreException ce ) {
- return new ProcessData[0];
- }
- waitForThreadsToTerminate(processes);
-
- // stop listening
- for( int i = 0; i < processes.length; i++ ) {
- processes[i].stopListening();
- }
-
- return processes;
- }
-
- protected void waitForThreadsToTerminate(ProcessData[] processes) {
- boolean allTerminated = false;
- while( !allTerminated && !canceled) {
- allTerminated = true;
- for( int i = 0; i < processes.length; i++ ) {
- if( processes[i].getProcess().isTerminated() == false ) {
- allTerminated = false;
- }
- }
- if( !allTerminated ) {
- if( canceled ) {
- try {
- // if canceled, terminate all twiddle processes
- for( int i = 0; i < processes.length; i++ )
- processes[i].getProcess().terminate();
- } catch( DebugException e ) {
- IStatus s = new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
- Messages.TerminateTwiddleFailed, e);
- JBossServerCorePlugin.getDefault().getLog().log(s);
- }
- }
- // sleep
- try {
- Thread.sleep(delay);
- } catch( InterruptedException ie ) {
- }
- }
- }
- }
-
- public static class ProcessData implements IStreamListener {
- private String args;
- private String processType;
-
- private IProcess process;
- private IStreamMonitor outMonitor;
- private IStreamMonitor errMonitor;
-
- private String out, err;
-
- public ProcessData(IProcess process, String processType) {
- this(null, process, processType);
- try {
- this.args = process.getLaunch().getLaunchConfiguration().
- getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, (String)null);
- } catch( CoreException ce ) {
- }
-
- }
-
- public ProcessData(String args, IProcess process, String processType) {
- this.args = args;
- this.process = process;
- this.processType = processType;
-
- //ASDebug.p("process is " + process, this);
- //ASDebug.p("Stream Proxy is " + process.getStreamsProxy(), this);
- this.outMonitor = process.getStreamsProxy().getOutputStreamMonitor();
- this.errMonitor = process.getStreamsProxy().getErrorStreamMonitor();
-
- out = ""; //$NON-NLS-1$
- err = ""; //$NON-NLS-1$
- }
-
- public void startListening() {
- outMonitor.addListener(this);
- errMonitor.addListener(this);
- }
-
- public void stopListening() {
- outMonitor.removeListener(this);
- errMonitor.removeListener(this);
- }
-
- public void resetStrings() {
- out = ""; //$NON-NLS-1$
- err = ""; //$NON-NLS-1$
- }
-
- public void destroy() {
- stopListening();
- resetStrings();
- }
-
- public void streamAppended(String text, IStreamMonitor monitor) {
- if( monitor == outMonitor ) {
- out += text;
- } else if( monitor == errMonitor ) {
- err += text;
- }
- }
-
- public String getArgs() {
- return args;
- }
-
- public String getErr() {
- return err;
- }
-
- public String getOut() {
- return out;
- }
-
- public String getProcesType() {
- return processType;
- }
-
- public IProcess getProcess() {
- return process;
- }
-
- }
-
-}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration/LocalStopLaunchConfigurator.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration/LocalStopLaunchConfigurator.java 2012-02-01 05:23:23 UTC (rev 38355)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration/LocalStopLaunchConfigurator.java 2012-02-01 06:51:11 UTC (rev 38356)
@@ -17,8 +17,8 @@
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
import org.eclipse.wst.server.core.IServer;
+import org.jboss.ide.eclipse.as.core.server.IJBossBehaviourDelegate;
import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
-import org.jboss.ide.eclipse.as.core.server.internal.IJBossBehaviourDelegate;
import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
import org.jboss.ide.eclipse.as.core.util.IJBossRuntimeConstants;
import org.jboss.ide.eclipse.as.core.util.IJBossRuntimeResourceConstants;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/xpl/LocalCopyCallback.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/xpl/LocalCopyCallback.java 2012-02-01 05:23:23 UTC (rev 38355)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/xpl/LocalCopyCallback.java 2012-02-01 06:51:11 UTC (rev 38356)
@@ -27,9 +27,9 @@
import org.jboss.ide.eclipse.as.core.publishers.PublishUtil;
import org.jboss.ide.eclipse.as.core.server.internal.DeployableServerBehavior;
import org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil.IPublishCopyCallbackHandler;
+import org.jboss.ide.eclipse.as.core.util.FileUtil;
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
import org.jboss.ide.eclipse.as.core.util.StreamUtils;
-import org.jboss.ide.eclipse.as.core.util.internal.FileUtils;
public class LocalCopyCallback implements IPublishCopyCallbackHandler {
@@ -82,7 +82,7 @@
*/
private IStatus copyFile(InputStream in, String to) {
try {
- FileUtils.writeTo(in, to);
+ FileUtil.writeTo(in, to);
return Status.OK_STATUS;
} catch (IOException e) {
//Trace.trace(Trace.SEVERE, "Error copying file", e);
@@ -130,7 +130,7 @@
private File writeToTempFile(InputStream in, IPath filePath) throws IOException {
// Change from original PublishUtil, will require
File tempFile = File.createTempFile(TEMPFILE_PREFIX, "." + filePath.getFileExtension(), getTempFolder()); //$NON-NLS-1$
- FileUtils.writeTo(in, tempFile);
+ FileUtil.writeTo(in, tempFile);
return tempFile;
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/xpl/PublishCopyUtil.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/xpl/PublishCopyUtil.java 2012-02-01 05:23:23 UTC (rev 38355)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/xpl/PublishCopyUtil.java 2012-02-01 06:51:11 UTC (rev 38356)
@@ -30,8 +30,8 @@
import org.eclipse.wst.server.core.model.IModuleResourceDelta;
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
import org.jboss.ide.eclipse.as.core.extensions.events.IEventCodes;
+import org.jboss.ide.eclipse.as.core.modules.ResourceModuleResourceUtil;
import org.jboss.ide.eclipse.as.core.publishers.AbstractServerToolsPublisher;
-import org.jboss.ide.eclipse.as.core.publishers.PublishUtil;
import org.jboss.ide.eclipse.as.core.publishers.patterns.IModulePathFilter;
/**
* Utility class with an assortment of useful file methods.
@@ -253,7 +253,7 @@
* @since 2.3
*/
public IStatus[] initFullPublish(IModuleResource[] resources, IModulePathFilter filter, IProgressMonitor monitor) throws CoreException {
- int count = PublishUtil.countMembers(resources);
+ int count = ResourceModuleResourceUtil.countMembers(resources);
monitor = ProgressUtil.getMonitorFor(monitor);
monitor.beginTask("Publishing " + count + " resources", //$NON-NLS-1$ //$NON-NLS-2$
(100 * (count)) + 200);
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/DeploymentPreferenceLoader.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/DeploymentPreferenceLoader.java 2012-02-01 05:23:23 UTC (rev 38355)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/DeploymentPreferenceLoader.java 2012-02-01 06:51:11 UTC (rev 38356)
@@ -29,8 +29,6 @@
import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethodType;
import org.jboss.ide.eclipse.as.core.server.internal.BehaviourModel;
import org.jboss.ide.eclipse.as.core.server.internal.ServerAttributeHelper;
-import org.jboss.ide.eclipse.as.core.util.internal.IMemento;
-import org.jboss.ide.eclipse.as.core.util.internal.XMLMemento;
public class DeploymentPreferenceLoader {
public static final String DEPLOYMENT_PREFERENCES_KEY = "org.jboss.ide.eclipse.as.core.util.deploymentPreferenceKey"; //$NON-NLS-1$
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/FileUtil.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/FileUtil.java 2012-02-01 05:23:23 UTC (rev 38355)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/FileUtil.java 2012-02-01 06:51:11 UTC (rev 38356)
@@ -12,6 +12,7 @@
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
+import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileFilter;
import java.io.FileInputStream;
@@ -22,7 +23,10 @@
import java.util.ArrayList;
import java.util.Date;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Status;
import org.eclipse.osgi.util.NLS;
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
@@ -277,4 +281,106 @@
}
}
+
+ // Copied from internal class FileUtils.java
+ private static final int BUFFER = 65536;
+
+ public static void writeTo(InputStream in, String fileName) throws IOException {
+ writeTo(in, new File(fileName));
+ }
+
+ public static void writeTo(InputStream in, File file) throws IOException {
+ OutputStream out = null;
+ try {
+ out = new BufferedOutputStream(new FileOutputStream(file));
+ writeTo(in, out);
+ } finally {
+ if (out != null) {
+ out.close();
+ }
+ }
+ }
+
+ public static void writeTo(InputStream in, OutputStream out) throws IOException {
+ byte[] buffer = new byte[BUFFER];
+ int avail = in.read(buffer);
+ while (avail > 0) {
+ out.write(buffer, 0, avail);
+ avail = in.read(buffer);
+ }
+ }
+
+ public static void setContents(File file, String contents) throws IOException, CoreException {
+ byte[] buffer = new byte[BUFFER];
+ InputStream in = new ByteArrayInputStream(contents.getBytes());
+ OutputStream out = null;
+ try {
+ out = new BufferedOutputStream(new FileOutputStream(file));
+ int avail = in.read(buffer);
+ while (avail > 0) {
+ out.write(buffer, 0, avail);
+ avail = in.read(buffer);
+ }
+ } finally {
+ if (out != null) {
+ out.close();
+ }
+ }
+ }
+
+ public static String getContents(IFile file) throws IOException, CoreException {
+ return getContents(file.getLocation().toFile());
+ }
+
+ public static String getContents(File aFile) throws IOException {
+ return new String(getBytesFromFile(aFile));
+ }
+
+ public static byte[] getBytesFromFile(File file) throws IOException {
+ InputStream is = new FileInputStream(file);
+ byte[] bytes = new byte[(int)file.length()];
+ int offset = 0;
+ int numRead = 0;
+ while (offset < bytes.length
+ && (numRead=is.read(bytes, offset, bytes.length-offset)) >= 0) {
+ offset += numRead;
+ }
+ is.close();
+ return bytes;
+ }
+
+ public static void setContents(IFile file, int val) throws IOException , CoreException{
+ setContents(file, "" + val); //$NON-NLS-1$
+ }
+
+ public static void setContents(IFile file, String val) throws IOException , CoreException{
+ if( !file.exists())
+ file.create(new ByteArrayInputStream((val).getBytes()), false, null);
+ else
+ file.setContents(new ByteArrayInputStream((val).getBytes()), false, false, new NullProgressMonitor());
+ try {
+ Thread.sleep(2000);
+ } catch( InterruptedException ie) {}
+ //JobUtils.waitForIdle();
+ }
+
+ public static int countFiles(File root) {
+ int count = 0;
+ if( !root.isDirectory() )
+ return 1;
+ File[] children = root.listFiles();
+ for( int i = 0; i < children.length; i++ )
+ count += countFiles(children[i]);
+ return count;
+ }
+
+ public static int countAllResources(File root) {
+ int count = 0;
+ if( !root.isDirectory() )
+ return 1;
+ File[] children = root.listFiles();
+ for( int i = 0; i < children.length; i++ )
+ count += countAllResources(children[i]);
+ return 1 + count;
+ }
}
Copied: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IMemento.java (from rev 38327, trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/internal/IMemento.java)
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IMemento.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IMemento.java 2012-02-01 06:51:11 UTC (rev 38356)
@@ -0,0 +1,115 @@
+/*******************************************************************************
+ * Copyright (c) 2006 Jeff Mesnil
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.jboss.ide.eclipse.as.core.util;
+
+import java.util.List;
+
+/**
+ * Stolen from webtools wst.server.core,
+ * represents a savable memento to be
+ * translated into xml
+ *
+ * Moved from org.jboss.ide.eclipse.as.core.util.internal
+ * to org.jboss.ide.eclipse.as.core.util
+ *
+ * May later move to COMMON
+ *
+ */
+public interface IMemento {
+ /**
+ * Creates a new child of this memento with the given type.
+ * <p>
+ * The <code>getChild</code> and <code>getChildren</code> methods
+ * are used to retrieve children of a given type.
+ * </p>
+ *
+ * @param type the type
+ * @return a new child memento
+ * @see #getChild
+ * @see #getChildren
+ */
+ public IMemento createChild(String type);
+
+ /**
+ * Returns the first child with the given type id.
+ *
+ * @param type the type id
+ * @return the first child with the given type
+ */
+ public IMemento getChild(String type);
+
+ /**
+ * Returns all children with the given type id.
+ *
+ * @param type the type id
+ * @return the list of children with the given type
+ */
+ public IMemento[] getChildren(String type);
+
+ /**
+ * Returns the floating point value of the given key.
+ *
+ * @param key the key
+ * @return the value, or <code>null</code> if the key was not found or was found
+ * but was not a floating point number
+ */
+ public Float getFloat(String key);
+
+ /**
+ * Returns the integer value of the given key.
+ *
+ * @param key the key
+ * @return the value, or <code>null</code> if the key was not found or was found
+ * but was not an integer
+ */
+ public Integer getInteger(String key);
+
+ /**
+ * Returns the string value of the given key.
+ *
+ * @param key the key
+ * @return the value, or <code>null</code> if the key was not found or was found
+ * but was not an integer
+ */
+ public String getString(String key);
+
+ /**
+ * Returns the boolean value of the given key.
+ *
+ * @param key the key
+ * @return the value, or <code>null</code> if the key was not found or was found
+ * but was not a boolean
+ */
+ public Boolean getBoolean(String key);
+
+ public List<String> getNames();
+
+ /**
+ * Sets the value of the given key to the given integer.
+ *
+ * @param key the key
+ * @param value the value
+ */
+ public void putInteger(String key, int value);
+
+ /**
+ * Sets the value of the given key to the given boolean value.
+ *
+ * @param key the key
+ * @param value the value
+ */
+ public void putBoolean(String key, boolean value);
+
+ /**
+ * Sets the value of the given key to the given string.
+ *
+ * @param key the key
+ * @param value the value
+ */
+ public void putString(String key, String value);
+}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/PollThreadUtils.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/PollThreadUtils.java 2012-02-01 05:23:23 UTC (rev 38355)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/PollThreadUtils.java 2012-02-01 06:51:11 UTC (rev 38356)
@@ -16,10 +16,10 @@
import org.eclipse.wst.server.core.IServer;
import org.jboss.ide.eclipse.as.core.ExtensionManager;
import org.jboss.ide.eclipse.as.core.server.INeedCredentials;
+import org.jboss.ide.eclipse.as.core.server.IPollResultListener;
import org.jboss.ide.eclipse.as.core.server.IProvideCredentials;
import org.jboss.ide.eclipse.as.core.server.IServerProvider;
import org.jboss.ide.eclipse.as.core.server.IServerStatePoller;
-import org.jboss.ide.eclipse.as.core.server.internal.IPollResultListener;
import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
import org.jboss.ide.eclipse.as.core.server.internal.PollThread;
import org.jboss.ide.eclipse.as.core.server.internal.ServerAttributeHelper;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ServerCreationUtils.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ServerCreationUtils.java 2012-02-01 05:23:23 UTC (rev 38355)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ServerCreationUtils.java 2012-02-01 06:51:11 UTC (rev 38356)
@@ -32,6 +32,7 @@
runtimeServerTypeMap.put(IJBossToolingConstants.AS_51, IJBossToolingConstants.SERVER_AS_51);
runtimeServerTypeMap.put(IJBossToolingConstants.AS_60, IJBossToolingConstants.SERVER_AS_60);
runtimeServerTypeMap.put(IJBossToolingConstants.AS_70, IJBossToolingConstants.SERVER_AS_70);
+ runtimeServerTypeMap.put(IJBossToolingConstants.AS_71, IJBossToolingConstants.SERVER_AS_71);
runtimeServerTypeMap.put(IJBossToolingConstants.EAP_43, IJBossToolingConstants.SERVER_EAP_43);
runtimeServerTypeMap.put(IJBossToolingConstants.EAP_50, IJBossToolingConstants.SERVER_EAP_50);
runtimeServerTypeMap.put(IJBossToolingConstants.EAP_60, IJBossToolingConstants.SERVER_EAP_60);
@@ -41,10 +42,10 @@
public static IServer createDeployOnlyServer(String deployLocation, String tempDeployLocation,
String rtName, String serverName) throws CoreException {
- IRuntimeType rt = ServerCore.findRuntimeType("org.jboss.ide.eclipse.as.runtime.stripped"); //$NON-NLS-1$
+ IRuntimeType rt = ServerCore.findRuntimeType(IJBossToolingConstants.DEPLOY_ONLY_RUNTIME);
IRuntimeWorkingCopy wc = rt.createRuntime(rtName, null);
IRuntime runtime = wc.save(true, null);
- IServerType st = ServerCore.findServerType("org.jboss.ide.eclipse.as.systemCopyServer"); //$NON-NLS-1$
+ IServerType st = ServerCore.findServerType(IJBossToolingConstants.DEPLOY_ONLY_SERVER);
ServerWorkingCopy swc = (ServerWorkingCopy) st.createServer(serverName, null, null);
swc.setServerConfiguration(null);
swc.setName(serverName);
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-02-01 05:23:23 UTC (rev 38355)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ServerUtil.java 2012-02-01 06:51:11 UTC (rev 38356)
@@ -33,9 +33,9 @@
import org.eclipse.wst.server.core.ServerCore;
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
import org.jboss.ide.eclipse.as.core.Messages;
+import org.jboss.ide.eclipse.as.core.server.IJBossBehaviourDelegate;
import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
import org.jboss.ide.eclipse.as.core.server.internal.DelegatingServerBehavior;
-import org.jboss.ide.eclipse.as.core.server.internal.IJBossBehaviourDelegate;
import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
public class ServerUtil {
Copied: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/XMLMemento.java (from rev 38327, trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/internal/XMLMemento.java)
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/XMLMemento.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/XMLMemento.java 2012-02-01 06:51:11 UTC (rev 38356)
@@ -0,0 +1,434 @@
+/*******************************************************************************
+ * Copyright (c) 2006 Jeff Mesnil
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.jboss.ide.eclipse.as.core.util;
+
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+import org.w3c.dom.Attr;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.Text;
+import org.xml.sax.InputSource;
+
+/**
+ * Stolen from webtools wst.server.core
+ * Moved from org.jboss.ide.eclipse.as.core.util.internal
+ * to org.jboss.ide.eclipse.as.core.util
+ *
+ * May later move to COMMON
+ *
+ */
+public class XMLMemento implements IMemento {
+ private Document factory;
+ private Element element;
+
+ /**
+ * Answer a memento for the document and element. For simplicity
+ * you should use createReadRoot and createWriteRoot to create the initial
+ * mementos on a document.
+ */
+ public XMLMemento(Document doc, Element el) {
+ factory = doc;
+ element = el;
+ }
+
+ /*
+ * @see IMemento
+ */
+ public IMemento createChild(String type) {
+ Element child = factory.createElement(type);
+ element.appendChild(child);
+ return new XMLMemento(factory, child);
+ }
+
+ public void removeChild(XMLMemento child) {
+ element.removeChild(child.element);
+ }
+
+ /**
+ * Create a Document from a Reader and answer a root memento for reading
+ * a document.
+ */
+ public static XMLMemento createReadRoot(InputStream in) {
+ Document document = null;
+ try {
+ DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+ DocumentBuilder parser = factory.newDocumentBuilder();
+ document = parser.parse(new InputSource(in));
+ Node node = document.getFirstChild();
+ if (node instanceof Element)
+ return new XMLMemento(document, (Element) node);
+ } catch (Exception e) {
+ // ignore
+ } finally {
+ try {
+ in.close();
+ } catch (Exception e) {
+ // ignore
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Answer a root memento for writing a document.
+ *
+ * @param type a type
+ * @return a memento
+ */
+ public static XMLMemento createWriteRoot(String type) {
+ Document document;
+ try {
+ document = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
+ Element element = document.createElement(type);
+ document.appendChild(element);
+ return new XMLMemento(document, element);
+ } catch (ParserConfigurationException e) {
+ throw new Error(e);
+ }
+ }
+
+ /*
+ * @see IMemento
+ */
+ public IMemento getChild(String type) {
+ // Get the nodes.
+ NodeList nodes = element.getChildNodes();
+ int size = nodes.getLength();
+ if (size == 0)
+ return null;
+
+ // Find the first node which is a child of this node.
+ for (int nX = 0; nX < size; nX ++) {
+ Node node = nodes.item(nX);
+ if (node instanceof Element) {
+ Element element2 = (Element)node;
+ if (element2.getNodeName().equals(type))
+ return new XMLMemento(factory, element2);
+ }
+ }
+
+ // A child was not found.
+ return null;
+ }
+
+ /*
+ * @see IMemento
+ */
+ public IMemento [] getChildren(String type) {
+ // Get the nodes.
+ NodeList nodes = element.getChildNodes();
+ int size = nodes.getLength();
+ if (size == 0)
+ return new IMemento[0];
+
+ // Extract each node with given type.
+ List<Element> list = new ArrayList<Element>(size);
+ for (int nX = 0; nX < size; nX ++) {
+ Node node = nodes.item(nX);
+ if (node instanceof Element) {
+ Element element2 = (Element)node;
+ if (element2.getNodeName().equals(type))
+ list.add(element2);
+ }
+ }
+
+ // Create a memento for each node.
+ size = list.size();
+ IMemento [] results = new IMemento[size];
+ for (int x = 0; x < size; x ++) {
+ results[x] = new XMLMemento(factory, list.get(x));
+ }
+ return results;
+ }
+
+ public String[] getChildNames() {
+ // Get the nodes.
+ NodeList nodes = element.getChildNodes();
+ int size = nodes.getLength();
+ if (size == 0)
+ return new String[0];
+
+ // Extract each node with given type.
+ List<String> list = new ArrayList<String>();
+ for (int nX = 0; nX < size; nX ++) {
+ Node node = nodes.item(nX);
+ if (node instanceof Element) {
+ Element element2 = (Element)node;
+ if (!list.contains(element2.getNodeName()))
+ list.add(element2.getNodeName());
+ }
+ }
+ return (String[]) list.toArray(new String[list.size()]);
+ }
+
+ /**
+ * Return the contents of this memento as a byte array.
+ *
+ * @return byte[]
+ * @throws IOException if anything goes wrong
+ */
+ public byte[] getContents() throws IOException {
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
+ save(out);
+ return out.toByteArray();
+ }
+
+ /**
+ * Returns an input stream for writing to the disk with a local locale.
+ *
+ * @return java.io.InputStream
+ * @throws IOException if anything goes wrong
+ */
+ public InputStream getInputStream() throws IOException {
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
+ save(out);
+ return new ByteArrayInputStream(out.toByteArray());
+ }
+
+ /*
+ * @see IMemento
+ */
+ public Float getFloat(String key) {
+ Attr attr = element.getAttributeNode(key);
+ if (attr == null)
+ return null;
+ String strValue = attr.getValue();
+ try {
+ return new Float(strValue);
+ } catch (NumberFormatException e) {
+ return null;
+ }
+ }
+
+ /*
+ * @see IMemento
+ */
+ public Integer getInteger(String key) {
+ Attr attr = element.getAttributeNode(key);
+ if (attr == null)
+ return null;
+ String strValue = attr.getValue();
+ try {
+ return new Integer(strValue);
+ } catch (NumberFormatException e) {
+ return null;
+ }
+ }
+
+ /*
+ * @see IMemento
+ */
+ public String getString(String key) {
+ Attr attr = element.getAttributeNode(key);
+ if (attr == null)
+ return null;
+ return attr.getValue();
+ }
+
+ public List<String> getNames() {
+ NamedNodeMap map = element.getAttributes();
+ int size = map.getLength();
+ List<String> list = new ArrayList<String>();
+ for (int i = 0; i < size; i++) {
+ Node node = map.item(i);
+ String name = node.getNodeName();
+ list.add(name);
+ }
+ return list;
+ }
+
+ /**
+ * Loads a memento from the given filename.
+ *
+ * @param in java.io.InputStream
+ * @return org.eclipse.ui.IMemento
+ */
+ public static IMemento loadMemento(InputStream in) {
+ return createReadRoot(in);
+ }
+
+ /**
+ * Loads a memento from the given filename.
+ *
+ * @param filename java.lang.String
+ * @return org.eclipse.ui.IMemento
+ * @exception java.io.IOException
+ */
+ public static IMemento loadMemento(String filename) throws IOException {
+ InputStream in = null;
+ try {
+ in = new BufferedInputStream(new FileInputStream(filename));
+ return XMLMemento.createReadRoot(in);
+ } finally {
+ try {
+ if (in != null)
+ in.close();
+ } catch (Exception e) {
+ // ignore
+ }
+ }
+ }
+
+ /*
+ * @see IMemento
+ */
+ public void putInteger(String key, int n) {
+ element.setAttribute(key, String.valueOf(n));
+ }
+
+ /*
+ * @see IMemento
+ */
+ public void putString(String key, String value) {
+ if (value == null)
+ return;
+ element.setAttribute(key, value);
+ }
+
+ /**
+ * Save this Memento to a Writer.
+ *
+ * @throws IOException if there is a problem saving
+ */
+ public void save(OutputStream os) throws IOException {
+ Result result = new StreamResult(os);
+ Source source = new DOMSource(factory);
+ try {
+ Transformer transformer = TransformerFactory.newInstance().newTransformer();
+ transformer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$
+ transformer.setOutputProperty(OutputKeys.METHOD, "xml"); //$NON-NLS-1$
+ transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8"); //$NON-NLS-1$
+ transformer.setOutputProperty("{http://xml.apache.org/xalan}indent-amount", "2"); //$NON-NLS-1$ //$NON-NLS-2$
+ transformer.transform(source, result);
+ } catch (Exception e) {
+ throw (IOException) (new IOException().initCause(e));
+ }
+ }
+
+ /**
+ * Saves the memento to the given file.
+ *
+ * @param filename java.lang.String
+ * @exception java.io.IOException
+ */
+ public void saveToFile(String filename) throws IOException {
+ BufferedOutputStream w = null;
+ try {
+ w = new BufferedOutputStream(new FileOutputStream(filename));
+ save(w);
+ } catch (IOException e) {
+ throw e;
+ } catch (Exception e) {
+ throw new IOException(e.getLocalizedMessage());
+ } finally {
+ if (w != null) {
+ try {
+ w.close();
+ } catch (Exception e) {
+ // ignore
+ }
+ }
+ }
+ }
+
+ public String saveToString() throws IOException {
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
+ save(out);
+ return out.toString("UTF-8"); //$NON-NLS-1$
+ }
+
+ /*
+ * @see IMemento#getBoolean(String)
+ */
+ public Boolean getBoolean(String key) {
+ Attr attr = element.getAttributeNode(key);
+ if (attr == null)
+ return null;
+ String strValue = attr.getValue();
+ if ("true".equalsIgnoreCase(strValue)) //$NON-NLS-1$
+ return new Boolean(true);
+ return new Boolean(false);
+ }
+
+ /*
+ * @see IMemento#putBoolean(String, boolean)
+ */
+ public void putBoolean(String key, boolean value) {
+ element.setAttribute(key, new Boolean(value).toString());
+ }
+
+ /**
+ * Returns the Text node of the memento. Each memento is allowed only
+ * one Text node.
+ *
+ * @return the Text node of the memento, or <code>null</code> if
+ * the memento has no Text node.
+ */
+ public Text getTextNode() {
+ // Get the nodes.
+ NodeList nodes = element.getChildNodes();
+ int size = nodes.getLength();
+ if (size == 0) {
+ return null;
+ }
+ for (int nX = 0; nX < size; nX++) {
+ Node node = nodes.item(nX);
+ if (node instanceof Text) {
+ return (Text) node;
+ }
+ }
+ // a Text node was not found
+ return null;
+ }
+
+ /* (non-Javadoc)
+ */
+ public void putTextData(String data) {
+ Text textNode = getTextNode();
+ if (textNode == null) {
+ textNode = factory.createTextNode(data);
+ // Always add the text node as the first child (fixes bug 93718)
+ element.insertBefore(textNode, element.getFirstChild());
+ } else {
+ textNode.setData(data);
+ }
+ }
+
+ public String getTextData() {
+ Text textNode = getTextNode();
+ if (textNode != null) {
+ return textNode.getData();
+ }
+ return ""; //$NON-NLS-1$
+ }
+}
\ No newline at end of file
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/internal/FileUtils.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/internal/FileUtils.java 2012-02-01 05:23:23 UTC (rev 38355)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/internal/FileUtils.java 2012-02-01 06:51:11 UTC (rev 38356)
@@ -1,135 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.ide.eclipse.as.core.util.internal;
-
-import java.io.BufferedOutputStream;
-import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.NullProgressMonitor;
-
-/**
- * Various util methods that allow to read and write to files.
- *
- * @author André Dietisheim
- *
- */
-public class FileUtils {
-
- private static final int BUFFER = 65536;
-
- public static void writeTo(InputStream in, String fileName) throws IOException {
- writeTo(in, new File(fileName));
- }
-
- public static void writeTo(InputStream in, File file) throws IOException {
- OutputStream out = null;
- try {
- out = new BufferedOutputStream(new FileOutputStream(file));
- writeTo(in, out);
- } finally {
- if (out != null) {
- out.close();
- }
- }
- }
-
- public static void writeTo(InputStream in, OutputStream out) throws IOException {
- byte[] buffer = new byte[BUFFER];
- int avail = in.read(buffer);
- while (avail > 0) {
- out.write(buffer, 0, avail);
- avail = in.read(buffer);
- }
- }
-
- public static void setContents(File file, String contents) throws IOException, CoreException {
- byte[] buffer = new byte[BUFFER];
- InputStream in = new ByteArrayInputStream(contents.getBytes());
- OutputStream out = null;
- try {
- out = new BufferedOutputStream(new FileOutputStream(file));
- int avail = in.read(buffer);
- while (avail > 0) {
- out.write(buffer, 0, avail);
- avail = in.read(buffer);
- }
- } finally {
- if (out != null) {
- out.close();
- }
- }
- }
-
- public static String getContents(IFile file) throws IOException, CoreException {
- return getContents(file.getLocation().toFile());
- }
-
- public static String getContents(File aFile) throws IOException {
- return new String(getBytesFromFile(aFile));
- }
-
- public static byte[] getBytesFromFile(File file) throws IOException {
- InputStream is = new FileInputStream(file);
- byte[] bytes = new byte[(int)file.length()];
- int offset = 0;
- int numRead = 0;
- while (offset < bytes.length
- && (numRead=is.read(bytes, offset, bytes.length-offset)) >= 0) {
- offset += numRead;
- }
- is.close();
- return bytes;
- }
-
- public static void setContents(IFile file, int val) throws IOException , CoreException{
- setContents(file, "" + val); //$NON-NLS-1$
- }
-
- public static void setContents(IFile file, String val) throws IOException , CoreException{
- if( !file.exists())
- file.create(new ByteArrayInputStream((val).getBytes()), false, null);
- else
- file.setContents(new ByteArrayInputStream((val).getBytes()), false, false, new NullProgressMonitor());
- try {
- Thread.sleep(2000);
- } catch( InterruptedException ie) {}
- //JobUtils.waitForIdle();
- }
-
- public static int countFiles(File root) {
- int count = 0;
- if( !root.isDirectory() )
- return 1;
- File[] children = root.listFiles();
- for( int i = 0; i < children.length; i++ )
- count += countFiles(children[i]);
- return count;
- }
-
- public static int countAllResources(File root) {
- int count = 0;
- if( !root.isDirectory() )
- return 1;
- File[] children = root.listFiles();
- for( int i = 0; i < children.length; i++ )
- count += countAllResources(children[i]);
- return 1 + count;
- }
-
-}
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/internal/IMemento.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/internal/IMemento.java 2012-02-01 05:23:23 UTC (rev 38355)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/internal/IMemento.java 2012-02-01 06:51:11 UTC (rev 38356)
@@ -1,110 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Jeff Mesnil
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.jboss.ide.eclipse.as.core.util.internal;
-
-import java.util.List;
-
-/**
- * Stolen from webtools wst.server.core,
- * represents a savable memento to be
- * translated into xml
- *
- */
-public interface IMemento {
- /**
- * Creates a new child of this memento with the given type.
- * <p>
- * The <code>getChild</code> and <code>getChildren</code> methods
- * are used to retrieve children of a given type.
- * </p>
- *
- * @param type the type
- * @return a new child memento
- * @see #getChild
- * @see #getChildren
- */
- public IMemento createChild(String type);
-
- /**
- * Returns the first child with the given type id.
- *
- * @param type the type id
- * @return the first child with the given type
- */
- public IMemento getChild(String type);
-
- /**
- * Returns all children with the given type id.
- *
- * @param type the type id
- * @return the list of children with the given type
- */
- public IMemento[] getChildren(String type);
-
- /**
- * Returns the floating point value of the given key.
- *
- * @param key the key
- * @return the value, or <code>null</code> if the key was not found or was found
- * but was not a floating point number
- */
- public Float getFloat(String key);
-
- /**
- * Returns the integer value of the given key.
- *
- * @param key the key
- * @return the value, or <code>null</code> if the key was not found or was found
- * but was not an integer
- */
- public Integer getInteger(String key);
-
- /**
- * Returns the string value of the given key.
- *
- * @param key the key
- * @return the value, or <code>null</code> if the key was not found or was found
- * but was not an integer
- */
- public String getString(String key);
-
- /**
- * Returns the boolean value of the given key.
- *
- * @param key the key
- * @return the value, or <code>null</code> if the key was not found or was found
- * but was not a boolean
- */
- public Boolean getBoolean(String key);
-
- public List<String> getNames();
-
- /**
- * Sets the value of the given key to the given integer.
- *
- * @param key the key
- * @param value the value
- */
- public void putInteger(String key, int value);
-
- /**
- * Sets the value of the given key to the given boolean value.
- *
- * @param key the key
- * @param value the value
- */
- public void putBoolean(String key, boolean value);
-
- /**
- * Sets the value of the given key to the given string.
- *
- * @param key the key
- * @param value the value
- */
- public void putString(String key, String value);
-}
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/internal/XMLMemento.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/internal/XMLMemento.java 2012-02-01 05:23:23 UTC (rev 38355)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/internal/XMLMemento.java 2012-02-01 06:51:11 UTC (rev 38356)
@@ -1,430 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Jeff Mesnil
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *******************************************************************************/
-package org.jboss.ide.eclipse.as.core.util.internal;
-
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.OutputKeys;
-import javax.xml.transform.Result;
-import javax.xml.transform.Source;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Text;
-import org.xml.sax.InputSource;
-
-/**
- * Stolen from webtools wst.server.core
- *
- */
-public final class XMLMemento implements IMemento {
- private Document factory;
- private Element element;
-
- /**
- * Answer a memento for the document and element. For simplicity
- * you should use createReadRoot and createWriteRoot to create the initial
- * mementos on a document.
- */
- public XMLMemento(Document doc, Element el) {
- factory = doc;
- element = el;
- }
-
- /*
- * @see IMemento
- */
- public IMemento createChild(String type) {
- Element child = factory.createElement(type);
- element.appendChild(child);
- return new XMLMemento(factory, child);
- }
-
- public void removeChild(XMLMemento child) {
- element.removeChild(child.element);
- }
-
- /**
- * Create a Document from a Reader and answer a root memento for reading
- * a document.
- */
- public static XMLMemento createReadRoot(InputStream in) {
- Document document = null;
- try {
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
- DocumentBuilder parser = factory.newDocumentBuilder();
- document = parser.parse(new InputSource(in));
- Node node = document.getFirstChild();
- if (node instanceof Element)
- return new XMLMemento(document, (Element) node);
- } catch (Exception e) {
- // ignore
- } finally {
- try {
- in.close();
- } catch (Exception e) {
- // ignore
- }
- }
- return null;
- }
-
- /**
- * Answer a root memento for writing a document.
- *
- * @param type a type
- * @return a memento
- */
- public static XMLMemento createWriteRoot(String type) {
- Document document;
- try {
- document = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
- Element element = document.createElement(type);
- document.appendChild(element);
- return new XMLMemento(document, element);
- } catch (ParserConfigurationException e) {
- throw new Error(e);
- }
- }
-
- /*
- * @see IMemento
- */
- public IMemento getChild(String type) {
- // Get the nodes.
- NodeList nodes = element.getChildNodes();
- int size = nodes.getLength();
- if (size == 0)
- return null;
-
- // Find the first node which is a child of this node.
- for (int nX = 0; nX < size; nX ++) {
- Node node = nodes.item(nX);
- if (node instanceof Element) {
- Element element2 = (Element)node;
- if (element2.getNodeName().equals(type))
- return new XMLMemento(factory, element2);
- }
- }
-
- // A child was not found.
- return null;
- }
-
- /*
- * @see IMemento
- */
- public IMemento [] getChildren(String type) {
- // Get the nodes.
- NodeList nodes = element.getChildNodes();
- int size = nodes.getLength();
- if (size == 0)
- return new IMemento[0];
-
- // Extract each node with given type.
- List<Element> list = new ArrayList<Element>(size);
- for (int nX = 0; nX < size; nX ++) {
- Node node = nodes.item(nX);
- if (node instanceof Element) {
- Element element2 = (Element)node;
- if (element2.getNodeName().equals(type))
- list.add(element2);
- }
- }
-
- // Create a memento for each node.
- size = list.size();
- IMemento [] results = new IMemento[size];
- for (int x = 0; x < size; x ++) {
- results[x] = new XMLMemento(factory, list.get(x));
- }
- return results;
- }
-
- public String[] getChildNames() {
- // Get the nodes.
- NodeList nodes = element.getChildNodes();
- int size = nodes.getLength();
- if (size == 0)
- return new String[0];
-
- // Extract each node with given type.
- List<String> list = new ArrayList<String>();
- for (int nX = 0; nX < size; nX ++) {
- Node node = nodes.item(nX);
- if (node instanceof Element) {
- Element element2 = (Element)node;
- if (!list.contains(element2.getNodeName()))
- list.add(element2.getNodeName());
- }
- }
- return (String[]) list.toArray(new String[list.size()]);
- }
-
- /**
- * Return the contents of this memento as a byte array.
- *
- * @return byte[]
- * @throws IOException if anything goes wrong
- */
- public byte[] getContents() throws IOException {
- ByteArrayOutputStream out = new ByteArrayOutputStream();
- save(out);
- return out.toByteArray();
- }
-
- /**
- * Returns an input stream for writing to the disk with a local locale.
- *
- * @return java.io.InputStream
- * @throws IOException if anything goes wrong
- */
- public InputStream getInputStream() throws IOException {
- ByteArrayOutputStream out = new ByteArrayOutputStream();
- save(out);
- return new ByteArrayInputStream(out.toByteArray());
- }
-
- /*
- * @see IMemento
- */
- public Float getFloat(String key) {
- Attr attr = element.getAttributeNode(key);
- if (attr == null)
- return null;
- String strValue = attr.getValue();
- try {
- return new Float(strValue);
- } catch (NumberFormatException e) {
- return null;
- }
- }
-
- /*
- * @see IMemento
- */
- public Integer getInteger(String key) {
- Attr attr = element.getAttributeNode(key);
- if (attr == null)
- return null;
- String strValue = attr.getValue();
- try {
- return new Integer(strValue);
- } catch (NumberFormatException e) {
- return null;
- }
- }
-
- /*
- * @see IMemento
- */
- public String getString(String key) {
- Attr attr = element.getAttributeNode(key);
- if (attr == null)
- return null;
- return attr.getValue();
- }
-
- public List<String> getNames() {
- NamedNodeMap map = element.getAttributes();
- int size = map.getLength();
- List<String> list = new ArrayList<String>();
- for (int i = 0; i < size; i++) {
- Node node = map.item(i);
- String name = node.getNodeName();
- list.add(name);
- }
- return list;
- }
-
- /**
- * Loads a memento from the given filename.
- *
- * @param in java.io.InputStream
- * @return org.eclipse.ui.IMemento
- */
- public static IMemento loadMemento(InputStream in) {
- return createReadRoot(in);
- }
-
- /**
- * Loads a memento from the given filename.
- *
- * @param filename java.lang.String
- * @return org.eclipse.ui.IMemento
- * @exception java.io.IOException
- */
- public static IMemento loadMemento(String filename) throws IOException {
- InputStream in = null;
- try {
- in = new BufferedInputStream(new FileInputStream(filename));
- return XMLMemento.createReadRoot(in);
- } finally {
- try {
- if (in != null)
- in.close();
- } catch (Exception e) {
- // ignore
- }
- }
- }
-
- /*
- * @see IMemento
- */
- public void putInteger(String key, int n) {
- element.setAttribute(key, String.valueOf(n));
- }
-
- /*
- * @see IMemento
- */
- public void putString(String key, String value) {
- if (value == null)
- return;
- element.setAttribute(key, value);
- }
-
- /**
- * Save this Memento to a Writer.
- *
- * @throws IOException if there is a problem saving
- */
- public void save(OutputStream os) throws IOException {
- Result result = new StreamResult(os);
- Source source = new DOMSource(factory);
- try {
- Transformer transformer = TransformerFactory.newInstance().newTransformer();
- transformer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$
- transformer.setOutputProperty(OutputKeys.METHOD, "xml"); //$NON-NLS-1$
- transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8"); //$NON-NLS-1$
- transformer.setOutputProperty("{http://xml.apache.org/xalan}indent-amount", "2"); //$NON-NLS-1$ //$NON-NLS-2$
- transformer.transform(source, result);
- } catch (Exception e) {
- throw (IOException) (new IOException().initCause(e));
- }
- }
-
- /**
- * Saves the memento to the given file.
- *
- * @param filename java.lang.String
- * @exception java.io.IOException
- */
- public void saveToFile(String filename) throws IOException {
- BufferedOutputStream w = null;
- try {
- w = new BufferedOutputStream(new FileOutputStream(filename));
- save(w);
- } catch (IOException e) {
- throw e;
- } catch (Exception e) {
- throw new IOException(e.getLocalizedMessage());
- } finally {
- if (w != null) {
- try {
- w.close();
- } catch (Exception e) {
- // ignore
- }
- }
- }
- }
-
- public String saveToString() throws IOException {
- ByteArrayOutputStream out = new ByteArrayOutputStream();
- save(out);
- return out.toString("UTF-8"); //$NON-NLS-1$
- }
-
- /*
- * @see IMemento#getBoolean(String)
- */
- public Boolean getBoolean(String key) {
- Attr attr = element.getAttributeNode(key);
- if (attr == null)
- return null;
- String strValue = attr.getValue();
- if ("true".equalsIgnoreCase(strValue)) //$NON-NLS-1$
- return new Boolean(true);
- return new Boolean(false);
- }
-
- /*
- * @see IMemento#putBoolean(String, boolean)
- */
- public void putBoolean(String key, boolean value) {
- element.setAttribute(key, new Boolean(value).toString());
- }
-
- /**
- * Returns the Text node of the memento. Each memento is allowed only
- * one Text node.
- *
- * @return the Text node of the memento, or <code>null</code> if
- * the memento has no Text node.
- */
- public Text getTextNode() {
- // Get the nodes.
- NodeList nodes = element.getChildNodes();
- int size = nodes.getLength();
- if (size == 0) {
- return null;
- }
- for (int nX = 0; nX < size; nX++) {
- Node node = nodes.item(nX);
- if (node instanceof Text) {
- return (Text) node;
- }
- }
- // a Text node was not found
- return null;
- }
-
- /* (non-Javadoc)
- */
- public void putTextData(String data) {
- Text textNode = getTextNode();
- if (textNode == null) {
- textNode = factory.createTextNode(data);
- // Always add the text node as the first child (fixes bug 93718)
- element.insertBefore(textNode, element.getFirstChild());
- } else {
- textNode.setData(data);
- }
- }
-
- public String getTextData() {
- Text textNode = getTextNode();
- if (textNode != null) {
- return textNode.getData();
- }
- return ""; //$NON-NLS-1$
- }
-}
\ No newline at end of file
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEJBossStartLaunchDelegate.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEJBossStartLaunchDelegate.java 2012-02-01 05:23:23 UTC (rev 38355)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEJBossStartLaunchDelegate.java 2012-02-01 06:51:11 UTC (rev 38356)
@@ -21,8 +21,8 @@
import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
import org.eclipse.wst.server.core.IServer;
import org.jboss.ide.eclipse.as.core.extensions.polling.WebPortPoller;
+import org.jboss.ide.eclipse.as.core.server.IJBossBehaviourDelegate;
import org.jboss.ide.eclipse.as.core.server.internal.DelegatingServerBehavior;
-import org.jboss.ide.eclipse.as.core.server.internal.IJBossBehaviourDelegate;
import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
import org.jboss.ide.eclipse.as.core.server.internal.launch.DelegatingStartLaunchConfiguration;
import org.jboss.ide.eclipse.as.core.server.internal.launch.configuration.JBossLaunchConfigProperties;
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs/TwiddleDialog.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs/TwiddleDialog.java 2012-02-01 05:23:23 UTC (rev 38355)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs/TwiddleDialog.java 2012-02-01 06:51:11 UTC (rev 38356)
@@ -1,176 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009 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.ui.dialogs;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.TrayDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.server.core.IServer;
-import org.jboss.ide.eclipse.as.core.server.internal.launch.TwiddleLaunchConfiguration;
-import org.jboss.ide.eclipse.as.core.server.internal.launch.TwiddleLauncher;
-import org.jboss.ide.eclipse.as.core.server.internal.launch.TwiddleLauncher.ProcessData;
-import org.jboss.ide.eclipse.as.ui.JBossServerUIPlugin;
-import org.jboss.ide.eclipse.as.ui.JBossServerUISharedImages;
-import org.jboss.ide.eclipse.as.ui.Messages;
-
-/**
- *
- * @author Rob Stryker <rob.stryker(a)redhat.com>
- *
- */
-public class TwiddleDialog extends TrayDialog {
-
- private static final int EXECUTE_ID = 2042;
- private Text query, results;
- private Label queryLabel;
- private IServer server = null;
- private Composite parentComposite;
-
-
- public TwiddleDialog(Shell parentShell, Object selection) {
- super(parentShell);
- setShellStyle(getShellStyle() | SWT.RESIZE);
- if( selection instanceof IServer ) {
- server = (IServer)selection;
- }
-
- }
-
- protected void configureShell(Shell newShell) {
- super.configureShell(newShell);
- newShell.setText(Messages.TwiddleDialog);
- newShell.setImage(JBossServerUISharedImages.getImage(JBossServerUISharedImages.TWIDDLE_IMAGE));
- }
-
- protected Point getInitialSize() {
- return new Point(600, 300);
- }
-
- protected void createButtonsForButtonBar(Composite parent) {
- // create OK and Cancel buttons by default
- createButton(parent, EXECUTE_ID, Messages.TwiddleDialogExecute, true);
- createButton(parent, IDialogConstants.OK_ID, Messages.TwiddleDialogDone,
- false);
- }
-
- protected void buttonPressed(int buttonId) {
- if (IDialogConstants.OK_ID == buttonId) {
- okPressed();
- } else if (EXECUTE_ID == buttonId) {
- executePressed();
- }
- }
-
- protected void executePressed() {
- final String args = query.getText();
- final Display dis = getShell().getDisplay();
- final IServer jbs = server;
- getButton(EXECUTE_ID).setEnabled(false);
- Thread t = new Thread() {
- public void run() {
- try {
- TwiddleLauncher launcher = new TwiddleLauncher();
- final ProcessData[] datas = launcher.getTwiddleResults(jbs, args, false);
- if( datas.length == 1 ) {
- final String s2 = datas[0].getOut();
- dis.asyncExec(new Runnable() {
- public void run() {
- // reset the default button, focus on the query, and
- // the entire string selected for easy new queries.
- results.setText(s2);
- getButton(EXECUTE_ID).setEnabled(true);
- Shell shell = parentComposite.getShell();
- query.setFocus();
- query.setSelection(0, query.getText().length());
- if (shell != null) {
- shell.setDefaultButton(getButton(EXECUTE_ID));
- }
- }
- } );
- }
- } catch( Exception e ) {
- IStatus status = new Status(IStatus.ERROR, JBossServerUIPlugin.PLUGIN_ID, Messages.TwiddleDialog_UnexpectedError, e);
- JBossServerUIPlugin.getDefault().getLog().log(status);
- }
-
- }
- };
- t.start();
-
- }
-
- protected Control createDialogArea(Composite parent) {
- this.parentComposite = parent;
- Composite c = (Composite)super.createDialogArea(parent);
- Composite main = new Composite(c, SWT.NONE);
- main.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- main.setLayout(new FormLayout());
-
- queryLabel = new Label(main, SWT.NONE);
- queryLabel.setText(Messages.TwiddleDialogArguments);
- FormData queryLabelData = new FormData();
- queryLabelData.left = new FormAttachment(0,5);
- queryLabelData.top = new FormAttachment(0,5);
- queryLabel.setLayoutData(queryLabelData);
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(getShell(),
- "org.jboss.ide.eclipse.as.ui.twiddle_usage_tutorial_help"); //$NON-NLS-1$
-
- query = new Text(main, SWT.BORDER);
- FormData queryData = new FormData();
- queryData.top = new FormAttachment(queryLabel, 5);
- queryData.right = new FormAttachment(100, -5);
- queryData.left = new FormAttachment(0, 5);
- query.setLayoutData(queryData);
-
-
-
- // Now add stuff to main
- results = new Text(main, SWT.BORDER | SWT.READ_ONLY | SWT.MULTI | SWT.V_SCROLL);
- FormData resultsData = new FormData();
- resultsData.left = new FormAttachment(0,5);
- resultsData.right = new FormAttachment(100,-5);
- resultsData.bottom = new FormAttachment(100,-5);
- resultsData.top = new FormAttachment(query, 5);
- results.setLayoutData(resultsData);
- results.setFont(new Font(null, "Courier New", 8, SWT.NONE)); //$NON-NLS-1$
-
- // set the default text
- try {
- String args = TwiddleLaunchConfiguration.getDefaultArgs(server);
- query.setText(args);
- query.setFocus();
- query.setSelection(args.length());
- } catch( CoreException ce ) {
- // server probably not found.
-
- }
- return c;
- }
-
-}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/ServerLogView.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/ServerLogView.java 2012-02-01 05:23:23 UTC (rev 38355)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/ServerLogView.java 2012-02-01 06:51:11 UTC (rev 38356)
@@ -70,8 +70,8 @@
import org.eclipse.ui.part.ViewPart;
import org.eclipse.wst.server.core.IServer;
import org.jboss.ide.eclipse.as.core.extensions.events.IEventCodes;
-import org.jboss.ide.eclipse.as.core.extensions.events.IServerLogListener;
import org.jboss.ide.eclipse.as.core.extensions.events.ServerLogger;
+import org.jboss.ide.eclipse.as.core.server.IServerLogListener;
import org.jboss.ide.eclipse.as.ui.JBossServerUIPlugin;
public class ServerLogView extends ViewPart implements IServerLogListener, ISelectionListener {
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/MockArgsTests.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/MockArgsTests.java 2012-02-01 05:23:23 UTC (rev 38355)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/MockArgsTests.java 2012-02-01 06:51:11 UTC (rev 38356)
@@ -20,8 +20,8 @@
import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.IServerWorkingCopy;
+import org.jboss.ide.eclipse.as.core.server.IProcessProvider;
import org.jboss.ide.eclipse.as.core.server.internal.DelegatingServerBehavior;
-import org.jboss.ide.eclipse.as.core.server.internal.IProcessProvider;
import org.jboss.ide.eclipse.as.core.server.internal.LocalJBossServerRuntime;
import org.jboss.ide.eclipse.as.core.server.internal.ServerAttributeHelper;
import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
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-02-01 05:23:23 UTC (rev 38355)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/util/ServerRuntimeUtils.java 2012-02-01 06:51:11 UTC (rev 38356)
@@ -42,9 +42,9 @@
import org.eclipse.wst.server.core.IServerWorkingCopy;
import org.eclipse.wst.server.core.ServerCore;
import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
+import org.jboss.ide.eclipse.as.core.server.IProcessProvider;
import org.jboss.ide.eclipse.as.core.server.internal.DelegatingServerBehavior;
import org.jboss.ide.eclipse.as.core.server.internal.DeployableServer;
-import org.jboss.ide.eclipse.as.core.server.internal.IProcessProvider;
import org.jboss.ide.eclipse.as.core.server.internal.ServerAttributeHelper;
import org.jboss.ide.eclipse.as.core.util.FileUtil;
import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
12 years, 11 months
JBoss Tools SVN: r38355 - in trunk/as/plugins/org.jboss.ide.eclipse.as.core: jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-02-01 00:23:23 -0500 (Wed, 01 Feb 2012)
New Revision: 38355
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss71ServerRuntime.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration/AbstractLaunchConfigurator.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml
Log:
JBIDE-10755 - changes to new args in dm12
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration/AbstractLaunchConfigurator.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration/AbstractLaunchConfigurator.java 2012-02-01 04:49:34 UTC (rev 38354)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/configuration/AbstractLaunchConfigurator.java 2012-02-01 05:23:23 UTC (rev 38355)
@@ -74,7 +74,8 @@
}
private boolean areDefaultsSet(ILaunchConfigurationWorkingCopy launchConfig) throws CoreException {
- return launchConfig.hasAttribute(DEFAULTS_SET);
+ boolean b = launchConfig.hasAttribute(DEFAULTS_SET);
+ return b;
}
private boolean shouldUpdateLaunch(ILaunchConfigurationWorkingCopy launchConfig) throws CoreException {
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss71ServerRuntime.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss71ServerRuntime.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss71ServerRuntime.java 2012-02-01 05:23:23 UTC (rev 38355)
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.core.server.internal.v7;
+
+import org.eclipse.core.runtime.IPath;
+import org.jboss.ide.eclipse.as.core.util.IJBossRuntimeConstants;
+import org.jboss.ide.eclipse.as.core.util.IJBossRuntimeResourceConstants;
+
+public class LocalJBoss71ServerRuntime extends LocalJBoss7ServerRuntime implements IJBossRuntimeConstants {
+ public static final String CONFIG_FILE = "org.jboss.ide.eclipse.as.core.server.internal.v7.CONFIG_FILE"; //$NON-NLS-1$
+ public static final String CONFIG_FILE_DEFAULT = "standalone.xml"; //$NON-NLS-1$
+
+ @Override
+ public String getDefaultRunArgs(IPath serverHome) {
+ return DASH + JB7_MP_ARG + SPACE + QUOTE
+ + serverHome.append(MODULES).toString() + QUOTE
+ + SPACE + DASH + JB7_JAXPMODULE + SPACE + JB7_JAXP_PROVIDER
+ + SPACE + JB7_STANDALONE_ARG;
+ }
+
+ @Override
+ public String getDefaultRunVMArgs(IPath serverHome) {
+ IJBossRuntimeResourceConstants c = new IJBossRuntimeResourceConstants() {};
+ IPath bootLog = serverHome.append(c.AS7_STANDALONE).append(c.FOLDER_LOG).append(c.AS7_BOOT_LOG);
+ IPath logConfig = serverHome.append(c.AS7_STANDALONE).append(c.CONFIGURATION).append(c.LOGGING_PROPERTIES);
+ return SERVER_ARG
+ + " -Xms64m" //$NON-NLS-1$
+ + " -Xmx512m" //$NON-NLS-1$
+ + " -XX:MaxPermSize=256m" //$NON-NLS-1$
+ + " -Djava.net.preferIPv4Stack=true" //$NON-NLS-1$
+ + " -Dorg.jboss.resolver.warning=true" //$NON-NLS-1$
+ + " -Dsun.rmi.dgc.client.gcInterval=3600000" //$NON-NLS-1$
+ + " -Dsun.rmi.dgc.server.gcInterval=3600000" //$NON-NLS-1$
+ + " -Djboss.modules.system.pkgs=org.jboss.byteman" //$NON-NLS-1$
+ + " -Djava.awt.headless=true" //$NON-NLS-1$
+ + SPACE + QUOTE + SYSPROP + JB7_BOOT_LOG_ARG + EQ + bootLog.toString() + QUOTE
+ + SPACE + QUOTE + SYSPROP + JB7_LOGGING_CONFIG_FILE + EQ + "file:" + logConfig.toString() + QUOTE //$NON-NLS-1$
+ + SPACE + QUOTE + SYSPROP + JBOSS_HOME_DIR + EQ + serverHome.toString() + QUOTE;
+ }
+}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml 2012-02-01 04:49:34 UTC (rev 38354)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml 2012-02-01 05:23:23 UTC (rev 38355)
@@ -363,7 +363,7 @@
<runtimeType
vendor="%providerName"
- class="org.jboss.ide.eclipse.as.core.server.internal.v7.LocalJBoss7ServerRuntime"
+ class="org.jboss.ide.eclipse.as.core.server.internal.v7.LocalJBoss71ServerRuntime"
description="%jboss.version.71.description"
name="%jboss.version.71.runtime.name"
id="org.jboss.ide.eclipse.as.runtime.71"
12 years, 11 months
JBoss Tools SVN: r38354 - in trunk/documentation/guides/GettingStartedGuide/en-US: images/getting_started and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: irooskov(a)redhat.com
Date: 2012-01-31 23:49:34 -0500 (Tue, 31 Jan 2012)
New Revision: 38354
Added:
trunk/documentation/guides/GettingStartedGuide/en-US/images/getting_started/jboss_perspective_04.png
Modified:
trunk/documentation/guides/GettingStartedGuide/en-US/Book_Info.xml
trunk/documentation/guides/GettingStartedGuide/en-US/getting_started.xml
Log:
updated with new jboss perspective information
Modified: trunk/documentation/guides/GettingStartedGuide/en-US/Book_Info.xml
===================================================================
--- trunk/documentation/guides/GettingStartedGuide/en-US/Book_Info.xml 2012-02-01 04:38:57 UTC (rev 38353)
+++ trunk/documentation/guides/GettingStartedGuide/en-US/Book_Info.xml 2012-02-01 04:49:34 UTC (rev 38354)
@@ -8,7 +8,7 @@
<productname>JBoss Developer Studio</productname>
<productnumber>5.0</productnumber>
<edition>5.0.0</edition>
-<pubsnumber>5</pubsnumber>
+<pubsnumber>6</pubsnumber>
<abstract>
<para>The Getting Started Guide explains the JBoss Developer Studio.</para>
</abstract>
Modified: trunk/documentation/guides/GettingStartedGuide/en-US/getting_started.xml
===================================================================
--- trunk/documentation/guides/GettingStartedGuide/en-US/getting_started.xml 2012-02-01 04:38:57 UTC (rev 38353)
+++ trunk/documentation/guides/GettingStartedGuide/en-US/getting_started.xml 2012-02-01 04:49:34 UTC (rev 38354)
@@ -332,6 +332,21 @@
</imageobject>
</mediaobject>
</figure>
+ <para>
+ The menu items for the context menu of a project can be seen in <xref linkend="figure-jboss_perspective_04" />
+ </para>
+ <figure id="figure-jboss_perspective_04">
+ <title>JBoss Perspective: <menuchoice>
+ <guimenuitem>Window</guimenuitem>
+ <guimenuitem>Show View</guimenuitem>
+ </menuchoice>
+ </title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/getting_started/jboss_perspective_04.png" scale="90"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
</section>
<section id="Support">
<?dbhtml filename="Support.html"?>
Added: trunk/documentation/guides/GettingStartedGuide/en-US/images/getting_started/jboss_perspective_04.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/guides/GettingStartedGuide/en-US/images/getting_started/jboss_perspective_04.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
12 years, 11 months
JBoss Tools SVN: r38353 - trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-01-31 23:38:57 -0500 (Tue, 31 Jan 2012)
New Revision: 38353
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServerUtils.java
Log:
blatent stupid error in the utils (getPassword calls getAppId... uhhh)
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServerUtils.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServerUtils.java 2012-02-01 04:24:24 UTC (rev 38352)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServerUtils.java 2012-02-01 04:38:57 UTC (rev 38353)
@@ -114,9 +114,8 @@
return wc.save(false, new NullProgressMonitor());
}
- // TODO Must secure this!!!
public static String getExpressPassword(IServerWorkingCopy server ) {
- return getExpressApplicationId(server.getOriginal());
+ return getExpressPassword(server.getOriginal());
}
public static String getExpressPassword(IServer server ) {
12 years, 11 months
JBoss Tools SVN: r38352 - in trunk/as: plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core and 5 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-01-31 23:24:24 -0500 (Tue, 31 Jan 2012)
New Revision: 38352
Added:
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/BehaviourModelDefectTest.java
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/MockArgsTests.java
Removed:
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/MockTests.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/ExtensionManager.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/BehaviourModel.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/DeploymentPreferenceLoader.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTestSuite.java
Log:
JBIDE-10768 - fixes and tests
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/ExtensionManager.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/ExtensionManager.java 2012-02-01 03:57:02 UTC (rev 38351)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/ExtensionManager.java 2012-02-01 04:24:24 UTC (rev 38352)
@@ -227,7 +227,6 @@
}
}
-
public IJBossServerPublisher[] getZippedPublishers() {
if( publishers == null )
loadPublishers();
@@ -242,47 +241,6 @@
return list.toArray(new IJBossServerPublisher[list.size()]);
}
-
-//
-// private ServerPublishMethodType[] publishMethodTypes;
-// public ServerPublishMethodType[] getPublishMethodTypes() {
-// if(publishMethodTypes == null )
-// publishMethodTypes = loadPublishMethodTypes();
-// return publishMethodTypes;
-// }
-//
-// public ServerPublishMethodType[] loadPublishMethodTypes() {
-// ArrayList<ServerPublishMethodType> types = new ArrayList<ServerPublishMethodType>();
-// IExtensionRegistry registry = Platform.getExtensionRegistry();
-// IConfigurationElement[] cf = registry.getConfigurationElementsFor(JBossServerCorePlugin.PLUGIN_ID, "publishMethod"); //$NON-NLS-1$
-// for( int i = 0; i < cf.length; i++ ) {
-// types.add(new ServerPublishMethodType(cf[i]));
-// }
-// return types.toArray(new ServerPublishMethodType[types.size()]);
-// }
-//
-// public IJBossServerPublishMethodType getPublishMethod(String id) {
-// ServerPublishMethodType[] publishMethods = getPublishMethodTypes();
-// for( int i = 0; i < publishMethods.length; i++ )
-// if( publishMethods[i].getId().equals(id))
-// return publishMethods[i];
-// return null;
-// }
-// public IJBossServerPublishMethodType[] findPossiblePublishMethods(IServerType type) {
-// ArrayList<IJBossServerPublishMethodType> list = new ArrayList<IJBossServerPublishMethodType>();
-// list.addAll(Arrays.asList(getPublishMethodTypes()));
-// Iterator<IJBossServerPublishMethodType> i = list.iterator();
-// while(i.hasNext()) {
-// if( !i.next().accepts(type.getId()))
-// i.remove();
-// }
-// return list.toArray(new IJBossServerPublishMethodType[list.size()]);
-// }
-//
-// public IJBossServerPublishMethodType[] findPossiblePublishMethods(IServer server) {
-// return findPossiblePublishMethods(server.getServerType());
-// }
-
// API extension
public static interface IServerJMXRunnable {
public void run(MBeanServerConnection connection) throws Exception;
@@ -328,40 +286,4 @@
public void setAlreadyStartedHandler(IServerAlreadyStartedHandler handler) {
defaultAlreadyStartedHandler = handler;
}
-
-
-// /**
-// * Temporary home for start launch setup participants and launch configs
-// * Should eventually be replaced by an extension point of some type
-// *
-// * TODO Convert this into a suitable fixed API
-// */
-// public static HashMap<String, IStartLaunchDelegate> JBoss7launchDelegates;
-// public static ArrayList<IStartLaunchSetupParticipant> JBoss7setupParticipants;
-// public static HashMap<String, IStartLaunchDelegate> JBossLaunchDelegates;
-// public static ArrayList<IStartLaunchSetupParticipant> JBossSetupParticipants;
-// static {
-// JBoss7setupParticipants = new ArrayList<IStartLaunchSetupParticipant>();
-// JBoss7launchDelegates = new HashMap<String, IStartLaunchDelegate>();
-// JBoss7setupParticipants.add(new LocalJBoss7StartLaunchDelegate());
-// JBoss7launchDelegates.put(LocalPublishMethod.LOCAL_PUBLISH_METHOD, new LocalJBoss7StartLaunchDelegate());
-//
-// JBossSetupParticipants = new ArrayList<IStartLaunchSetupParticipant>();
-// JBossLaunchDelegates = new HashMap<String, IStartLaunchDelegate>();
-// JBossSetupParticipants.add(new LocalJBossStartLaunchDelegate());
-// JBossLaunchDelegates.put(LocalPublishMethod.LOCAL_PUBLISH_METHOD, new LocalJBossStartLaunchDelegate());
-// }
-// public HashMap<String, IStartLaunchDelegate> getLaunchDelegates(IServer server) {
-// if( server.getServerType().getId().equals(IJBossToolingConstants.SERVER_AS_70)) {
-// return JBoss7launchDelegates;
-// }
-// return JBossLaunchDelegates;
-// }
-// public ArrayList<IStartLaunchSetupParticipant> getSetupParticipants(IServer server) {
-// if( ServerUtil.isJBoss7(server)) {
-// return JBoss7setupParticipants;
-// }
-// return JBossSetupParticipants;
-// }
-//
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/BehaviourModel.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/BehaviourModel.java 2012-02-01 03:57:02 UTC (rev 38351)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/BehaviourModel.java 2012-02-01 04:24:24 UTC (rev 38352)
@@ -33,9 +33,11 @@
loadModel();
}
- public static IJBossServerPublishMethodType getPublishMethodType(IServer server) {
+ public static IJBossServerPublishMethodType getPublishMethodType(IServer server, String defaultType) {
String serverType = server.getServerType().getId();
String behaviourType = DeploymentPreferenceLoader.getCurrentDeploymentMethodTypeId(server);
+ if( behaviourType == null )
+ behaviourType = defaultType;
return BehaviourModel.getModel().getBehaviour(serverType).getImpl(behaviourType);
}
@@ -159,7 +161,14 @@
return null;
}
+ private boolean isEmpty(String s) {
+ return s == null || "".equals(s); //$NON-NLS-1$
+ }
+
public IJBossLaunchDelegate createLaunchDelegate() {
+ if( isEmpty(element.getAttribute("launchDelegate"))) //$NON-NLS-1$
+ return null;
+
try {
return (IJBossLaunchDelegate) element.createExecutableExtension("launchDelegate"); //$NON-NLS-1$
} catch( CoreException ce ) {
@@ -169,6 +178,9 @@
}
public IJBossBehaviourDelegate createBehaviourDelegate() {
+ if( isEmpty(element.getAttribute("behaviourDelegate"))) //$NON-NLS-1$
+ return null;
+
try {
return (IJBossBehaviourDelegate)element.createExecutableExtension("behaviourDelegate"); //$NON-NLS-1$
} catch(CoreException ce) {
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/DeploymentPreferenceLoader.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/DeploymentPreferenceLoader.java 2012-02-01 03:57:02 UTC (rev 38351)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/DeploymentPreferenceLoader.java 2012-02-01 04:24:24 UTC (rev 38352)
@@ -51,7 +51,7 @@
}
public static IJBossServerPublishMethodType getCurrentDeploymentMethodType(IServer server, String defaultType) {
- return BehaviourModel.getPublishMethodType(server);
+ return BehaviourModel.getPublishMethodType(server, defaultType);
}
public static String getCurrentDeploymentMethodTypeId(IServer server) {
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml 2012-02-01 03:57:02 UTC (rev 38351)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml 2012-02-01 04:24:24 UTC (rev 38352)
@@ -1125,21 +1125,17 @@
</variable>
</extension>
- <!--
<extension
- point="org.jboss.ide.eclipse.as.core.publishMethod">
- <publishMethod
- id="local"
- name="Local"
- class="org.jboss.ide.eclipse.as.core.publishers.LocalPublishMethod"
- serverTypes="%AllJBTServerTypes">
- </publishMethod>
- </extension>
- -->
-
- <extension
point="org.jboss.ide.eclipse.as.core.behaviourExtension">
<behaviour
+ behaviourDelegate=""
+ launchDelegate=""
+ name="Local"
+ publishMethod="org.jboss.ide.eclipse.as.core.publishers.LocalPublishMethod"
+ serverTypes="org.jboss.ide.eclipse.as.systemCopyServer"
+ typeId="local">
+ </behaviour>
+ <behaviour
behaviourDelegate="org.jboss.ide.eclipse.as.core.server.internal.LocalJBossBehaviorDelegate"
launchDelegate="org.jboss.ide.eclipse.as.core.server.internal.launch.LocalJBossStartLaunchDelegate"
name="Local"
@@ -1147,9 +1143,6 @@
serverTypes="%ServerTypesJBoss6OrLower"
typeId="local">
</behaviour>
- </extension>
- <extension
- point="org.jboss.ide.eclipse.as.core.behaviourExtension">
<behaviour
behaviourDelegate="org.jboss.ide.eclipse.as.core.server.internal.v7.LocalJBoss7BehaviorDelegate"
launchDelegate="org.jboss.ide.eclipse.as.core.server.internal.v7.LocalJBoss7StartLaunchDelegate"
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-02-01 03:57:02 UTC (rev 38351)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTestSuite.java 2012-02-01 04:24:24 UTC (rev 38352)
@@ -33,6 +33,7 @@
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;
+import org.jboss.ide.eclipse.as.test.publishing.v2.BehaviourModelDefectTest;
import org.jboss.ide.eclipse.as.test.publishing.v2.JSTDeployBinaryChildModuleTest;
import org.jboss.ide.eclipse.as.test.publishing.v2.JSTDeploymentTester;
import org.jboss.ide.eclipse.as.test.publishing.v2.JSTDeploymentWarUpdateXML;
@@ -66,6 +67,7 @@
suite.addTestSuite(SingleFileDeployableMockDeploymentTester.class);
// Publishing tests
+ suite.addTestSuite(BehaviourModelDefectTest.class);
suite.addTestSuite(MockJSTPublisherTest.class);
suite.addTestSuite(MockJSTPublisherTestDynUtil.class);
suite.addTestSuite(JBIDE1657Test.class);
Added: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/BehaviourModelDefectTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/BehaviourModelDefectTest.java (rev 0)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/BehaviourModelDefectTest.java 2012-02-01 04:24:24 UTC (rev 38352)
@@ -0,0 +1,85 @@
+package org.jboss.ide.eclipse.as.test.publishing.v2;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.wst.server.core.IServer;
+import org.jboss.ide.eclipse.as.core.server.internal.BehaviourModel;
+import org.jboss.ide.eclipse.as.core.util.DeploymentPreferenceLoader;
+import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
+import org.jboss.ide.eclipse.as.test.util.ServerRuntimeUtils;
+
+public class BehaviourModelDefectTest extends TestCase {
+ public void tearDown() {
+ try {
+ ServerRuntimeUtils.deleteAllServers();
+ ServerRuntimeUtils.deleteAllRuntimes();
+ } catch(CoreException ce) {}
+ }
+
+ public void serverTestImpl(String type) {
+ IServer server = ServerRuntimeUtils.createMockServerWithRuntime(type, "server1", "default");
+ serverTestBehaviourImpl(server);
+ serverTestBehaviourImplLaunches(server);
+ }
+ public void serverTestBehaviourImpl(IServer server) {
+ // all should have a publish method
+ String serverType = server.getServerType().getId();
+ String behaviourType = DeploymentPreferenceLoader.getCurrentDeploymentMethodTypeId(server);
+ assertNotNull(behaviourType);
+ assertNotNull(BehaviourModel.getModel().getBehaviour(serverType).getImpl(behaviourType));
+ assertNotNull(BehaviourModel.getModel().getBehaviour(serverType).getImpl(behaviourType).createPublishMethod());
+ }
+
+ public void serverTestBehaviourImplLaunches(IServer server) {
+ String serverType = server.getServerType().getId();
+ String behaviourType = DeploymentPreferenceLoader.getCurrentDeploymentMethodTypeId(server);
+ assertNotNull(behaviourType);
+ assertNotNull(BehaviourModel.getModel().getBehaviour(serverType).getImpl(behaviourType).createLaunchDelegate());
+ }
+
+ public void testDeployOnlyBehaviourModel() throws CoreException {
+ IServer server = ServerRuntimeUtils.createMockDeployOnlyServer();
+ String serverType = server.getServerType().getId();
+ String behaviourType = DeploymentPreferenceLoader.getCurrentDeploymentMethodTypeId(server);
+ assertNull(behaviourType);
+ assertNotNull(BehaviourModel.getModel().getBehaviour(serverType).getImpl("local"));
+ assertNotNull(BehaviourModel.getModel().getBehaviour(serverType).getImpl("local").createPublishMethod());
+ assertNull(BehaviourModel.getModel().getBehaviour(serverType).getImpl("local").createLaunchDelegate());
+ }
+
+ public void test32BehaviourModel() {
+ serverTestImpl(IJBossToolingConstants.SERVER_AS_32);
+ }
+ public void test40BehaviourModel() {
+ serverTestImpl(IJBossToolingConstants.SERVER_AS_40);
+ }
+ public void test42BehaviourModel() {
+ serverTestImpl(IJBossToolingConstants.SERVER_AS_42);
+ }
+ public void test50BehaviourModel() {
+ serverTestImpl(IJBossToolingConstants.SERVER_AS_50);
+ }
+ public void test51BehaviourModel() {
+ serverTestImpl(IJBossToolingConstants.SERVER_AS_51);
+ }
+ public void test60BehaviourModel() {
+ serverTestImpl(IJBossToolingConstants.SERVER_AS_60);
+ }
+ public void test70BehaviourModel() {
+ serverTestImpl(IJBossToolingConstants.SERVER_AS_70);
+ }
+ public void test71BehaviourModel() {
+ serverTestImpl(IJBossToolingConstants.SERVER_AS_71);
+ }
+ public void testEap43BehaviourModel() {
+ serverTestImpl(IJBossToolingConstants.SERVER_EAP_43);
+ }
+ public void testEap50BehaviourModel() {
+ serverTestImpl(IJBossToolingConstants.SERVER_EAP_50);
+ }
+ public void testEap60BehaviourModel() {
+ serverTestImpl(IJBossToolingConstants.SERVER_EAP_60);
+ }
+
+}
Copied: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/MockArgsTests.java (from rev 38327, trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/MockTests.java)
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/MockArgsTests.java (rev 0)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/MockArgsTests.java 2012-02-01 04:24:24 UTC (rev 38352)
@@ -0,0 +1,163 @@
+/*******************************************************************************
+ * Copyright (c) 2010 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.test.server;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.debug.core.model.IProcess;
+import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.IServerWorkingCopy;
+import org.jboss.ide.eclipse.as.core.server.internal.DelegatingServerBehavior;
+import org.jboss.ide.eclipse.as.core.server.internal.IProcessProvider;
+import org.jboss.ide.eclipse.as.core.server.internal.LocalJBossServerRuntime;
+import org.jboss.ide.eclipse.as.core.server.internal.ServerAttributeHelper;
+import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
+import org.jboss.ide.eclipse.as.test.util.ServerRuntimeUtils;
+
+public class MockArgsTests extends TestCase {
+ public void setUp() {
+ }
+ public void tearDown() {
+ try {
+ ServerRuntimeUtils.deleteAllServers();
+ ServerRuntimeUtils.deleteAllRuntimes();
+ } catch(CoreException ce) {}
+ }
+
+
+ public void testRemoveCriticalVMArgs() {
+ IServer server = serverTestImpl(IJBossToolingConstants.SERVER_AS_50);
+ try {
+ ILaunchConfiguration config = server.getLaunchConfiguration(true, new NullProgressMonitor());
+ ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy();
+ wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, "hello");
+ wc.doSave();
+
+ // re-get it and check the changes
+ ILaunchConfiguration launchConfig = server.getLaunchConfiguration(false, null);
+ String vmArgs = launchConfig.getAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, (String)null);
+ LocalJBossServerRuntime rt = (LocalJBossServerRuntime)server.getRuntime().loadAdapter(LocalJBossServerRuntime.class, new NullProgressMonitor());
+ String defaultVMArgs = rt.getDefaultRunVMArgs();
+ assertFalse(vmArgs == null);
+ assertFalse(vmArgs.equals(rt.getDefaultRunVMArgs()));
+ assertFalse(vmArgs.equals(defaultVMArgs));
+ assertTrue(vmArgs.startsWith("hello -Djava.endorsed.dirs=\""));
+ assertTrue(vmArgs.endsWith(".metadata/.plugins/org.jboss.ide.eclipse.as.test/mockedServers/server1/lib/endorsed\""));
+ } catch(CoreException ce) {
+ fail(ce.getMessage());
+ }
+ }
+
+ public void testChangeArgs() {
+ // should still match the defaults since the defaults are extremely all required
+ IServer server = serverTestImpl(IJBossToolingConstants.SERVER_AS_50);
+ try {
+ ILaunchConfiguration config = server.getLaunchConfiguration(true, new NullProgressMonitor());
+ ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy();
+ wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, "");
+ wc.doSave();
+ String command = runAndGetCommand(server);
+ assertFalse("No args found from process", command == null);
+ LocalJBossServerRuntime rt = (LocalJBossServerRuntime)server.getRuntime().loadAdapter(LocalJBossServerRuntime.class, new NullProgressMonitor());
+ String defaultArgs = rt.getDefaultRunArgs().replace("\"", "");
+ assertTrue(command.replace("\"", "").contains(defaultArgs));
+ } catch(CoreException ce) {
+ fail(ce.getMessage());
+ }
+ }
+
+ protected IServer serverTestImpl(String type) {
+ IServer server = ServerRuntimeUtils.createMockServerWithRuntime(type, "server1", "default");
+ IServer fixed = setMockDetails(server);
+ String command = runAndGetCommand(fixed);
+ assertFalse("No args found from process", command == null);
+
+ LocalJBossServerRuntime rt = (LocalJBossServerRuntime)server.getRuntime().loadAdapter(LocalJBossServerRuntime.class, new NullProgressMonitor());
+ String defaultArgs = rt.getDefaultRunArgs().replace("\"", "");
+ String defaultVMArgs = rt.getDefaultRunVMArgs().replace("\"", "");
+ assertTrue(command.replace("\"", "").contains(defaultArgs.trim()));
+ assertTrue(command.replace("\"", "").contains(defaultVMArgs.trim()));
+ return fixed;
+ }
+
+ protected IProcess runAndGetProcess(final IServer server) {
+ try {
+ server.start("run", new NullProgressMonitor());
+ } catch( CoreException ce) {}
+
+ int loops = 0;
+ DelegatingServerBehavior behavior = (DelegatingServerBehavior)server.loadAdapter(DelegatingServerBehavior.class, null);
+
+ while(loops < 50) {
+ if( ((IProcessProvider)behavior.getDelegate()).getProcess() != null ) {
+ return ((IProcessProvider)behavior.getDelegate()).getProcess();
+ }
+ try {
+ loops++;
+ Thread.sleep(1000);
+ } catch(Exception e){}
+ }
+ return null;
+ }
+
+ protected String runAndGetCommand(final IServer server) {
+ return runAndGetProcess(server).getAttribute(IProcess.ATTR_CMDLINE);
+ }
+
+ private IServer setMockDetails(IServer server) {
+ IServerWorkingCopy copy = server.createWorkingCopy();
+ ServerAttributeHelper helper = new ServerAttributeHelper(server, copy);
+ helper.setAttribute("start-timeout", "2");
+ helper.setAttribute("org.jboss.ide.eclipse.as.core.server.attributes.startupPollerKey",
+ "org.jboss.ide.eclipse.as.core.runtime.server.timeoutpoller");
+ try {
+ return copy.save(true, new NullProgressMonitor());
+ } catch( CoreException ce ) {
+ }
+ return null;
+ }
+
+ public void test32Mock() {
+ serverTestImpl(IJBossToolingConstants.SERVER_AS_32);
+ }
+
+ public void test40Mock() {
+ serverTestImpl(IJBossToolingConstants.SERVER_AS_40);
+ }
+
+ public void test42Mock() {
+ serverTestImpl(IJBossToolingConstants.SERVER_AS_42);
+ }
+
+ public void test50Mock() {
+ serverTestImpl(IJBossToolingConstants.SERVER_AS_50);
+ }
+ public void test51Mock() {
+ serverTestImpl(IJBossToolingConstants.SERVER_AS_51);
+ }
+ public void test60Mock() {
+ serverTestImpl(IJBossToolingConstants.SERVER_AS_60);
+ }
+ public void testEap43Mock() {
+ serverTestImpl(IJBossToolingConstants.SERVER_EAP_43);
+ }
+ public void testEap50Mock() {
+ serverTestImpl(IJBossToolingConstants.SERVER_EAP_50);
+ }
+ public void testEap60Mock() {
+ serverTestImpl(IJBossToolingConstants.SERVER_EAP_60);
+ }
+}
Deleted: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/MockTests.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/MockTests.java 2012-02-01 03:57:02 UTC (rev 38351)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/MockTests.java 2012-02-01 04:24:24 UTC (rev 38352)
@@ -1,160 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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.test.server;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.debug.core.model.IProcess;
-import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.IServerWorkingCopy;
-import org.jboss.ide.eclipse.as.core.server.internal.DelegatingServerBehavior;
-import org.jboss.ide.eclipse.as.core.server.internal.IProcessProvider;
-import org.jboss.ide.eclipse.as.core.server.internal.LocalJBossServerRuntime;
-import org.jboss.ide.eclipse.as.core.server.internal.ServerAttributeHelper;
-import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
-import org.jboss.ide.eclipse.as.test.util.ServerRuntimeUtils;
-
-public class MockTests extends TestCase {
- public void setUp() {
- }
- public void tearDown() {
- try {
- ServerRuntimeUtils.deleteAllServers();
- ServerRuntimeUtils.deleteAllRuntimes();
- } catch(CoreException ce) {}
- }
-
-
- public void testRemoveCriticalVMArgs() {
- IServer server = serverTestImpl(IJBossToolingConstants.SERVER_AS_50);
- try {
- ILaunchConfiguration config = server.getLaunchConfiguration(true, new NullProgressMonitor());
- ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy();
- wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, "hello");
- wc.doSave();
-
- // re-get it and check the changes
- ILaunchConfiguration launchConfig = server.getLaunchConfiguration(false, null);
- String vmArgs = launchConfig.getAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, (String)null);
- LocalJBossServerRuntime rt = (LocalJBossServerRuntime)server.getRuntime().loadAdapter(LocalJBossServerRuntime.class, new NullProgressMonitor());
- String defaultVMArgs = rt.getDefaultRunVMArgs();
- assertFalse(vmArgs == null);
- assertFalse(vmArgs.equals(rt.getDefaultRunVMArgs()));
- assertFalse(vmArgs.equals(defaultVMArgs));
- assertTrue(vmArgs.startsWith("hello -Djava.endorsed.dirs=\""));
- assertTrue(vmArgs.endsWith(".metadata/.plugins/org.jboss.ide.eclipse.as.test/mockedServers/server1/lib/endorsed\""));
- } catch(CoreException ce) {
- fail(ce.getMessage());
- }
- }
-
- public void testChangeArgs() {
- // should still match the defaults since the defaults are extremely all required
- IServer server = serverTestImpl(IJBossToolingConstants.SERVER_AS_50);
- try {
- ILaunchConfiguration config = server.getLaunchConfiguration(true, new NullProgressMonitor());
- ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy();
- wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, "");
- wc.doSave();
- String command = runAndGetCommand(server);
- assertFalse("No args found from process", command == null);
- LocalJBossServerRuntime rt = (LocalJBossServerRuntime)server.getRuntime().loadAdapter(LocalJBossServerRuntime.class, new NullProgressMonitor());
- String defaultArgs = rt.getDefaultRunArgs().replace("\"", "");
- assertTrue(command.replace("\"", "").contains(defaultArgs));
- } catch(CoreException ce) {
- fail(ce.getMessage());
- }
- }
-
- protected IServer serverTestImpl(String type) {
- IServer server = ServerRuntimeUtils.createMockServerWithRuntime(type, "server1", "default");
- IServer fixed = setMockDetails(server);
- String command = runAndGetCommand(fixed);
- assertFalse("No args found from process", command == null);
-
- LocalJBossServerRuntime rt = (LocalJBossServerRuntime)server.getRuntime().loadAdapter(LocalJBossServerRuntime.class, new NullProgressMonitor());
- String defaultArgs = rt.getDefaultRunArgs().replace("\"", "");
- String defaultVMArgs = rt.getDefaultRunVMArgs().replace("\"", "");
- assertTrue(command.replace("\"", "").contains(defaultArgs.trim()));
- assertTrue(command.replace("\"", "").contains(defaultVMArgs.trim()));
- return fixed;
- }
-
- protected IProcess runAndGetProcess(final IServer server) {
- try {
- server.start("run", new NullProgressMonitor());
- } catch( CoreException ce) {}
-
- int loops = 0;
- DelegatingServerBehavior behavior = (DelegatingServerBehavior)server.loadAdapter(DelegatingServerBehavior.class, null);
-
- while(loops < 50) {
- if( ((IProcessProvider)behavior.getDelegate()).getProcess() != null ) {
- return ((IProcessProvider)behavior.getDelegate()).getProcess();
- }
- try {
- loops++;
- Thread.sleep(1000);
- } catch(Exception e){}
- }
- return null;
- }
-
- protected String runAndGetCommand(final IServer server) {
- return runAndGetProcess(server).getAttribute(IProcess.ATTR_CMDLINE);
- }
-
- private IServer setMockDetails(IServer server) {
- IServerWorkingCopy copy = server.createWorkingCopy();
- ServerAttributeHelper helper = new ServerAttributeHelper(server, copy);
- helper.setAttribute("start-timeout", "2");
- helper.setAttribute("org.jboss.ide.eclipse.as.core.server.attributes.startupPollerKey",
- "org.jboss.ide.eclipse.as.core.runtime.server.timeoutpoller");
- try {
- return copy.save(true, new NullProgressMonitor());
- } catch( CoreException ce ) {
- }
- return null;
- }
-
- public void test32Mock() {
- serverTestImpl(IJBossToolingConstants.SERVER_AS_32);
- }
-
- public void test40Mock() {
- serverTestImpl(IJBossToolingConstants.SERVER_AS_40);
- }
-
- public void test42Mock() {
- serverTestImpl(IJBossToolingConstants.SERVER_AS_42);
- }
-
- public void test50Mock() {
- serverTestImpl(IJBossToolingConstants.SERVER_AS_50);
- }
- public void test51Mock() {
- serverTestImpl(IJBossToolingConstants.SERVER_AS_51);
- }
- public void test60Mock() {
- serverTestImpl(IJBossToolingConstants.SERVER_AS_60);
- }
- public void testEap43Mock() {
- serverTestImpl(IJBossToolingConstants.SERVER_EAP_43);
- }
- public void testEap50Mock() {
- serverTestImpl(IJBossToolingConstants.SERVER_EAP_50);
- }
-}
12 years, 11 months
JBoss Tools SVN: r38351 - trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2012-01-31 22:57:02 -0500 (Tue, 31 Jan 2012)
New Revision: 38351
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/messages.properties
Log:
https://issues.jboss.org/browse/JBIDE-10766
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/messages.properties
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/messages.properties 2012-02-01 03:53:01 UTC (rev 38350)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/messages.properties 2012-02-01 03:57:02 UTC (rev 38351)
@@ -10,8 +10,8 @@
#******************************************************************************/
#Components
NONUNIQUE_COMPONENT_NAME_MESSAGE=Duplicate component name: "{0}"
-STATEFUL_COMPONENT_DOES_NOT_CONTAIN_REMOVE=Stateful component "{0}" doesn't have a method annotated @Remove
-STATEFUL_COMPONENT_DOES_NOT_CONTAIN_DESTROY=Stateful component "{0}" doesn't have a method annotated @Destroy
+STATEFUL_COMPONENT_DOES_NOT_CONTAIN_REMOVE=Stateful component "{0}" does not have a method annotated @Remove
+STATEFUL_COMPONENT_DOES_NOT_CONTAIN_DESTROY=Stateful component "{0}" does not have a method annotated @Destroy
STATEFUL_COMPONENT_WRONG_SCOPE=Stateful component "{0}" should not have org.jboss.seam.ScopeType.PAGE, nor org.jboss.seam.ScopeType.STATELESS
UNKNOWN_COMPONENT_CLASS_NAME="{0}" cannot be resolved to a type
UNKNOWN_COMPONENT_PROPERTY=Class "{0}" of component "{1}" does not have a setter or a field for the property "{2}"
12 years, 11 months
JBoss Tools SVN: r38350 - trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2012-01-31 22:53:01 -0500 (Tue, 31 Jan 2012)
New Revision: 38350
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/messages.properties
Log:
https://issues.jboss.org/browse/JBIDE-10766
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/messages.properties
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/messages.properties 2012-02-01 02:31:44 UTC (rev 38349)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/messages.properties 2012-02-01 03:53:01 UTC (rev 38350)
@@ -10,8 +10,8 @@
#******************************************************************************/
#Components
NONUNIQUE_COMPONENT_NAME_MESSAGE=Duplicate component name: "{0}"
-STATEFUL_COMPONENT_DOES_NOT_CONTAIN_REMOVE=Stateful component "{0}" must have a method marked @Remove
-STATEFUL_COMPONENT_DOES_NOT_CONTAIN_DESTROY=Stateful component "{0}" must have a method marked @Destroy
+STATEFUL_COMPONENT_DOES_NOT_CONTAIN_REMOVE=Stateful component "{0}" doesn't have a method annotated @Remove
+STATEFUL_COMPONENT_DOES_NOT_CONTAIN_DESTROY=Stateful component "{0}" doesn't have a method annotated @Destroy
STATEFUL_COMPONENT_WRONG_SCOPE=Stateful component "{0}" should not have org.jboss.seam.ScopeType.PAGE, nor org.jboss.seam.ScopeType.STATELESS
UNKNOWN_COMPONENT_CLASS_NAME="{0}" cannot be resolved to a type
UNKNOWN_COMPONENT_PROPERTY=Class "{0}" of component "{1}" does not have a setter or a field for the property "{2}"
12 years, 11 months
JBoss Tools SVN: r38349 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2012-01-31 21:31:44 -0500 (Tue, 31 Jan 2012)
New Revision: 38349
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeSourceDomBuilder.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualKeyHandler.java
Log:
code clean up, nul check is removed where it is not required
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2012-02-01 02:27:33 UTC (rev 38348)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2012-02-01 02:31:44 UTC (rev 38349)
@@ -1431,7 +1431,7 @@
public IPath getPath() {
if (editPart != null) {
IEditorInput input = editPart.getEditorInput();
- if (input != null && input instanceof IFileEditorInput) {
+ if (input instanceof IFileEditorInput) {
return ((IFileEditorInput) input).getFile().getFullPath();
}
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeSourceDomBuilder.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeSourceDomBuilder.java 2012-02-01 02:27:33 UTC (rev 38348)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeSourceDomBuilder.java 2012-02-01 02:31:44 UTC (rev 38349)
@@ -156,7 +156,7 @@
private boolean openOnOnVisualNode(nsIDOMNode visualNode) {
VpeNodeMapping nodeMapping = VpeNodesManagingUtil.getNodeMapping(
this.domMapping, visualNode);
- if (nodeMapping != null && nodeMapping instanceof VpeElementMapping) {
+ if (nodeMapping instanceof VpeElementMapping) {
VpeElementMapping elementMapping = (VpeElementMapping) nodeMapping;
VpeTemplate template = elementMapping.getTemplate();
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2012-02-01 02:27:33 UTC (rev 38348)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2012-02-01 02:31:44 UTC (rev 38349)
@@ -886,7 +886,7 @@
} else {
VpeNodeMapping nodeMapping = domMapping
.getNodeMapping(sourceParent);
- if (nodeMapping != null && nodeMapping instanceof VpeElementMapping) {
+ if (nodeMapping instanceof VpeElementMapping) {
VpeTemplate template = ((VpeElementMapping) nodeMapping)
.getTemplate();
if (template != null) {
@@ -1302,7 +1302,7 @@
nsIDOMNode visualParent = visualDropContainer.getParentNode();
VpeNodeMapping oldMapping = mapping;
mapping = domMapping.getNearNodeMapping(visualParent);
- if (mapping != null && mapping instanceof VpeElementMapping) {
+ if (mapping instanceof VpeElementMapping) {
((VpeElementMapping) mapping).getTemplate().innerDrop(
pageContext,
new VpeSourceInnerDragInfo(dragNode, 0, 0),
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualKeyHandler.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualKeyHandler.java 2012-02-01 02:27:33 UTC (rev 38348)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualKeyHandler.java 2012-02-01 02:31:44 UTC (rev 38349)
@@ -1064,7 +1064,7 @@
VpeNodeMapping parentMapping = domMapping.getNearParentMapping(focusNode);
if (parentMapping != null) {
boolean handled = false;
- while (!handled && parentMapping != null && parentMapping instanceof VpeElementMapping) {
+ while (!handled && parentMapping instanceof VpeElementMapping) {
VpeTemplate template = ((VpeElementMapping)parentMapping).getTemplate();
Node srcNode = parentMapping.getSourceNode();
nsIDOMNode visualNode = parentMapping.getVisualNode();
@@ -1127,7 +1127,7 @@
VpeNodeMapping parentMapping = domMapping.getNearParentMapping(focusNode);
if (parentMapping != null) {
boolean handled = false;
- while (!handled && parentMapping != null && parentMapping instanceof VpeElementMapping) {
+ while (!handled && parentMapping instanceof VpeElementMapping) {
VpeTemplate template = ((VpeElementMapping)parentMapping).getTemplate();
Node srcNode = parentMapping.getSourceNode();
nsIDOMNode visualNode = parentMapping.getVisualNode();
@@ -1262,7 +1262,7 @@
private void goToParentTemplate(Node node, SourceSelection selection, long keyCode) {
ITextFormatter formatter = null;
VpeNodeMapping nearNodeMapping = domMapping.getNearParentMapping(node);
- if (nearNodeMapping != null && nearNodeMapping instanceof VpeElementMapping) {
+ if (nearNodeMapping instanceof VpeElementMapping) {
VpeTemplate template = ((VpeElementMapping)nearNodeMapping).getTemplate();
if (template != null) {
Node sourceNode = nearNodeMapping.getSourceNode();
12 years, 11 months