public boolean select(Viewer viewer, Object parent, Object element) { if (element instanceof IType) { try { return !((IType) element).isAnnotation(); } catch (JavaModelException ex) { return true; } } return true; } }
@Override public boolean select(Viewer viewer, Object parent, Object element) { if (element instanceof IType) { try { return !((IType) element).isAnnotation(); } catch (JavaModelException ex) { return true; } } return true; } }
@Override public boolean select(Viewer viewer, Object parent, Object element) { if (element instanceof IType) { try { return !((IType) element).isAnnotation(); } catch (JavaModelException ex) { return true; } } return true; } }
@Override public boolean select(Viewer viewer, Object parent, Object element) { if (element instanceof IType) { try { IType type= (IType) element; return !type.isInterface() || type.isAnnotation(); } catch (JavaModelException ex) { return true; } } return true; } }
public boolean select(Viewer viewer, Object parent, Object element) { if (element instanceof IType) { try { IType type= (IType) element; return !type.isInterface() || type.isAnnotation(); } catch (JavaModelException ex) { return true; } } return true; } }
public static boolean supportsGetterSetter(IType type) throws JavaModelException { if (type == null || type.isAnnotation() || type.isInterface() || type.getCompilationUnit() == null) { return false; } return true; }
@Override public final boolean isApplicable() throws CoreException { return Checks.isAvailable(fSubType) && Checks.isAvailable(fSuperType) && !fSubType.isAnonymous() && !fSubType.isAnnotation() && !fSuperType.isAnonymous() && !fSuperType.isAnnotation() && !fSuperType.isEnum(); }
protected Image getImageForType(IType type) { String imageName= JavaPluginImages.IMG_OBJS_CLASS; // default try { if (type.isAnnotation()) { imageName= JavaPluginImages.IMG_OBJS_ANNOTATION; } else if (type.isInterface()) { imageName= JavaPluginImages.IMG_OBJS_INTERFACE; } } catch (JavaModelException e) { JavaPlugin.log(e); } return JavaPluginImages.get(imageName); }
public static boolean isUseSuperTypeAvailable(final IType type) throws JavaModelException { return type != null && type.exists() && !type.isAnnotation() && !type.isAnonymous() && !type.isLambda(); }
private static boolean isImplementableType(IJavaElement element) { if (element.getElementType() == IJavaElement.TYPE) { IType type= (IType) element; try { if (type.isClass() || type.isInterface() && !type.isAnnotation()) { return true; } } catch (JavaModelException e) { // cannot check the type } } return false; } }
@Override public final boolean isApplicable() throws CoreException { return Checks.isAvailable(fSubType) && !fSubType.isBinary() && !fSubType.isReadOnly() && !fSubType.isAnnotation() && !fSubType.isAnonymous(); }
private boolean canEnable(IStructuredSelection selection) throws JavaModelException { if (getSelectedFields(selection) != null) return true; if ((selection.size() == 1) && (selection.getFirstElement() instanceof IType)) { IType type= (IType) selection.getFirstElement(); return type.getCompilationUnit() != null && !type.isInterface() && !type.isAnnotation(); } if ((selection.size() == 1) && (selection.getFirstElement() instanceof ICompilationUnit)) return true; return false; }
private boolean canEnable(IStructuredSelection selection) throws JavaModelException { if (getSelectedFields(selection) != null) return true; if ((selection.size() == 1) && (selection.getFirstElement() instanceof IType)) { IType type= (IType) selection.getFirstElement(); return type.getCompilationUnit() != null && !type.isInterface() && !type.isAnnotation() && !type.isAnonymous(); } if ((selection.size() == 1) && (selection.getFirstElement() instanceof ICompilationUnit)) return true; return false; }
private boolean canEnable(IStructuredSelection selection) throws JavaModelException { if (getSelectedFields(selection) != null) return true; if ((selection.size() == 1) && (selection.getFirstElement() instanceof IType)) { IType type= (IType) selection.getFirstElement(); return type.getCompilationUnit() != null && !type.isInterface() && !type.isAnnotation() && !type.isAnonymous(); } if ((selection.size() == 1) && (selection.getFirstElement() instanceof ICompilationUnit)) return true; return false; }
private void initialize() throws JavaModelException { fQualifiedTypeName= JavaModelUtil.concatenateName(fType.getPackageFragment().getElementName(), fType.getElementName()); fEnclosingInstanceFieldName= getInitialNameForEnclosingInstanceField(); fSourceRewrite= new CompilationUnitRewrite(fType.getCompilationUnit()); fIsInstanceFieldCreationPossible= !(JdtFlags.isStatic(fType) || fType.isAnnotation() || fType.isEnum()); fIsInstanceFieldCreationMandatory= fIsInstanceFieldCreationPossible && isInstanceFieldCreationMandatory(); fCreateInstanceField= fIsInstanceFieldCreationMandatory; }
private boolean canRunOn(IType type) throws JavaModelException { if (type == null || type.getCompilationUnit() == null) { MessageDialog.openInformation(getShell(), DIALOG_TITLE, ActionMessages.AddDelegateMethodsAction_not_in_source_file); return false; } else if (type.isAnnotation()) { MessageDialog.openInformation(getShell(), DIALOG_TITLE, ActionMessages.AddDelegateMethodsAction_annotation_not_applicable); return false; } else if (type.isInterface()) { MessageDialog.openInformation(getShell(), DIALOG_TITLE, ActionMessages.AddDelegateMethodsAction_interface_not_applicable); return false; } return canRunOn(type.getFields()); }
private boolean canRunOn(IType type) throws JavaModelException { if (type == null || type.getCompilationUnit() == null) { MessageDialog.openInformation(getShell(), DIALOG_TITLE, ActionMessages.AddDelegateMethodsAction_not_in_source_file); return false; } else if (type.isAnnotation()) { MessageDialog.openInformation(getShell(), DIALOG_TITLE, ActionMessages.AddDelegateMethodsAction_annotation_not_applicable); return false; } else if (type.isInterface()) { MessageDialog.openInformation(getShell(), DIALOG_TITLE, ActionMessages.AddDelegateMethodsAction_interface_not_applicable); return false; } return canRunOn(type.getFields()); }
protected RefactoringStatus checkDeclaringType(final IProgressMonitor monitor) throws JavaModelException { final IType type= getDeclaringType(); if (type.isEnum()) return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.HierarchyRefactoring_enum_members); if (type.isAnnotation()) return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.HierarchyRefactoring_annotation_members); if (type.isInterface()) return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.HierarchyRefactoring_interface_members); if (type.isBinary()) return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.HierarchyRefactoring_members_of_binary); if (type.isReadOnly()) return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.HierarchyRefactoring_members_of_read_only); return new RefactoringStatus(); }
private void initialize() throws JavaModelException { fQualifiedTypeName= JavaModelUtil.concatenateName(fType.getPackageFragment().getElementName(), fType.getElementName()); fEnclosingInstanceFieldName= getInitialNameForEnclosingInstanceField(); fSourceRewrite= new CompilationUnitRewrite(fType.getCompilationUnit()); fIsInstanceFieldCreationPossible= !(JdtFlags.isStatic(fType) || fType.isAnnotation() || fType.isEnum() || (fType.getDeclaringType() == null && !JavaElementUtil.isMainType(fType))); fIsInstanceFieldCreationMandatory= fIsInstanceFieldCreationPossible && isInstanceFieldCreationMandatory(); fCreateInstanceField= fIsInstanceFieldCreationMandatory; }
private void initialize() throws JavaModelException { fQualifiedTypeName= JavaModelUtil.concatenateName(fType.getPackageFragment().getElementName(), fType.getElementName()); fEnclosingInstanceFieldName= getInitialNameForEnclosingInstanceField(); fSourceRewrite= new CompilationUnitRewrite(fType.getCompilationUnit()); fIsInstanceFieldCreationPossible= !(JdtFlags.isStatic(fType) || fType.isAnnotation() || fType.isEnum() || (fType.getDeclaringType() == null && !JavaElementUtil.isMainType(fType))); fIsInstanceFieldCreationMandatory= fIsInstanceFieldCreationPossible && isInstanceFieldCreationMandatory(); fCreateInstanceField= fIsInstanceFieldCreationMandatory; }