Author: rob.stryker(a)jboss.com
Date: 2010-10-14 23:38:18 -0400 (Thu, 14 Oct 2010)
New Revision: 25846
Added:
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/SingleFolderZippedPublisher.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/ResourceModuleResourceUtil.java
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/archives/RSEZippedFolderPublisher.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/plugin.xml
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/LocalZippedPublisherUtil.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/SingleDeployableFactory.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/AbstractJSTPublisher.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/AbstractServerToolsPublisher.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/SingleFilePublisher.java
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/plugin.xml
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEJSTPublisher.java
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSESingleFilePublisher.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/DeployAction.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml
Log:
JBIDE-7324 - make deployable for folders
Modified: trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/plugin.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/plugin.xml 2010-10-14
21:56:53 UTC (rev 25845)
+++ trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/plugin.xml 2010-10-15
03:38:18 UTC (rev 25846)
@@ -95,6 +95,11 @@
priority="2"
zipDelegate="true">
</publisher>
+ <publisher
+
class="org.jboss.ide.eclipse.archives.webtools.modules.SingleFolderZippedPublisher"
+ priority="2"
+ zipDelegate="true">
+ </publisher>
</extension>
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/LocalZippedPublisherUtil.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/LocalZippedPublisherUtil.java 2010-10-14
21:56:53 UTC (rev 25845)
+++
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/LocalZippedPublisherUtil.java 2010-10-15
03:38:18 UTC (rev 25846)
@@ -1,3 +1,14 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ ******************************************************************************/
package org.jboss.ide.eclipse.archives.webtools.modules;
import java.io.File;
@@ -36,21 +47,12 @@
public class LocalZippedPublisherUtil extends PublishUtil {
- private IServer server;
private String deployRoot;
- private IModule[] module;
- private int publishType;
- private IModuleResourceDelta[] delta;
public IStatus publishModule(IServer server, String deployRoot, IModule[] module,
int publishType, IModuleResourceDelta[] delta,
IProgressMonitor monitor) throws CoreException {
- this.server = server;
this.deployRoot = deployRoot;
- this.module = module;
- this.publishType = publishType;
- this.delta = delta;
-
IStatus[] returnStatus;
Added:
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/SingleFolderZippedPublisher.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/SingleFolderZippedPublisher.java
(rev 0)
+++
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/SingleFolderZippedPublisher.java 2010-10-15
03:38:18 UTC (rev 25846)
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * TODO: Logging and Progress Monitors
+ ******************************************************************************/
+package org.jboss.ide.eclipse.archives.webtools.modules;
+
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IServer;
+import org.jboss.ide.eclipse.as.core.modules.SingleDeployableFactory;
+import org.jboss.ide.eclipse.as.wtp.core.modules.IJBTModule;
+
+public class SingleFolderZippedPublisher extends WTPZippedPublisher {
+ public boolean accepts(String method, IServer server, IModule[] module) {
+ if( module != null && module.length > 0
+ && module[module.length-1] != null
+ &&
module[module.length-1].getModuleType().getId().equals(SingleDeployableFactory.MODULE_TYPE))
{
+ IModule mod = module[module.length-1];
+ IJBTModule del = (IJBTModule)mod.loadAdapter(IJBTModule.class, new
NullProgressMonitor());
+ if( del != null && !del.isBinary())
+ return true; // we have a folder
+ }
+ return false;
+ }
+}
\ No newline at end of file
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/ResourceModuleResourceUtil.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/ResourceModuleResourceUtil.java
(rev 0)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/ResourceModuleResourceUtil.java 2010-10-15
03:38:18 UTC (rev 25846)
@@ -0,0 +1,63 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.core.modules;
+
+import java.util.ArrayList;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.wst.server.core.model.IModuleResource;
+import org.eclipse.wst.server.core.util.ModuleFile;
+import org.eclipse.wst.server.core.util.ModuleFolder;
+
+public class ResourceModuleResourceUtil {
+ public static IModuleResource createResource(IResource resource) {
+ return createResource(resource, new Path("/")); //$NON-NLS-1$
+ }
+
+ public static IModuleResource createResource(IResource resource, IPath path) {
+ if( resource instanceof IFile ) {
+ return createFile((IFile)resource, path);
+ }
+ IContainer cont = (IContainer)resource;
+ return createFolder(cont, path);
+ }
+
+ public static IModuleResource createFile(IFile resource, IPath path) {
+ IPath global = resource.getLocation();
+ return new ModuleFile(global.toFile(),
+ global.lastSegment(), path);
+ }
+
+ public static IModuleResource createFolder(IContainer cont, IPath path) {
+ ModuleFolder folder = new ModuleFolder(cont, cont.getName(), path);
+ IModuleResource[] childrenResources = createChildrenResources(cont,
path.append(cont.getName()));
+ folder.setMembers(childrenResources);
+ return folder;
+ }
+
+ public static IModuleResource[] createChildrenResources(IContainer parent, IPath
forcedParentPath) {
+ ArrayList<IModuleResource> modChildren = new ArrayList<IModuleResource>();
+ IResource[] children = new IResource[]{};
+ try {
+ children = parent.members();
+ } catch(CoreException ce) {
+ }
+ for( int i = 0; i < children.length; i++ ) {
+ modChildren.add(createResource(children[i], forcedParentPath));
+ }
+ return modChildren.toArray(new IModuleResource[modChildren.size()]);
+ }
+}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/SingleDeployableFactory.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/SingleDeployableFactory.java 2010-10-14
21:56:53 UTC (rev 25845)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/SingleDeployableFactory.java 2010-10-15
03:38:18 UTC (rev 25846)
@@ -19,6 +19,8 @@
import java.util.List;
import java.util.Set;
+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.IResourceChangeEvent;
@@ -45,9 +47,9 @@
import org.eclipse.wst.server.core.ServerCore;
import org.eclipse.wst.server.core.ServerUtil;
import org.eclipse.wst.server.core.internal.ModuleFactory;
-import org.eclipse.wst.server.core.internal.ModuleFile;
import org.eclipse.wst.server.core.internal.PublishServerJob;
import org.eclipse.wst.server.core.internal.ServerPlugin;
+import org.eclipse.wst.server.core.model.IModuleFolder;
import org.eclipse.wst.server.core.model.IModuleResource;
import org.eclipse.wst.server.core.model.ModuleDelegate;
import org.eclipse.wst.server.core.model.ModuleFactoryDelegate;
@@ -117,8 +119,6 @@
return getFactory().getModule(workspaceRelative);
}
-
-
private HashMap<IPath, IModule> moduleIdToModule;
private HashMap<IModule, SingleDeployableModuleDelegate> moduleToDelegate;
private IResourceChangeListener resourceListener;
@@ -317,20 +317,33 @@
public class SingleDeployableModuleDelegate extends ModuleDelegate implements IJBTModule
{
private IPath global;
private IPath workspaceRelative;
+ private IResource resource;
public SingleDeployableModuleDelegate(IPath workspaceRelative) {
this.workspaceRelative = workspaceRelative;
- IResource res =
ResourcesPlugin.getWorkspace().getRoot().findMember(workspaceRelative);
- global = res.getLocation();
+ resource = ResourcesPlugin.getWorkspace().getRoot().findMember(workspaceRelative);
+ global = resource.getLocation();
}
public IModule[] getChildModules() {
return new IModule[0];
}
public IModuleResource[] members() throws CoreException {
- return new IModuleResource[] {
- new ModuleFile(global.toFile(),
- global.lastSegment(),
- global.removeLastSegments(1)) };
+ if( isBinary() && resource instanceof IFile) {
+ IModuleResource resource2 = ResourceModuleResourceUtil.createResource(resource);
+ return new IModuleResource[]{resource2};
+ }
+ /*
+ * Single deployable modules that are folders are not treated as
+ * binary modules, but rather regular modules with no extension.
+ * This means all module resource paths must be relative to the root folder,
+ * and so we ensure that here.
+ */
+ if( !isBinary() && resource instanceof IContainer) {
+ IModuleResource[] resource2 = ResourceModuleResourceUtil.createChildrenResources(
+ (IContainer)resource, new Path("/")); //$NON-NLS-1$
+ return resource2;
+ }
+ return new IModuleResource[]{};
}
public IStatus validate() {
@@ -350,8 +363,11 @@
public String getURI(IModule module) {
return null; // never called
}
+
+ // folders are not binary
public boolean isBinary() {
- return true;
+ boolean b = global.toFile().exists() && global.toFile().isFile();
+ return b;
}
}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/AbstractJSTPublisher.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/AbstractJSTPublisher.java 2010-10-14
21:56:53 UTC (rev 25845)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/AbstractJSTPublisher.java 2010-10-15
03:38:18 UTC (rev 25846)
@@ -24,7 +24,7 @@
* This abstract publisher is only suitable for non force-zipped deployments
*/
public boolean accepts(String method, IServer server, IModule[] module) {
- if( module == null || !method.equals(getTargetedPublishMethodId()))
+ if( module == null || (publishMethodSpecific() &&
!method.equals(getTargetedPublishMethodId())))
return false;
IDeployableServer ds = ServerConverter.getDeployableServer(server);
return ds != null
@@ -33,6 +33,15 @@
}
/**
+ * Return true if this publisher requires a specific
+ * publish method / publish method id.
+ * Clients are expected to override
+ */
+ protected boolean publishMethodSpecific() {
+ return false;
+ }
+
+ /**
* Get the publish method this publisher is associated with
* @return
*/
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/AbstractServerToolsPublisher.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/AbstractServerToolsPublisher.java 2010-10-14
21:56:53 UTC (rev 25845)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/AbstractServerToolsPublisher.java 2010-10-15
03:38:18 UTC (rev 25846)
@@ -156,7 +156,8 @@
// First delete it
// if the module we're publishing is a project, not a binary, clean it's
folder
- if( !(new Path(module.getName()).segmentCount() > 1 ))
+ //if( !(new Path(module.getName()).segmentCount() > 1 ))
+ if( !ServerModelUtilities.isBinaryModule(module))
callback.deleteResource(new Path("/"), ProgressMonitorUtil.submon(monitor,
100)); //$NON-NLS-1$
if( monitor.isCanceled())
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 2010-10-14
21:56:53 UTC (rev 25845)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/SingleFilePublisher.java 2010-10-15
03:38:18 UTC (rev 25846)
@@ -10,17 +10,22 @@
******************************************************************************/
package org.jboss.ide.eclipse.as.core.publishers;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IServer;
import org.jboss.ide.eclipse.as.core.modules.SingleDeployableFactory;
+import org.jboss.ide.eclipse.as.wtp.core.modules.IJBTModule;
public class SingleFilePublisher extends AbstractServerToolsPublisher {
public boolean accepts(String method, IServer server, IModule[] module) {
- if( LocalPublishMethod.LOCAL_PUBLISH_METHOD.equals(method)
- && module != null && module.length > 0
+ if( module != null && module.length > 0
&& module[module.length-1] != null
- &&
module[module.length-1].getModuleType().getId().equals(SingleDeployableFactory.MODULE_TYPE))
- return true;
+ &&
module[module.length-1].getModuleType().getId().equals(SingleDeployableFactory.MODULE_TYPE))
{
+ IModule mod = module[module.length-1];
+ IJBTModule del = (IJBTModule)mod.loadAdapter(IJBTModule.class, new
NullProgressMonitor());
+ if( del != null && del.isBinary())
+ return true;
+ }
return false;
}
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/plugin.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/plugin.xml 2010-10-14 21:56:53 UTC
(rev 25845)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/plugin.xml 2010-10-15 03:38:18 UTC
(rev 25846)
@@ -13,6 +13,7 @@
</extension>
<extension
point="org.jboss.ide.eclipse.as.core.publishers">
+<!--
<publisher
class="org.jboss.ide.eclipse.as.rse.core.RSESingleFilePublisher"
priority="7">
@@ -21,11 +22,17 @@
class="org.jboss.ide.eclipse.as.rse.core.RSEJSTPublisher"
priority="5">
</publisher>
+-->
<publisher
class="org.jboss.ide.eclipse.as.rse.core.archives.RSEZippedJSTPublisher"
priority="3"
zipDelegate="true">
</publisher>
+ <publisher
+
class="org.jboss.ide.eclipse.as.rse.core.archives.RSEZippedFolderPublisher"
+ priority="8"
+ zipDelegate="true">
+ </publisher>
</extension>
</plugin>
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEJSTPublisher.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEJSTPublisher.java 2010-10-14
21:56:53 UTC (rev 25845)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEJSTPublisher.java 2010-10-15
03:38:18 UTC (rev 25846)
@@ -15,6 +15,7 @@
import org.jboss.ide.eclipse.as.core.publishers.AbstractJSTPublisher;
+@Deprecated
public class RSEJSTPublisher extends AbstractJSTPublisher {
@Override
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSESingleFilePublisher.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSESingleFilePublisher.java 2010-10-14
21:56:53 UTC (rev 25845)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSESingleFilePublisher.java 2010-10-15
03:38:18 UTC (rev 25846)
@@ -15,14 +15,15 @@
import org.jboss.ide.eclipse.as.core.modules.SingleDeployableFactory;
import org.jboss.ide.eclipse.as.core.publishers.AbstractServerToolsPublisher;
+@Deprecated
public class RSESingleFilePublisher extends AbstractServerToolsPublisher {
public boolean accepts(String method, IServer server, IModule[] module) {
- if( RSEPublishMethod.RSE_ID.equals(method)
- && module != null && module.length > 0
- && module[module.length-1] != null
- &&
module[module.length-1].getModuleType().getId().equals(SingleDeployableFactory.MODULE_TYPE))
- return true;
+// if( RSEPublishMethod.RSE_ID.equals(method)
+// && module != null && module.length > 0
+// && module[module.length-1] != null
+// &&
module[module.length-1].getModuleType().getId().equals(SingleDeployableFactory.MODULE_TYPE))
+// return true;
return false;
}
}
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/archives/RSEZippedFolderPublisher.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/archives/RSEZippedFolderPublisher.java
(rev 0)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/archives/RSEZippedFolderPublisher.java 2010-10-15
03:38:18 UTC (rev 25846)
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * TODO: Logging and Progress Monitors
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.rse.core.archives;
+
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IServer;
+import org.jboss.ide.eclipse.as.core.modules.SingleDeployableFactory;
+import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
+import org.jboss.ide.eclipse.as.core.util.ServerConverter;
+import org.jboss.ide.eclipse.as.rse.core.RSEPublishMethod;
+import org.jboss.ide.eclipse.as.wtp.core.modules.IJBTModule;
+
+/**
+ * This class is in charge of RSE zipped publishing for deployable folders
+ */
+public class RSEZippedFolderPublisher extends RSEZippedJSTPublisher {
+ public boolean accepts(String method, IServer server, IModule[] module) {
+ if( !RSEPublishMethod.RSE_ID.equals(method))
+ return false;
+
+ IDeployableServer ds = ServerConverter.getDeployableServer(server);
+ if( module != null && module.length > 0
+ && module[module.length-1] != null
+ &&
module[module.length-1].getModuleType().getId().equals(SingleDeployableFactory.MODULE_TYPE))
{
+ IModule mod = module[module.length-1];
+ IJBTModule del = (IJBTModule)mod.loadAdapter(IJBTModule.class, new
NullProgressMonitor());
+ if( del != null && !del.isBinary())
+ return ds != null && ds.zipsWTPDeployments();; // we have a folder
+ }
+ return false;
+ }
+}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/DeployAction.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/DeployAction.java 2010-10-14
21:56:53 UTC (rev 25845)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/DeployAction.java 2010-10-15
03:38:18 UTC (rev 25846)
@@ -24,7 +24,7 @@
import java.util.ArrayList;
import java.util.Iterator;
-import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
@@ -89,7 +89,7 @@
return false;
Iterator i = sel.iterator();
while(i.hasNext())
- if( !(i.next() instanceof IFile ))
+ if( !(i.next() instanceof IResource ))
return false;
}
return true;
@@ -101,7 +101,7 @@
return Messages.ActionDelegateMakeDeployable;
}
- // True if we want to unpublish, false if we wantt to publish
+ // True if we want to unpublish, false if we want to publish
protected boolean verifyType() {
if( selection instanceof IStructuredSelection ) {
IStructuredSelection sel = (IStructuredSelection)selection;
@@ -111,7 +111,7 @@
Object o;
while(i.hasNext()) {
o = i.next();
- if( !(o instanceof IFile) ||
SingleDeployableFactory.findModule(((IFile)o).getFullPath()) == null)
+ if( !(o instanceof IResource) ||
SingleDeployableFactory.findModule(((IResource)o).getFullPath()) == null)
return false;
}
}
@@ -136,8 +136,8 @@
Object[] objs = sel2.toArray();
IModule[] modules = new IModule[objs.length];
for( int i = 0; i < objs.length; i++ ) {
- SingleDeployableFactory.makeDeployable(((IFile)objs[i]).getFullPath());
- modules[i] = SingleDeployableFactory.findModule(((IFile)objs[i]).getFullPath());
+ SingleDeployableFactory.makeDeployable(((IResource)objs[i]).getFullPath());
+ modules[i] = SingleDeployableFactory.findModule(((IResource)objs[i]).getFullPath());
}
tryToPublish();
@@ -148,8 +148,8 @@
Object[] objs = sel2.toArray();
ArrayList<IPath> paths = new ArrayList<IPath>();
for( int i = 0; i < objs.length; i++ )
- if(objs[i] instanceof IFile )
- paths.add(((IFile)objs[i]).getFullPath());
+ if(objs[i] instanceof IResource )
+ paths.add(((IResource)objs[i]).getFullPath());
new UndeployFromServerJob(paths).schedule();
}
@@ -182,7 +182,7 @@
} else {
IModule[] modules = new IModule[objs.length];
for( int i = 0; i < objs.length; i++ ) {
- modules[i] = SingleDeployableFactory.findModule(((IFile)objs[i]).getFullPath());
+ modules[i] =
SingleDeployableFactory.findModule(((IResource)objs[i]).getFullPath());
}
try {
IServerWorkingCopy copy = server.createWorkingCopy();
@@ -204,7 +204,7 @@
protected boolean allFiles(Object[] objs) {
for( int i = 0; i < objs.length; i++ )
- if( !(objs[i] instanceof IFile) )
+ if( !(objs[i] instanceof IResource) )
return false;
return true;
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml 2010-10-14 21:56:53 UTC (rev
25845)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml 2010-10-15 03:38:18 UTC (rev
25846)
@@ -196,7 +196,7 @@
adaptable="true"
id="org.jboss.ide.eclipse.as.ui.popups.makeDeployable.contrib"
nameFilter="*"
- objectClass="org.eclipse.core.resources.IFile">
+ objectClass="org.eclipse.core.resources.IResource">
<action
id="org.jboss.ide.eclipse.as.ui.popups.makeDeployable.action"
label="Make Publishable"