use of org.eclipse.jdt.core.IClasspathContainer in project che by eclipse.
the class SetContainerOperation method verbose_set_container.
private void verbose_set_container() {
Util.verbose(//$NON-NLS-1$
"CPContainer SET - setting container\n" + " container path: " + this.containerPath + //$NON-NLS-1$
'\n' + //$NON-NLS-1$
" projects: {" + org.eclipse.jdt.internal.compiler.util.Util.toString(this.affectedProjects, new org.eclipse.jdt.internal.compiler.util.Util.Displayable() {
public String displayString(Object o) {
return ((IJavaProject) o).getElementName();
}
}) + //$NON-NLS-1$
"}\n values: {\n" + org.eclipse.jdt.internal.compiler.util.Util.toString(this.respectiveContainers, new org.eclipse.jdt.internal.compiler.util.Util.Displayable() {
public String displayString(Object o) {
//$NON-NLS-1$
StringBuffer buffer = new StringBuffer(" ");
if (o == null) {
//$NON-NLS-1$
buffer.append("<null>");
return buffer.toString();
}
IClasspathContainer container = (IClasspathContainer) o;
buffer.append(container.getDescription());
//$NON-NLS-1$
buffer.append(" {\n");
IClasspathEntry[] entries = container.getClasspathEntries();
if (entries != null) {
for (int i = 0; i < entries.length; i++) {
//$NON-NLS-1$
buffer.append(" ");
buffer.append(entries[i]);
buffer.append('\n');
}
}
//$NON-NLS-1$
buffer.append(" }");
return buffer.toString();
}
}) + //$NON-NLS-1$
"\n }");
}
use of org.eclipse.jdt.core.IClasspathContainer in project bndtools by bndtools.
the class BndtoolsBuilder method requestClasspathContainerUpdate.
/**
* Request the classpath container be updated for this project.
* <p>
* The classpath container may have added errors to the model which the caller must check for.
*
* @return {@code true} if this project has a bnd classpath container and the classpath was changed. {@code false}
* if this project does not have a bnd classpath container or the classpath was not changed.
*/
private boolean requestClasspathContainerUpdate() throws CoreException {
IJavaProject javaProject = JavaCore.create(getProject());
if (javaProject == null) {
// project is not a java project
return false;
}
IClasspathContainer oldContainer = BndContainerInitializer.getClasspathContainer(javaProject);
if (oldContainer == null) {
// project does not have a BndContainer
return false;
}
BndContainerInitializer.requestClasspathContainerUpdate(javaProject);
return oldContainer != BndContainerInitializer.getClasspathContainer(javaProject);
}
use of org.eclipse.jdt.core.IClasspathContainer in project xtext-xtend by eclipse.
the class XtendContainerInitializer method initialize.
/**
* {@inheritDoc}
*/
@Override
public void initialize(final IPath containerPath, final IJavaProject project) throws CoreException {
if (isXtendPath(containerPath)) {
IClasspathContainer container = new XtendClasspathContainer(containerPath);
JavaCore.setClasspathContainer(containerPath, new IJavaProject[] { project }, new IClasspathContainer[] { container }, null);
}
}
use of org.eclipse.jdt.core.IClasspathContainer in project liferay-ide by liferay.
the class SDKClasspathContainerInitializer method initialize.
@Override
public void initialize(IPath containerPath, IJavaProject project) throws CoreException {
IClasspathContainer classpathContainer = null;
String root = containerPath.segment(0);
if (!SDKClasspathContainer.ID.equals(root)) {
String msg = "Invalid plugin classpath container, expecting container root ";
throw new CoreException(ProjectCore.createErrorStatus(msg + SDKClasspathContainer.ID));
}
PortalBundle bundle = ServerUtil.getPortalBundle(project.getProject());
if (bundle == null) {
String msg = "Invalid sdk properties setting.";
throw new CoreException(ProjectCore.createErrorStatus(msg));
}
IPath globalDir = bundle.getAppServerLibGlobalDir();
IPath portalDir = bundle.getAppServerPortalDir();
IPath bundleDir = bundle.getAppServerDir();
IPath[] bundleDependencyJars = bundle.getBundleDependencyJars();
IPath[] sdkDependencyJarPaths = _getSDKDependencies(project);
if (portalDir == null) {
return;
}
classpathContainer = new SDKClasspathContainer(containerPath, project, portalDir, null, null, globalDir, bundleDir, bundleDependencyJars, sdkDependencyJarPaths);
IJavaProject[] projects = { project };
IClasspathContainer[] containers = { classpathContainer };
JavaCore.setClasspathContainer(containerPath, projects, containers, null);
}
use of org.eclipse.jdt.core.IClasspathContainer in project liferay-ide by liferay.
the class PluginClasspathContainerInitializer method initialize.
@Override
public void initialize(IPath containerPath, IJavaProject project) throws CoreException {
IClasspathContainer classpathContainer = null;
int count = containerPath.segmentCount();
if (count != 2) {
String msg = "Invalid plugin classpath container should expecting 2 segments.";
throw new CoreException(ProjectCore.createErrorStatus(msg));
}
String root = containerPath.segment(0);
if (!ID.equals(root)) {
String msg = "Invalid plugin classpath container, expecting container root ";
throw new CoreException(ProjectCore.createErrorStatus(msg + ID));
}
String finalSegment = containerPath.segment(1);
IPath portalDir = ServerUtil.getPortalDir(project);
if (portalDir == null) {
return;
}
String javadocURL = null;
IPath sourceLocation = null;
try {
ILiferayRuntime liferayRuntime = ServerUtil.getLiferayRuntime(project.getProject());
if (liferayRuntime != null) {
javadocURL = liferayRuntime.getJavadocURL();
sourceLocation = liferayRuntime.getSourceLocation();
}
} catch (Exception e) {
ProjectCore.logError(e);
}
classpathContainer = getCorrectContainer(containerPath, finalSegment, project, portalDir, javadocURL, sourceLocation);
IJavaProject[] projects = { project };
IClasspathContainer[] containers = { classpathContainer };
JavaCore.setClasspathContainer(containerPath, projects, containers, null);
}
Aggregations