Author: rob.stryker(a)jboss.com
Date: 2007-09-24 13:05:07 -0400 (Mon, 24 Sep 2007)
New Revision: 3772
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServer.java
Log:
Change allowing children to be seen in view
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServer.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServer.java 2007-09-24
15:16:53 UTC (rev 3771)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServer.java 2007-09-24
17:05:07 UTC (rev 3772)
@@ -35,8 +35,10 @@
import org.eclipse.core.runtime.Status;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
+import org.eclipse.jst.server.core.IEnterpriseApplication;
import org.eclipse.jst.server.core.IWebModule;
import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IModuleType;
import org.eclipse.wst.server.core.IRuntime;
import org.eclipse.wst.server.core.IServerWorkingCopy;
import org.eclipse.wst.server.core.ServerPort;
@@ -83,7 +85,29 @@
}
public IModule[] getChildModules(IModule[] module) {
- return null;
+ if (module[0] != null && module[0].getModuleType() != null) {
+ if (module.length == 1) {
+ IModuleType moduleType = module[0].getModuleType();
+ if (moduleType != null && "jst.ear".equals(moduleType.getId())) {
//$NON-NLS-1$
+ IEnterpriseApplication enterpriseApplication = (IEnterpriseApplication) module[0]
+ .loadAdapter(IEnterpriseApplication.class, null);
+ if (enterpriseApplication != null) {
+ IModule[] earModules = enterpriseApplication.getModules();
+ if ( earModules != null) {
+ return earModules;
+ }
+ }
+ }
+ else if (moduleType != null &&
"jst.web".equals(moduleType.getId())) { //$NON-NLS-1$
+ IWebModule webModule = (IWebModule) module[0].loadAdapter(IWebModule.class, null);
+ if (webModule != null) {
+ IModule[] modules = webModule.getModules();
+ return modules;
+ }
+ }
+ }
+ }
+ return new IModule[0];
}
// As of now none of my modules are implementing the parent / child nonesense
Show replies by date