use of org.eclipse.wst.common.componentcore.internal.flat.IChildModuleReference in project webtools.sourceediting by eclipse.
the class FlatComponentDeployable method getExportModelChildren.
public IChildModuleReference[] getExportModelChildren() throws CoreException {
IFlatVirtualComponent em = getFlatComponent();
IChildModuleReference[] children = em.getChildModules();
return children;
}
use of org.eclipse.wst.common.componentcore.internal.flat.IChildModuleReference in project webtools.sourceediting by eclipse.
the class FlatComponentDeployable method getURI.
/**
* Returns the URI of the given contained CHILD module.
*
* SOFT requirements (NOT API!!) in use by some adopters
* If the passed in module is equal to this module, return our own deployed name
*
* @param module a module
* @return the URI of the given module, or <code>null</code> if the URI could
* not be found
*/
public String getURI(IModule module) {
ProjectModule md = (ProjectModule) module.loadAdapter(ProjectModule.class, new NullProgressMonitor());
if (md == this) {
// guess my own name
return VirtualReferenceUtilities.INSTANCE.getDefaultProjectArchiveName(this.component);
}
try {
FlatComponentDeployable cd = (FlatComponentDeployable) module.loadAdapter(FlatComponentDeployable.class, new NullProgressMonitor());
if (cd != null) {
IFlatVirtualComponent em = getFlatComponent();
IChildModuleReference[] children = em.getChildModules();
for (int i = 0; i < children.length; i++) {
IModule child = gatherModuleReference(component, children[i]);
if (child != null && child.getId().equals(module.getId()))
return children[i].getRelativeURI().toString();
}
}
} catch (CoreException ce) {
}
return null;
}
use of org.eclipse.wst.common.componentcore.internal.flat.IChildModuleReference in project webtools.sourceediting by eclipse.
the class FlatComponentDeployable method getModules.
public IModule[] getModules() {
// Legacy, here in case the old modules are used
if (component.isBinary())
return new IModule[] {};
try {
List<IModule> modules = new ArrayList<IModule>();
IChildModuleReference[] children = getExportModelChildren();
for (int i = 0; i < children.length; i++) {
IModule child = gatherModuleReference(component, children[i]);
if (child != null)
modules.add(child);
}
return modules.toArray(new IModule[modules.size()]);
} catch (CoreException ce) {
}
return new IModule[] {};
}
Aggregations