JBoss Tools SVN: r14783 - in trunk/as/plugins: org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules and 7 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2009-04-17 02:33:38 -0400 (Fri, 17 Apr 2009)
New Revision: 14783
Added:
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/WTPZippedPublisher.java
Removed:
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/TestPublisher.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/plugin.xml
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/publishers/JstPublisher.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IDeployableServer.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/schema/publishers.exsd
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
Log:
https://jira.jboss.org/jira/browse/JBIDE-4193
Modified: trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/plugin.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/plugin.xml 2009-04-16 16:53:34 UTC (rev 14782)
+++ trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/plugin.xml 2009-04-17 06:33:38 UTC (rev 14783)
@@ -90,6 +90,11 @@
class="org.jboss.ide.eclipse.archives.webtools.modules.PackagesPublisher"
priority="5">
</publisher>
+ <publisher
+ class="org.jboss.ide.eclipse.archives.webtools.modules.WTPZippedPublisher"
+ priority="0"
+ zipDelegate="true">
+ </publisher>
</extension>
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/TestPublisher.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/TestPublisher.java 2009-04-16 16:53:34 UTC (rev 14782)
+++ trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/TestPublisher.java 2009-04-17 06:33:38 UTC (rev 14783)
@@ -1,290 +0,0 @@
-package org.jboss.ide.eclipse.archives.webtools.modules;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.MultiStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.wst.common.componentcore.ModuleCoreNature;
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.internal.Server;
-import org.eclipse.wst.server.core.model.IModuleFile;
-import org.eclipse.wst.server.core.model.IModuleFolder;
-import org.eclipse.wst.server.core.model.IModuleResource;
-import org.eclipse.wst.server.core.model.IModuleResourceDelta;
-import org.jboss.ide.eclipse.archives.core.util.internal.TrueZipUtil;
-import org.jboss.ide.eclipse.archives.webtools.IntegrationPlugin;
-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.publishers.PublishUtil;
-import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
-import org.jboss.ide.eclipse.as.core.server.IJBossServerPublisher;
-import org.jboss.ide.eclipse.as.core.server.internal.DeployableServerBehavior;
-import org.jboss.ide.eclipse.as.core.util.FileUtil;
-import org.jboss.ide.eclipse.as.core.util.FileUtil.IFileUtilListener;
-
-import de.schlichtherle.io.ArchiveDetector;
-
-public class TestPublisher extends PublishUtil implements IJBossServerPublisher {
- private int moduleState = IServer.PUBLISH_STATE_NONE;
- public boolean accepts(IServer server, IModule[] module) {
- // TODO check for zip preference
- return ModuleCoreNature.isFlexibleProject(module[0].getProject());
- }
-
- public int getPublishState() {
- return moduleState;
- }
-
- protected IDeployableServer getDeployableServer(IServer server) {
- return (IDeployableServer)server.loadAdapter(IDeployableServer.class, new NullProgressMonitor());
- }
- protected DeployableServerBehavior getBehaviour(IServer server) {
- return (DeployableServerBehavior)server.loadAdapter(DeployableServerBehavior.class, new NullProgressMonitor());
- }
-
- protected List<IModule[]> getRemovedModules(IServer s) {
- return getBehaviour(s).getRemovedModules();
- }
-
- public boolean isNew(IModule[] module, IServer s) {
- return !getBehaviour(s).hasBeenPublished(module);
- }
-
-
- public IStatus publishModule(IServer server, IModule[] module,
- int publishType, IModuleResourceDelta[] delta,
- IProgressMonitor monitor) throws CoreException {
- if( module.length > 1 ) {
- return Status.OK_STATUS;
- }
-
- IStatus[] returnStatus;
- // Am I a removal? If yes, remove me, and return
- if( publishType == IJBossServerPublisher.REMOVE_PUBLISH)
- returnStatus = removeModule(server, module);
-
- // Am I a full publish? If yes, full publish me, and return
- else if( publishType == IJBossServerPublisher.FULL_PUBLISH)
- returnStatus = fullPublish(server, module);
-
- else {
- // Am I changed? If yes, handle my changes
- ArrayList<IStatus> results = new ArrayList<IStatus>();
- if( countChanges(delta) > 0) {
- results.addAll(Arrays.asList(publishChanges(server, module)));
- }
-
- IModule[] children = server.getChildModules(module, new NullProgressMonitor());
- results.addAll(Arrays.asList(handleChildrenDeltas(server, module, children)));
-
- // Handle the removed children that are not returned by getChildModules
- List<IModule[]> removed = getBehaviour(server).getRemovedModules();
- Iterator<IModule[]> i = removed.iterator();
- while(i.hasNext()) {
- IModule[] removedArray = i.next();
- if( removedArray[0].getId().equals(module[0].getId())) {
- results.addAll(Arrays.asList(removeModule(server, removedArray)));
- }
- }
- returnStatus = (IStatus[]) results.toArray(new IStatus[results.size()]);
- }
- TrueZipUtil.umount();
-
- IStatus finalStatus;
- if( returnStatus.length > 0 ) {
- MultiStatus ms = new MultiStatus(JBossServerCorePlugin.PLUGIN_ID, IEventCodes.JST_PUB_INC_FAIL,
- "Publish Failed for module " + module[0].getName(), null); //$NON-NLS-1$
- for( int i = 0; i < returnStatus.length; i++ )
- ms.add(returnStatus[i]);
- finalStatus = ms;
- } else
- finalStatus = Status.OK_STATUS;
-
- return finalStatus;
- }
-
- protected IStatus[] handleChildrenDeltas(IServer server, IModule[] module, IModule[] children) {
- // For each child:
- ArrayList<IStatus> results = new ArrayList<IStatus>();
- for( int i = 0; i < children.length; i++ ) {
- IModule[] combinedChild = combine(module, children[i]);
- // if it's new, full publish it
- if( !getBehaviour(server).hasBeenPublished(combinedChild)) {
- results.addAll(Arrays.asList(fullPublish(server, combinedChild)));
- }
- // else if it's removed, full remove it
- else if( isRemoved(server, combinedChild)) {
- results.addAll(Arrays.asList(removeModule(server, combinedChild)));
- }
- // else
- else {
- // handle changed resources
- results.addAll(Arrays.asList(publishChanges(server, combinedChild)));
-
- // recurse
- IModule[] children2 = server.getChildModules(combinedChild, new NullProgressMonitor());
- results.addAll(Arrays.asList(handleChildrenDeltas(server, children, children2)));
- }
- }
- return (IStatus[]) results.toArray(new IStatus[results.size()]);
- }
-
- protected boolean isRemoved(IServer server, IModule[] child) {
- List<IModule[]> removed = getBehaviour(server).getRemovedModules();
- Iterator<IModule[]> i = removed.iterator();
- while(i.hasNext()) {
- IModule[] next = i.next();
- if( next.length == child.length) {
- for( int j = 0; j < next.length; j++ ) {
- if( !next[j].getId().equals(child[j].getId())) {
- continue;
- }
- }
- return true;
- }
- }
- return false;
- }
-
- protected IStatus[] removeModule(IServer server, IModule[] module) {
- String depFolder = getDeployableServer(server).getDeployFolder();
- IPath deployPath = getDeployPath(module, depFolder);
- final ArrayList<IStatus> status = new ArrayList<IStatus>();
- IFileUtilListener listener = new IFileUtilListener() {
- public void fileCopied(File source, File dest, boolean result,Exception e) {}
- public void fileDeleted(File file, boolean result, Exception e) {
- if( result == false || e != null ) {
- status.add(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, IEventCodes.JST_PUB_FILE_DELETE_FAIL,
- "Attempt to delete " + file.getAbsolutePath() + " failed",e)); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- public void folderDeleted(File file, boolean result, Exception e) {
- if( result == false || e != null ) {
- status.add(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, IEventCodes.JST_PUB_FILE_DELETE_FAIL,
- "Attempt to delete " + file.getAbsolutePath() + " failed",e)); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- };
- FileUtil.safeDelete(deployPath.toFile(), listener);
- return (IStatus[]) status.toArray(new IStatus[status.size()]);
- }
-
- protected IStatus[] fullPublish(IServer server, IModule[] module) {
- ArrayList<IStatus> results = new ArrayList<IStatus>();
- try {
- String depFolder = getDeployableServer(server).getDeployFolder();
- IPath path = getDeployPath(module, depFolder);
- // Get rid of the old
- path.toFile().delete();
-
- TrueZipUtil.createArchive(path);
- de.schlichtherle.io.File root = TrueZipUtil.getFile(path, TrueZipUtil.getJarArchiveDetector());
- IModuleResource[] resources = getResources(module);
- results.addAll(Arrays.asList(copy(root, resources)));
-
- IModule[] children = server.getChildModules(module, new NullProgressMonitor());
- for( int i = 0; i < children.length; i++ )
- results.addAll(Arrays.asList(fullPublish(server, combine(module, children[i]))));
- return (IStatus[]) results.toArray(new IStatus[results.size()]);
- } catch( CoreException ce) {
- results.add(generateCoreExceptionStatus(ce));
- return (IStatus[]) results.toArray(new IStatus[results.size()]);
- }
- }
-
- protected IStatus[] publishChanges(IServer server, IModule[] module) {
- String depFolder = getDeployableServer(server).getDeployFolder();
- IPath path = getDeployPath(module, depFolder);
- de.schlichtherle.io.File root = TrueZipUtil.getFile(path, TrueZipUtil.getJarArchiveDetector());
- IModuleResourceDelta[] deltas = ((Server)server).getPublishedResourceDelta(module);
- return publishChanges(server, deltas, root);
- }
-
- protected IStatus[] publishChanges(IServer server, IModuleResourceDelta[] deltas, de.schlichtherle.io.File root) {
- ArrayList<IStatus> results = new ArrayList<IStatus>();
- if( deltas == null || deltas.length == 0 )
- return new IStatus[]{};
- int dKind;
- IModuleResource resource;
- for( int i = 0; i < deltas.length; i++ ) {
- dKind = deltas[i].getKind();
- resource = deltas[i].getModuleResource();
- if( dKind == IModuleResourceDelta.ADDED ) {
- results.addAll(Arrays.asList(copy(root, new IModuleResource[]{resource})));
- } else if( dKind == IModuleResourceDelta.CHANGED ) {
- if( resource instanceof IModuleFile )
- results.addAll(Arrays.asList(copy(root, new IModuleResource[]{resource})));
- results.addAll(Arrays.asList(publishChanges(server, deltas[i].getAffectedChildren(), root)));
- } else if( dKind == IModuleResourceDelta.REMOVED) {
- de.schlichtherle.io.File f = getFileInArchive(root,
- resource.getModuleRelativePath().append(
- resource.getName()));
- boolean b = f.deleteAll();
- if( !b )
- results.add(generateDeleteFailedStatus(f));
- } else if( dKind == IModuleResourceDelta.NO_CHANGE ) {
- results.addAll(Arrays.asList(publishChanges(server, deltas[i].getAffectedChildren(), root)));
- }
- }
-
- return (IStatus[]) results.toArray(new IStatus[results.size()]);
- }
-
-
- protected IStatus[] copy(de.schlichtherle.io.File root, IModuleResource[] children) {
- ArrayList<IStatus> results = new ArrayList<IStatus>();
- for( int i = 0; i < children.length; i++ ) {
- if( children[i] instanceof IModuleFile ) {
- IModuleFile mf = (IModuleFile)children[i];
- java.io.File source = getFile(mf);
- de.schlichtherle.io.File destination = getFileInArchive(root, mf.getModuleRelativePath().append(mf.getName()));
- boolean b = new de.schlichtherle.io.File(source).copyAllTo(destination);
- if( !b )
- results.add(generateCopyFailStatus(source, destination));
- } else if( children[i] instanceof IModuleFolder ) {
- de.schlichtherle.io.File destination = getFileInArchive(root, children[i].getModuleRelativePath().append(children[i].getName()));
- destination.mkdirs();
- IModuleFolder mf = (IModuleFolder)children[i];
- results.addAll(Arrays.asList(copy(root, mf.members())));
- }
- }
- return (IStatus[]) results.toArray(new IStatus[results.size()]);
- }
-
- protected IStatus generateDeleteFailedStatus(java.io.File file) {
- return new Status(IStatus.ERROR, IntegrationPlugin.PLUGIN_ID, "Could not delete file " + file); //$NON-NLS-1$
- }
- protected IStatus generateCoreExceptionStatus(CoreException ce) {
- return new Status(IStatus.ERROR, IntegrationPlugin.PLUGIN_ID, ce.getMessage(), ce);
- }
- protected IStatus generateCopyFailStatus(java.io.File source, java.io.File destination) {
- return new Status(IStatus.ERROR, IntegrationPlugin.PLUGIN_ID, "Copy of " + source + " to " + destination + " has failed");//$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
- }
-
- protected de.schlichtherle.io.File getFileInArchive(de.schlichtherle.io.File root, IPath relative) {
- while(relative.segmentCount() > 0 ) {
- root = new de.schlichtherle.io.File(root,
- relative.segment(0), ArchiveDetector.DEFAULT);
- relative = relative.removeFirstSegments(1);
- }
- return root;
- }
-
- private IModule[] combine(IModule[] module, IModule newMod) {
- IModule[] retval = new IModule[module.length + 1];
- for( int i = 0; i < module.length; i++ )
- retval[i]=module[i];
- retval[retval.length-1] = newMod;
- return retval;
- }
-}
Copied: trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/WTPZippedPublisher.java (from rev 14768, trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/TestPublisher.java)
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/WTPZippedPublisher.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/WTPZippedPublisher.java 2009-04-17 06:33:38 UTC (rev 14783)
@@ -0,0 +1,290 @@
+package org.jboss.ide.eclipse.archives.webtools.modules;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.MultiStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.wst.common.componentcore.ModuleCoreNature;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.internal.Server;
+import org.eclipse.wst.server.core.model.IModuleFile;
+import org.eclipse.wst.server.core.model.IModuleFolder;
+import org.eclipse.wst.server.core.model.IModuleResource;
+import org.eclipse.wst.server.core.model.IModuleResourceDelta;
+import org.jboss.ide.eclipse.archives.core.util.internal.TrueZipUtil;
+import org.jboss.ide.eclipse.archives.webtools.IntegrationPlugin;
+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.publishers.PublishUtil;
+import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
+import org.jboss.ide.eclipse.as.core.server.IJBossServerPublisher;
+import org.jboss.ide.eclipse.as.core.server.internal.DeployableServerBehavior;
+import org.jboss.ide.eclipse.as.core.util.FileUtil;
+import org.jboss.ide.eclipse.as.core.util.FileUtil.IFileUtilListener;
+
+import de.schlichtherle.io.ArchiveDetector;
+
+public class WTPZippedPublisher extends PublishUtil implements IJBossServerPublisher {
+ private int moduleState = IServer.PUBLISH_STATE_NONE;
+ public boolean accepts(IServer server, IModule[] module) {
+ // TODO check for zip preference
+ return ModuleCoreNature.isFlexibleProject(module[0].getProject());
+ }
+
+ public int getPublishState() {
+ return moduleState;
+ }
+
+ protected IDeployableServer getDeployableServer(IServer server) {
+ return (IDeployableServer)server.loadAdapter(IDeployableServer.class, new NullProgressMonitor());
+ }
+ protected DeployableServerBehavior getBehaviour(IServer server) {
+ return (DeployableServerBehavior)server.loadAdapter(DeployableServerBehavior.class, new NullProgressMonitor());
+ }
+
+ protected List<IModule[]> getRemovedModules(IServer s) {
+ return getBehaviour(s).getRemovedModules();
+ }
+
+ public boolean isNew(IModule[] module, IServer s) {
+ return !getBehaviour(s).hasBeenPublished(module);
+ }
+
+
+ public IStatus publishModule(IServer server, IModule[] module,
+ int publishType, IModuleResourceDelta[] delta,
+ IProgressMonitor monitor) throws CoreException {
+ if( module.length > 1 ) {
+ return Status.OK_STATUS;
+ }
+
+ IStatus[] returnStatus;
+ // Am I a removal? If yes, remove me, and return
+ if( publishType == IJBossServerPublisher.REMOVE_PUBLISH)
+ returnStatus = removeModule(server, module);
+
+ // Am I a full publish? If yes, full publish me, and return
+ else if( publishType == IJBossServerPublisher.FULL_PUBLISH)
+ returnStatus = fullPublish(server, module);
+
+ else {
+ // Am I changed? If yes, handle my changes
+ ArrayList<IStatus> results = new ArrayList<IStatus>();
+ if( countChanges(delta) > 0) {
+ results.addAll(Arrays.asList(publishChanges(server, module)));
+ }
+
+ IModule[] children = server.getChildModules(module, new NullProgressMonitor());
+ results.addAll(Arrays.asList(handleChildrenDeltas(server, module, children)));
+
+ // Handle the removed children that are not returned by getChildModules
+ List<IModule[]> removed = getBehaviour(server).getRemovedModules();
+ Iterator<IModule[]> i = removed.iterator();
+ while(i.hasNext()) {
+ IModule[] removedArray = i.next();
+ if( removedArray[0].getId().equals(module[0].getId())) {
+ results.addAll(Arrays.asList(removeModule(server, removedArray)));
+ }
+ }
+ returnStatus = (IStatus[]) results.toArray(new IStatus[results.size()]);
+ }
+ TrueZipUtil.umount();
+
+ IStatus finalStatus;
+ if( returnStatus.length > 0 ) {
+ MultiStatus ms = new MultiStatus(JBossServerCorePlugin.PLUGIN_ID, IEventCodes.JST_PUB_INC_FAIL,
+ "Publish Failed for module " + module[0].getName(), null); //$NON-NLS-1$
+ for( int i = 0; i < returnStatus.length; i++ )
+ ms.add(returnStatus[i]);
+ finalStatus = ms;
+ } else
+ finalStatus = Status.OK_STATUS;
+
+ return finalStatus;
+ }
+
+ protected IStatus[] handleChildrenDeltas(IServer server, IModule[] module, IModule[] children) {
+ // For each child:
+ ArrayList<IStatus> results = new ArrayList<IStatus>();
+ for( int i = 0; i < children.length; i++ ) {
+ IModule[] combinedChild = combine(module, children[i]);
+ // if it's new, full publish it
+ if( !getBehaviour(server).hasBeenPublished(combinedChild)) {
+ results.addAll(Arrays.asList(fullPublish(server, combinedChild)));
+ }
+ // else if it's removed, full remove it
+ else if( isRemoved(server, combinedChild)) {
+ results.addAll(Arrays.asList(removeModule(server, combinedChild)));
+ }
+ // else
+ else {
+ // handle changed resources
+ results.addAll(Arrays.asList(publishChanges(server, combinedChild)));
+
+ // recurse
+ IModule[] children2 = server.getChildModules(combinedChild, new NullProgressMonitor());
+ results.addAll(Arrays.asList(handleChildrenDeltas(server, children, children2)));
+ }
+ }
+ return (IStatus[]) results.toArray(new IStatus[results.size()]);
+ }
+
+ protected boolean isRemoved(IServer server, IModule[] child) {
+ List<IModule[]> removed = getBehaviour(server).getRemovedModules();
+ Iterator<IModule[]> i = removed.iterator();
+ while(i.hasNext()) {
+ IModule[] next = i.next();
+ if( next.length == child.length) {
+ for( int j = 0; j < next.length; j++ ) {
+ if( !next[j].getId().equals(child[j].getId())) {
+ continue;
+ }
+ }
+ return true;
+ }
+ }
+ return false;
+ }
+
+ protected IStatus[] removeModule(IServer server, IModule[] module) {
+ String depFolder = getDeployableServer(server).getDeployFolder();
+ IPath deployPath = getDeployPath(module, depFolder);
+ final ArrayList<IStatus> status = new ArrayList<IStatus>();
+ IFileUtilListener listener = new IFileUtilListener() {
+ public void fileCopied(File source, File dest, boolean result,Exception e) {}
+ public void fileDeleted(File file, boolean result, Exception e) {
+ if( result == false || e != null ) {
+ status.add(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, IEventCodes.JST_PUB_FILE_DELETE_FAIL,
+ "Attempt to delete " + file.getAbsolutePath() + " failed",e)); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+ public void folderDeleted(File file, boolean result, Exception e) {
+ if( result == false || e != null ) {
+ status.add(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, IEventCodes.JST_PUB_FILE_DELETE_FAIL,
+ "Attempt to delete " + file.getAbsolutePath() + " failed",e)); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+ };
+ FileUtil.safeDelete(deployPath.toFile(), listener);
+ return (IStatus[]) status.toArray(new IStatus[status.size()]);
+ }
+
+ protected IStatus[] fullPublish(IServer server, IModule[] module) {
+ ArrayList<IStatus> results = new ArrayList<IStatus>();
+ try {
+ String depFolder = getDeployableServer(server).getDeployFolder();
+ IPath path = getDeployPath(module, depFolder);
+ // Get rid of the old
+ FileUtil.safeDelete(path.toFile(), null);
+
+ TrueZipUtil.createArchive(path);
+ de.schlichtherle.io.File root = TrueZipUtil.getFile(path, TrueZipUtil.getJarArchiveDetector());
+ IModuleResource[] resources = getResources(module);
+ results.addAll(Arrays.asList(copy(root, resources)));
+
+ IModule[] children = server.getChildModules(module, new NullProgressMonitor());
+ for( int i = 0; i < children.length; i++ )
+ results.addAll(Arrays.asList(fullPublish(server, combine(module, children[i]))));
+ return (IStatus[]) results.toArray(new IStatus[results.size()]);
+ } catch( CoreException ce) {
+ results.add(generateCoreExceptionStatus(ce));
+ return (IStatus[]) results.toArray(new IStatus[results.size()]);
+ }
+ }
+
+ protected IStatus[] publishChanges(IServer server, IModule[] module) {
+ String depFolder = getDeployableServer(server).getDeployFolder();
+ IPath path = getDeployPath(module, depFolder);
+ de.schlichtherle.io.File root = TrueZipUtil.getFile(path, TrueZipUtil.getJarArchiveDetector());
+ IModuleResourceDelta[] deltas = ((Server)server).getPublishedResourceDelta(module);
+ return publishChanges(server, deltas, root);
+ }
+
+ protected IStatus[] publishChanges(IServer server, IModuleResourceDelta[] deltas, de.schlichtherle.io.File root) {
+ ArrayList<IStatus> results = new ArrayList<IStatus>();
+ if( deltas == null || deltas.length == 0 )
+ return new IStatus[]{};
+ int dKind;
+ IModuleResource resource;
+ for( int i = 0; i < deltas.length; i++ ) {
+ dKind = deltas[i].getKind();
+ resource = deltas[i].getModuleResource();
+ if( dKind == IModuleResourceDelta.ADDED ) {
+ results.addAll(Arrays.asList(copy(root, new IModuleResource[]{resource})));
+ } else if( dKind == IModuleResourceDelta.CHANGED ) {
+ if( resource instanceof IModuleFile )
+ results.addAll(Arrays.asList(copy(root, new IModuleResource[]{resource})));
+ results.addAll(Arrays.asList(publishChanges(server, deltas[i].getAffectedChildren(), root)));
+ } else if( dKind == IModuleResourceDelta.REMOVED) {
+ de.schlichtherle.io.File f = getFileInArchive(root,
+ resource.getModuleRelativePath().append(
+ resource.getName()));
+ boolean b = f.deleteAll();
+ if( !b )
+ results.add(generateDeleteFailedStatus(f));
+ } else if( dKind == IModuleResourceDelta.NO_CHANGE ) {
+ results.addAll(Arrays.asList(publishChanges(server, deltas[i].getAffectedChildren(), root)));
+ }
+ }
+
+ return (IStatus[]) results.toArray(new IStatus[results.size()]);
+ }
+
+
+ protected IStatus[] copy(de.schlichtherle.io.File root, IModuleResource[] children) {
+ ArrayList<IStatus> results = new ArrayList<IStatus>();
+ for( int i = 0; i < children.length; i++ ) {
+ if( children[i] instanceof IModuleFile ) {
+ IModuleFile mf = (IModuleFile)children[i];
+ java.io.File source = getFile(mf);
+ de.schlichtherle.io.File destination = getFileInArchive(root, mf.getModuleRelativePath().append(mf.getName()));
+ boolean b = new de.schlichtherle.io.File(source).copyAllTo(destination);
+ if( !b )
+ results.add(generateCopyFailStatus(source, destination));
+ } else if( children[i] instanceof IModuleFolder ) {
+ de.schlichtherle.io.File destination = getFileInArchive(root, children[i].getModuleRelativePath().append(children[i].getName()));
+ destination.mkdirs();
+ IModuleFolder mf = (IModuleFolder)children[i];
+ results.addAll(Arrays.asList(copy(root, mf.members())));
+ }
+ }
+ return (IStatus[]) results.toArray(new IStatus[results.size()]);
+ }
+
+ protected IStatus generateDeleteFailedStatus(java.io.File file) {
+ return new Status(IStatus.ERROR, IntegrationPlugin.PLUGIN_ID, "Could not delete file " + file); //$NON-NLS-1$
+ }
+ protected IStatus generateCoreExceptionStatus(CoreException ce) {
+ return new Status(IStatus.ERROR, IntegrationPlugin.PLUGIN_ID, ce.getMessage(), ce);
+ }
+ protected IStatus generateCopyFailStatus(java.io.File source, java.io.File destination) {
+ return new Status(IStatus.ERROR, IntegrationPlugin.PLUGIN_ID, "Copy of " + source + " to " + destination + " has failed");//$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
+ }
+
+ protected de.schlichtherle.io.File getFileInArchive(de.schlichtherle.io.File root, IPath relative) {
+ while(relative.segmentCount() > 0 ) {
+ root = new de.schlichtherle.io.File(root,
+ relative.segment(0), ArchiveDetector.DEFAULT);
+ relative = relative.removeFirstSegments(1);
+ }
+ return root;
+ }
+
+ private IModule[] combine(IModule[] module, IModule newMod) {
+ IModule[] retval = new IModule[module.length + 1];
+ for( int i = 0; i < module.length; i++ )
+ retval[i]=module[i];
+ retval[retval.length-1] = newMod;
+ return retval;
+ }
+}
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-16 16:53:34 UTC (rev 14782)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/ExtensionManager.java 2009-04-17 06:33:38 UTC (rev 14783)
@@ -164,6 +164,19 @@
return null;
}
+ public IJBossServerPublisher getZippedPublisher() {
+ if( publishers == null )
+ loadPublishers();
+ Iterator<PublisherWrapper> i = publishers.iterator();
+ PublisherWrapper wrapper;
+ while(i.hasNext()) {
+ wrapper = i.next();
+ if( wrapper.isZipDelegate )
+ return wrapper.publisher;
+ }
+ return null;
+ }
+
private void loadPublishers() {
ArrayList<PublisherWrapper> publishers = new ArrayList<PublisherWrapper>();
IExtensionRegistry registry = Platform.getExtensionRegistry();
@@ -172,11 +185,12 @@
try {
Object clazz = cf[i].createExecutableExtension("class");
String priority = cf[i].getAttribute("priority");
+ String zipDelegate = cf[i].getAttribute("zipDelegate");
int p = -1;
try {
p = Integer.parseInt(priority);
} catch( NumberFormatException nfe) {}
- publishers.add(new PublisherWrapper(p, (IJBossServerPublisher)clazz));
+ publishers.add(new PublisherWrapper(p, zipDelegate, (IJBossServerPublisher)clazz));
} catch( CoreException e ) {
} catch( ClassCastException cce ) {
}
@@ -193,9 +207,11 @@
private class PublisherWrapper {
private int priority;
private IJBossServerPublisher publisher;
- private PublisherWrapper(int priority, IJBossServerPublisher publisher) {
+ private boolean isZipDelegate = false;
+ private PublisherWrapper(int priority, String zipDelegate, IJBossServerPublisher publisher) {
this.priority = priority;
this.publisher = publisher;
+ isZipDelegate = Boolean.parseBoolean(zipDelegate);
}
}
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java 2009-04-16 16:53:34 UTC (rev 14782)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java 2009-04-17 06:33:38 UTC (rev 14783)
@@ -44,6 +44,7 @@
import org.eclipse.wst.server.core.model.IModuleResource;
import org.eclipse.wst.server.core.model.IModuleResourceDelta;
import org.eclipse.wst.server.core.util.ProjectModule;
+import org.jboss.ide.eclipse.as.core.ExtensionManager;
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.server.IDeployableServer;
@@ -72,15 +73,31 @@
public JstPublisher() {
}
+ private boolean serverRequiresZips() {
+ return server.zipsWTPDeployments();
+ }
+
public IStatus publishModule(IServer server, IModule[] module,
int publishType, IModuleResourceDelta[] delta, IProgressMonitor monitor) throws CoreException {
IStatus status = null;
this.server = ServerConverter.getDeployableServer(server);
this.delta = delta;
+
+ if( serverRequiresZips() ) {
+ IJBossServerPublisher delegate =
+ ExtensionManager.getDefault().getZippedPublisher();
+ if( delegate != null ) {
+ return delegate.publishModule(server, module, publishType, delta, monitor);
+ } else {
+ // TODO log, return
+ }
+ }
+
+
boolean deleted = false;
for( int i = 0; i < module.length; i++ ) {
- if( module[i] instanceof DeletedModule )
+ if( module[i].isExternal() )
deleted = true;
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IDeployableServer.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IDeployableServer.java 2009-04-16 16:53:34 UTC (rev 14782)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IDeployableServer.java 2009-04-17 06:33:38 UTC (rev 14783)
@@ -32,6 +32,7 @@
public static final String DEPLOY_DIRECTORY = "org.jboss.ide.eclipse.as.core.server.deployDirectory";
public static final String TEMP_DEPLOY_DIRECTORY = "org.jboss.ide.eclipse.as.core.server.tempDeployDirectory";
public static final String DEPLOY_DIRECTORY_TYPE = "org.jboss.ide.eclipse.as.core.server.deployDirectoryType";
+ public static final String ZIP_DEPLOYMENTS_PREF = "org.jboss.ide.eclipse.as.core.server.zipDeploymentsPreference";
public static final String DEPLOY_METADATA = "metadata";
public static final String DEPLOY_CUSTOM = "custom";
@@ -43,6 +44,8 @@
public void setTempDeployFolder(String folder);
public String getDeployLocationType();
public void setDeployLocationType(String type);
+ public boolean zipsWTPDeployments();
+ public void setZipWTPDeployments(boolean val);
public String getConfigDirectory();
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-16 16:53:34 UTC (rev 14782)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServer.java 2009-04-17 06:33:38 UTC (rev 14783)
@@ -157,6 +157,14 @@
return getAttribute(DEPLOY_DIRECTORY_TYPE, DEPLOY_CUSTOM);
}
+ public void setZipWTPDeployments(boolean val) {
+ setAttribute(ZIP_DEPLOYMENTS_PREF, val);
+ }
+ public boolean zipsWTPDeployments() {
+ return getAttribute(ZIP_DEPLOYMENTS_PREF, false);
+ }
+
+
/*
* (non-Javadoc)
* @see org.jboss.ide.eclipse.as.core.server.attributes.IDeployableServer#getAttributeHelper()
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/schema/publishers.exsd
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/schema/publishers.exsd 2009-04-16 16:53:34 UTC (rev 14782)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/schema/publishers.exsd 2009-04-17 06:33:38 UTC (rev 14783)
@@ -2,9 +2,9 @@
<!-- Schema file written by PDE -->
<schema targetNamespace="org.jboss.ide.eclipse.as.core" xmlns="http://www.w3.org/2001/XMLSchema">
<annotation>
- <appinfo>
+ <appInfo>
<meta.schema plugin="org.jboss.ide.eclipse.as.core" id="publishers" name="org.jboss.ide.eclipse.as.core.publishers"/>
- </appinfo>
+ </appInfo>
<documentation>
[Enter description of this extension point.]
</documentation>
@@ -12,9 +12,9 @@
<element name="extension">
<annotation>
- <appinfo>
+ <appInfo>
<meta.element />
- </appinfo>
+ </appInfo>
</annotation>
<complexType>
<sequence>
@@ -39,9 +39,9 @@
<documentation>
</documentation>
- <appinfo>
+ <appInfo>
<meta.attribute translatable="true"/>
- </appinfo>
+ </appInfo>
</annotation>
</attribute>
</complexType>
@@ -61,45 +61,52 @@
<documentation>
</documentation>
- <appinfo>
+ <appInfo>
<meta.attribute kind="java" basedOn=":org.jboss.ide.eclipse.as.core.server.IJBossServerPublisher"/>
- </appinfo>
+ </appInfo>
</annotation>
</attribute>
+ <attribute name="zipDelegate" type="boolean" use="default" value="false">
+ <annotation>
+ <documentation>
+ This should be false unless you want to be the delegated zip handler for webtools projects.
+ </documentation>
+ </annotation>
+ </attribute>
</complexType>
</element>
<annotation>
- <appinfo>
+ <appInfo>
<meta.section type="since"/>
- </appinfo>
+ </appInfo>
<documentation>
[Enter the first release in which this extension point appears.]
</documentation>
</annotation>
<annotation>
- <appinfo>
+ <appInfo>
<meta.section type="examples"/>
- </appinfo>
+ </appInfo>
<documentation>
[Enter extension point usage example here.]
</documentation>
</annotation>
<annotation>
- <appinfo>
+ <appInfo>
<meta.section type="apiinfo"/>
- </appinfo>
+ </appInfo>
<documentation>
[Enter API information here.]
</documentation>
</annotation>
<annotation>
- <appinfo>
+ <appInfo>
<meta.section type="implementation"/>
- </appinfo>
+ </appInfo>
<documentation>
[Enter information about supplied implementation of this extension point.]
</documentation>
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-16 16:53:34 UTC (rev 14782)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.java 2009-04-17 06:33:38 UTC (rev 14783)
@@ -130,6 +130,7 @@
public static String EditorUseCustomDeployFolder;
public static String EditorSetDeployLabel;
public static String EditorSetTempDeployLabel;
+ public static String EditorZipDeployments;
public static String EditorSetRadioClicked;
public static String EditorDeployDNE;
public static String EditorTempDeployDNE;
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-16 16:53:34 UTC (rev 14782)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.properties 2009-04-17 06:33:38 UTC (rev 14783)
@@ -108,6 +108,7 @@
EditorUseCustomDeployFolder=Use a custom deploy folder
EditorSetDeployLabel=Set Deploy Directory
EditorSetTempDeployLabel=Set Temporary Deploy Directory
+EditorZipDeployments=Zip webtools projects when deploying
EditorSetRadioClicked=Set Deploy Location
EditorDeployDNE=The deploy directory "{0}" does not exist.
EditorTempDeployDNE=The temporary deploy directory "{0}" does not exist.
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-16 16:53:34 UTC (rev 14782)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/DeploySection.java 2009-04-17 06:33:38 UTC (rev 14783)
@@ -56,6 +56,7 @@
import org.eclipse.wst.server.core.IRuntime;
import org.eclipse.wst.server.ui.editor.ServerEditorSection;
import org.eclipse.wst.server.ui.internal.command.ServerCommand;
+import org.jboss.ide.eclipse.as.core.ExtensionManager;
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;
@@ -76,9 +77,9 @@
private Button metadataRadio, serverRadio, customRadio, currentSelection;
private Button deployButton, tempDeployButton;
private ModifyListener deployListener, tempDeployListener;
- private SelectionListener radioListener;
+ private SelectionListener radioListener, zipListener;
private ServerAttributeHelper helper;
-
+ private Button zipDeployWTPProjects;
private String lastCustomDeploy, lastCustomTemp;
public DeploySection() {
}
@@ -103,41 +104,41 @@
Label descriptionLabel = toolkit.createLabel(composite, Messages.swf_DeploymentDescription);
Control top = descriptionLabel;
- Composite inner = toolkit.createComposite(composite);
- inner.setLayout(new GridLayout(1, false));
- metadataRadio = toolkit.createButton(inner, Messages.EditorUseWorkspaceMetadata, SWT.RADIO);
- serverRadio = toolkit.createButton(inner, Messages.EditorUseServersDeployFolder, SWT.RADIO);
- customRadio = toolkit.createButton(inner, Messages.EditorUseCustomDeployFolder, SWT.RADIO);
-
- metadataRadio.setSelection(getDeployType().equals(IDeployableServer.DEPLOY_METADATA));
- serverRadio.setSelection(getDeployType().equals(IDeployableServer.DEPLOY_SERVER));
- customRadio.setSelection(getDeployType().equals(IDeployableServer.DEPLOY_CUSTOM));
- currentSelection = metadataRadio.getSelection() ? metadataRadio :
- serverRadio.getSelection() ? serverRadio :
- customRadio;
-
- radioListener = new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- widgetSelected(e);
- }
- public void widgetSelected(SelectionEvent e) {
- if( e.getSource() == currentSelection )
- return; // do nothing
- execute(new RadioClickedCommand((Button)e.getSource(), currentSelection));
- currentSelection = (Button)e.getSource();
- } };
- metadataRadio.addSelectionListener(radioListener);
- serverRadio.addSelectionListener(radioListener);
- customRadio.addSelectionListener(radioListener);
-
- FormData radios = new FormData();
- radios.top = new FormAttachment(descriptionLabel,5);
- radios.left = new FormAttachment(0,5);
- radios.right = new FormAttachment(100,-5);
- inner.setLayoutData(radios);
- top = inner;
+ Composite inner = toolkit.createComposite(composite);
+ inner.setLayout(new GridLayout(1, false));
+ metadataRadio = toolkit.createButton(inner, Messages.EditorUseWorkspaceMetadata, SWT.RADIO);
+ serverRadio = toolkit.createButton(inner, Messages.EditorUseServersDeployFolder, SWT.RADIO);
+ customRadio = toolkit.createButton(inner, Messages.EditorUseCustomDeployFolder, SWT.RADIO);
+ metadataRadio.setSelection(getDeployType().equals(IDeployableServer.DEPLOY_METADATA));
+ serverRadio.setSelection(getDeployType().equals(IDeployableServer.DEPLOY_SERVER));
+ customRadio.setSelection(getDeployType().equals(IDeployableServer.DEPLOY_CUSTOM));
+ currentSelection = metadataRadio.getSelection() ? metadataRadio :
+ serverRadio.getSelection() ? serverRadio :
+ customRadio;
+ radioListener = new SelectionListener() {
+ public void widgetDefaultSelected(SelectionEvent e) {
+ widgetSelected(e);
+ }
+ public void widgetSelected(SelectionEvent e) {
+ if( e.getSource() == currentSelection )
+ return; // do nothing
+ execute(new RadioClickedCommand((Button)e.getSource(), currentSelection));
+ currentSelection = (Button)e.getSource();
+ } };
+ metadataRadio.addSelectionListener(radioListener);
+ serverRadio.addSelectionListener(radioListener);
+ customRadio.addSelectionListener(radioListener);
+
+ FormData radios = new FormData();
+ radios.top = new FormAttachment(descriptionLabel,5);
+ radios.left = new FormAttachment(0,5);
+ radios.right = new FormAttachment(100,-5);
+ inner.setLayoutData(radios);
+ top = inner;
+
+
Label label = toolkit.createLabel(composite, Messages.swf_DeployDirectory);
label.setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
deployText = toolkit.createText(composite, getDeployDir(), SWT.BORDER);
@@ -232,6 +233,28 @@
tempButtonData.top = new FormAttachment(deployText,5);
tempDeployButton.setLayoutData(tempButtonData);
+ zipDeployWTPProjects = toolkit.createButton(composite, Messages.EditorZipDeployments, SWT.CHECK);
+ boolean publisherAvailable = ExtensionManager.getDefault().getZippedPublisher() != null;
+ boolean value = getServer().zipsWTPDeployments();
+ zipDeployWTPProjects.setEnabled(publisherAvailable);
+ zipDeployWTPProjects.setSelection(publisherAvailable && value);
+
+ FormData zipButtonData = new FormData();
+ zipButtonData.right = new FormAttachment(100,-5);
+ zipButtonData.left = new FormAttachment(0,5);
+ zipButtonData.top = new FormAttachment(tempDeployText,5);
+ zipDeployWTPProjects.setLayoutData(zipButtonData);
+
+ zipListener = new SelectionListener(){
+ public void widgetSelected(SelectionEvent e) {
+ execute(new SetZipCommand());
+ }
+ public void widgetDefaultSelected(SelectionEvent e) {
+ widgetSelected(e);
+ }
+ };
+ zipDeployWTPProjects.addSelectionListener(zipListener);
+
toolkit.paintBordersFor(composite);
section.setClient(composite);
getSaveStatus();
@@ -303,6 +326,27 @@
}
}
+ public class SetZipCommand extends ServerCommand {
+ boolean oldVal;
+ boolean newVal;
+ public SetZipCommand() {
+ super(DeploySection.this.server, Messages.EditorZipDeployments);
+ oldVal = helper.getAttribute(IDeployableServer.ZIP_DEPLOYMENTS_PREF, false);
+ newVal = zipDeployWTPProjects.getSelection();
+ }
+ public void execute() {
+ helper.setAttribute(IDeployableServer.ZIP_DEPLOYMENTS_PREF, newVal);
+ getSaveStatus();
+ }
+ public void undo() {
+ zipDeployWTPProjects.removeSelectionListener(zipListener);
+ zipDeployWTPProjects.setSelection(oldVal);
+ helper.setAttribute(IDeployableServer.ZIP_DEPLOYMENTS_PREF, oldVal);
+ zipDeployWTPProjects.addSelectionListener(zipListener);
+ getSaveStatus();
+ }
+ }
+
public class SetTempDeployDirCommand extends ServerCommand {
private String oldDir;
private String newDir;
15 years, 8 months
JBoss Tools SVN: r14782 - trunk/jsf/tests/org.jboss.tools.jsf.vpe.facelets.test/META-INF.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-04-16 12:53:34 -0400 (Thu, 16 Apr 2009)
New Revision: 14782
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.facelets.test/META-INF/MANIFEST.MF
Log:
https://jira.jboss.org/jira/browse/JBIDE-4123 Migration to Eclipse 3.5
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.facelets.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.facelets.test/META-INF/MANIFEST.MF 2009-04-16 16:48:27 UTC (rev 14781)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.facelets.test/META-INF/MANIFEST.MF 2009-04-16 16:53:34 UTC (rev 14782)
@@ -11,8 +11,10 @@
org.eclipse.core.resources,
org.eclipse.ui.ide,
org.jboss.tools.common,
+ org.jboss.tools.common.text.ext,
org.jboss.tools.vpe.ui.test,
org.jboss.tools.jst.jsp,
+ org.jboss.tools.jst.web,
org.jboss.tools.vpe.xulrunner,
org.mozilla.xpcom
Eclipse-LazyStart: true
15 years, 8 months
JBoss Tools SVN: r14781 - in trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal: jpa/process/wizard and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-04-16 12:48:27 -0400 (Thu, 16 Apr 2009)
New Revision: 14781
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/SaveQueryEditorListener.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/process/wizard/HibernateJPAWizard.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4123 Migration to Eclipse 3.5
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/SaveQueryEditorListener.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/SaveQueryEditorListener.java 2009-04-16 16:41:00 UTC (rev 14780)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/SaveQueryEditorListener.java 2009-04-16 16:48:27 UTC (rev 14781)
@@ -12,7 +12,7 @@
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Status;
-import org.eclipse.jdt.internal.ui.refactoring.RefactoringSaveHelper;
+import org.eclipse.jdt.ui.refactoring.RefactoringSaveHelper;
import org.eclipse.jdt.internal.ui.refactoring.actions.RefactoringStarter;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.text.BadLocationException;
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/process/wizard/HibernateJPAWizard.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/process/wizard/HibernateJPAWizard.java 2009-04-16 16:41:00 UTC (rev 14780)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/process/wizard/HibernateJPAWizard.java 2009-04-16 16:48:27 UTC (rev 14781)
@@ -10,7 +10,7 @@
******************************************************************************/
package org.hibernate.eclipse.jdt.ui.internal.jpa.process.wizard;
-import org.eclipse.jdt.internal.ui.refactoring.RefactoringSaveHelper;
+import org.eclipse.jdt.ui.refactoring.RefactoringSaveHelper;
import org.eclipse.jdt.internal.ui.refactoring.actions.RefactoringStarter;
import org.eclipse.ltk.core.refactoring.RefactoringStatus;
import org.eclipse.ltk.ui.refactoring.RefactoringWizard;
15 years, 8 months
JBoss Tools SVN: r14780 - trunk/common/tests/org.jboss.tools.common.el.core.test/META-INF.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-04-16 12:41:00 -0400 (Thu, 16 Apr 2009)
New Revision: 14780
Modified:
trunk/common/tests/org.jboss.tools.common.el.core.test/META-INF/MANIFEST.MF
Log:
https://jira.jboss.org/jira/browse/JBIDE-4123 Migration to Eclipse 3.5
Modified: trunk/common/tests/org.jboss.tools.common.el.core.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/common/tests/org.jboss.tools.common.el.core.test/META-INF/MANIFEST.MF 2009-04-16 16:38:51 UTC (rev 14779)
+++ trunk/common/tests/org.jboss.tools.common.el.core.test/META-INF/MANIFEST.MF 2009-04-16 16:41:00 UTC (rev 14780)
@@ -10,6 +10,7 @@
org.junit,
org.eclipse.core.runtime,
org.eclipse.core.resources,
+ org.eclipse.jface.text,
org.jboss.tools.common.el.core,
org.jboss.tools.common.test,
org.jboss.tools.tests
15 years, 8 months
JBoss Tools SVN: r14779 - trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editor.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-04-16 12:38:51 -0400 (Thu, 16 Apr 2009)
New Revision: 14779
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editor/XMLContentDescriber.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4123 Migration to Eclipse 3.5
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editor/XMLContentDescriber.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editor/XMLContentDescriber.java 2009-04-16 16:36:58 UTC (rev 14778)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editor/XMLContentDescriber.java 2009-04-16 16:38:51 UTC (rev 14779)
@@ -23,7 +23,7 @@
/**
* @author Viacheslav Kabanovich
*/
-public class XMLContentDescriber extends org.eclipse.core.internal.content.XMLContentDescriber implements ITextContentDescriber {
+public class XMLContentDescriber extends org.eclipse.core.runtime.content.XMLContentDescriber implements ITextContentDescriber {
public int describe(InputStream contents, IContentDescription description) throws IOException {
super.describe(contents, description);
15 years, 8 months
JBoss Tools SVN: r14778 - trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/refactoring.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-04-16 12:36:58 -0400 (Thu, 16 Apr 2009)
New Revision: 14778
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/refactoring/RenameProcessorRunner.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4123
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/refactoring/RenameProcessorRunner.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/refactoring/RenameProcessorRunner.java 2009-04-16 15:46:13 UTC (rev 14777)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/refactoring/RenameProcessorRunner.java 2009-04-16 16:36:58 UTC (rev 14778)
@@ -12,7 +12,7 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jdt.internal.corext.refactoring.tagging.*;
-import org.eclipse.jdt.internal.ui.refactoring.RefactoringSaveHelper;
+import org.eclipse.jdt.ui.refactoring.RefactoringSaveHelper;
import org.eclipse.jdt.internal.ui.refactoring.reorg.*;
import org.eclipse.ltk.core.refactoring.participants.*;
import org.eclipse.swt.widgets.Shell;
15 years, 8 months
JBoss Tools SVN: r14777 - trunk/seam/plugins/org.jboss.ide.seam.gen/src/org/jboss/ide/seam/gen/actions.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2009-04-16 11:46:13 -0400 (Thu, 16 Apr 2009)
New Revision: 14777
Modified:
trunk/seam/plugins/org.jboss.ide.seam.gen/src/org/jboss/ide/seam/gen/actions/SeamGenAction.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4189 Fixed compile error in org.jboss.ide.seam.gen
Modified: trunk/seam/plugins/org.jboss.ide.seam.gen/src/org/jboss/ide/seam/gen/actions/SeamGenAction.java
===================================================================
--- trunk/seam/plugins/org.jboss.ide.seam.gen/src/org/jboss/ide/seam/gen/actions/SeamGenAction.java 2009-04-16 15:36:47 UTC (rev 14776)
+++ trunk/seam/plugins/org.jboss.ide.seam.gen/src/org/jboss/ide/seam/gen/actions/SeamGenAction.java 2009-04-16 15:46:13 UTC (rev 14777)
@@ -14,7 +14,7 @@
import java.util.Map.Entry;
import org.eclipse.ant.internal.ui.IAntUIConstants;
-import org.eclipse.ant.internal.ui.launchConfigurations.IAntLaunchConfigurationConstants;
+import org.eclipse.ant.ui.launching.IAntLaunchConfigurationConstants;
import org.eclipse.core.filesystem.URIUtil;
import org.eclipse.core.internal.utils.FileUtil;
import org.eclipse.core.resources.IProject;
@@ -245,7 +245,7 @@
ILaunchConfigurationType launchConfigurationType = launchManager.getLaunchConfigurationType( "org.eclipse.ant.AntLaunchConfigurationType" );
ILaunchConfigurationWorkingCopy wc = launchConfigurationType.newInstance( null, "seamgen" );
wc.setAttribute( "process_factory_id", "org.eclipse.ant.ui.remoteAntProcessFactory" );
- wc.setAttribute(IAntUIConstants.ATTR_DEFAULT_VM_INSTALL, true);
+ wc.setAttribute(IAntLaunchConfigurationConstants.ATTR_DEFAULT_VM_INSTALL, true);
wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, "org.eclipse.ant.internal.ui.antsupport.InternalAntRunner");
wc.setAttribute("org.eclipse.debug.core.appendEnvironmentVariables", true);
15 years, 8 months
JBoss Tools SVN: r14776 - trunk/jst/features/org.jboss.tools.jst.feature.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2009-04-16 11:36:47 -0400 (Thu, 16 Apr 2009)
New Revision: 14776
Modified:
trunk/jst/features/org.jboss.tools.jst.feature/feature.xml
Log:
https://jira.jboss.org/jira/browse/JBIDE-4162 Removed struts debugger code
Modified: trunk/jst/features/org.jboss.tools.jst.feature/feature.xml
===================================================================
--- trunk/jst/features/org.jboss.tools.jst.feature/feature.xml 2009-04-16 15:35:09 UTC (rev 14775)
+++ trunk/jst/features/org.jboss.tools.jst.feature/feature.xml 2009-04-16 15:36:47 UTC (rev 14776)
@@ -218,18 +218,6 @@
version="0.0.0"/>
<plugin
- id="org.jboss.tools.jst.web.debug"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.jboss.tools.jst.web.debug.ui"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
id="org.jboss.tools.jst.web.ui"
download-size="0"
install-size="0"
15 years, 8 months
JBoss Tools SVN: r14775 - trunk/struts/features/org.jboss.tools.struts.feature.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2009-04-16 11:35:09 -0400 (Thu, 16 Apr 2009)
New Revision: 14775
Modified:
trunk/struts/features/org.jboss.tools.struts.feature/feature.xml
Log:
https://jira.jboss.org/jira/browse/JBIDE-4162 Removed struts debugger code
Modified: trunk/struts/features/org.jboss.tools.struts.feature/feature.xml
===================================================================
--- trunk/struts/features/org.jboss.tools.struts.feature/feature.xml 2009-04-16 15:34:25 UTC (rev 14774)
+++ trunk/struts/features/org.jboss.tools.struts.feature/feature.xml 2009-04-16 15:35:09 UTC (rev 14775)
@@ -29,12 +29,6 @@
version="0.0.0"/>
<plugin
- id="org.jboss.tools.struts.debug"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
id="org.jboss.tools.struts.text.ext"
download-size="0"
install-size="0"
15 years, 8 months
JBoss Tools SVN: r14774 - trunk/jsf/features/org.jboss.tools.richfaces.feature.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2009-04-16 11:34:25 -0400 (Thu, 16 Apr 2009)
New Revision: 14774
Modified:
trunk/jsf/features/org.jboss.tools.richfaces.feature/feature.xml
Log:
https://jira.jboss.org/jira/browse/JBIDE-4162 Removed struts debugger code
Modified: trunk/jsf/features/org.jboss.tools.richfaces.feature/feature.xml
===================================================================
--- trunk/jsf/features/org.jboss.tools.richfaces.feature/feature.xml 2009-04-16 15:31:20 UTC (rev 14773)
+++ trunk/jsf/features/org.jboss.tools.richfaces.feature/feature.xml 2009-04-16 15:34:25 UTC (rev 14774)
@@ -354,18 +354,6 @@
version="0.0.0"/>
<plugin
- id="org.jboss.tools.jst.web.debug"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.jboss.tools.jst.web.debug.ui"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
id="org.jboss.tools.jst.web.tiles"
download-size="0"
install-size="0"
15 years, 8 months