use of org.eclipse.core.expressions.PropertyTester in project jop by jop-devel.
the class ToggleJOPNatureAction method run.
/*
* (non-Javadoc)
*
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
public void run(IAction action) {
if (selection instanceof IStructuredSelection) {
for (Iterator it = ((IStructuredSelection) selection).iterator(); it.hasNext(); ) {
Object element = it.next();
IProject project = null;
if (element instanceof IProject) {
project = (IProject) element;
} else if (element instanceof IAdaptable) {
project = (IProject) ((IAdaptable) element).getAdapter(IProject.class);
}
if (project != null) {
toggleNature(project);
System.err.println(project + " > Nature");
PropertyTester jopPropTest = new JOPNaturePropertyTester();
jopPropTest.test(project, "hasJOPNature", null, null);
}
}
}
}
Aggregations