use of org.eclipse.wst.common.componentcore.resources.IVirtualComponent in project webtools.sourceediting by eclipse.
the class FacetModuleCoreSupportDelegate method getReferenced.
static IProject[] getReferenced(IProject current) {
if (!ModuleCoreNature.isFlexibleProject(current))
return new IProject[0];
Set projects = new HashSet();
IVirtualReference[] references = ComponentCore.createComponent(current).getReferences();
if (references != null) {
for (int i = 0; i < references.length; i++) {
IVirtualComponent referencedComponent = references[i].getReferencedComponent();
if (referencedComponent == null)
continue;
IProject project = referencedComponent.getProject();
if (project == null || project.equals(current))
continue;
projects.add(project);
}
}
return (IProject[]) projects.toArray(new IProject[projects.size()]);
}
use of org.eclipse.wst.common.componentcore.resources.IVirtualComponent in project webtools.sourceediting by eclipse.
the class SimpleWebFacetInstallDelegate method execute.
@Override
public void execute(IProject project, IProjectFacetVersion fv, Object config, IProgressMonitor monitor) throws CoreException {
if (monitor != null)
// $NON-NLS-1$
monitor.beginTask("", 1);
try {
IDataModel model = (IDataModel) config;
addNatures(project);
final IVirtualComponent c = ComponentCore.createComponent(project, false);
c.create(0, null);
final IWorkspace ws = ResourcesPlugin.getWorkspace();
final IPath pjpath = project.getFullPath();
final IPath contentdir = setContentPropertyIfNeeded(model, pjpath, project);
mkdirs(ws.getRoot().getFolder(contentdir));
final IVirtualFolder webroot = c.getRootFolder();
if (webroot.getProjectRelativePath().equals(new Path("/"))) {
// $NON-NLS-1$
// $NON-NLS-1$
webroot.createLink(new Path("/" + model.getStringProperty(ISimpleWebFacetInstallDataModelProperties.CONTENT_DIR)), 0, null);
}
ComponentUtilities.setServerContextRoot(project, model.getStringProperty(ISimpleWebFacetInstallDataModelProperties.CONTEXT_ROOT));
try {
((IDataModelOperation) model.getProperty(FacetDataModelProvider.NOTIFICATION_OPERATION)).execute(monitor, null);
} catch (ExecutionException e) {
WSTWebPlugin.logError(e);
}
} finally {
if (monitor != null)
monitor.done();
}
}
use of org.eclipse.wst.common.componentcore.resources.IVirtualComponent in project webtools.sourceediting by eclipse.
the class ComponentDeployable method addUtilMembers.
protected void addUtilMembers(IVirtualComponent vc) {
ArtifactEdit edit = null;
try {
edit = getComponentArtifactEditForRead();
IVirtualReference[] components = vc.getReferences();
for (int i = 0; i < components.length; i++) {
IVirtualReference reference = components[i];
IVirtualComponent virtualComp = reference.getReferencedComponent();
if (shouldIncludeUtilityComponent(virtualComp, components, edit)) {
addUtilMember(vc, reference, reference.getRuntimePath());
}
}
} finally {
if (edit != null)
edit.dispose();
}
}
use of org.eclipse.wst.common.componentcore.resources.IVirtualComponent in project webtools.sourceediting by eclipse.
the class ComponentDeployable method getModules.
public IModule[] getModules() {
List<IModule> modules = new ArrayList<IModule>();
if (component != null) {
IVirtualReference[] components = getReferences(component);
for (int i = 0; i < components.length; i++) {
IVirtualReference reference = components[i];
if (reference != null && reference.getDependencyType() == IVirtualReference.DEPENDENCY_TYPE_USES) {
IVirtualComponent virtualComp = reference.getReferencedComponent();
IModule module = gatherModuleReference(component, virtualComp);
if (module != null && !modules.contains(module))
modules.add(module);
}
}
}
return modules.toArray(new IModule[modules.size()]);
}
use of org.eclipse.wst.common.componentcore.resources.IVirtualComponent in project mdw-designer by CenturyLinkCloud.
the class WorkflowProject method getEarContentFolder.
public IFolder getEarContentFolder() {
if (isCloudProject()) {
return getSourceProject().getFolder(new Path("deploy/ear"));
} else // ear project
{
IVirtualComponent earComponent = ComponentCore.createComponent(getEarProject());
if (earComponent == null)
return null;
IVirtualFolder earRootFolder = earComponent.getRootFolder();
return (IFolder) earRootFolder.getUnderlyingFolder();
}
}
Aggregations