Java Code Examples for org.eclipse.jdt.core.IJavaElementDelta#F_CLASSPATH_CHANGED

The following examples show how to use org.eclipse.jdt.core.IJavaElementDelta#F_CLASSPATH_CHANGED . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Activator.java    From google-cloud-eclipse with Apache License 2.0 6 votes vote down vote up
private void visit(IJavaElementDelta delta) {
  switch (delta.getElement().getElementType()) {
    case IJavaElement.JAVA_PROJECT:
      if ((delta.getFlags() & IJavaElementDelta.F_CLASSPATH_CHANGED) != 0) {
        final IJavaProject javaProject = (IJavaProject) delta.getElement();
        Job updateContainerStateJob = new WorkspaceJob("Updating Google Cloud libraries") {
          @Override
          public IStatus runInWorkspace(IProgressMonitor monitor) {
            BuildPath.checkLibraryList(javaProject, null);
            return Status.OK_STATUS;
          }
        };
        IWorkspace workspace = javaProject.getProject().getWorkspace();
        ISchedulingRule buildRule = workspace.getRuleFactory().buildRule();
        updateContainerStateJob.setRule(buildRule);
        updateContainerStateJob.setSystem(true);
        updateContainerStateJob.schedule();
      }
      break;
    case IJavaElement.JAVA_MODEL:
      visitChildren(delta);
      break;
    default:
      break;
  }
}
 
Example 2
Source File: ClasspathChangedListener.java    From gwt-eclipse-plugin with Eclipse Public License 1.0 5 votes vote down vote up
public void elementChanged(ElementChangedEvent event) {
  for (IJavaElementDelta delta : event.getDelta().getChangedChildren()) {
    int flags = delta.getFlags();
    if ((flags & IJavaElementDelta.F_CLASSPATH_CHANGED) != 0) {
      IJavaElement element = delta.getElement();
      if (element.getElementType() != IJavaElement.JAVA_PROJECT) {
        continue;
      }

      classpathChanged((IJavaProject) element);
    }
  }
}
 
Example 3
Source File: JavaProjectClasspathChangeAnalyzer.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
/**
 * Determines if the change i a classpath change on a project
 * 
 * @param delta the IJavaElementDelta to analyze. the deltas element must be an instance of IProject
 */
public boolean isClasspathChangeOnProject(IJavaElementDelta delta) {
	assert (delta.getElement() instanceof IJavaProject);
	return (delta.getFlags() & IJavaElementDelta.F_CLASSPATH_CHANGED) != 0
			|| (delta.getFlags() & IJavaElementDelta.F_RESOLVED_CLASSPATH_CHANGED) != 0;
}
 
Example 4
Source File: ClasspathChagedListener.java    From hybris-commerce-eclipse-plugin with Apache License 2.0 4 votes vote down vote up
private boolean isClasspathChanged(int flags) {
	return 0 != (flags
			& (IJavaElementDelta.F_CLASSPATH_CHANGED | IJavaElementDelta.F_RESOLVED_CLASSPATH_CHANGED));
}
 
Example 5
Source File: ClasspathUpdateHandler.java    From eclipse.jdt.ls with Eclipse Public License 2.0 4 votes vote down vote up
private boolean isClasspathChanged(int flags) {
	return 0 != (flags & (IJavaElementDelta.F_CLASSPATH_CHANGED | IJavaElementDelta.F_RESOLVED_CLASSPATH_CHANGED
			| IJavaElementDelta.F_CLOSED | IJavaElementDelta.F_OPENED));
}
 
Example 6
Source File: ClasspathChangeListener.java    From scava with Eclipse Public License 2.0 2 votes vote down vote up
private boolean isClasspathChanged(int flags) {
	return 0 != (flags & (IJavaElementDelta.F_CLASSPATH_CHANGED | IJavaElementDelta.F_RESOLVED_CLASSPATH_CHANGED));

}