JBoss Tools SVN: r14844 - trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2009-04-22 03:51:56 -0400 (Wed, 22 Apr 2009)
New Revision: 14844
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/ExtensionManager.java
Log:
JBIDE-4216
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 2009-04-22 07:24:57 UTC (rev 14843)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/ExtensionManager.java 2009-04-22 07:51:56 UTC (rev 14844)
@@ -159,7 +159,7 @@
while(i.hasNext()) {
wrapper = (PublisherWrapper)i.next();
if( wrapper.publisher.accepts(server, module))
- return wrapper.publisher;
+ return wrapper.getNewInstance();
}
return null;
}
@@ -172,7 +172,7 @@
while(i.hasNext()) {
wrapper = i.next();
if( wrapper.isZipDelegate )
- return wrapper.publisher;
+ return wrapper.getNewInstance();
}
return null;
}
@@ -190,7 +190,7 @@
try {
p = Integer.parseInt(priority);
} catch( NumberFormatException nfe) {}
- publishers.add(new PublisherWrapper(p, zipDelegate, (IJBossServerPublisher)clazz));
+ publishers.add(new PublisherWrapper(p, zipDelegate, (IJBossServerPublisher)clazz, cf[i]));
} catch( CoreException e ) {
} catch( ClassCastException cce ) {
}
@@ -208,10 +208,20 @@
private int priority;
private IJBossServerPublisher publisher;
private boolean isZipDelegate = false;
- private PublisherWrapper(int priority, String zipDelegate, IJBossServerPublisher publisher) {
+ private IConfigurationElement element;
+ private PublisherWrapper(int priority, String zipDelegate, IJBossServerPublisher publisher, IConfigurationElement element) {
this.priority = priority;
this.publisher = publisher;
isZipDelegate = Boolean.parseBoolean(zipDelegate);
+ element = element;
}
+ private IJBossServerPublisher getNewInstance() {
+ try {
+ Object clazz = element.createExecutableExtension("class");
+ return (IJBossServerPublisher)clazz;
+ } catch( CoreException ce ) {
+ }
+ return publisher;
+ }
}
}
15 years, 8 months
JBoss Tools SVN: r14843 - in trunk/as/plugins: org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/events and 7 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2009-04-22 03:24:57 -0400 (Wed, 22 Apr 2009)
New Revision: 14843
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/JBossServerCorePlugin.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/server/IJBossServerConstants.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServer.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServer.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/ServerListener.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/JBossServerStartupLaunchConfiguration.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.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.properties
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/DeploySection.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossServerWizardFragment.java
Log:
JBIDE-3896 - initial fix commit... let's see how this goes
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/JBossServerCorePlugin.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/JBossServerCorePlugin.java 2009-04-22 05:56:32 UTC (rev 14842)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/JBossServerCorePlugin.java 2009-04-22 07:24:57 UTC (rev 14843)
@@ -27,8 +27,10 @@
import org.eclipse.core.runtime.IExtension;
import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.IExtensionRegistry;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Plugin;
+import org.eclipse.wst.server.core.IServer;
import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathModel;
import org.jboss.ide.eclipse.as.core.server.UnitedServerListenerManager;
import org.jboss.ide.eclipse.as.core.server.internal.ServerListener;
@@ -99,5 +101,16 @@
public ResourceBundle getResourceBundle() {
return resourceBundle;
}
-
+
+ public static IPath getServerStateLocation(IServer server) {
+ return server == null ? getDefault().getStateLocation() :
+ getServerStateLocation(server.getId());
+ }
+
+ public static IPath getServerStateLocation(String serverID) {
+ return serverID == null ? getDefault().getStateLocation() :
+ JBossServerCorePlugin.getDefault().getStateLocation()
+ .append(serverID.replace(' ', '_'));
+ }
+
}
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 2009-04-22 05:56:32 UTC (rev 14842)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/events/ServerLogger.java 2009-04-22 07:24:57 UTC (rev 14843)
@@ -28,6 +28,7 @@
import org.eclipse.core.runtime.IStatus;
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.IJBossServerConstants;
public class ServerLogger implements IJBossServerConstants {
@@ -77,8 +78,7 @@
}
public static File getServerLogFile(IServer server) {
- File f = server == null ? PLUGIN_LOCATION.toFile() :
- PLUGIN_LOCATION.append(server.getId().replace(' ', '_')).append(LOG).toFile();
+ File f = JBossServerCorePlugin.getServerStateLocation(server).append(LOG).toFile();
if( !f.getParentFile().exists() )
f.getParentFile().mkdirs();
return f;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBossServerConstants.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBossServerConstants.java 2009-04-22 05:56:32 UTC (rev 14842)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBossServerConstants.java 2009-04-22 07:24:57 UTC (rev 14843)
@@ -31,12 +31,17 @@
*
*/
public interface IJBossServerConstants {
- public static final IPath PLUGIN_LOCATION = JBossServerCorePlugin.getDefault().getStateLocation();
+ // Metadata folders
public static final String LOG = "log";
public static final String TEMP_DEPLOY = "tempDeploy";
public static final String JBOSSTOOLS_TMP = "jbosstoolsTemp";
public static final String TMP = "tmp";
+ public static final String CONFIG_IN_METADATA = "jbossConfig";
+
+ // Preference codes
+ public static final String USE_METADATA_CONFIG = "IJBossServerConstants.useMetadataConfig";
+
// Launch configuration constants
public static final String JBOSS_SERVER_HOME_DIR = "jboss.server.home.dir";
public static final String JBOSS_SERVER_BASE_DIR = "jboss.server.base.dir";
@@ -47,6 +52,11 @@
public static final String DEFAULT_SERVER_NAME = "default";
public static final String DEPLOY = "deploy";
public static final String SERVER = "server";
+ public static final String WORK = "work";
+ public static final String DATA = "data";
+// public static final String TMP = "tmp"; // repeat
+// public static final String LOG = "log"; // repeat
+ public static final String[] JBOSS_TEMPORARY_FOLDERS = new String[] { WORK, DATA, TMP, LOG};
// Property keys stored in the server object
public static final String SERVER_USERNAME = "org.jboss.ide.eclipse.as.core.server.userName";
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServer.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServer.java 2009-04-22 05:56:32 UTC (rev 14842)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServer.java 2009-04-22 07:24:57 UTC (rev 14843)
@@ -35,13 +35,13 @@
import org.eclipse.wst.server.core.IRuntime;
import org.eclipse.wst.server.core.IServerWorkingCopy;
import org.eclipse.wst.server.core.ServerPort;
-import org.eclipse.wst.server.core.ServerUtil;
import org.eclipse.wst.server.core.model.ServerDelegate;
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
import org.jboss.ide.eclipse.as.core.server.IJBossServerConstants;
import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
import org.jboss.ide.eclipse.as.core.util.ModuleUtil;
+import org.jboss.ide.eclipse.as.core.util.ServerUtil;
public class DeployableServer extends ServerDelegate implements IDeployableServer {
@@ -87,7 +87,7 @@
private IModule[] doGetParentModules(IModule module) {
- IModule[] ears = ServerUtil.getModules("jst.ear"); //$NON-NLS-1$
+ IModule[] ears = org.eclipse.wst.server.core.ServerUtil.getModules("jst.ear"); //$NON-NLS-1$
ArrayList<IModule> list = new ArrayList<IModule>();
for (int i = 0; i < ears.length; i++) {
IEnterpriseApplication ear = (IEnterpriseApplication)ears[i].loadAdapter(IEnterpriseApplication.class,null);
@@ -110,43 +110,21 @@
public String getDeployFolder() {
- String type = getDeployLocationType();
- if( type.equals(DEPLOY_CUSTOM))
- return makeGlobal(getRuntime(), new Path(getAttribute(DEPLOY_DIRECTORY, ""))).toString();
- if( type.equals(DEPLOY_METADATA)) {
- return IJBossServerConstants.PLUGIN_LOCATION.append(getServer().getId().replace(' ', '_')).
- append(IJBossServerConstants.DEPLOY).makeAbsolute().toString();
- } else /* if( type.equals(DEPLOY_SERVER)) */ {
- IJBossServerRuntime jbsrt = getRuntime();
- String config = jbsrt.getJBossConfiguration();
- IPath p = new Path(IJBossServerConstants.SERVER).append(config)
- .append(IJBossServerConstants.DEPLOY).makeRelative();
- return makeGlobal(getRuntime(), p).toString();
- }
+ IJBossServerRuntime jbsrt = getRuntime();
+ return ServerUtil.makeGlobal(jbsrt, new Path(getAttribute(DEPLOY_DIRECTORY, ""))).toString();
}
public void setDeployFolder(String folder) {
- setAttribute(DEPLOY_DIRECTORY, makeRelative(getRuntime(), new Path(folder)).toString());
+ setAttribute(DEPLOY_DIRECTORY, ServerUtil.makeRelative(getRuntime(), new Path(folder)).toString());
}
public String getTempDeployFolder() {
- String type = getDeployLocationType();
- if( type.equals(DEPLOY_CUSTOM))
- return makeGlobal(getRuntime(), new Path(getAttribute(TEMP_DEPLOY_DIRECTORY, ""))).toString();
- if( type.equals(DEPLOY_METADATA)) {
- return IJBossServerConstants.PLUGIN_LOCATION.append(getServer().getId().replace(' ', '_')).
- append(IJBossServerConstants.TEMP_DEPLOY).makeAbsolute().toString();
- } else /* if( type.equals(DEPLOY_SERVER)) */{
- IJBossServerRuntime jbsrt = getRuntime();
- String config = jbsrt.getJBossConfiguration();
- IPath p = new Path(IJBossServerConstants.SERVER)
- .append(config).append(IJBossServerConstants.TMP)
- .append(IJBossServerConstants.JBOSSTOOLS_TMP).makeRelative();
- return makeGlobal(getRuntime(), p).toString();
- }
- }
+ IJBossServerRuntime jbsrt = getRuntime();
+ return ServerUtil.makeGlobal(jbsrt, new Path(getAttribute(TEMP_DEPLOY_DIRECTORY, ""))).toString();
+ }
+
public void setTempDeployFolder(String folder) {
- setAttribute(TEMP_DEPLOY_DIRECTORY, makeRelative(getRuntime(), new Path(folder)).toString());
+ setAttribute(TEMP_DEPLOY_DIRECTORY, ServerUtil.makeRelative(getRuntime(), new Path(folder)).toString());
}
public void setDeployLocationType(String type) {
@@ -188,21 +166,5 @@
new NullProgressMonitor());
return ajbsrt;
}
-
- public static IPath makeRelative(IJBossServerRuntime rt, IPath p) {
- if( p.isAbsolute() && rt != null) {
- if(rt.getRuntime().getLocation().isPrefixOf(p)) {
- int size = rt.getRuntime().getLocation().toOSString().length();
- return new Path(p.toOSString().substring(size)).makeRelative();
- }
- }
- return p;
- }
-
- public static IPath makeGlobal(IJBossServerRuntime rt, IPath p) {
- if( !p.isAbsolute() && rt != null) {
- return rt.getRuntime().getLocation().append(p).makeAbsolute();
- }
- return p;
- }
+
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServer.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServer.java 2009-04-22 05:56:32 UTC (rev 14842)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServer.java 2009-04-22 07:24:57 UTC (rev 14843)
@@ -27,6 +27,7 @@
import java.util.Map;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
@@ -46,6 +47,7 @@
import org.jboss.ide.eclipse.as.core.server.IJBossServerConstants;
import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
import org.jboss.ide.eclipse.as.core.util.ArgsUtil;
+import org.jboss.ide.eclipse.as.core.util.ServerUtil;
/**
*
@@ -134,14 +136,57 @@
}
public String getDeployFolder() {
- String folder = super.getDeployFolder();
- return folder != null ? folder : getDeployFolder(true);
+ IJBossServerRuntime jbsrt = getRuntime();
+ String type = getDeployLocationType();
+ if( type.equals(DEPLOY_CUSTOM))
+ return ServerUtil.makeGlobal(jbsrt, new Path(getAttribute(DEPLOY_DIRECTORY, ""))).toString();
+ if( type.equals(DEPLOY_METADATA)) {
+ return JBossServerCorePlugin.getServerStateLocation(getServer()).
+ append(IJBossServerConstants.DEPLOY).makeAbsolute().toString();
+ } else if( type.equals(DEPLOY_SERVER)) {
+ if( !getAttribute(USE_METADATA_CONFIG, false)) {
+ String config = jbsrt.getJBossConfiguration();
+ IPath p = new Path(IJBossServerConstants.SERVER).append(config)
+ .append(IJBossServerConstants.DEPLOY).makeRelative();
+ return ServerUtil.makeGlobal(jbsrt, p).toString();
+ } else {
+ IPath dest = JBossServerCorePlugin.getServerStateLocation(getServer());
+ dest = dest.append(IJBossServerConstants.CONFIG_IN_METADATA);
+ return dest.toOSString();
+ }
+ }
+ return null;
}
protected String getDeployFolder(boolean checkLaunchConfig) {
return new Path(getConfigDirectory(checkLaunchConfig) + Path.SEPARATOR + DEPLOY).toOSString();
}
+
+ public String getTempDeployFolder() {
+ IJBossServerRuntime jbsrt = getRuntime();
+ String type = getDeployLocationType();
+ if( type.equals(DEPLOY_CUSTOM))
+ return ServerUtil.makeGlobal(jbsrt, new Path(getAttribute(TEMP_DEPLOY_DIRECTORY, ""))).toString();
+ if( type.equals(DEPLOY_METADATA)) {
+ return JBossServerCorePlugin.getServerStateLocation(getServer()).
+ append(IJBossServerConstants.TEMP_DEPLOY).makeAbsolute().toString();
+ } else if( type.equals(DEPLOY_SERVER)) {
+ if( !getAttribute(USE_METADATA_CONFIG, false)) {
+ String config = jbsrt.getJBossConfiguration();
+ IPath p = new Path(IJBossServerConstants.SERVER)
+ .append(config).append(IJBossServerConstants.TMP)
+ .append(IJBossServerConstants.JBOSSTOOLS_TMP).makeRelative();
+ return ServerUtil.makeGlobal(jbsrt, p).toString();
+ } else {
+ return JBossServerCorePlugin.getServerStateLocation(getServer()).
+ append(IJBossServerConstants.TEMP_DEPLOY).makeAbsolute().toString();
+ }
+ }
+ return null;
+ }
+
+
protected String getLaunchConfigConfigurationDirectory() {
try {
Server s = (Server)getServer();
@@ -167,6 +212,10 @@
return null;
}
+ public boolean isMetadataConfig() {
+ return getAttribute(USE_METADATA_CONFIG, false);
+ }
+
protected String getRuntimeConfigDirectory() {
IJBossServerRuntime runtime = (IJBossServerRuntime)
getServer().getRuntime().loadAdapter(IJBossServerRuntime.class, null);
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/ServerListener.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/ServerListener.java 2009-04-22 05:56:32 UTC (rev 14842)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/ServerListener.java 2009-04-22 07:24:57 UTC (rev 14843)
@@ -6,6 +6,7 @@
import javax.management.ObjectName;
import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
@@ -13,6 +14,7 @@
import org.eclipse.wst.server.core.IRuntime;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.ServerEvent;
+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.extensions.events.ServerLogger;
import org.jboss.ide.eclipse.as.core.extensions.jmx.JBossServerConnectionProvider;
@@ -22,6 +24,7 @@
import org.jboss.ide.eclipse.as.core.server.UnitedServerListener;
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.ServerUtil;
import org.jboss.tools.jmx.core.IJMXRunnable;
import org.jboss.tools.jmx.core.JMXException;
@@ -34,35 +37,11 @@
}
public void serverAdded(IServer server) {
- // create metadata area
- File location = IJBossServerConstants.PLUGIN_LOCATION.append(server.getId().replace(' ', '_')).toFile();
- location.mkdirs();
-
- // create temp deploy folder
- IDeployableServer ds = (IDeployableServer)server.loadAdapter(IDeployableServer.class, null);
- if( ds != null ) {
- File d1 = new File(location, IJBossServerConstants.DEPLOY);
- File d2 = new File(location, IJBossServerConstants.TEMP_DEPLOY);
- d1.mkdirs();
- d2.mkdirs();
- if( !new File(ds.getDeployFolder()).equals(d1))
- new File(ds.getDeployFolder()).mkdirs();
- if( !new File(ds.getTempDeployFolder()).equals(d2))
- new File(ds.getTempDeployFolder()).mkdirs();
- IRuntime rt = server.getRuntime();
- IJBossServerRuntime jbsrt = (IJBossServerRuntime)rt.loadAdapter(IJBossServerRuntime.class, new NullProgressMonitor());
- String config = jbsrt.getJBossConfiguration();
- IPath newTemp = new Path(IJBossServerConstants.SERVER).append(config)
- .append(IJBossServerConstants.TMP)
- .append(IJBossServerConstants.JBOSSTOOLS_TMP).makeRelative();
- IPath newTempAsGlobal = DeployableServer.makeGlobal(jbsrt, newTemp);
- newTempAsGlobal.toFile().mkdirs();
- }
}
public void serverRemoved(IServer server) {
// delete metadata area
- File f = IJBossServerConstants.PLUGIN_LOCATION.append(server.getId().replace(' ', '_')).toFile();
+ File f = JBossServerCorePlugin.getServerStateLocation(server).toFile();
FileUtil.safeDelete(f);
}
@@ -119,7 +98,7 @@
IPath deploy = new Path(IJBossServerConstants.SERVER)
.append(config)
.append(IJBossServerConstants.DEPLOY).makeRelative();
- IPath deployGlobal = DeployableServer.makeGlobal(jbsrt, deploy);
+ IPath deployGlobal = ServerUtil.makeGlobal(jbsrt, deploy);
if( new Path(deployFolder).equals(deployGlobal))
shouldAdd = false;
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/JBossServerStartupLaunchConfiguration.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/JBossServerStartupLaunchConfiguration.java 2009-04-22 05:56:32 UTC (rev 14842)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/JBossServerStartupLaunchConfiguration.java 2009-04-22 07:24:57 UTC (rev 14843)
@@ -21,6 +21,7 @@
*/
package org.jboss.ide.eclipse.as.core.server.internal.launch;
+import java.net.MalformedURLException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@@ -49,6 +50,7 @@
import org.eclipse.wst.server.core.ServerCore;
import org.eclipse.wst.server.core.ServerUtil;
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
+import org.jboss.ide.eclipse.as.core.server.IJBossServerConstants;
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.JBossServerBehavior;
@@ -121,7 +123,16 @@
jbs.getServer().getRuntime().loadAdapter(IJBossServerRuntime.class, null);
String config = runtime.getJBossConfiguration();
args = ArgsUtil.setArg(args, "-c", "--configuration", config);
-
+
+ if( jbs.isMetadataConfig()) {
+ try {
+ IPath dest = JBossServerCorePlugin.getServerStateLocation(jbs.getServer());
+ dest = dest.append(IJBossServerConstants.CONFIG_IN_METADATA);
+ args = ArgsUtil.setArg(args, null, "-Djboss.server.home.url", dest.toFile().toURL().toString());
+ } catch( MalformedURLException murle) {}
+ }
+
+
vmArgs= ArgsUtil.setArg(vmArgs, null, "-Djava.endorsed.dirs",
"\"" + runtime.getRuntime().getLocation().append("lib").append("endorsed") + "\"", false);
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 2009-04-22 05:56:32 UTC (rev 14842)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ServerUtil.java 2009-04-22 07:24:57 UTC (rev 14843)
@@ -1,5 +1,85 @@
package org.jboss.ide.eclipse.as.core.util;
+import java.io.File;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.wst.server.core.IRuntime;
+import org.eclipse.wst.server.core.IServer;
+import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
+import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
+import org.jboss.ide.eclipse.as.core.server.IJBossServerConstants;
+import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
+import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
+
public class ServerUtil {
-
+
+ public static IPath makeRelative(IJBossServerRuntime rt, IPath p) {
+ if( p.isAbsolute() && rt != null) {
+ if(rt.getRuntime().getLocation().isPrefixOf(p)) {
+ int size = rt.getRuntime().getLocation().toOSString().length();
+ return new Path(p.toOSString().substring(size)).makeRelative();
+ }
+ }
+ return p;
+ }
+
+ public static IPath makeGlobal(IJBossServerRuntime rt, IPath p) {
+ if( !p.isAbsolute() && rt != null) {
+ return rt.getRuntime().getLocation().append(p).makeAbsolute();
+ }
+ return p;
+ }
+
+ public static void cloneConfigToMetadata(IServer server, IProgressMonitor monitor) {
+ IPath dest = JBossServerCorePlugin.getServerStateLocation(server);
+ dest = dest.append(IJBossServerConstants.CONFIG_IN_METADATA);
+ IRuntime rt = server.getRuntime();
+ IJBossServerRuntime jbsrt = (IJBossServerRuntime)rt.loadAdapter(IJBossServerRuntime.class, new NullProgressMonitor());
+ IPath src = rt.getLocation().append(IJBossServerConstants.SERVER).append(jbsrt.getJBossConfiguration());
+ dest.toFile().mkdirs();
+
+ File[] subFiles = src.toFile().listFiles();
+ dest.toFile().mkdirs();
+ String[] excluded = IJBossServerConstants.JBOSS_TEMPORARY_FOLDERS;
+ for (int i = 0; i < subFiles.length; i++) {
+ boolean found = false;
+ for( int j = 0; j < excluded.length; j++)
+ if( subFiles[i].getName().equals(excluded[j]))
+ found = true;
+ if( !found ) {
+ File newDest = new File(dest.toFile(), subFiles[i].getName());
+ FileUtil.fileSafeCopy(subFiles[i], newDest, null);
+ }
+ }
+ }
+
+ public static void createStandardFolders(IServer server) {
+ // create metadata area
+ File location = JBossServerCorePlugin.getServerStateLocation(server).toFile();
+ location.mkdirs();
+
+ // create temp deploy folder
+ JBossServer ds = ( JBossServer)server.loadAdapter(JBossServer.class, null);
+ if( ds != null ) {
+ File d1 = new File(location, IJBossServerConstants.DEPLOY);
+ File d2 = new File(location, IJBossServerConstants.TEMP_DEPLOY);
+ d1.mkdirs();
+ d2.mkdirs();
+ if( !new File(ds.getDeployFolder()).equals(d1))
+ new File(ds.getDeployFolder()).mkdirs();
+ if( !new File(ds.getTempDeployFolder()).equals(d2))
+ new File(ds.getTempDeployFolder()).mkdirs();
+ IRuntime rt = server.getRuntime();
+ IJBossServerRuntime jbsrt = (IJBossServerRuntime)rt.loadAdapter(IJBossServerRuntime.class, new NullProgressMonitor());
+ String config = jbsrt.getJBossConfiguration();
+ IPath newTemp = new Path(IJBossServerConstants.SERVER).append(config)
+ .append(IJBossServerConstants.TMP)
+ .append(IJBossServerConstants.JBOSSTOOLS_TMP).makeRelative();
+ IPath newTempAsGlobal = ServerUtil.makeGlobal(jbsrt, newTemp);
+ newTempAsGlobal.toFile().mkdirs();
+ }
+ }
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.java 2009-04-22 05:56:32 UTC (rev 14842)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.java 2009-04-22 07:24:57 UTC (rev 14843)
@@ -59,6 +59,7 @@
public static String swf_DeploymentDescription;
public static String swf_DeployDirectory;
public static String swf_TempDeployDirectory;
+ public static String swf_CloneConfiguration;
public static String sswf_Title;
public static String sswf_BaseName;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.properties
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.properties 2009-04-22 05:56:32 UTC (rev 14842)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.properties 2009-04-22 07:24:57 UTC (rev 14843)
@@ -31,6 +31,7 @@
swf_DeploymentDescription=The temporary deployment location is where files will \nbe copied to before being renamed into the deploy directory. \nThis folder should be on the same file system \nas the deploy folder.
swf_DeployDirectory=Deploy Directory
swf_TempDeployDirectory=Temporary Deploy Directory
+swf_CloneConfiguration=Copy this configuration into workspace metadata
sswf_Title=Create a new System Copy Server
sswf_BaseName=Local Deployer
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/DeploySection.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/DeploySection.java 2009-04-22 05:56:32 UTC (rev 14842)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/DeploySection.java 2009-04-22 07:24:57 UTC (rev 14843)
@@ -61,8 +61,8 @@
import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
import org.jboss.ide.eclipse.as.core.server.IJBossServerConstants;
import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
-import org.jboss.ide.eclipse.as.core.server.internal.DeployableServer;
import org.jboss.ide.eclipse.as.core.server.internal.ServerAttributeHelper;
+import org.jboss.ide.eclipse.as.core.util.ServerUtil;
import org.jboss.ide.eclipse.as.ui.JBossServerUIPlugin;
import org.jboss.ide.eclipse.as.ui.Messages;
@@ -397,10 +397,10 @@
if( newSelection == metadataRadio ) {
- newDir = IJBossServerConstants.PLUGIN_LOCATION.append(id.replace(' ', '_')).
- append(IJBossServerConstants.DEPLOY).makeAbsolute().toString();
- newTemp = IJBossServerConstants.PLUGIN_LOCATION.append(id.replace(' ', '_')).
- append(IJBossServerConstants.TEMP_DEPLOY).makeAbsolute().toString();
+ newDir = JBossServerCorePlugin.getServerStateLocation(id)
+ .append(IJBossServerConstants.DEPLOY).makeAbsolute().toString();
+ newTemp = JBossServerCorePlugin.getServerStateLocation(id)
+ .append(IJBossServerConstants.TEMP_DEPLOY).makeAbsolute().toString();
type = IDeployableServer.DEPLOY_METADATA;
new File(newDir).mkdirs();
new File(newTemp).mkdirs();
@@ -486,14 +486,14 @@
}
private String makeGlobal(String path) {
- return DeployableServer.makeGlobal(getRuntime(), new Path(path)).toString();
+ return ServerUtil.makeGlobal(getRuntime(), new Path(path)).toString();
}
private String makeRelative(String path) {
if (getRuntime() == null) {
return path;
}
- return DeployableServer.makeRelative(getRuntime(), new Path(path)).toString();
+ return ServerUtil.makeRelative(getRuntime(), new Path(path)).toString();
}
private IJBossServerRuntime getRuntime() {
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossServerWizardFragment.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossServerWizardFragment.java 2009-04-22 05:56:32 UTC (rev 14842)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossServerWizardFragment.java 2009-04-22 07:24:57 UTC (rev 14843)
@@ -30,11 +30,14 @@
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
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.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
@@ -44,11 +47,14 @@
import org.eclipse.wst.server.core.IServerWorkingCopy;
import org.eclipse.wst.server.core.ServerCore;
import org.eclipse.wst.server.core.TaskModel;
+import org.eclipse.wst.server.core.internal.ServerWorkingCopy;
import org.eclipse.wst.server.ui.wizard.IWizardHandle;
import org.eclipse.wst.server.ui.wizard.WizardFragment;
import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
+import org.jboss.ide.eclipse.as.core.server.IJBossServerConstants;
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.util.ServerUtil;
import org.jboss.ide.eclipse.as.ui.JBossServerUISharedImages;
import org.jboss.ide.eclipse.as.ui.Messages;
@@ -68,7 +74,8 @@
private Composite nameComposite;
private Group runtimeGroup;
private Text nameText;
-
+ private Button cloneButton;
+ private boolean shouldClone;
public Composite createComposite(Composite parent, IWizardHandle handle) {
this.handle = handle;
@@ -224,6 +231,21 @@
configValLabel = new Label(runtimeGroup, SWT.NONE);
d = new GridData(SWT.BEGINNING, SWT.CENTER, true, false);
configValLabel.setLayoutData(d);
+
+ cloneButton = new Button(runtimeGroup, SWT.CHECK);
+ cloneButton.setText(Messages.swf_CloneConfiguration);
+ d = new GridData(SWT.BEGINNING, SWT.CENTER, true, false);
+ d.horizontalSpan = 2;
+ cloneButton.setLayoutData(d);
+
+ cloneButton.addSelectionListener(new SelectionListener() {
+ public void widgetDefaultSelected(SelectionEvent e) {
+ widgetSelected(e);
+ }
+ public void widgetSelected(SelectionEvent e) {
+ shouldClone = cloneButton.getSelection();
+ }
+ });
}
private void updateErrorMessage() {
@@ -264,10 +286,17 @@
JBossServer jbs = (JBossServer)serverWC.loadAdapter(JBossServer.class, new NullProgressMonitor());
jbs.setUsername("admin");
jbs.setPassword("admin");
+ ((ServerWorkingCopy)serverWC).setAttribute(IJBossServerConstants.USE_METADATA_CONFIG, shouldClone);
jbs.setDeployLocationType(isAS5() ? IDeployableServer.DEPLOY_SERVER : IDeployableServer.DEPLOY_METADATA);
serverWC.setRuntime((IRuntime)getTaskModel().getObject(TaskModel.TASK_RUNTIME));
serverWC.setName(name);
serverWC.setServerConfiguration(null); // no inside jboss folder
+
+ IServer saved = serverWC.save(false, new NullProgressMonitor());
+ getTaskModel().putObject(TaskModel.TASK_SERVER, saved);
+ ServerUtil.createStandardFolders(saved);
+ if( shouldClone)
+ ServerUtil.cloneConfigToMetadata(saved, monitor);
}
private IJBossServerRuntime getRuntime() {
15 years, 8 months
JBoss Tools SVN: r14842 - trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2009-04-22 01:56:32 -0400 (Wed, 22 Apr 2009)
New Revision: 14842
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/GenericGeneratorAnnotationImpl.java
Log:
fix for hibernate compilation errors, someone have to implement it in right way, I just tried to keep build rolling
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/GenericGeneratorAnnotationImpl.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/GenericGeneratorAnnotationImpl.java 2009-04-22 05:52:37 UTC (rev 14841)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/GenericGeneratorAnnotationImpl.java 2009-04-22 05:56:32 UTC (rev 14842)
@@ -10,9 +10,10 @@
******************************************************************************/
package org.jboss.tools.hibernate.jpt.core.internal.context.java;
+import org.eclipse.jdt.core.IAnnotation;
import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.internal.resource.java.AbstractResourceAnnotation;
+import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation;
import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
import org.eclipse.jpt.core.internal.utility.jdt.ShortCircuitAnnotationElementAdapter;
import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
@@ -30,7 +31,7 @@
* @author Dmitry Geraskov
*
*/
-public class GenericGeneratorAnnotationImpl extends AbstractResourceAnnotation<Member>
+public class GenericGeneratorAnnotationImpl extends SourceAnnotation<Member>
implements GenericGeneratorAnnotation {
private final AnnotationElementAdapter<String> nameAdapter;
@@ -222,6 +223,23 @@
public String getAnnotationName() {
return ANNOTATION_NAME;
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jpt.core.resource.java.AnnotationDefinition#buildAnnotation(org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember, org.eclipse.jdt.core.IAnnotation)
+ */
+ public Annotation buildAnnotation(JavaResourcePersistentMember arg0,
+ IAnnotation arg1) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jpt.core.resource.java.AnnotationDefinition#buildNullAnnotation(org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember)
+ */
+ public Annotation buildNullAnnotation(JavaResourcePersistentMember arg0) {
+ // TODO Auto-generated method stub
+ return null;
+ }
}
}
15 years, 8 months
JBoss Tools SVN: r14841 - trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2009-04-22 01:52:37 -0400 (Wed, 22 Apr 2009)
New Revision: 14841
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/SingleFilePublisher.java
Log:
JBIDE-4156
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 2009-04-22 05:39:52 UTC (rev 14840)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PublishUtil.java 2009-04-22 05:52:37 UTC (rev 14841)
@@ -1,3 +1,24 @@
+/**
+ * JBoss, a Division of Red Hat
+ * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+* This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.ide.eclipse.as.core.publishers;
import org.eclipse.core.resources.IFile;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/SingleFilePublisher.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/SingleFilePublisher.java 2009-04-22 05:39:52 UTC (rev 14840)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/SingleFilePublisher.java 2009-04-22 05:52:37 UTC (rev 14841)
@@ -1,3 +1,24 @@
+/**
+ * JBoss, a Division of Red Hat
+ * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+* This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.ide.eclipse.as.core.publishers;
import java.io.File;
@@ -74,19 +95,19 @@
FileUtilListener l = new FileUtilListener();
FileUtil.fileSafeCopy(sourcePath.toFile(), tempDestFile, l);
boolean success = tempDestFile.renameTo(destFile);
- if( updateTimestamp )
+ if( success && updateTimestamp )
destFile.setLastModified(new Date().getTime());
if( l.errorFound || !success ) {
publishState = IServer.PUBLISH_STATE_FULL;
Exception e = l.e != null ? l.e : new Exception("Move from " + tempDestFile + " to " + destFile + " failed.");
return new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, IEventCodes.SINGLE_FILE_PUBLISH_FAIL,
- "The module cannot be published.", e);
+ "The module " + module.getName() + " cannot be published.", e);
}
} else {
// deleted module. o noes. Ignore it. We can't re-publish it, so just ignore it.
publishState = IServer.PUBLISH_STATE_UNKNOWN;
Status status = new Status(IStatus.WARNING, JBossServerCorePlugin.PLUGIN_ID, IEventCodes.SINGLE_FILE_PUBLISH_MNF,
- "The module cannot be published because it cannot be located. (" + module.getName() + ")", null);
+ "The module " + module.getName() + " cannot be published because it cannot be located. (" + module.getName() + ")", null);
return status;
}
15 years, 8 months
JBoss Tools SVN: r14840 - trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2009-04-22 01:39:52 -0400 (Wed, 22 Apr 2009)
New Revision: 14840
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/SingleFilePublisher.java
Log:
JBIDE-4156
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/SingleFilePublisher.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/SingleFilePublisher.java 2009-04-21 18:33:28 UTC (rev 14839)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/SingleFilePublisher.java 2009-04-22 05:39:52 UTC (rev 14840)
@@ -69,6 +69,8 @@
IPath tempDestFolder = new Path(server.getTempDeployFolder());
File tempDestFile = tempDestFolder.append(sourcePath.lastSegment()).toFile();
File destFile = destFolder.append(sourcePath.lastSegment()).toFile();
+ if( destFile.exists())
+ destFile.delete();
FileUtilListener l = new FileUtilListener();
FileUtil.fileSafeCopy(sourcePath.toFile(), tempDestFile, l);
boolean success = tempDestFile.renameTo(destFile);
15 years, 8 months
JBoss Tools SVN: r14839 - in trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common: command and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2009-04-21 14:33:28 -0400 (Tue, 21 Apr 2009)
New Revision: 14839
Modified:
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/action/VerticalAutoLayoutAction.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/DeleteElementCommand.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ConnectionEditPart.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ContainerEditPart.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ElementEditPart.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/LabelEditPart.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/RootEditPart.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/WrapperPropertySource.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractContainerWrapper.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractFlowWrapper.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractLabelWrapper.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractNodeWrapper.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractWrapper.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/ContainerWrapper.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultLabelWrapper.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/FlowWrapper.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/ModelEvent.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/Wrapper.java
Log:
richer model event, to allow for adding and removing children to/from elements
Modified: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/action/VerticalAutoLayoutAction.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/action/VerticalAutoLayoutAction.java 2009-04-21 17:49:24 UTC (rev 14838)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/action/VerticalAutoLayoutAction.java 2009-04-21 18:33:28 UTC (rev 14839)
@@ -67,7 +67,7 @@
for (Map.Entry<String, Node> entry: mapping.entrySet()) {
Node node = entry.getValue();
NodeWrapper nodeWrapper =
- ((FlowWrapper)diagramViewer.getContents().getModel()).getElement(entry.getKey());
+ ((FlowWrapper)diagramViewer.getContents().getModel()).getNodeWrapper(entry.getKey());
nodeWrapper.setConstraint(new Rectangle(node.x, node.y, node.width, node.height));
}
}
@@ -76,7 +76,7 @@
protected DirectedGraph createDirectedGraph(Map<String, Node> mapping) {
DirectedGraph graph = new DirectedGraph();
FlowWrapper processWrapper = (FlowWrapper)diagramViewer.getContents().getModel();
- for (NodeWrapper elementWrapper: processWrapper.getElements()) {
+ for (NodeWrapper elementWrapper: processWrapper.getNodeWrappers()) {
Node node = new Node();
Integer width = (Integer) elementWrapper.getConstraint().width;
Integer height = (Integer) elementWrapper.getConstraint().height;
@@ -90,7 +90,7 @@
graph.nodes.add(node);
mapping.put(elementWrapper.getId(), node);
}
- for (NodeWrapper elementWrapper: processWrapper.getElements()) {
+ for (NodeWrapper elementWrapper: processWrapper.getNodeWrappers()) {
for (ConnectionWrapper connection: elementWrapper.getIncomingConnections()) {
Node source = mapping.get(connection.getSource().getId());
Node target = mapping.get(connection.getTarget().getId());
Modified: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/DeleteElementCommand.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/DeleteElementCommand.java 2009-04-21 17:49:24 UTC (rev 14838)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/DeleteElementCommand.java 2009-04-21 18:33:28 UTC (rev 14839)
@@ -62,7 +62,7 @@
private void initializeEmbeddedCommands() {
embeddedCommands = new ArrayList<DeleteElementCommand>();
ContainerWrapper container = (ContainerWrapper)child;
- List<NodeWrapper> children = container.getElements();
+ List<NodeWrapper> children = container.getNodeWrappers();
for (NodeWrapper w : children) {
DeleteElementCommand c = new DeleteElementCommand();
c.setParent(container);
Modified: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ConnectionEditPart.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ConnectionEditPart.java 2009-04-21 17:49:24 UTC (rev 14838)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ConnectionEditPart.java 2009-04-21 18:33:28 UTC (rev 14839)
@@ -94,7 +94,7 @@
}
public void modelChanged(ModelEvent event) {
- if (event.getChange() == ConnectionWrapper.CHANGE_BENDPOINTS) {
+ if (event.getChangeType() == ConnectionWrapper.CHANGE_BENDPOINTS) {
refreshBendpoints();
}
}
Modified: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ContainerEditPart.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ContainerEditPart.java 2009-04-21 17:49:24 UTC (rev 14838)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ContainerEditPart.java 2009-04-21 18:33:28 UTC (rev 14839)
@@ -47,7 +47,7 @@
}
public void modelChanged(ModelEvent event) {
- if (event.getChange() == ContainerWrapper.ADD_ELEMENT) {
+ if (event.getChangeType() == ContainerWrapper.ADD_ELEMENT) {
refreshChildren();
Object changedObject = event.getChangedObject();
if (changedObject != null) {
@@ -56,7 +56,7 @@
((ElementEditPart)editPart).performDirectEdit();
}
}
- } else if (event.getChange() == ContainerWrapper.REMOVE_ELEMENT) {
+ } else if (event.getChangeType() == ContainerWrapper.REMOVE_ELEMENT) {
refreshChildren();
} else {
super.modelChanged(event);
@@ -72,7 +72,7 @@
}
protected List<NodeWrapper> getModelChildren() {
- return getElementContainerElementWrapper().getElements();
+ return getElementContainerElementWrapper().getNodeWrappers();
}
public IFigure getContentPane() {
Modified: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ElementEditPart.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ElementEditPart.java 2009-04-21 17:49:24 UTC (rev 14838)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ElementEditPart.java 2009-04-21 18:33:28 UTC (rev 14839)
@@ -99,15 +99,15 @@
}
public void modelChanged(ModelEvent event) {
- if (event.getChange() == NodeWrapper.ADD_INCOMING_CONNECTION) {
+ if (event.getChangeType() == NodeWrapper.ADD_ELEMENT && "incomingConnection".equals(event.getChangeDiscriminator())) {
refreshTargetConnections();
- } else if (event.getChange() == NodeWrapper.REMOVE_INCOMING_CONNECTION) {
+ } else if (event.getChangeType() == NodeWrapper.REMOVE_ELEMENT && "incomingConnection".equals(event.getChangeDiscriminator())) {
refreshTargetConnections();
- } else if (event.getChange() == NodeWrapper.ADD_OUTGOING_CONNECTION) {
+ } else if (event.getChangeType() == NodeWrapper.ADD_ELEMENT && "outgoingConnection".equals(event.getChangeDiscriminator())) {
refreshSourceConnections();
- } else if (event.getChange() == NodeWrapper.REMOVE_OUTGOING_CONNECTION) {
+ } else if (event.getChangeType() == NodeWrapper.REMOVE_ELEMENT && "outgoingConnection".equals(event.getChangeDiscriminator())) {
refreshSourceConnections();
- } else if (event.getChange() == NodeWrapper.CHANGE_VISUAL) {
+ } else if (event.getChangeType() == NodeWrapper.CHANGE_VISUAL) {
refreshVisuals();
}
}
Modified: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/LabelEditPart.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/LabelEditPart.java 2009-04-21 17:49:24 UTC (rev 14838)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/LabelEditPart.java 2009-04-21 18:33:28 UTC (rev 14839)
@@ -106,7 +106,7 @@
}
public void modelChanged(ModelEvent event) {
- if (event.getChange() == Wrapper.CHANGE_PROPERTY || event.getChange() == Wrapper.CHANGE_VISUAL) {
+ if (event.getChangeType() == Wrapper.CHANGE_PROPERTY || event.getChangeType() == Wrapper.CHANGE_VISUAL) {
refreshVisuals();
}
}
Modified: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/RootEditPart.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/RootEditPart.java 2009-04-21 17:49:24 UTC (rev 14838)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/RootEditPart.java 2009-04-21 18:33:28 UTC (rev 14839)
@@ -68,7 +68,7 @@
}
protected List<NodeWrapper> getModelChildren() {
- return getWrapper().getElements();
+ return getWrapper().getNodeWrappers();
}
public void activate() {
@@ -82,11 +82,11 @@
}
public void modelChanged(ModelEvent event) {
- if (event.getChange() == ContainerWrapper.ADD_ELEMENT) {
+ if (event.getChangeType() == ContainerWrapper.ADD_ELEMENT) {
refreshChildren();
- } else if (event.getChange() == ContainerWrapper.REMOVE_ELEMENT) {
+ } else if (event.getChangeType() == ContainerWrapper.REMOVE_ELEMENT) {
refreshChildren();
- } else if (event.getChange() == FlowWrapper.CHANGE_VISUAL) {
+ } else if (event.getChangeType() == FlowWrapper.CHANGE_VISUAL) {
refreshVisuals();
}
}
Modified: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/WrapperPropertySource.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/WrapperPropertySource.java 2009-04-21 17:49:24 UTC (rev 14838)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/WrapperPropertySource.java 2009-04-21 18:33:28 UTC (rev 14839)
@@ -53,10 +53,11 @@
}
}
- public void setPropertyValue(Object id, Object value) {
+ public void setPropertyValue(Object id, Object newValue) {
if (elementPropertySource != null) {
- elementPropertySource.setPropertyValue(id, value);
- wrapper.notifyListeners(Wrapper.CHANGE_PROPERTY, id);
+ Object oldValue = elementPropertySource.getPropertyValue(id);
+ elementPropertySource.setPropertyValue(id, newValue);
+ wrapper.notifyListeners(Wrapper.CHANGE_PROPERTY, id, wrapper, oldValue, newValue);
}
}
Modified: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractContainerWrapper.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractContainerWrapper.java 2009-04-21 17:49:24 UTC (rev 14838)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractContainerWrapper.java 2009-04-21 18:33:28 UTC (rev 14839)
@@ -26,7 +26,7 @@
public void addElement(NodeWrapper element) {
internalAddElement(element);
localAddElement(element);
- notifyListeners(ADD_ELEMENT, element);
+ notifyListeners(ADD_ELEMENT, "node", this, null, element);
}
public void localAddElement(NodeWrapper element) {
@@ -40,12 +40,12 @@
internalRemoveElement(element);
elements.remove(element);
element.setParent(null);
- notifyListeners(REMOVE_ELEMENT, element);
+ notifyListeners(REMOVE_ELEMENT, "node", this, element, null);
}
protected abstract void internalRemoveElement(NodeWrapper element);
- public List<NodeWrapper> getElements() {
+ public List<NodeWrapper> getNodeWrappers() {
return elements;
}
Modified: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractFlowWrapper.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractFlowWrapper.java 2009-04-21 17:49:24 UTC (rev 14838)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractFlowWrapper.java 2009-04-21 18:33:28 UTC (rev 14839)
@@ -29,39 +29,39 @@
*/
public abstract class AbstractFlowWrapper extends AbstractWrapper implements FlowWrapper {
- private Map<String, NodeWrapper> elementMap = new HashMap<String, NodeWrapper>();
- private List<NodeWrapper> elementList = new ArrayList<NodeWrapper>();
- private transient List<ModelListener> listeners = new ArrayList<ModelListener>();
+ private Map<String, NodeWrapper> nodeWrapperMap = new HashMap<String, NodeWrapper>();
+ private List<NodeWrapper> nodeWrapperList = new ArrayList<NodeWrapper>();
public abstract Integer getRouterLayout();
- public void setRouterLayout(Integer routerLayout) {
- internalSetRouterLayout(routerLayout);
- notifyListeners(CHANGE_VISUAL, null);
+ public void setRouterLayout(Integer newLayout) {
+ Integer oldLayout = getRouterLayout();
+ internalSetRouterLayout(newLayout);
+ notifyListeners(CHANGE_VISUAL, "routerLayout", this, oldLayout, newLayout);
}
protected void internalSetRouterLayout(Integer routerLayout) {
}
- public List<NodeWrapper> getElements() {
+ public List<NodeWrapper> getNodeWrappers() {
return Collections.unmodifiableList(
- new ArrayList<NodeWrapper>(elementList));
+ new ArrayList<NodeWrapper>(nodeWrapperList));
}
- public NodeWrapper getElement(String id) {
- return (NodeWrapper) elementMap.get(id);
+ public NodeWrapper getNodeWrapper(String id) {
+ return (NodeWrapper) nodeWrapperMap.get(id);
}
- public void addElement(NodeWrapper element) {
- if (!acceptsElement(element)) return;
- internalAddElement(element);
- localAddElement(element);
- notifyListeners(ADD_ELEMENT, element);
+ public void addElement(NodeWrapper nodeWrapper) {
+ if (!acceptsElement(nodeWrapper)) return;
+ internalAddElement(nodeWrapper);
+ localAddElement(nodeWrapper);
+ notifyListeners(ADD_ELEMENT, "node", this, null, nodeWrapper);
}
public void localAddElement(NodeWrapper element) {
- elementMap.put(element.getId(), element);
- elementList.add(element);
+ nodeWrapperMap.put(element.getId(), element);
+ nodeWrapperList.add(element);
element.setParent(this);
}
@@ -72,14 +72,14 @@
protected abstract void internalAddElement(NodeWrapper element);
public void localRemoveElement(NodeWrapper element) {
- elementMap.remove(element.getId());
- elementList.remove(element);
+ nodeWrapperMap.remove(element.getId());
+ nodeWrapperList.remove(element);
}
public void removeElement(NodeWrapper element) {
localRemoveElement(element);
internalRemoveElement(element);
- notifyListeners(REMOVE_ELEMENT, element);
+ notifyListeners(REMOVE_ELEMENT, "node", this, element, null);
}
protected abstract void internalRemoveElement(NodeWrapper element);
@@ -88,19 +88,4 @@
return this;
}
- public void addListener(ModelListener listener) {
- listeners.add(listener);
- }
-
- public void removeListener(ModelListener listener) {
- listeners.remove(listener);
- }
-
- protected void notifyListeners(int change, NodeWrapper wrapper) {
- ModelEvent event = new ModelEvent(change, wrapper);
- for (ModelListener listener: listeners) {
- listener.modelChanged(event);
- }
- }
-
}
Modified: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractLabelWrapper.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractLabelWrapper.java 2009-04-21 17:49:24 UTC (rev 14838)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractLabelWrapper.java 2009-04-21 18:33:28 UTC (rev 14839)
@@ -16,9 +16,10 @@
return null;
}
- public void setLocation(Point location) {
- this.location = location;
- notifyListeners(CHANGE_VISUAL, this);
+ public void setLocation(Point newLocation) {
+ Point oldLocation = this.location;
+ this.location = newLocation;
+ notifyListeners(CHANGE_VISUAL, "location", this, oldLocation, newLocation);
}
public void setText(String text) {
Modified: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractNodeWrapper.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractNodeWrapper.java 2009-04-21 17:49:24 UTC (rev 14838)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractNodeWrapper.java 2009-04-21 18:33:28 UTC (rev 14839)
@@ -47,9 +47,10 @@
private List<ConnectionWrapper> outgoingConnections = new ArrayList<ConnectionWrapper>();
public void setConstraint(Rectangle constraint) {
+ Rectangle oldConstraint = this.constraint;
this.constraint = constraint;
internalSetConstraint(constraint);
- notifyListeners(CHANGE_VISUAL, this);
+ notifyListeners(CHANGE_VISUAL, "constraint", this, oldConstraint, constraint);
}
protected abstract void internalSetConstraint(Rectangle constraint);
@@ -90,7 +91,7 @@
public void addIncomingConnection(ConnectionWrapper connection) {
localAddIncomingConnection(connection);
internalAddIncomingConnection(connection);
- notifyListeners(ADD_INCOMING_CONNECTION, connection);
+ notifyListeners(ADD_ELEMENT, "incomingConnection", this, null, connection);
}
public void localAddIncomingConnection(ConnectionWrapper connection) {
@@ -103,7 +104,7 @@
public void removeIncomingConnection(ConnectionWrapper connection) {
incomingConnections.remove(connection);
internalRemoveIncomingConnection(connection);
- notifyListeners(REMOVE_INCOMING_CONNECTION, connection);
+ notifyListeners(REMOVE_ELEMENT, "incomingConnection", this, connection, null);
}
protected void internalRemoveIncomingConnection(ConnectionWrapper connection) {
@@ -112,7 +113,7 @@
public void addOutgoingConnection(ConnectionWrapper connection) {
localAddOutgoingConnection(connection);
internalAddOutgoingConnection(connection);
- notifyListeners(ADD_OUTGOING_CONNECTION, connection);
+ notifyListeners(ADD_ELEMENT, "outgoingConnection", this, null, connection);
}
public void localAddOutgoingConnection(ConnectionWrapper connection) {
@@ -125,15 +126,16 @@
public void removeOutgoingConnection(ConnectionWrapper connection) {
outgoingConnections.remove(connection);
internalRemoveOutgoingConnection(connection);
- notifyListeners(REMOVE_OUTGOING_CONNECTION, connection);
+ notifyListeners(REMOVE_ELEMENT, "outgoingConnection", this, connection, null);
}
protected void internalRemoveOutgoingConnection(ConnectionWrapper connection) {
}
- public void setName(String name) {
- internalSetName(name);
- notifyListeners(CHANGE_VISUAL, this);
+ public void setName(String newLocation) {
+ String oldName = getName();
+ internalSetName(newLocation);
+ notifyListeners(CHANGE_VISUAL, "name", this, oldName, newLocation);
}
protected void internalSetName(String name) {
Modified: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractWrapper.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractWrapper.java 2009-04-21 17:49:24 UTC (rev 14838)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractWrapper.java 2009-04-21 18:33:28 UTC (rev 14839)
@@ -1,7 +1,9 @@
package org.jboss.tools.flow.common.wrapper;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import org.eclipse.ui.views.properties.IPropertyDescriptor;
import org.eclipse.ui.views.properties.IPropertySource;
@@ -11,6 +13,7 @@
private Element element;
private transient List<ModelListener> listeners = new ArrayList<ModelListener>();
+ private transient Map<Object, List<Element>> children = new HashMap<Object, List<Element>>();
public void setElement(Element element) {
this.element = element;
@@ -20,6 +23,39 @@
return element;
}
+ public void addChild(Object type, Element element) {
+ List<Element> childList = children.get(type);
+ if (childList == null) {
+ childList = new ArrayList<Element>();
+ children.put(type, childList);
+ }
+ childList.add(element);
+ notifyListeners(ADD_ELEMENT, type, this, null, element);
+ }
+
+ public void removeChild(Object type, Element element) {
+ List<Element> childList = children.get(type);
+ if (childList == null) return;
+ childList.remove(element);
+ if (childList.isEmpty()) {
+ children.remove(type);
+ }
+ notifyListeners(REMOVE_ELEMENT, type, this, element, null);
+ }
+
+ public void setMetaData(String name, Object value) {
+ if (element != null) {
+ element.setMetaData(name, value);
+ }
+ }
+
+ public Object getMetaData(String name) {
+ if (element != null) {
+ return element.getMetaData(name);
+ }
+ return null;
+ }
+
public void addListener(ModelListener listener) {
listeners.add(listener);
}
@@ -28,15 +64,18 @@
listeners.remove(listener);
}
- public void notifyListeners(int change, Object object) {
- ModelEvent event = new ModelEvent(change, object);
+ public void notifyListeners(int type, Object discriminator, Object object, Object oldValue, Object newValue) {
+ notifyListeners(new ModelEvent(type, discriminator, object, oldValue, newValue));
+ }
+
+ public void notifyListeners(ModelEvent event) {
for (ModelListener listener: listeners) {
listener.modelChanged(event);
}
}
public void notifyListeners(int change) {
- notifyListeners(change, null);
+ notifyListeners(change, null, null, null, null);
}
public Object getEditableValue() {
@@ -73,10 +112,11 @@
}
}
- public void setPropertyValue(Object id, Object value) {
+ public void setPropertyValue(Object id, Object newValue) {
if (getPropertySource() != null) {
- getPropertySource().setPropertyValue(id, value);
- notifyListeners(CHANGE_PROPERTY, id);
+ Object oldValue = getPropertySource().getPropertyValue(id);
+ getPropertySource().setPropertyValue(id, newValue);
+ notifyListeners(CHANGE_PROPERTY, id, this, oldValue, newValue);
}
}
Modified: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/ContainerWrapper.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/ContainerWrapper.java 2009-04-21 17:49:24 UTC (rev 14838)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/ContainerWrapper.java 2009-04-21 18:33:28 UTC (rev 14839)
@@ -26,7 +26,7 @@
void removeElement(NodeWrapper element);
- List<NodeWrapper> getElements();
+ List<NodeWrapper> getNodeWrappers();
FlowWrapper getFlowWrapper();
Modified: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultLabelWrapper.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultLabelWrapper.java 2009-04-21 17:49:24 UTC (rev 14838)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultLabelWrapper.java 2009-04-21 18:33:28 UTC (rev 14839)
@@ -23,7 +23,7 @@
}
public void modelChanged(ModelEvent event) {
- notifyListeners(event.getChange(), event.getChangedObject());
+ notifyListeners(event);
}
protected IPropertySource getPropertySource() {
Modified: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/FlowWrapper.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/FlowWrapper.java 2009-04-21 17:49:24 UTC (rev 14838)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/FlowWrapper.java 2009-04-21 18:33:28 UTC (rev 14839)
@@ -7,7 +7,7 @@
Integer ROUTER_LAYOUT_SHORTEST_PATH = new Integer(2);
- NodeWrapper getElement(String id);
+ NodeWrapper getNodeWrapper(String id);
Object getRouterLayout();
Modified: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/ModelEvent.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/ModelEvent.java 2009-04-21 17:49:24 UTC (rev 14838)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/ModelEvent.java 2009-04-21 18:33:28 UTC (rev 14839)
@@ -23,24 +23,47 @@
*/
public class ModelEvent {
- private int change;
+ private int changeType;
+ private Object changeDiscriminator;
private Object changedObject;
+ private Object oldValue;
+ private Object newValue;
- public ModelEvent(int change) {
- this.change = change;
- }
+// public ModelEvent(int changeType) {
+// this.changeType = changeType;
+// }
- public ModelEvent(int change, Object changedObject) {
- this.change = change;
+// public ModelEvent(int changeType, Object changedObject) {
+// this.changeType = changeType;
+// this.changedObject = changedObject;
+// }
+
+ public ModelEvent(int changeType, Object changeDiscriminator, Object changedObject, Object oldValue, Object newValue) {
+ this.changeType = changeType;
+ this.changeDiscriminator = changeDiscriminator;
this.changedObject = changedObject;
+ this.oldValue = oldValue;
+ this.newValue = newValue;
}
- public int getChange() {
- return change;
+ public int getChangeType() {
+ return changeType;
}
+ public Object getChangeDiscriminator() {
+ return changeDiscriminator;
+ }
+
public Object getChangedObject() {
return changedObject;
}
+ public Object getOldValue() {
+ return oldValue;
+ }
+
+ public Object getNewValue() {
+ return newValue;
+ }
+
}
Modified: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/Wrapper.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/Wrapper.java 2009-04-21 17:49:24 UTC (rev 14838)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/Wrapper.java 2009-04-21 18:33:28 UTC (rev 14839)
@@ -5,12 +5,12 @@
import org.jboss.tools.flow.common.model.Element;
-public interface Wrapper extends IAdaptable, IPropertySource {
+public interface Wrapper extends IAdaptable, IPropertySource, Element {
- int ADD_INCOMING_CONNECTION = 1;
- int REMOVE_INCOMING_CONNECTION = 2;
- int ADD_OUTGOING_CONNECTION = 3;
- int REMOVE_OUTGOING_CONNECTION = 4;
+// int ADD_INCOMING_CONNECTION = 1;
+// int REMOVE_INCOMING_CONNECTION = 2;
+// int ADD_OUTGOING_CONNECTION = 3;
+// int REMOVE_OUTGOING_CONNECTION = 4;
int CHANGE_VISUAL = 5;
int ADD_ELEMENT = 6;
int REMOVE_ELEMENT = 7;
@@ -21,8 +21,11 @@
void setElement(Element element);
Element getElement();
+ void addChild(Object type, Element element);
+ void removeChild(Object type, Element element);
+
void addListener(ModelListener listener);
void removeListener(ModelListener listener);
- void notifyListeners(int changeId, Object changedObject);
+ void notifyListeners(int changeId, Object changeDiscriminator, Object changedObject, Object oldValue, Object newValue);
}
15 years, 8 months
JBoss Tools SVN: r14838 - trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/src/org/jboss/tools/jsf/text/ext/richfaces/hyperlink.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2009-04-21 13:49:24 -0400 (Tue, 21 Apr 2009)
New Revision: 14838
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/src/org/jboss/tools/jsf/text/ext/richfaces/hyperlink/RichfacesBundleHyperlink.java
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/src/org/jboss/tools/jsf/text/ext/richfaces/hyperlink/RichfacesJSPBundleHyperlinkPartitioner.java
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/src/org/jboss/tools/jsf/text/ext/richfaces/hyperlink/RichfacesJSPLoadBundleHyperlinkPartitioner.java
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/src/org/jboss/tools/jsf/text/ext/richfaces/hyperlink/RichfacesLoadBundleHyperlink.java
Log:
JBIDE-4147 A hyperlink doesn't work for <a4j:loadBundle> RichFaces tag
The heading comments are added to new classes
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/src/org/jboss/tools/jsf/text/ext/richfaces/hyperlink/RichfacesBundleHyperlink.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/src/org/jboss/tools/jsf/text/ext/richfaces/hyperlink/RichfacesBundleHyperlink.java 2009-04-21 17:44:01 UTC (rev 14837)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/src/org/jboss/tools/jsf/text/ext/richfaces/hyperlink/RichfacesBundleHyperlink.java 2009-04-21 17:49:24 UTC (rev 14838)
@@ -1,3 +1,14 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Exadel, Inc. and 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:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
package org.jboss.tools.jsf.text.ext.richfaces.hyperlink;
import java.util.ArrayList;
@@ -11,6 +22,11 @@
import org.jboss.tools.jst.web.tld.VpeTaglibManager;
import org.jboss.tools.jst.web.tld.VpeTaglibManagerProvider;
+/**
+ *
+ * @author Victor Rubezhny
+ *
+ */
public class RichfacesBundleHyperlink extends BundleHyperlink {
protected String[] getLoadBundleTagPrefixes(IRegion region) {
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/src/org/jboss/tools/jsf/text/ext/richfaces/hyperlink/RichfacesJSPBundleHyperlinkPartitioner.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/src/org/jboss/tools/jsf/text/ext/richfaces/hyperlink/RichfacesJSPBundleHyperlinkPartitioner.java 2009-04-21 17:44:01 UTC (rev 14837)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/src/org/jboss/tools/jsf/text/ext/richfaces/hyperlink/RichfacesJSPBundleHyperlinkPartitioner.java 2009-04-21 17:49:24 UTC (rev 14838)
@@ -1,3 +1,14 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Exadel, Inc. and 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:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
package org.jboss.tools.jsf.text.ext.richfaces.hyperlink;
import java.util.ArrayList;
@@ -6,6 +17,11 @@
import org.jboss.tools.common.text.ext.util.TaglibManagerWrapper;
import org.jboss.tools.jsf.text.ext.hyperlink.JSPBundleHyperlinkPartitioner;
+/**
+ *
+ * @author Victor Rubezhny
+ *
+ */
public class RichfacesJSPBundleHyperlinkPartitioner extends JSPBundleHyperlinkPartitioner {
public static final String JSP_RICHFACES_BUNDLE_PARTITION = "org.jboss.tools.common.text.ext.jsp.JSP_RICHFACES_BUNDLE";
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/src/org/jboss/tools/jsf/text/ext/richfaces/hyperlink/RichfacesJSPLoadBundleHyperlinkPartitioner.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/src/org/jboss/tools/jsf/text/ext/richfaces/hyperlink/RichfacesJSPLoadBundleHyperlinkPartitioner.java 2009-04-21 17:44:01 UTC (rev 14837)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/src/org/jboss/tools/jsf/text/ext/richfaces/hyperlink/RichfacesJSPLoadBundleHyperlinkPartitioner.java 2009-04-21 17:49:24 UTC (rev 14838)
@@ -1,3 +1,14 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Exadel, Inc. and 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:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
package org.jboss.tools.jsf.text.ext.richfaces.hyperlink;
import java.util.ArrayList;
@@ -6,7 +17,11 @@
import org.jboss.tools.common.text.ext.util.TaglibManagerWrapper;
import org.jboss.tools.jsf.text.ext.hyperlink.JSPLoadBundleHyperlinkPartitioner;
-
+/**
+ *
+ * @author Victor Rubezhny
+ *
+ */
public class RichfacesJSPLoadBundleHyperlinkPartitioner extends
JSPLoadBundleHyperlinkPartitioner {
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/src/org/jboss/tools/jsf/text/ext/richfaces/hyperlink/RichfacesLoadBundleHyperlink.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/src/org/jboss/tools/jsf/text/ext/richfaces/hyperlink/RichfacesLoadBundleHyperlink.java 2009-04-21 17:44:01 UTC (rev 14837)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/src/org/jboss/tools/jsf/text/ext/richfaces/hyperlink/RichfacesLoadBundleHyperlink.java 2009-04-21 17:49:24 UTC (rev 14838)
@@ -1,3 +1,14 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Exadel, Inc. and 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:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
package org.jboss.tools.jsf.text.ext.richfaces.hyperlink;
import java.util.ArrayList;
@@ -11,6 +22,11 @@
import org.jboss.tools.jst.web.tld.VpeTaglibManager;
import org.jboss.tools.jst.web.tld.VpeTaglibManagerProvider;
+/**
+ *
+ * @author Victor Rubezhny
+ *
+ */
public class RichfacesLoadBundleHyperlink extends LoadBundleHyperlink {
protected String[] getLoadBundleTagPrefixes(IRegion region) {
15 years, 8 months
JBoss Tools SVN: r14837 - branches/jbosstools-3.0.x/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2009-04-21 13:44:01 -0400 (Tue, 21 Apr 2009)
New Revision: 14837
Modified:
branches/jbosstools-3.0.x/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamProjectCreator.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4166 Patch applied to 3.0.1 brunch
Modified: branches/jbosstools-3.0.x/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamProjectCreator.java
===================================================================
--- branches/jbosstools-3.0.x/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamProjectCreator.java 2009-04-21 17:40:55 UTC (rev 14836)
+++ branches/jbosstools-3.0.x/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamProjectCreator.java 2009-04-21 17:44:01 UTC (rev 14837)
@@ -14,10 +14,12 @@
import java.io.FilenameFilter;
import java.io.IOException;
import java.util.Collections;
+import java.util.regex.Pattern;
import org.apache.tools.ant.types.FilterSet;
import org.apache.tools.ant.types.FilterSetCollection;
import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspaceRoot;
@@ -29,6 +31,9 @@
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.core.runtime.preferences.IScopeContext;
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jst.common.project.facet.JavaFacetUtils;
import org.eclipse.jst.common.project.facet.core.ClasspathHelper;
import org.eclipse.wst.common.componentcore.ComponentCore;
@@ -108,6 +113,7 @@
protected File ejbMetaInf;
protected File droolsLibFolder;
+ private String jbossSeamPath;
/**
* @param model Seam facet data model
@@ -225,17 +231,29 @@
return name.lastIndexOf(".jar") > 0; //$NON-NLS-1$
}
});
- String earJarsStr = ""; //$NON-NLS-1$
+ String earJarsStrWar = ""; //$NON-NLS-1$
+ String earJarsStrEjb = ""; //$NON-NLS-1$
for (File file : earJars) {
- earJarsStr += " " + file.getName() + " \n"; //$NON-NLS-1$ //$NON-NLS-2$
+ earJarsStrWar += " " + file.getName() + " \n"; //$NON-NLS-1$ //$NON-NLS-2$
+ if (isJBossSeamJar(file)) {
+ jbossSeamPath = file.getAbsolutePath();
+ } else {
+ earJarsStrEjb += " " + file.getName() + " \n"; //$NON-NLS-1$ //$NON-NLS-2$
+ }
}
- FilterSetCollection manifestFilterCol = new FilterSetCollection(projectFilterSet);
+ FilterSetCollection manifestFilterColWar = new FilterSetCollection(projectFilterSet);
FilterSet manifestFilter = new FilterSet();
- manifestFilter.addFilter("earLibs", earJarsStr); //$NON-NLS-1$
- manifestFilterCol.addFilterSet(manifestFilter);
- AntCopyUtils.copyFileToFolder(new File(SeamFacetInstallDataModelProvider.getTemplatesFolder(), "war/META-INF/MANIFEST.MF"), webMetaInf, manifestFilterCol, true); //$NON-NLS-1$
- AntCopyUtils.copyFileToFolder(new File(SeamFacetInstallDataModelProvider.getTemplatesFolder(), "ejb/ejbModule/META-INF/MANIFEST.MF"), ejbMetaInf, manifestFilterCol, true); //$NON-NLS-1$
+ manifestFilter.addFilter("earLibs", earJarsStrWar); //$NON-NLS-1$
+ manifestFilterColWar.addFilterSet(manifestFilter);
+
+ FilterSetCollection manifestFilterColEjb = new FilterSetCollection(projectFilterSet);
+ FilterSet manifestFilterEjb = new FilterSet();
+ manifestFilterEjb.addFilter("earLibs", earJarsStrEjb); //$NON-NLS-1$
+ manifestFilterColEjb.addFilterSet(manifestFilterEjb);
+
+ AntCopyUtils.copyFileToFolder(new File(SeamFacetInstallDataModelProvider.getTemplatesFolder(), "war/META-INF/MANIFEST.MF"), webMetaInf, manifestFilterColWar, true); //$NON-NLS-1$
+ AntCopyUtils.copyFileToFolder(new File(SeamFacetInstallDataModelProvider.getTemplatesFolder(), "ejb/ejbModule/META-INF/MANIFEST.MF"), ejbMetaInf, manifestFilterColEjb, true); //$NON-NLS-1$
} catch (IOException e) {
SeamCorePlugin.getPluginLog().logError(e);
}
@@ -264,9 +282,38 @@
IProjectFacet sf = ProjectFacetsManager.getProjectFacet("jst.ejb");
IProjectFacetVersion pfv = ProjectFacetsManager.create(ejbProjectToBeImported).getInstalledVersion(sf);
ClasspathHelper.addClasspathEntries(ejbProjectToBeImported, pfv);
- WtpUtils.reconfigure(ejbProjectToBeImported,monitor);
IProject earProjectToBeImported = wsRoot.getProject(earProjectName);
ResourcesUtils.importExistingProject(earProjectToBeImported, wsPath + "/" + earProjectName, earProjectName, monitor, false);
+ if (jbossSeamPath != null && jbossSeamPath.trim().length() > 0
+ && new File(jbossSeamPath).exists()) {
+ IJavaProject ejbJavaProject = JavaCore
+ .create(ejbProjectToBeImported);
+ if (ejbJavaProject != null) {
+ if (!ejbJavaProject.isOpen()) {
+ ejbJavaProject.open(monitor);
+ }
+ IClasspathEntry[] cps = ejbJavaProject.getRawClasspath();
+ IClasspathEntry[] entries = new IClasspathEntry[cps.length + 1];
+ for (int i = 0; i < cps.length; i++) {
+ entries[i] = cps[i];
+ }
+ IPath path = new Path(jbossSeamPath);
+ IFile[] files = wsRoot.findFilesForLocation(path);
+ IFile f = null;
+ if (files != null && files.length > 0) {
+ f=files[0];
+ } else {
+ f = wsRoot.getFile(path);
+ }
+ if (f.exists()) {
+ path = f.getFullPath();
+ }
+ entries[cps.length] = JavaCore.newLibraryEntry(path, null,
+ null);
+ ejbJavaProject.setRawClasspath(entries, monitor);
+ }
+ }
+ WtpUtils.reconfigure(ejbProjectToBeImported,monitor);
WtpUtils.reconfigure(earProjectToBeImported, monitor);
}
@@ -287,6 +334,11 @@
WtpUtils.reconfigure(testProjectToBeImported, monitor);
}
+ private boolean isJBossSeamJar(File file) {
+ String regex = "(jboss-seam){1}(-[0-9][0-9\\.]+){0,1}(.jar){1}";
+ return Pattern.matches(regex, file.getName());
+ }
+
/**
* Creates test project for given seam web project.
*/
15 years, 8 months
JBoss Tools SVN: r14836 - in trunk/jsf/plugins: org.jboss.tools.jsf.text.ext.richfaces and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2009-04-21 13:40:55 -0400 (Tue, 21 Apr 2009)
New Revision: 14836
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/plugin.xml
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/ForIDHyperlink.java
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPForIDHyperlinkPartitioner.java
Log:
JBIDE-3570 Create Open-Ons for "ForID"-like attributes in RichFaces
The hyperlinks for the "ForID"-like attributes are created.
The hyperlinks for the "converter"-like attributes are created.
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/ForIDHyperlink.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/ForIDHyperlink.java 2009-04-21 12:22:50 UTC (rev 14835)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/ForIDHyperlink.java 2009-04-21 17:40:55 UTC (rev 14836)
@@ -18,6 +18,8 @@
import org.eclipse.jface.text.Region;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
import org.jboss.tools.common.text.ext.hyperlink.AbstractHyperlink;
+import org.jboss.tools.common.text.ext.hyperlink.HyperlinkRegion;
+import org.jboss.tools.common.text.ext.hyperlink.IHyperlinkRegion;
import org.jboss.tools.common.text.ext.hyperlink.xpl.Messages;
import org.jboss.tools.common.text.ext.util.StructuredModelWrapper;
import org.jboss.tools.common.text.ext.util.StructuredSelectionHelper;
@@ -169,8 +171,56 @@
final int propLength = bEnd - bStart;
if (propStart > offset || propStart + propLength < offset) return null;
-
- return new Region(propStart,propLength);
+
+ // Find an ID (suppose that there may be a list of commas-separated IDs)
+ int bIdStart = offset;
+ int bIdEnd = offset;
+
+ //find start of bean property
+ while (bIdStart >= propStart) {
+ if (!Character.isJavaIdentifierPart(sb.charAt(bIdStart - start)) &&
+ sb.charAt(bIdStart - start) != ' ') {
+ bIdStart++;
+ break;
+ }
+
+ if (bIdStart == 0) break;
+ bIdStart--;
+ }
+ // find end of bean property
+ while (bIdEnd < propStart + propLength) {
+ if (!Character.isJavaIdentifierPart(sb.charAt(bIdEnd - start)) &&
+ sb.charAt(bIdEnd - start) != ' ')
+ break;
+ bIdEnd++;
+ }
+
+ // Skip leading spaces
+ while (bIdStart < bIdEnd) {
+ if (Character.isJavaIdentifierPart(sb.charAt(bIdStart - start))) {
+ break;
+ }
+
+ bIdStart++;
+ }
+
+ // Skip trailing spaces
+ while (bIdEnd > bIdStart) {
+ if (Character.isJavaIdentifierPart(sb.charAt(bIdEnd - 1 - start))) {
+ break;
+ }
+
+ bIdEnd--;
+ }
+
+ int idStart = bIdStart;
+ int idLength = bIdEnd - bIdStart;
+
+ if (idStart > offset || idStart + idLength < offset) return null;
+
+
+
+ return new Region(idStart,idLength);
} catch (BadLocationException x) {
JSFExtensionsPlugin.log("", x);
return null;
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPForIDHyperlinkPartitioner.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPForIDHyperlinkPartitioner.java 2009-04-21 12:22:50 UTC (rev 14835)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPForIDHyperlinkPartitioner.java 2009-04-21 17:40:55 UTC (rev 14836)
@@ -103,9 +103,60 @@
int propStart = bStart + start;
int propLength = bEnd - bStart;
+
if (propStart > offset || propStart + propLength < offset) return null;
-
- IHyperlinkRegion region = new HyperlinkRegion(propStart, propLength, null, null, null);
+
+ // Find an ID (suppose that there may be a list of commas-separated IDs)
+ int bIdStart = offset;
+ int bIdEnd = offset;
+
+ //find start of bean property
+ while (bIdStart >= propStart) {
+ if (!Character.isJavaIdentifierPart(sb.charAt(bIdStart - start)) &&
+ sb.charAt(bIdStart - start) != ' ') {
+ bIdStart++;
+ break;
+ }
+
+ if (bIdStart == 0) break;
+ bIdStart--;
+ }
+
+ // find end of bean property
+ while (bIdEnd < propStart + propLength) {
+ if (!Character.isJavaIdentifierPart(sb.charAt(bIdEnd - start)) &&
+ sb.charAt(bIdEnd - start) != ' ')
+ break;
+ bIdEnd++;
+ }
+
+ // Skip leading spaces
+ while (bIdStart < bIdEnd) {
+ if (Character.isJavaIdentifierPart(sb.charAt(bIdStart - start))) {
+ break;
+ }
+
+ bIdStart++;
+ }
+
+ // Skip trailing spaces
+ while (bIdEnd > bIdStart) {
+ if (Character.isJavaIdentifierPart(sb.charAt(bIdEnd - 1 - start))) {
+ break;
+ }
+
+ bIdEnd--;
+ }
+
+
+ int idStart = bIdStart;
+ int idLength = bIdEnd - bIdStart;
+
+ if (idStart > offset || idStart + idLength < offset) return null;
+
+
+
+ IHyperlinkRegion region = new HyperlinkRegion(idStart, idLength, null, null, null);
return region;
} catch (BadLocationException x) {
JSFExtensionsPlugin.log("", x);
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/plugin.xml
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/plugin.xml 2009-04-21 12:22:50 UTC (rev 14835)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/plugin.xml 2009-04-21 17:40:55 UTC (rev 14836)
@@ -196,6 +196,124 @@
</contentType>
</hyperlinkPartitioner>
+ <hyperlinkPartitioner
+ id="org.jboss.tools.common.text.ext.jsf.hyperlink.JSPForIDHyperlinkPartitioner"
+ class="org.jboss.tools.jsf.text.ext.hyperlink.JSPForIDHyperlinkPartitioner">
+ <contentType id="org.eclipse.jst.jsp.core.jspsource">
+ <partitionType id="org.jboss.tools.common.text.ext.xml.XML_ATTRIBUTE_VALUE">
+ <axis path="*/[http://richfaces.org/a4j]:*/focus/" />
+ <axis path="*/[https://ajax4jsf.dev.java.net/ajax]:*/focus/" />
+ <axis path="*/[http://richfaces.org/rich]:*/focus/" />
+ <axis path="*/[http://richfaces.ajax4jsf.org/rich]:*/focus/" />
+
+ <axis path="*/[http://richfaces.org/a4j]:*/reRender/" />
+ <axis path="*/[https://ajax4jsf.dev.java.net/ajax]:*/reRender/" />
+ <axis path="*/[http://richfaces.org/rich]:*/reRender/" />
+ <axis path="*/[http://richfaces.ajax4jsf.org/rich]:*/reRender/" />
+
+ <axis path="*/[http://richfaces.org/a4j]:*/status/" />
+ <axis path="*/[https://ajax4jsf.dev.java.net/ajax]:*/status/" />
+ <axis path="*/[http://richfaces.org/rich]:*/status/" />
+ <axis path="*/[http://richfaces.ajax4jsf.org/rich]:*/status/" />
+
+ <axis path="*/[http://richfaces.org/a4j]:*/for/" />
+ <axis path="*/[https://ajax4jsf.dev.java.net/ajax]:*/for/" />
+ <axis path="*/[http://richfaces.org/rich]:*/for/" />
+ <axis path="*/[http://richfaces.ajax4jsf.org/rich]:*/for/" />
+
+ <axis path="*/[http://richfaces.org/rich]:effect/targetId/" />
+ <axis path="*/[http://richfaces.ajax4jsf.org/rich]:effect/targetId/" />
+
+ <axis path="*/[http://richfaces.org/rich]:toggleControl/panelId/" />
+ <axis path="*/[http://richfaces.ajax4jsf.org/rich]:toggleControl/panelId/" />
+
+ <axis path="*/[http://richfaces.org/rich]:*/dragIndicator/" />
+ <axis path="*/[http://richfaces.ajax4jsf.org/rich]:*/dragIndicator/" />
+
+ <axis path="*/[http://richfaces.org/rich]:*/process/" />
+ <axis path="*/[http://richfaces.ajax4jsf.org/rich]:*/process/" />
+
+ <axis path="*/[http://richfaces.org/rich]:*/similarityGroupingId/" />
+ <axis path="*/[http://richfaces.ajax4jsf.org/rich]:*/similarityGroupingId/" />
+
+ <axis path="*/[http://richfaces.org/rich]:progressBar/reRenderAfterComplete/" />
+
+ <axis path="*/[http://richfaces.ajax4jsf.org/rich]:componentControl/attachTo/" />
+ <axis path="*/[http://richfaces.ajax4jsf.org/rich]:contextMenu/attachTo/" />
+ </partitionType>
+ </contentType>
+ <contentType id="org.eclipse.wst.html.core.htmlsource">
+ <partitionType id="org.jboss.tools.common.text.ext.xml.XML_ATTRIBUTE_VALUE">
+ <axis path="*/[http://richfaces.org/a4j]:*/focus/" />
+ <axis path="*/[https://ajax4jsf.dev.java.net/ajax]:*/focus/" />
+ <axis path="*/[http://richfaces.org/rich]:*/focus/" />
+ <axis path="*/[http://richfaces.ajax4jsf.org/rich]:*/focus/" />
+
+ <axis path="*/[http://richfaces.org/a4j]:*/reRender/" />
+ <axis path="*/[https://ajax4jsf.dev.java.net/ajax]:*/reRender/" />
+ <axis path="*/[http://richfaces.org/rich]:*/reRender/" />
+ <axis path="*/[http://richfaces.ajax4jsf.org/rich]:*/reRender/" />
+
+ <axis path="*/[http://richfaces.org/a4j]:*/status/" />
+ <axis path="*/[https://ajax4jsf.dev.java.net/ajax]:*/status/" />
+ <axis path="*/[http://richfaces.org/rich]:*/status/" />
+ <axis path="*/[http://richfaces.ajax4jsf.org/rich]:*/status/" />
+
+ <axis path="*/[http://richfaces.org/a4j]:*/for/" />
+ <axis path="*/[https://ajax4jsf.dev.java.net/ajax]:*/for/" />
+ <axis path="*/[http://richfaces.org/rich]:*/for/" />
+ <axis path="*/[http://richfaces.ajax4jsf.org/rich]:*/for/" />
+
+ <axis path="*/[http://richfaces.org/rich]:effect/targetId/" />
+ <axis path="*/[http://richfaces.ajax4jsf.org/rich]:effect/targetId/" />
+
+ <axis path="*/[http://richfaces.org/rich]:toggleControl/panelId/" />
+ <axis path="*/[http://richfaces.ajax4jsf.org/rich]:toggleControl/panelId/" />
+
+ <axis path="*/[http://richfaces.org/rich]:*/dragIndicator/" />
+ <axis path="*/[http://richfaces.ajax4jsf.org/rich]:*/dragIndicator/" />
+
+ <axis path="*/[http://richfaces.org/rich]:*/process/" />
+ <axis path="*/[http://richfaces.ajax4jsf.org/rich]:*/process/" />
+
+ <axis path="*/[http://richfaces.org/rich]:*/similarityGroupingId/" />
+ <axis path="*/[http://richfaces.ajax4jsf.org/rich]:*/similarityGroupingId/" />
+
+ <axis path="*/[http://richfaces.org/rich]:progressBar/reRenderAfterComplete/" />
+
+ <axis path="*/[http://richfaces.ajax4jsf.org/rich]:componentControl/attachTo/" />
+ <axis path="*/[http://richfaces.ajax4jsf.org/rich]:contextMenu/attachTo/" />
+ </partitionType>
+ </contentType>
+ </hyperlinkPartitioner>
+
+ <hyperlinkPartitioner
+ id="org.jboss.tools.common.text.ext.jsf.hyperlink.JSPConverterHyperlinkPartitioner"
+ class="org.jboss.tools.jsf.text.ext.hyperlink.JSPConverterHyperlinkPartitioner">
+ <contentType id="org.eclipse.jst.jsp.core.jspsource">
+ <partitionType id="org.jboss.tools.common.text.ext.xml.XML_ATTRIBUTE_VALUE">
+ <axis path="*/[http://richfaces.org/a4j]:*/converter/" />
+ <axis path="*/[https://ajax4jsf.dev.java.net/ajax]:*/converter/" />
+ <axis path="*/[http://richfaces.org/rich]:*/converter/" />
+ <axis path="*/[http://richfaces.ajax4jsf.org/rich]:*/converter/" />
+
+ <axis path="*/[http://richfaces.org/rich]:*/rowKeyConverter/" />
+ <axis path="*/[http://richfaces.ajax4jsf.org/rich]:*/rowKeyConverter/" />
+ </partitionType>
+ </contentType>
+ <contentType id="org.eclipse.wst.html.core.htmlsource">
+ <partitionType id="org.jboss.tools.common.text.ext.xml.XML_ATTRIBUTE_VALUE">
+ <axis path="*/[http://richfaces.org/a4j]:*/converter/" />
+ <axis path="*/[https://ajax4jsf.dev.java.net/ajax]:*/converter/" />
+ <axis path="*/[http://richfaces.org/rich]:*/converter/" />
+ <axis path="*/[http://richfaces.ajax4jsf.org/rich]:*/converter/" />
+
+ <axis path="*/[http://richfaces.org/rich]:*/rowKeyConverter/" />
+ <axis path="*/[http://richfaces.ajax4jsf.org/rich]:*/rowKeyConverter/" />
+ </partitionType>
+ </contentType>
+ </hyperlinkPartitioner>
+
</extension>
<extension
15 years, 8 months
JBoss Tools SVN: r14835 - trunk/ws/docs/reference/en/images/topdown.
by jbosstools-commits@lists.jboss.org
Author: abogachuk
Date: 2009-04-21 08:22:50 -0400 (Tue, 21 Apr 2009)
New Revision: 14835
Modified:
trunk/ws/docs/reference/en/images/topdown/jbossws_bottomup_5.png
trunk/ws/docs/reference/en/images/topdown/jbossws_bottomup_6.png
Log:
https://jira.jboss.org/jira/browse/JBDS-398 - screenshots' borders adjusted
Modified: trunk/ws/docs/reference/en/images/topdown/jbossws_bottomup_5.png
===================================================================
(Binary files differ)
Modified: trunk/ws/docs/reference/en/images/topdown/jbossws_bottomup_6.png
===================================================================
(Binary files differ)
15 years, 8 months