@Override public boolean isStructureKnown() throws JavaModelException { return ((IJavaElement)getOpenableParent()).isStructureKnown(); } /*
public boolean isStructureKnown() throws JavaModelException { return ((IJavaElement)getOpenableParent()).isStructureKnown(); } /*
public boolean isStructureKnown() throws JavaModelException { return ((IJavaElement)getOpenableParent()).isStructureKnown(); } /*
public boolean isStructureKnown() throws JavaModelException { return ((IJavaElement)getOpenableParent()).isStructureKnown(); } /*
public boolean isStructureKnown() throws JavaModelException { return ((IJavaElement)getOpenableParent()).isStructureKnown(); } /*
public boolean isStructureKnown() throws JavaModelException { return ((IJavaElement)getOpenableParent()).isStructureKnown(); } /*
public static boolean isAvailable(IJavaElement javaElement) throws JavaModelException { if (javaElement == null) return false; if (! javaElement.exists()) return false; if (javaElement.isReadOnly()) return false; // work around for https://bugs.eclipse.org/bugs/show_bug.cgi?id=48422 // the Java project is now cheating regarding its children so we shouldn't // call isStructureKnown if the project isn't open. // see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=52474 if (!(javaElement instanceof IJavaProject) && !(javaElement instanceof ILocalVariable) && !javaElement.isStructureKnown()) return false; if (javaElement instanceof IMember && ((IMember)javaElement).isBinary()) return false; return true; }
public static boolean isAvailable(IJavaElement javaElement) throws JavaModelException { if (javaElement == null) return false; if (! javaElement.exists()) return false; if (javaElement.isReadOnly()) return false; // work around for https://bugs.eclipse.org/bugs/show_bug.cgi?id=48422 // the Java project is now cheating regarding its children so we shouldn't // call isStructureKnown if the project isn't open. // see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=52474 if (!(javaElement instanceof IJavaProject) && !(javaElement instanceof ILocalVariable) && !javaElement.isStructureKnown()) return false; if (javaElement instanceof IMember && ((IMember)javaElement).isBinary()) return false; return true; }
public static boolean isAvailable(IJavaElement javaElement) throws JavaModelException { if (javaElement == null) return false; if (! javaElement.exists()) return false; if (javaElement.isReadOnly()) return false; // work around for https://bugs.eclipse.org/bugs/show_bug.cgi?id=48422 // the Java project is now cheating regarding its children so we shouldn't // call isStructureKnown if the project isn't open. // see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=52474 if (!(javaElement instanceof IJavaProject) && !(javaElement instanceof ILocalVariable) && !javaElement.isStructureKnown()) return false; if (javaElement instanceof IMember && ((IMember)javaElement).isBinary()) return false; return true; }
return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ReorgPolicyFactory_readonly); if (!javaElement.isStructureKnown()) return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ReorgPolicyFactory_structure);
return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ReorgPolicyFactory_readonly); if (!javaElement.isStructureKnown()) return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ReorgPolicyFactory_structure);
return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ReorgPolicyFactory_readonly); if (!javaElement.isStructureKnown()) return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ReorgPolicyFactory_structure);
/** * Checks whether it is possible to modify the given <code>IJavaElement</code>. * The <code>IJavaElement</code> must exist and be non read-only to be modifiable. * Moreover, if it is a <code>IMember</code> it must not be binary. * The returned <code>RefactoringStatus</code> has <code>ERROR</code> severity if * it is not possible to modify the element. * @param javaElement * @return the status * @throws JavaModelException * * @see IJavaElement#exists * @see IJavaElement#isReadOnly * @see IMember#isBinary * @see RefactoringStatus */ public static RefactoringStatus checkAvailability(IJavaElement javaElement) throws JavaModelException{ RefactoringStatus result= new RefactoringStatus(); if (! javaElement.exists()) result.addFatalError(Messages.format(RefactoringCoreMessages.Refactoring_not_in_model, getJavaElementName(javaElement))); if (javaElement.isReadOnly()) result.addFatalError(Messages.format(RefactoringCoreMessages.Refactoring_read_only, getJavaElementName(javaElement))); if (javaElement.exists() && !javaElement.isStructureKnown()) result.addFatalError(Messages.format(RefactoringCoreMessages.Refactoring_unknown_structure, getJavaElementName(javaElement))); if (javaElement instanceof IMember && ((IMember)javaElement).isBinary()) result.addFatalError(Messages.format(RefactoringCoreMessages.Refactoring_binary, getJavaElementName(javaElement))); return result; }
/** * Checks whether it is possible to modify the given <code>IJavaElement</code>. * The <code>IJavaElement</code> must exist and be non read-only to be modifiable. * Moreover, if it is a <code>IMember</code> it must not be binary. * The returned <code>RefactoringStatus</code> has <code>ERROR</code> severity if * it is not possible to modify the element. * @param javaElement * @return the status * @throws JavaModelException * * @see IJavaElement#exists * @see IJavaElement#isReadOnly * @see IMember#isBinary * @see RefactoringStatus */ public static RefactoringStatus checkAvailability(IJavaElement javaElement) throws JavaModelException{ RefactoringStatus result= new RefactoringStatus(); if (! javaElement.exists()) result.addFatalError(Messages.format(RefactoringCoreMessages.Refactoring_not_in_model, getJavaElementName(javaElement))); if (javaElement.isReadOnly()) result.addFatalError(Messages.format(RefactoringCoreMessages.Refactoring_read_only, getJavaElementName(javaElement))); if (javaElement.exists() && !javaElement.isStructureKnown()) result.addFatalError(Messages.format(RefactoringCoreMessages.Refactoring_unknown_structure, getJavaElementName(javaElement))); if (javaElement instanceof IMember && ((IMember)javaElement).isBinary()) result.addFatalError(Messages.format(RefactoringCoreMessages.Refactoring_binary, getJavaElementName(javaElement))); return result; }
/** * Checks whether it is possible to modify the given <code>IJavaElement</code>. * The <code>IJavaElement</code> must exist and be non read-only to be modifiable. * Moreover, if it is a <code>IMember</code> it must not be binary. * The returned <code>RefactoringStatus</code> has <code>ERROR</code> severity if * it is not possible to modify the element. * @param javaElement * @return the status * @throws JavaModelException * * @see IJavaElement#exists * @see IJavaElement#isReadOnly * @see IMember#isBinary * @see RefactoringStatus */ public static RefactoringStatus checkAvailability(IJavaElement javaElement) throws JavaModelException{ RefactoringStatus result= new RefactoringStatus(); if (! javaElement.exists()) result.addFatalError(Messages.format(RefactoringCoreMessages.Refactoring_not_in_model, javaElement.getElementName())); if (javaElement.isReadOnly()) result.addFatalError(Messages.format(RefactoringCoreMessages.Refactoring_read_only, javaElement.getElementName())); if (javaElement.exists() && !javaElement.isStructureKnown()) result.addFatalError(Messages.format(RefactoringCoreMessages.Refactoring_unknown_structure, javaElement.getElementName())); if (javaElement instanceof IMember && ((IMember)javaElement).isBinary()) result.addFatalError(Messages.format(RefactoringCoreMessages.Refactoring_binary, javaElement.getElementName())); return result; }
if (!javaElement.isStructureKnown()) { return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ReorgPolicyFactory_structure);