JBoss Tools SVN: r3742 - trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/xpl.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-09-20 19:43:34 -0400 (Thu, 20 Sep 2007)
New Revision: 3742
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/xpl/ServerSourcePathComputerDelegate.java
Log:
removing compiler warnings (generics)
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/xpl/ServerSourcePathComputerDelegate.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/xpl/ServerSourcePathComputerDelegate.java 2007-09-20 23:41:49 UTC (rev 3741)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/xpl/ServerSourcePathComputerDelegate.java 2007-09-20 23:43:34 UTC (rev 3742)
@@ -39,19 +39,19 @@
public ISourceContainer[] computeSourceContainers(ILaunchConfiguration configuration, IProgressMonitor monitor) throws CoreException {
IRuntimeClasspathEntry[] unresolvedEntries = JavaRuntime.computeUnresolvedSourceLookupPath(configuration);
- List sourcefolderList = new ArrayList();
+ List<FolderSourceContainer> sourcefolderList = new ArrayList<FolderSourceContainer>();
IServer server = ServerUtil.getServer(configuration);
IModule[] modules = server.getModules();
- List javaProjectList = new ArrayList();
+ List<IJavaProject> javaProjectList = new ArrayList<IJavaProject>();
processModules(sourcefolderList, modules, javaProjectList, server,monitor);
IRuntimeClasspathEntry[] projectEntries = new IRuntimeClasspathEntry[javaProjectList.size()];
for (int i = 0; i < javaProjectList.size(); i++) {
- projectEntries[i] = JavaRuntime.newProjectRuntimeClasspathEntry((IJavaProject)javaProjectList.get(i));
+ projectEntries[i] = JavaRuntime.newProjectRuntimeClasspathEntry(javaProjectList.get(i));
}
IRuntimeClasspathEntry[] entries = new IRuntimeClasspathEntry[projectEntries.length+unresolvedEntries.length];
System.arraycopy(unresolvedEntries,0,entries,0,unresolvedEntries.length);
@@ -71,7 +71,7 @@
}
- private void processModules(List sourcefolderList, IModule[] modules, List javaProjectList, IServer server, IProgressMonitor monitor) {
+ private void processModules(List<FolderSourceContainer> sourcefolderList, IModule[] modules, List<IJavaProject> javaProjectList, IServer server, IProgressMonitor monitor) {
for (int i = 0; i < modules.length; i++) {
IProject project = modules[i].getProject();
IModule[] pModule = new IModule[1];
17 years, 3 months
JBoss Tools SVN: r3741 - trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-09-20 19:41:49 -0400 (Thu, 20 Sep 2007)
New Revision: 3741
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/ArchivesBuildListener.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/ArchivesModelModuleContributor.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/PackageModuleFactory.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/SingleDeployableFactory.java
Log:
removing compiler warnings (generics)
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/ArchivesBuildListener.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/ArchivesBuildListener.java 2007-09-20 23:26:55 UTC (rev 3740)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/ArchivesBuildListener.java 2007-09-20 23:41:49 UTC (rev 3741)
@@ -116,7 +116,7 @@
public static DeployableServerBehavior[] getServers(String servers) {
if( servers == null || "".equals(servers))
return null;
- ArrayList list = new ArrayList();
+ ArrayList<DeployableServerBehavior> list = new ArrayList<DeployableServerBehavior>();
String[] byId = servers.split(",");
for( int i = 0; i < byId.length; i++ ) {
IServer server = ServerCore.findServer(byId[i]);
@@ -127,7 +127,7 @@
}
}
}
- return (DeployableServerBehavior[]) list.toArray(new DeployableServerBehavior[list.size()]);
+ return list.toArray(new DeployableServerBehavior[list.size()]);
}
/*
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/ArchivesModelModuleContributor.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/ArchivesModelModuleContributor.java 2007-09-20 23:26:55 UTC (rev 3740)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/ArchivesModelModuleContributor.java 2007-09-20 23:41:49 UTC (rev 3741)
@@ -26,10 +26,10 @@
}
private PackageModuleFactory factory;
- protected ArrayList modules = null;
- protected HashMap projectToModules = new HashMap(5); //IPath to IModule
- protected HashMap moduleDelegates = new HashMap(5);
- protected HashMap packageToModule = new HashMap(5);
+ protected ArrayList<IModule> modules = null;
+ protected HashMap<IPath, ArrayList<IModule>> projectToModules = new HashMap<IPath, ArrayList<IModule>>(5); //IPath to IModule
+ protected HashMap<IModule, Object> moduleDelegates = new HashMap<IModule, Object>(5);
+ protected HashMap<IArchive, IModule> packageToModule = new HashMap<IArchive, IModule>(5);
private ArchivesModelModuleContributor(PackageModuleFactory factory) {
this.factory = factory;
@@ -37,7 +37,7 @@
public IModule[] getModules() {
if( modules == null ) {
- modules = new ArrayList();
+ modules = new ArrayList<IModule>();
IProject[] projects2 = ResourcesPlugin.getWorkspace().getRoot().getProjects();
int size = projects2.length;
for (int i = 0; i < size; i++) {
@@ -46,7 +46,7 @@
}
}
}
- return (IModule[]) modules.toArray(new IModule[modules.size()]);
+ return modules.toArray(new IModule[modules.size()]);
}
protected void createModules(IProject project) {
@@ -54,8 +54,9 @@
if( packs != null && packs.length > 0 ) {
IModule module;
IArchive[] packages = ArchivesModelCore.getProjectPackages(project.getLocation(), new NullProgressMonitor(), true);
- boolean requiresSave = ensureArchivesHaveIDs(project, packages);
- ArrayList mods = new ArrayList();
+ /*boolean requiresSave = */
+ ensureArchivesHaveIDs(project, packages);
+ ArrayList<IModule> mods = new ArrayList<IModule>();
for( int i = 0; i < packages.length; i++ ) {
module = factory.createModule2(packages[i], project);
modules.add(module);
@@ -78,11 +79,11 @@
public void refreshProject(IPath projectLoc) {
// remove old mods
- ArrayList mods = (ArrayList)projectToModules.get(projectLoc);
+ ArrayList<IModule> mods = projectToModules.get(projectLoc);
IModule mod;
IArchive arc;
if (mods != null) {
- for( Iterator i = mods.iterator(); i.hasNext();) {
+ for( Iterator<IModule> i = mods.iterator(); i.hasNext();) {
mod = (IModule)i.next();
if( moduleDelegates.get(mod) != null ) {
arc = ((PackagedModuleDelegate)moduleDelegates.get(mod)).getPackage();
@@ -92,7 +93,6 @@
}
}
createModules(findProject(projectLoc));
- factory.clearModuleCache();
}
protected IProject findProject(IPath projectLoc) {
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/PackageModuleFactory.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/PackageModuleFactory.java 2007-09-20 23:26:55 UTC (rev 3740)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/PackageModuleFactory.java 2007-09-20 23:41:49 UTC (rev 3741)
@@ -171,11 +171,11 @@
public IModule[] getModules() {
- ArrayList list = new ArrayList();
+ ArrayList<IModule> list = new ArrayList<IModule>();
for( int i = 0; i < moduleContributors.length; i++ ) {
list.addAll(Arrays.asList(moduleContributors[i].getModules()));
}
- return (IModule[]) list.toArray(new IModule[list.size()]);
+ return list.toArray(new IModule[list.size()]);
}
public ModuleDelegate getModuleDelegate(IModule module) {
@@ -202,15 +202,15 @@
public static class DelegateInitVisitor implements IArchiveNodeVisitor {
private IArchive pack;
- private HashMap members; // node -> imoduleresource
- private HashMap pathToNode; // path -> node
+ private HashMap<IArchiveNode, ArchiveContainerResource> members; // node -> imoduleresource
+ private HashMap<IPath, IArchiveNode> pathToNode; // path -> node
public DelegateInitVisitor(IArchive pack) {
this.pack = pack;
reset();
}
public void reset() {
- members = new HashMap();
- pathToNode = new HashMap();
+ members = new HashMap<IArchiveNode, ArchiveContainerResource>();
+ pathToNode = new HashMap<IPath, IArchiveNode>();
}
public boolean visit(IArchiveNode node) {
int type = node.getNodeType();
@@ -222,13 +222,13 @@
String name = type == IArchiveNode.TYPE_ARCHIVE ? ((IArchive)node).getName() : ((IArchiveFolder)node).getName();
// if we're any other archive or a folder, create us and add to parent
IArchiveNode parent = node.getParent();
- ArchiveContainerResource parentAsResource = (ArchiveContainerResource)members.get(parent);
+ ArchiveContainerResource parentAsResource = members.get(parent);
IPath rel = node.getRootArchiveRelativePath();
members.put(node, new ArchiveContainerResource(name, node, rel));
pathToNode.put(rel, node);
- parentAsResource.addChild((IModuleResource)members.get(node));
+ parentAsResource.addChild(members.get(node));
} else if( type == IArchiveNode.TYPE_ARCHIVE_FILESET ) {
- ArchiveContainerResource parentAsResource = (ArchiveContainerResource)members.get(node.getParent());
+ ArchiveContainerResource parentAsResource = members.get(node.getParent());
parentAsResource.addFilesetAsChild((IArchiveFileSet)node);
}
@@ -236,11 +236,11 @@
}
public IModuleResource getRootResource() {
- return (IModuleResource)members.get(pack);
+ return members.get(pack);
}
public IModuleResource getResourceForNode(IArchiveNode node) {
- return (IModuleResource)members.get(node);
+ return members.get(node);
}
}
@@ -249,7 +249,7 @@
protected IPath moduleRelativePath;
protected IArchiveNode node;
protected String name;
- private HashMap members;
+ private HashMap<IPath, IModuleResource> members;
// represents source folder on disk. only used if node is fileset
private IPath folderGlobalPath = null;
@@ -257,7 +257,7 @@
this.name = name;
this.node = node;
this.moduleRelativePath = moduleRelativePath;
- members = new HashMap();
+ members = new HashMap<IPath, IModuleResource>();
if( node instanceof IArchiveFileSet) {
IPath tmp = moduleRelativePath.removeFirstSegments(node.getParent().getRootArchiveRelativePath().segmentCount());
folderGlobalPath = ((IArchiveFileSet)node).getGlobalSourcePath().append(tmp);
@@ -284,7 +284,7 @@
members.remove(moduleRelativePath);
}
public IModuleResource getChild(IPath path) {
- return (IModuleResource)members.get(path);
+ return members.get(path);
}
public void addFilesetAsChild(IArchiveFileSet fs) {
@@ -331,8 +331,8 @@
}
public IModuleResource[] members() {
- Collection c = members.values();
- return (IModuleResource[]) c.toArray(new IModuleResource[c.size()]);
+ Collection<IModuleResource> c = members.values();
+ return c.toArray(new IModuleResource[c.size()]);
}
public IPath getModuleRelativePath() {
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 2007-09-20 23:26:55 UTC (rev 3740)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/SingleDeployableFactory.java 2007-09-20 23:41:49 UTC (rev 3741)
@@ -76,11 +76,11 @@
- private HashMap moduleIdToModule;
- private HashMap moduleToDelegate;
+ private HashMap<IPath, IModule> moduleIdToModule;
+ private HashMap<IModule, SingleDeployableModuleDelegate> moduleToDelegate;
public SingleDeployableFactory() {
- moduleIdToModule = new HashMap();
- moduleToDelegate = new HashMap();
+ moduleIdToModule = new HashMap<IPath, IModule>();
+ moduleToDelegate = new HashMap<IModule, SingleDeployableModuleDelegate>();
String files = JBossServerCorePlugin.getDefault().getPluginPreferences().getString(PREFERENCE_KEY);
if( files.equals("")) return;
String[] files2 = files.split(DELIM);
@@ -90,13 +90,13 @@
}
public IModule getModule(IPath path) {
- return (IModule)moduleIdToModule.get(path);
+ return moduleIdToModule.get(path);
}
public void saveDeployableList() {
- Iterator i = moduleIdToModule.keySet().iterator();
+ Iterator<IPath> i = moduleIdToModule.keySet().iterator();
String val = "";
while(i.hasNext()) {
- val += ((IPath)i.next()).toString() + DELIM;
+ val += i.next().toString() + DELIM;
}
JBossServerCorePlugin.getDefault().getPluginPreferences().setValue(PREFERENCE_KEY, val);
JBossServerCorePlugin.getDefault().savePluginPreferences();
@@ -115,18 +115,18 @@
}
protected void removeModule(IPath path) {
- IModule mod = (IModule)moduleIdToModule.get(path);
+ IModule mod = moduleIdToModule.get(path);
moduleIdToModule.remove(path);
moduleToDelegate.remove(mod);
}
public IModule[] getModules() {
- Collection c = moduleIdToModule.values();
- return (IModule[]) c.toArray(new IModule[c.size()]);
+ Collection<IModule> c = moduleIdToModule.values();
+ return c.toArray(new IModule[c.size()]);
}
public ModuleDelegate getModuleDelegate(IModule module) {
- return (ModuleDelegate)moduleToDelegate.get(module);
+ return moduleToDelegate.get(module);
}
public class SingleDeployableModuleDelegate extends ModuleDelegate {
17 years, 3 months
JBoss Tools SVN: r3740 - trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-09-20 19:26:55 -0400 (Thu, 20 Sep 2007)
New Revision: 3740
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/ModuleViewProvider.java
Log:
Ensuring modules are added appropriately to the list of modules
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/ModuleViewProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/ModuleViewProvider.java 2007-09-20 23:26:50 UTC (rev 3739)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/ModuleViewProvider.java 2007-09-20 23:26:55 UTC (rev 3740)
@@ -72,20 +72,22 @@
deleteModuleAction = new Action() {
public void run() {
if (MessageDialog.openConfirm(new Shell(), Messages.ServerDialogHeading, Messages.DeleteModuleConfirm)) {
- try {
- IServerWorkingCopy server = selection.server.createWorkingCopy();
- ServerUtil.modifyModules(server, null, selection.module, new NullProgressMonitor());
- IServer server2 = server.save(true, null);
-
- if( ServerConverter.getDeployableServer(selection.server) != null ) {
- ServerConverter.getDeployableServerBehavior(selection.server)
- .publishOneModule(IServer.PUBLISH_FULL, selection.module, ServerBehaviourDelegate.REMOVED, new NullProgressMonitor());
- } else {
- server2.publish(IServer.PUBLISH_INCREMENTAL, new NullProgressMonitor());
+ Thread t = new Thread() { public void run() {
+ try {
+ IServerWorkingCopy server = selection.server.createWorkingCopy();
+ IServer server2 = server.save(true, null);
+
+ if( ServerConverter.getDeployableServer(selection.server) != null ) {
+ ServerConverter.getDeployableServerBehavior(selection.server)
+ .publishOneModule(IServer.PUBLISH_FULL, selection.module, ServerBehaviourDelegate.REMOVED, new NullProgressMonitor());
+ } else {
+ server2.publish(IServer.PUBLISH_INCREMENTAL, new NullProgressMonitor());
+ }
+ } catch (Exception e) {
+ // ignore
}
- } catch (Exception e) {
- // ignore
- }
+ }};
+ t.start();
}
}
};
@@ -171,7 +173,7 @@
}
return ms2;
} catch (Exception e) {
- return null;
+ return new Object[]{};
}
}
@@ -186,7 +188,7 @@
}
return ms;
}
- return null;
+ return new Object[] {};
}
public Object getParent(Object element) {
17 years, 3 months
JBoss Tools SVN: r3739 - trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-09-20 19:26:50 -0400 (Thu, 20 Sep 2007)
New Revision: 3739
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerBehavior.java
Log:
Ensuring modules are added appropriately to the list of modules
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerBehavior.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerBehavior.java 2007-09-20 22:29:14 UTC (rev 3738)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerBehavior.java 2007-09-20 23:26:50 UTC (rev 3739)
@@ -7,10 +7,13 @@
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.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.IServerWorkingCopy;
+import org.eclipse.wst.server.core.ServerUtil;
import org.eclipse.wst.server.core.internal.IModuleVisitor;
import org.eclipse.wst.server.core.internal.ProgressUtil;
import org.eclipse.wst.server.core.internal.Server;
@@ -133,6 +136,9 @@
// Basically stolen from RunOnServerActionDelegate
public IStatus publishOneModule(int kind, IModule[] module, int deltaKind, IProgressMonitor monitor) {
+ // add it to the server first
+ addAndRemoveModules(module, deltaKind);
+
ArrayList moduleList = new ArrayList();
ArrayList deltaKindList = new ArrayList();
moduleList.add(module);
@@ -174,19 +180,19 @@
return Status.CANCEL_STATUS;
}
-// protected void addAndRemoveModules(IModule[] module, int deltaKind) {
-// if( getServer() == null ) return;
-// boolean contains = ServerUtil.containsModule(getServer(), module[0], new NullProgressMonitor());
-// try {
-// if( !contains && (deltaKind == ServerBehaviourDelegate.ADDED) || (deltaKind == ServerBehaviourDelegate.CHANGED)) {
-// IServerWorkingCopy wc = getServer().createWorkingCopy();
-// ServerUtil.modifyModules(wc, module, new IModule[0], new NullProgressMonitor());
-// wc.save(false, new NullProgressMonitor());
-// } else if( contains && deltaKind == ServerBehaviourDelegate.REMOVED) {
-// IServerWorkingCopy wc = getServer().createWorkingCopy();
-// ServerUtil.modifyModules(wc, new IModule[0], module, new NullProgressMonitor());
-// wc.save(false, new NullProgressMonitor());
-// }
-// } catch( Exception e ) {} // swallowed
-// }
+ protected void addAndRemoveModules(IModule[] module, int deltaKind) {
+ if( getServer() == null ) return;
+ boolean contains = ServerUtil.containsModule(getServer(), module[0], new NullProgressMonitor());
+ try {
+ if( !contains && (deltaKind == ServerBehaviourDelegate.ADDED) || (deltaKind == ServerBehaviourDelegate.CHANGED)) {
+ IServerWorkingCopy wc = getServer().createWorkingCopy();
+ ServerUtil.modifyModules(wc, module, new IModule[0], new NullProgressMonitor());
+ wc.save(false, new NullProgressMonitor());
+ } else if( contains && deltaKind == ServerBehaviourDelegate.REMOVED) {
+ IServerWorkingCopy wc = getServer().createWorkingCopy();
+ ServerUtil.modifyModules(wc, new IModule[0], module, new NullProgressMonitor());
+ wc.save(false, new NullProgressMonitor());
+ }
+ } catch( Exception e ) {} // swallowed
+ }
}
17 years, 3 months
JBoss Tools SVN: r3738 - trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/build.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-09-20 18:29:14 -0400 (Thu, 20 Sep 2007)
New Revision: 3738
Modified:
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/build/ArchiveBuildDelegate.java
Log:
null check
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/build/ArchiveBuildDelegate.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/build/ArchiveBuildDelegate.java 2007-09-20 19:44:42 UTC (rev 3737)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/build/ArchiveBuildDelegate.java 2007-09-20 22:29:14 UTC (rev 3738)
@@ -61,6 +61,7 @@
EventManager.startedBuild(project);
IArchiveModelNode root = ArchivesModel.instance().getRoot(project);
+ if( root == null ) return;
IArchiveNode[] nodes = root.getChildren(IArchiveNode.TYPE_ARCHIVE);
for( int i = 0; i < nodes.length; i++ ) {
fullArchiveBuild(((IArchive)nodes[i]));
17 years, 3 months
JBoss Tools SVN: r3737 - in trunk/seam/plugins/org.jboss.tools.seam.ui: src/org/jboss/tools/seam/ui/wizard and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2007-09-20 15:44:42 -0400 (Thu, 20 Sep 2007)
New Revision: 3737
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEnitiesWizard.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-906
Fix Test NG problem for EAR deployment
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml 2007-09-20 19:44:37 UTC (rev 3736)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml 2007-09-20 19:44:42 UTC (rev 3737)
@@ -122,6 +122,21 @@
relative="org.eclipse.ui.views.TaskList">
</view>
</perspectiveExtension>
+ <perspectiveExtension
+ targetID="org.jboss.tools.seam.ui.SeamPerspective">
+ <newWizardShortcut
+ id="org.jboss.tools.seam.ui.wizards.SeamProjectWizard">
+ </newWizardShortcut>
+ <newWizardShortcut
+ id="org.jboss.tools.seam.ui.wizard.SeamActionWizard">
+ </newWizardShortcut>
+ <newWizardShortcut
+ id="org.jboss.tools.seam.ui.wizard.SeamFormWizard">
+ </newWizardShortcut>
+ <newWizardShortcut
+ id="org.jboss.tools.seam.ui.SeamGenerateEntitiesWizard">
+ </newWizardShortcut>
+ </perspectiveExtension>
</extension>
<extension point="org.eclipse.ui.navigator.viewer">
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEnitiesWizard.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEnitiesWizard.java 2007-09-20 19:44:37 UTC (rev 3736)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEnitiesWizard.java 2007-09-20 19:44:42 UTC (rev 3737)
@@ -23,7 +23,6 @@
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.Status;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunchConfigurationType;
@@ -37,10 +36,10 @@
import org.hibernate.eclipse.console.model.impl.ExporterDefinition;
import org.hibernate.eclipse.launch.HibernateLaunchConstants;
import org.jboss.tools.seam.core.SeamCorePlugin;
-import org.jboss.tools.seam.core.project.facet.SeamFacetPreference;
import org.jboss.tools.seam.core.project.facet.SeamRuntime;
import org.jboss.tools.seam.core.project.facet.SeamRuntimeManager;
import org.jboss.tools.seam.internal.core.project.facet.ISeamFacetDataModelProperties;
+import org.jboss.tools.seam.ui.SeamGuiPlugin;
import org.jboss.tools.seam.ui.SeamUIMessages;
/**
@@ -116,7 +115,7 @@
launchManager.addLaunch(wc.launch(ILaunchManager.RUN_MODE, monitor));
} catch (CoreException e) {
- SeamCorePlugin.getPluginLog().logError(e);
+ SeamGuiPlugin.getPluginLog().logError(e);
}
return Status.OK_STATUS;
}
17 years, 3 months
JBoss Tools SVN: r3736 - in trunk/seam/plugins/org.jboss.tools.seam.core: templates/ejb/ejbModule/META-INF and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2007-09-20 15:44:37 -0400 (Thu, 20 Sep 2007)
New Revision: 3736
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegete.java
trunk/seam/plugins/org.jboss.tools.seam.core/templates/ejb/ejbModule/META-INF/MANIFEST.MF
trunk/seam/plugins/org.jboss.tools.seam.core/templates/test/.classpath
trunk/seam/plugins/org.jboss.tools.seam.core/templates/war/META-INF/MANIFEST.MF
Log:
http://jira.jboss.com/jira/browse/JBIDE-906
Fix Test NG problem for EAR deployment
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegete.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegete.java 2007-09-20 15:59:50 UTC (rev 3735)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegete.java 2007-09-20 19:44:37 UTC (rev 3736)
@@ -12,6 +12,7 @@
import java.io.File;
import java.io.FileOutputStream;
+import java.io.FilenameFilter;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.util.Properties;
@@ -335,6 +336,8 @@
if(model.getProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATH)!=null)
AntCopyUtils.copyFiles((String[])model.getProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATH), webLibFolder);
+
+
Job create = new DataSourceXmlDeployer(project);
create.setRule(ResourcesPlugin.getWorkspace().getRoot());
create.schedule();
@@ -347,12 +350,8 @@
AntCopyUtils.copyFiles(seamHomeFolder,webLibFolder,new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(JBOSS_WAR_LIB_FILESET_EAR_CONFIG).dir(seamHomeFolder)));
AntCopyUtils.copyFiles(seamLibFolder,webLibFolder,new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(JBOSS_WAR_LIB_FILESET_EAR_CONFIG).dir(seamLibFolder)));
AntCopyUtils.copyFiles(droolsLibFolder,webLibFolder,new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(JBOSS_WAR_LIB_FILESET_EAR_CONFIG).dir(droolsLibFolder)));
- try {
- AntCopyUtils.copyFileToFolder(new File(SeamFacetInstallDataModelProvider.getTemplatesFolder(),"war/META-INF/MANIFEST.MF"), webMetaInf, new FilterSetCollection(projectFilterSet), true);
- } catch (IOException e) {
- SeamCorePlugin.getPluginLog().logError(e);
- }
+
File ear = new File(project.getLocation().removeLastSegments(1).toFile(),model.getProperty(ISeamFacetDataModelProperties.SEAM_PROJECT_NAME)+"-ear");
File ejb = new File(project.getLocation().removeLastSegments(1).toFile(),model.getProperty(ISeamFacetDataModelProperties.SEAM_PROJECT_NAME)+"-ejb");
ear.mkdir();
@@ -439,10 +438,39 @@
AntCopyUtils.copyFiles(droolsLibFolder,earContentsFolder,new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(JBOSS_EAR_CONTENT).dir(droolsLibFolder)));
AntCopyUtils.copyFiles(seamLibFolder,earContentsFolder,new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(JBOSS_EAR_CONTENT).dir(seamLibFolder)));
AntCopyUtils.copyFiles(seamGenResFolder,earContentsFolder,new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(JBOSS_EAR_CONTENT).dir(seamGenResFolder)));
-
- // Copy JDBC driver if there is any
+
+
+
if(model.getProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATH)!=null)
AntCopyUtils.copyFiles((String[])model.getProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATH), earContentsFolder);
+
+ try {
+
+ File[] earJars = earContentsFolder.listFiles(new FilenameFilter() {
+ /* (non-Javadoc)
+ * @see java.io.FilenameFilter#accept(java.io.File, java.lang.String)
+ */
+ public boolean accept(File dir, String name) {
+ if(name.lastIndexOf(".jar")>0) return true;
+ return false;
+ }
+ });
+ String earJarsStr = "";
+ for (File file : earJars) {
+ earJarsStr +=" " + file.getName() +" \n";
+ }
+
+ FilterSetCollection manifestFilterCol = new FilterSetCollection(projectFilterSet);
+ FilterSet manifestFilter = new FilterSet();
+ manifestFilter.addFilter("earLibs",earJarsStr);
+ manifestFilterCol.addFilterSet(manifestFilter);
+ AntCopyUtils.copyFileToFolder(new File(SeamFacetInstallDataModelProvider.getTemplatesFolder(),"war/META-INF/MANIFEST.MF"), webMetaInf, manifestFilterCol, true);
+ File ejbMetaInf = new File(ejb,"ejbModule/META-INF");
+ AntCopyUtils.copyFileToFolder(new File(SeamFacetInstallDataModelProvider.getTemplatesFolder(),"ejb/ejbModule/META-INF/MANIFEST.MF"), ejbMetaInf, manifestFilterCol, true);
+ } catch (IOException e) {
+ SeamCorePlugin.getPluginLog().logError(e);
+ }
+
} catch (IOException e) {
SeamCorePlugin.getPluginLog().logError(e);
}
@@ -587,6 +615,7 @@
new AntCopyUtils.FileSetFileFilter(includeLibs));
createComponentsProperties(testSrcDir, seamWebProject.getName(), Boolean.TRUE);
+
}
/**
@@ -595,7 +624,7 @@
private void createComponentsProperties(final File seamGenResFolder, String seamWebProjectName, Boolean embedded) {
Properties components = new Properties();
components.put("embeddedEjb", embedded.toString());
- components.put("jndiPattern", seamWebProjectName+"/#{ejbName}/local");
+ components.put("jndiPattern", "/#{ejbName}/local");
File componentsProps = new File(seamGenResFolder,"components.properties");
try {
componentsProps.createNewFile();
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/templates/ejb/ejbModule/META-INF/MANIFEST.MF
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/templates/ejb/ejbModule/META-INF/MANIFEST.MF 2007-09-20 15:59:50 UTC (rev 3735)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/templates/ejb/ejbModule/META-INF/MANIFEST.MF 2007-09-20 19:44:37 UTC (rev 3736)
@@ -1,3 +1,2 @@
Manifest-Version: 1.0
-Class-Path: jboss-seam.jar
-@driverJar@
\ No newline at end of file
+Class-Path: @earLibs@
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/templates/test/.classpath
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/templates/test/.classpath 2007-09-20 15:59:50 UTC (rev 3735)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/templates/test/.classpath 2007-09-20 19:44:37 UTC (rev 3736)
@@ -3,7 +3,7 @@
<classpathentry kind="src" path="test-src"/>
<classpathentry kind="src" path="embedded-ejb"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+@testLibraries@<classpathentry kind="lib" path="/@projectName@/WebContent"/>
@requiredProjects@
-@testLibraries@<classpathentry kind="lib" path="/@projectName@/WebContent"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/templates/war/META-INF/MANIFEST.MF
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/templates/war/META-INF/MANIFEST.MF 2007-09-20 15:59:50 UTC (rev 3735)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/templates/war/META-INF/MANIFEST.MF 2007-09-20 19:44:37 UTC (rev 3736)
@@ -1,4 +1,3 @@
Manifest-Version: 1.0
-Class-Path: jboss-seam.jar
- @projectName(a)-ejb.jar
-
+Class-Path: @projectName(a)-ejb.jar
+@earLibs@
\ No newline at end of file
17 years, 3 months
JBoss Tools SVN: r3735 - in trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core: validation and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-09-20 11:59:50 -0400 (Thu, 20 Sep 2007)
New Revision: 3735
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java
Log:
JBIDE-922
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java 2007-09-20 13:28:01 UTC (rev 3734)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java 2007-09-20 15:59:50 UTC (rev 3735)
@@ -758,10 +758,23 @@
factories.remove();
allVariables.remove(f);
fireChanges(changes);
+// System.out.println("Factory removed 1 " + f.getName());
}
}
+
+ firePathRemovedToDependentProjects(source);
}
-
+
+ public void firePathRemovedToDependentProjects(IPath source) {
+ if(usedBy.size() == 0) return;
+ if(source.toString().endsWith(".jar")) return;
+
+ for (SeamProject p : usedBy) {
+ p.resolve();
+ p.pathRemoved(source);
+ }
+ }
+
/**
*
* @param source
@@ -866,6 +879,7 @@
if(removed.containsKey(c.getId())) {
iterator.remove();
allVariables.remove(c);
+// System.out.println("Factory removed 2 " + c.getName());
changes = Change.addChange(changes, new Change(this, null, c, null));
}
}
@@ -1051,6 +1065,7 @@
*/
public void removeFactory(ISeamFactory factory) {
allFactories.remove(factory);
+// System.out.println("Factory removed 3 " + factory.getName());
allVariables.remove(factory);
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java 2007-09-20 13:28:01 UTC (rev 3734)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java 2007-09-20 15:59:50 UTC (rev 3735)
@@ -206,6 +206,21 @@
}
private void validateFactory(ISeamFactory factory, Set<String> markedDuplicateFactoryNames) {
+
+ if(factory.getResource() == null) {
+ IPath source = factory.getSourcePath();
+ String name = factory.getName();
+ String message = null;
+ if(factory.getSeamProject() != null) {
+ factory.getSeamProject().removeFactory(factory);
+ message = "Seam core validator detected factory with null resource " + "(name=" + name + " source=" + source + ").";
+ } else {
+ message = "Seam core validator detected factory with null resource " + "(name=" + name + " source=" + source + ")" + " and null parent in seam model.";
+ }
+ SeamCorePlugin.getPluginLog().logInfo(message);
+ return;
+ }
+
if(coreHelper.isJar(factory.getResource())) {
return;
}
17 years, 3 months
JBoss Tools SVN: r3734 - trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-09-20 09:28:01 -0400 (Thu, 20 Sep 2007)
New Revision: 3734
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/SimpleWebFileLoader.java
Log:
JBIDE-898
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/SimpleWebFileLoader.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/SimpleWebFileLoader.java 2007-09-20 13:27:07 UTC (rev 3733)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/SimpleWebFileLoader.java 2007-09-20 13:28:01 UTC (rev 3734)
@@ -79,8 +79,8 @@
protected Document loadDocument(XModelObject object, String body) {
int resolution = EntityXMLRegistration.getInstance().resolve(object.getModelEntity());
+ if(EntityXMLRegistration.isSystemId(body)) resolution = EntityXMLRegistration.UNRESOLVED;
String[] errors =
-// XMLUtil.getXMLErrors(new StringReader(body), isCheckingDTD(), isCheckingSchema());
XMLUtil.getXMLErrors(new StringReader(body), resolution == EntityXMLRegistration.DTD, resolution == EntityXMLRegistration.SCHEMA);
if(errors != null && errors.length > 0) {
object.setAttributeValue("isIncorrect", "yes");
17 years, 3 months
JBoss Tools SVN: r3733 - in trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web: webapp/model and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-09-20 09:27:07 -0400 (Thu, 20 Sep 2007)
New Revision: 3733
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tld/model/FileTLDRecognizer.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/webapp/model/FileWebAppRecognizer.java
Log:
JBIDE-898
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tld/model/FileTLDRecognizer.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tld/model/FileTLDRecognizer.java 2007-09-20 13:22:34 UTC (rev 3732)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tld/model/FileTLDRecognizer.java 2007-09-20 13:27:07 UTC (rev 3733)
@@ -32,10 +32,19 @@
public FileTLDRecognizer() {}
public String getEntityName(String ext, String body) {
- return (body == null || !"tld".equals(ext)) ? null :
- (body.indexOf(TLD_DOC_PUBLICID_1_1) >= 0) ? "FileTLD_PRO" :
- (body.indexOf(TLD_DOC_PUBLICID_1_2) >= 0) ? "FileTLD_1_2" :
- (body.indexOf("<taglib") >= 0
+ if((body == null || !"tld".equals(ext))) return null;
+ int i = body.indexOf("<!DOCTYPE");
+ if(i >= 0) {
+ int j = body.indexOf(">", i);
+ if(j < 0) return null;
+ String dt = body.substring(i, j);
+ if(dt.indexOf("taglib") < 0) return null;
+ if(dt.indexOf(TLD_DOC_PUBLICID_1_1) > 0) return "FileTLD_PRO";
+ if(dt.indexOf(TLD_DOC_PUBLICID_1_2) > 0) return "FileTLD_1_2";
+ if(dt.indexOf("SYSTEM") > 0 && dt.indexOf("web-jsptaglibrary_1_1.dtd") > 0) return "FileTLD_PRO";
+ if(dt.indexOf("SYSTEM") > 0 && dt.indexOf("web-jsptaglibrary_1_2.dtd") > 0) return "FileTLD_1_2";
+ }
+ return (body.indexOf("<taglib") >= 0
&& body.indexOf(VERSION_2_0) > 0
&& body.indexOf("xmlns=" + XMLNS_2_0) > 0) ? "FileTLD_2_0" :
(isTLD20WithNamespace(body, VERSION_2_0, XMLNS_2_0)) ? "FileTLD_2_0" :
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/webapp/model/FileWebAppRecognizer.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/webapp/model/FileWebAppRecognizer.java 2007-09-20 13:22:34 UTC (rev 3732)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/webapp/model/FileWebAppRecognizer.java 2007-09-20 13:27:07 UTC (rev 3733)
@@ -27,10 +27,19 @@
}
public String getEntityName(String ext, String body) {
- return (body == null || !"xml".equals(ext)) ? null :
- (body.indexOf(WebAppConstants.DOC_PUBLICID) >= 0 ||
- body.indexOf(WebAppConstants.DOC_PUBLICID_2_3) >= 0) ? "FileWebApp" :
- (body.indexOf("<web-app") >= 0
+ if((body == null || !"xml".equals(ext))) return null;
+ int i = body.indexOf("<!DOCTYPE");
+ if(i >= 0) {
+ int j = body.indexOf(">", i);
+ if(j < 0) return null;
+ String dt = body.substring(i, j);
+ if(dt.indexOf("web-app") < 0) return null;
+ if(dt.indexOf(WebAppConstants.DOC_PUBLICID) > 0) return "FileWebApp";
+ if(dt.indexOf(WebAppConstants.DOC_PUBLICID_2_3) > 0) return "FileWebApp";
+ if(dt.indexOf("SYSTEM") > 0 && dt.indexOf("web-app_2_3.dtd") > 0) return "FileWebApp";
+ }
+
+ return (body.indexOf("<web-app") >= 0
&& body.indexOf("version=\"2.4\"") > 0
&& body.indexOf("xmlns=\"http://java.sun.com/xml/ns/j2ee\"") > 0) ? "FileWebApp24" :
(body.indexOf("<web-app") >= 0
17 years, 3 months