|
Hello, Yours faithfully |
|
Something like http://bits.netbeans.org/dev/javadoc/org-openide-windows/org/openide/windows/TopComponent.Registry.html#getOpened() ?
Then I guess you could look at the Nodes or see what's in the Lookup and find a DataObject/FileObject, etc. --emi
On Tue, Feb 21, 2012 at 7:19 PM, Martin Velek <[hidden email]> wrote:
http://www.josekibold.ro : Honesty & well-done software. |
|
The class NbEditorUtilities has static methods
getDataObject/getFileObject.
With the TopComponent you can do tc.getLookup().lookup(EditorCookie.class).getDocument() (and watch out for null) -ernie On 2/21/2012 9:22 AM, Emilian Bold wrote: Something like http://bits.netbeans.org/dev/javadoc/org-openide-windows/org/openide/windows/TopComponent.Registry.html#getOpened() ? |
|
Thank you. Did you mean something like this? List<FileObject> fos = new ArrayList<FileObject>(); Set<TopComponent> opened = TopComponent.getRegistry().getOpened();Document d = null; for (TopComponent tc : opened) {d = tc.getLookup().lookup(EditorCookie.class).getDocument(); if (d != null) { fos.add(NbEditorUtilities.getFileObject(d)); } } Unfortunately this piece of code causes a compilation error. I'm new to all this and this was all I could work out. Here's what compiler spit out: C:\Program Files\NetBeans 7.0.1\harness\common.xml:206: Compile failed; see the compiler error output for details.
common.xml: 205: <nb-javac srcdir="${src.dir}" destdir="${build.classes.dir}" debug="${build.compiler.debug}" debuglevel="${build.compiler.debuglevel}" encoding="UTF-8" 206: deprecation="${build.compiler.deprecation}" optimize="${build.compiler.optimize}" source="${javac.source}" target="${javac.target}" includeantruntime="false"> 207: <classpath refid="cp"/>
208: <compilerarg line="${javac.compilerargs}"/> 209: <processorpath refid="processor.cp"/> 210: </nb-javac> |
| Powered by Nabble | See how NAML generates this page |
