/** * Returns the Java element wrapped by this editors input. * * @return the Java element wrapped by this editors input. * @since 3.0 */ protected ITypeRoot getInputJavaElement() { return EditorUtility.getEditorInputJavaElement(this, false); }
/** * @param primaryOnly if <code>true</code> only primary working copies will be returned * @since 3.2 */ private static IJavaElement getInput(JavaEditor editor, boolean primaryOnly) { if (editor == null) return null; return EditorUtility.getEditorInputJavaElement(editor, primaryOnly); }
/** * Returns the Java element wrapped by this editors input. * * @return the Java element wrapped by this editors input. * @since 3.0 */ protected ITypeRoot getInputJavaElement() { return EditorUtility.getEditorInputJavaElement(this, false); }
/** * Returns the input element of the given editor. * * @param editor the Java editor * @param primaryOnly if <code>true</code> only primary working copies will be returned * @return the type root which is the editor input, or <code>null</code> if none * @since 3.2 */ private static ITypeRoot getInput(JavaEditor editor, boolean primaryOnly) { if (editor == null) return null; return EditorUtility.getEditorInputJavaElement(editor, primaryOnly); }
private IJavaElement getInputElement() { if (fEditor == null) return null; return EditorUtility.getEditorInputJavaElement(fEditor, false); }
/** * Returns the Java element wrapped by this editors input. * * @return the Java element wrapped by this editors input. * @since 3.0 */ protected IJavaElement getInputJavaElement() { return EditorUtility.getEditorInputJavaElement(this, false); }
private IJavaElement getInputElement() { if (fEditor == null) return null; return EditorUtility.getEditorInputJavaElement(fEditor, false); }
private IJavaElement getInputElement() { if (fEditor == null) return null; return EditorUtility.getEditorInputJavaElement(fEditor, false); }
private ICompilationUnit getCompilationUnit() { return (ICompilationUnit) EditorUtility.getEditorInputJavaElement(fEditor, false); }
private ICompilationUnit getCompilationUnit() { return (ICompilationUnit) EditorUtility.getEditorInputJavaElement(fEditor, false); }
/** * Returns the input element of the given editor. * * @param editor the Java editor * @param primaryOnly if <code>true</code> only primary working copies will be returned * @return the type root which is the editor input, or <code>null</code> if none * @since 3.2 */ private static ITypeRoot getInput(JavaEditor editor, boolean primaryOnly) { if (editor == null) return null; return EditorUtility.getEditorInputJavaElement(editor, primaryOnly); }
protected ITypeRoot getEditorInputJavaElement() { IEditorPart editor= getEditor(); if (editor != null) return EditorUtility.getEditorInputJavaElement(editor, false); return null; } }
protected ITypeRoot getEditorInputJavaElement() { IEditorPart editor= getEditor(); if (editor != null) return EditorUtility.getEditorInputJavaElement(editor, false); return null; } }
/** * Returns the given editor's input as Java element. * * @param editor the editor * @param primaryOnly if <code>true</code> only primary working copies will be returned * @return the given editor's input as <code>ITypeRoot</code> or <code>null</code> if none * @since 3.2 */ public static ITypeRoot getEditorInputJavaElement(IEditorPart editor, boolean primaryOnly) { Assert.isNotNull(editor); return getEditorInputJavaElement(editor.getEditorInput(), primaryOnly); }
/** * Returns the given editor's input as Java element. * * @param editor the editor * @param primaryOnly if <code>true</code> only primary working copies will be returned * @return the given editor's input as <code>ITypeRoot</code> or <code>null</code> if none * @since 3.2 */ public static ITypeRoot getEditorInputJavaElement(IEditorPart editor, boolean primaryOnly) { Assert.isNotNull(editor); return getEditorInputJavaElement(editor.getEditorInput(), primaryOnly); }
private boolean isProcessable() { if (fEditor != null) { IJavaElement je= EditorUtility.getEditorInputJavaElement(fEditor, false); if (je instanceof ICompilationUnit && !JavaModelUtil.isPrimary((ICompilationUnit)je)) return true; // can process non-primary working copies } return ActionUtil.isProcessable(fEditor); }
/** * Note: This constructor is for internal use only. Clients should not call this constructor. * @param editor the Java editor */ public OpenAction(JavaEditor editor) { this(editor.getEditorSite()); fEditor= editor; setText(ActionMessages.OpenAction_declaration_label); setEnabled(EditorUtility.getEditorInputJavaElement(fEditor, false) != null); }
/** * Note: This constructor is for internal use only. Clients should not call this constructor. * @param editor the Java editor * * @noreference This constructor is not intended to be referenced by clients. */ public OpenAction(JavaEditor editor) { this(editor.getEditorSite()); fEditor= editor; setText(ActionMessages.OpenAction_declaration_label); setEnabled(EditorUtility.getEditorInputJavaElement(fEditor, false) != null); }
/** * Note: This constructor is for internal use only. Clients should not call this constructor. * @param editor the Java editor * * @noreference This constructor is not intended to be referenced by clients. */ public OpenAction(JavaEditor editor) { this(editor.getEditorSite()); fEditor= editor; setText(ActionMessages.OpenAction_declaration_label); setEnabled(EditorUtility.getEditorInputJavaElement(fEditor, false) != null); }
@Override protected boolean reveal(Object element) { if (!(element instanceof IJavaElement)) return false; IJavaElement javaElement= (IJavaElement) element; ITypeRoot inputElement= EditorUtility.getEditorInputJavaElement(getJavaEditor(), false); ITypeRoot root= (ITypeRoot) javaElement.getAncestor(IJavaElement.COMPILATION_UNIT); if (root == null) root= (ITypeRoot) javaElement.getAncestor(IJavaElement.CLASS_FILE); if (root == null) return false; if (!root.equals(inputElement)) return false; return revealInEditor(javaElement); }