public static FileObject getCurrentFile() { return EditorContextDispatcher.getDefault().getCurrentFile(); }
public static FileObject getCurrentFile() { return EditorContextDispatcher.getDefault().getCurrentFile(); }
/** throws IllegalComponentStateException when can not return the data in AWT. */ private String getCurrentElement(final ElementKind kind, final String[] elementSignaturePtr) throws java.awt.IllegalComponentStateException { return getCurrentElement(contextDispatcher.getCurrentFile(), contextDispatcher.getCurrentEditor(), kind, elementSignaturePtr); }
/** throws IllegalComponentStateException when can not return the data in AWT. */ private String getCurrentElement(final ElementKind kind, final String[] elementSignaturePtr) throws java.awt.IllegalComponentStateException { return getCurrentElement(contextDispatcher.getCurrentFile(), contextDispatcher.getCurrentEditor(), kind, elementSignaturePtr); }
public static Line getCurrentLine() { FileObject fo = EditorContextDispatcher.getDefault().getCurrentFile(); if (fo == null) { return null; } if (!JS_MIME_TYPE.equalsIgnoreCase(fo.getMIMEType())) { return null; } return EditorContextDispatcher.getDefault().getCurrentLine(); }
public static Line getCurrentLine() { FileObject fo = EditorContextDispatcher.getDefault().getCurrentFile(); if (fo == null) { return null; } if (!JS_MIME_TYPE.equalsIgnoreCase(fo.getMIMEType())) { return null; } return EditorContextDispatcher.getDefault().getCurrentLine(); }
/** @return declared class name */ public String getCurrentClassDeclaration() { FileObject fo = contextDispatcher.getCurrentFile(); if (fo == null) { return null; } JEditorPane ep = contextDispatcher.getCurrentEditor(); final int currentOffset = (ep == null) ? 0 : ep.getCaretPosition(); //final int currentOffset = org.netbeans.editor.Registry.getMostActiveComponent().getCaretPosition(); return EditorContextSupport.getClassDeclaredAt(fo, currentOffset); }
public static Line getCurrentLine() { FileObject fo = EditorContextDispatcher.getDefault().getCurrentFile(); if (fo == null) { return null; } if (!JS_MIME_TYPE.equalsIgnoreCase(fo.getMIMEType())) { return null; } return EditorContextDispatcher.getDefault().getCurrentLine(); }
/** @return { "method name", "method signature", "enclosing class name" } */ @Override public String[] getCurrentMethodDeclaration() { FileObject fo = contextDispatcher.getCurrentFile(); if (fo == null) { return null; } JEditorPane ep = contextDispatcher.getCurrentEditor(); final int currentOffset = (ep == null) ? 0 : ep.getCaretPosition(); return EditorContextSupport.getMethodDeclaredAt(fo, currentOffset); }
public static boolean isInDisasm() { if (opened) { //TODO: optimize FileObject fobj = EditorContextDispatcher.getDefault().getCurrentFile(); if (fobj == null) { fobj = EditorContextDispatcher.getDefault().getMostRecentFile(); } if (fobj != null) { try { return DataObject.find(fobj).equals(getDataObject()); } catch(DataObjectNotFoundException doe) { Exceptions.printStackTrace(doe); } } } return false; }
return false; FileObject fo = editorContext.getCurrentFile(); if (fo == null || !fo.hasExt("java")) { return false;
return false; FileObject fo = editorContext.getCurrentFile(); if (fo == null || !fo.hasExt("java")) { return false;
FileObject fo = contextDispatcher.getCurrentFile(); if (fo == null) { return null;
FileObject fo = contextDispatcher.getCurrentFile(); if (fo == null) { return null;
FileObject fo = contextDispatcher.getCurrentFile(); if (fo == null) { return null;
FileObject fo = contextDispatcher.getCurrentFile(); if (fo == null) { return null;