NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

Does the File Type wizard fully support non-text MIME types?

 
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Platform Users
View previous topic :: View next topic  
Author Message
gbullock



Joined: 21 Apr 2010
Posts: 20
Location: Pacific Grove, CA

PostPosted: Tue May 28, 2013 6:26 am    Post subject: Does the File Type wizard fully support non-text MIME types? Reply with quote

I'm developing and app using NetBeans Platform 7.3 that requires the user be able to open and edit (using a graphical editor) non-text files.
I used the File Type wizard to add suitable File Types and create the corresponding MyDataObject, MyDataLoader, and (if the MultiView box is checked) MyVisualElement classes. I really love how, when the user opens a file (using File > Open File),

  1. The editor tab opens immediately,
  2. The editor tab shows the file name,
  3. The file is added automatically to the Open Recent Files menu, and
  4. If the file is still open when the application terminates, then it's automatically reopened the next time the application starts.

But there are two problems that I need help with: When the user opens a file (using File > Open File),

  1. The data loader attempts to open the files as text files, then gives an error message about "The file cannot be safely opened with encoding windows-1252."
  2. The automatically displayed editor is a text editor, whereas I need to substitute my own, custom (graphical) editor.

Ideally, I'd like to resolve these two problems while preserving all four of the benefits listed above. Not sure how to do this.

Commenting out the call in the MyDataObject constructor to
Code:
registerEditor("image/vnd.mycom.mytype", true);
seems to avert the problem in displaying the text editor, but it creates other problems and eliminates the four benefits listed above.

Do I need to create my own MyDataLoader? And if so, how to I tell it to use my custom editor (not the text editor)?

And how to add the file names to the Open Recent Files menu?

If I use the automatically generated MyDataLoader, how do I tell it not to try to load the file as text while still maintaining the four benefits listed above? And how do I tell it to use my custom editor instead of the text editor?

Is it sufficient to register my custom editor for this MIME type? How do I register it? And what class should my custom editor class extend, and what interfaces should it implement, to be able to register it and preserve the four benefits above?

Reading various forum comments, blog posts, and tutorials seems to give mixed messages about all this. Some indicate that the File Type wizard is useful only for files that can be edited with a text editor or only for single-view documents. Others suggest that with ver. 7.3, the File Type wizard now applies to all cases.

For my immediate purposes, I'd be happy using either MultiView or single-view -- whichever gets the development off the ground the quickest.

Any help most appreciated.
Back to top
Geertjan Wielenga
Posted via mailing list.





PostPosted: Tue May 28, 2013 12:30 pm    Post subject: Does the File Type wizard fully support non-text MIME types? Reply with quote

On 05/28/2013 08:26 AM, gbullock wrote:
Quote:
I'm developing and app using NetBeans Platform 7.3 that requires the user be able to open and edit (using a graphical editor) non-text files.
I used the File Type wizard to add suitable File Types and create the corresponding MyDataObject, MyDataLoader, and (if the MultiView box is checked) MyVisualElement classes. I really love how, when the user opens a file (using File > Open File),
The editor tab opens immediately,

The editor tab shows the file name,

The file is added automatically to the Open Recent Files menu, and

If the file is still open when the application terminates, then it's automatically reopened the next time the application starts.

But there are two problems that I need help with: When the user opens a file (using File > Open File),
The data loader attempts to open the files as text files, then gives an error message about "The file cannot be safely opened with encoding windows-1252."


The first Action defined in the DataObject is the one that will be
called automatically. Normally, this is the "OpenAction", which right
now is treating your file as a text file. Change the first Action (via
the "position" attribute") to a different Action or write your own
OpenAction to replace the existing one.


Quote:

The automatically displayed editor is a text editor, whereas I need to substitute my own, custom (graphical) editor.

Remove the text editor. In the DataObject, you will find a Source editor
registered via an annotation. Remove that annotation and you will not
have a source editor anymore.

Gj


Quote:

Ideally, I'd like to resolve these two problems while preserving all four of the benefits listed above. Not sure how to do this.

Commenting out the call in the MyDataObject constructor to
Code:
registerEditor("image/vnd.mycom.mytype", true);

seems to avert the problem in displaying the text editor, but it creates other problems and eliminates the four benefits listed above.

Do I need to create my own MyDataLoader? And if so, how to I tell it to use my custom editor (not the text editor)?

And how to add the file names to the Open Recent Files menu?

If I use the automatically generated MyDataLoader, how do I tell it not to try to load the file as text while still maintaining the four benefits listed above? And how do I tell it to use my custom editor instead of the text editor?

Is it sufficient to register my custom editor for this MIME type? How do I register it? And what class should my custom editor class extend, and what interfaces should it implement, to be able to register it and preserve the four benefits above?

Reading various forum comments, blog posts, and tutorials seems to give mixed messages about all this. Some indicate that the File Type wizard is useful only for files that can be edited with a text editor or only for single-view documents. Others suggest that with ver. 7.3, the File Type wizard now applies to all cases.

For my immediate purposes, I'd be happy using either MultiView or single-view -- whichever gets the development off the ground the quickest.

Any help most appreciated.



Back to top
gbullock



Joined: 21 Apr 2010
Posts: 20
Location: Pacific Grove, CA

PostPosted: Wed May 29, 2013 1:29 am    Post subject: Reply with quote

Thank you, Geertjan.

I really appreciate your patience with us novices and your devotion to helping us here.

Your suggestions helped me past some basic problems, but I still get confused in the implementation. Perhaps you could help answer a few more, related questions. I've tried it both ways, using a MultiViewElement editor window, and using just a single view. No doubt there are many mistakes in these attempts.

In the single view case, I don't see how to open an editor tab upon opening the file? Indeed, I need a tab with each open instance of a file, similar to NetBeans IDE with .java files. Also, how to add the file to the Open Recent File menu?

In the MultiViewElement case, how to display the filename in the editor tab? And how to add the file to the Open Recent File menu?

Below are the detailed steps illustrating the problems. Any further help from you is most appreciated.

MultiView Editor Application:

  1. Use File > New Project... > NetBeans Modules to create a new NetBeans Platform Application.
  2. Call it "MyMultiViewApp" and click Finish.
  3. Right-click on MyMultiViewApp and choose Properties > Librararies.
  4. Expand the node "ide" and check the box "User Utilities".
  5. Click Resolve, then OK.
  6. Right-click on Modules under MyMultiViewApp and choose Add New...
  7. Name the Module "MyMultiViewAPI" and click Next.
  8. For Code Name Base, use org.example.multiview.api, and click Finish.
  9. Repeat the above three steps, adding a module named "MyMultiViewFileType" with Code Name Base org.example.multiview.filetype.
  10. Right-click on MyMultiViewAPI and choose New > Java Class.
  11. For Class Name, use MyFileData, set the package to org.example.multiview.api, and click Finish.
  12. Add the following field to the MyFileData class:
    Code:
        public String myData = "A placeholder for real data.";

  13. Right-click on MyMultiViewAPI and choose Properties > API Versioning.
  14. Check the box org.example.multiview.api and click OK.
  15. Right-click on MyMultiViewFileType and choose Properties > Librararies > Add Dependency....
  16. Select MyMultiViewAPI and click OK.
  17. Click Add Dependency..., select Windows System API, and click OK twice.
  18. Right-click on MyMultiViewFileType and choose New > File Type....
  19. For MIME Type, type image/vnd.example.customdata, set the Extension(s) to "mydat", and click Next.
  20. For Class Name Prefix, use MyCustom.
  21. Browse for any 16x16 png file for an Icon.
  22. Check the box MultiView and click Finish.
  23. In the source code for MyCustomDataObject, add showInFileChooser = {"#LBL_MyCustom_LOADER"} to the @MIMEResolver.ExtensionRegistration so it reads
    Code:
    @MIMEResolver.ExtensionRegistration(
            displayName = "#LBL_MyCustom_LOADER",
            mimeType = "image/vnd.example.customdata",
            extension = {"mydat"},
            showInFileChooser = {"#LBL_MyCustom_LOADER"})

  24. Add "implements Openable" to the MyCustomDataObject class declaration so it reads
  25. public class MyCustomDataObject extends MultiDataObject implements Openable {
  26. Click the yellow light bulb in the margin to the left of that line and choose "Add import for org.netbeans.api.actions.Openable".
  27. Click the yellow light bulb again and choose "implement all abstract methods".
  28. Add the following field to the MyCustomDataObject class
    Code:
        protected MyFileData myFileData = null;

  29. Click the yellow light bulb on that line and choose "Add import for org.example.multiview.api.MyFileData".
  30. Delete the static method MultiViewEditorElement createEditor(Lookup lkp) and its preceeding annotations.
  31. Modify the body of the open() method to
    Code:
        @Override
        public void open() {
            myFileData = new MyFileData();
            // Here we read file data into myFileData....
        }

  32. Use the Form editor for the MyCustomVisualElement class to add a JLabel to the form.
  33. Switch to the Source editor, and in the constructor, add the following code after the initComponents();:
    Code:
            jLabel1.setText(obj.myFileData.myData);
            TopComponent tc = lkp.lookup(TopComponent.class);
            if (tc != null) {
                tc.setDisplayName(obj.getName());
            }

  34. To supply a working example of a *.mydat file, just duplicate a .png file somewhere, and change the extension to .mydat.

When you run the application, you may the File > Open File ... to open the *.mydat file to confirm that the loader does not try to read it as text and also the an editor tab appears with each instance of an open *.mydat file. Doubly great!
But how to display the name of the file in the tab?
And how to add the file to the Open Recent File menu?


Single View Editor Application:

  1. Use File > New Project... > NetBeans Modules to create a new NetBeans Platform Application.
  2. Call it "MySingleViewApp" and click Finish.
  3. Right-click on MySingleViewApp and choose Properties > Librararies.
  4. Expand the node "ide" and check the box "User Utilities".
  5. Click Resolve, then OK.
  6. Right-click on Modules under MySingleViewApp and choose Add New...
  7. Name the Module "MySingleViewAPI" and click Next.
  8. For Code Name Base, use org.example.singleview.api, and click Finish.
  9. Repeat the above three steps, adding a module named "MySingleViewFileType" with Code Name Base org.example.singleview.filetype.
  10. Right-click on MySingleViewAPI and choose New > Java Class.
  11. For Class Name, use MyFileData, set the package to org.example.singleview.api, and click Finish.
  12. Add the following field to the MyFileData class:
    Code:
         public String myData = "A placeholder for real data.";

  13. Right-click on MySingleViewAPI and choose Properties > API Versioning.
  14. Check the box org.example.singleview.api and click OK.
  15. Right-click on MySingleViewFileType and choose Properties > Librararies > Add Dependency....
  16. Select MySingleViewAPI and click OK.
  17. Click Add Dependency..., select Windows System API, and click OK twice.
  18. Right-click on MySingleViewFileType and choose New > File Type....
  19. For MIME Type, type image/vnd.example.customdata, set the Extension(s) to "mydat", and click Next.
  20. For Class Name Prefix, use MyCustom.
  21. Browse for any 16x16 png file for an Icon.
  22. Uncheck the box MultiView and click Finish.
  23. In the source code, add showInFileChooser = {"#LBL_MyCustom_LOADER"} to the @MIMEResolver.ExtensionRegistration so it reads
    Code:
    @MIMEResolver.ExtensionRegistration(
            displayName = "#LBL_MyCustom_LOADER",
            mimeType = "image/vnd.example.customdata",
            extension = {"mydat"},
            showInFileChooser = {"#LBL_MyCustom_LOADER"})

  24. Find the annotation for
    @ActionID(category = "Edit", id = "org.openide.actions.CopyAction"),
    and change the position and separatorAfter to values smaller than the OpenAction:
    Code:
                position = 40,
                separatorAfter = 50),

  25. Add "implements Openable" to the MyCustomDataObject class declaration so it reads
  26. public class MyCustomDataObject extends MultiDataObject implements Openable {
  27. Click the yellow light bulb in the margin to the left of that line and choose "Add import for org.netbeans.api.actions.Openable".
  28. Click the yellow light bulb again and choose "implement all abstract methods".
  29. Add the following field to the MyCustomDataObject class
    Code:
        protected MyFileData myFileData = null;

  30. Click the yellow light bulb on that line and choose "Add import for org.example.singleview.api.MyFileData".
  31. Modify the body of the open() method to
    Code:
        @Override
        public void open() {
            myFileData = new MyFileData();
            // Here we read file data into myFileData....
        }

  32. Right-click on MySingleViewFileType and choose New > JPanel Form....
  33. For Class Name, use MyFileEditor, set the package to org.example.singleview.filetype, and click Finish.
  34. Add a JLabel to the newly created form.
  35. Switch to the Source tab, and add the following field to the MyFileEditor class
    Code:
        protected MyCustomDataObject myDataObject = null;

  36. Change the extended base class from javax.swing.JPanel to TopComponent.
  37. Insert the following annotations above the class declaration:
    Code:
    @TopComponent.Description(
            preferredID = "MyFileEditor",
            iconBase = "com/example/singleview/filetype/myImageIcon.png",
            persistenceType = TopComponent.PERSISTENCE_ALWAYS)
    @TopComponent.Registration(
            mode = "editor",
            openAtStartup = false)
    @ActionID(
            category = "Window",
            id = "org.example.singleview.filetype.MyFileEditor")
    @ActionReferences({
        @ActionReference(
            path = "Menu/Window",
            position = 0),
        @ActionReference(
            path = "Toolbars/File",
            position = 0)
    })
    @TopComponent.OpenActionRegistration(
            displayName = "#CTL_OpenMyImageAction")
    @Messages({
            "CTL_OpenMyImageAction=My Image Data"})

  38. Right-click on the editor window and choose Fix Imports.
  39. Override the componentOpened method as follows:
    Code:
        @Override
        protected void componentOpened() {
            if (myDataObject != null) {
                jLabel1.setText(myDataObject.myFileData.myData);
            }
        }

  40. To supply a working example of a *.mydat file, just duplicate a .png file somewhere, and change the extension to .mydat.

When you run the application, you may the File > Open File ... to open the *.mydat file to confirm that the loader does not try to read it as text. Great!
But how to open an editor tab with each instance of an open *.mydat file?
And how to add the file to the Open Recent File menu?
Back to top
Geertjan Wielenga
Posted via mailing list.





PostPosted: Wed May 29, 2013 12:01 pm    Post subject: Does the File Type wizard fully support non-text MIME types? Reply with quote

On 05/29/2013 03:29 AM, gbullock wrote:
Quote:

To supply a working example of a *.mydat file, just duplicate a .png file somewhere, and change the extension to .mydat.


When you run the application, you may the File > Open File ... to open the *.mydat file to confirm that the loader does not try to read it as text and also the an editor tab appears with each instance of an open *.mydat file. Doubly great!
But how to display the name of the file in the tab?

@Override
public void setMultiViewCallback(MultiViewElementCallback callback) {
this.callback = callback;
callback.getTopComponent().setDisplayName(obj.getName());
}

Quote:
And how to add the file to the Open Recent File menu?

Close the file. Then you'll see it in that list.

I'm sorry, not going to take 1000,000 steps again just to simulate your
problem. Just take all those steps yourself, upload the ZIP somewhere,
and write here stating where to find it and what the problem is.

Gj
Back to top
gbullock



Joined: 21 Apr 2010
Posts: 20
Location: Pacific Grove, CA

PostPosted: Wed May 29, 2013 5:43 pm    Post subject: Reply with quote

Thank you very much, Geertjan.

Indeed, that solves the problem in the case of the MultiView Editor Application.

The attached has my floundering attempt at a Single View Editor Application, in which the editor view does not (yet) automatically display when the .mydat file is opened.

I really appreciate all the great information you provide.



MySingleViewApp.zip
 Description:
MySingleViewApp, as created by the posted steps, doesn't yet automatically show the editor view when the .mydat file is opened.

Download
 Filename:  MySingleViewApp.zip
 Filesize:  28 KB
 Downloaded:  33 Time(s)

Back to top
Geertjan Wielenga
Posted via mailing list.





PostPosted: Thu May 30, 2013 2:28 pm    Post subject: Does the File Type wizard fully support non-text MIME types? Reply with quote

On 05/29/2013 07:43 PM, gbullock wrote:
Quote:
Thank you very much, Geertjan.

Indeed, that solves the problem in the case of the MultiView Editor Application.

The attached has my floundering attempt at a Single View Editor Application, in which the editor view does not (yet) automatically display when the .mydat file is opened.

I really appreciate all the great information you provide.




Attachments:
http://forums.netbeans.org//files/mysingleviewapp_144.zip


Some reading:

http://comments.gmane.org/gmane.comp.java.netbeans.modules.openide.devel/44092

And attached is the solution.

Gj



MySingleViewApp.zip
 Description:

Download
 Filename:  MySingleViewApp.zip
 Filesize:  23.46 KB
 Downloaded:  55 Time(s)

Back to top
Geertjan Wielenga
Posted via mailing list.





PostPosted: Thu May 30, 2013 8:55 pm    Post subject: Does the File Type wizard fully support non-text MIME types? Reply with quote

Much better solution attached.

- Now the "Open Recent File" action works correctly. (All that's needed
is for the DataObject to be in the Lookup of the TopComponent. When the
TopComponent closes, its DataObject is automatically added to the
RecentFiles list, which is maintained internally and visualized via the
RecentFilesAction shown in the File menu.)

- When a file is already open, and you want to open it again, then the
open file (i.e., its TopComponent) is found and activated, instead of
being recreated.

Gj


On 05/30/2013 04:28 PM, Geertjan Wielenga wrote:
Quote:
On 05/29/2013 07:43 PM, gbullock wrote:
Quote:
Thank you very much, Geertjan.

Indeed, that solves the problem in the case of the MultiView Editor
Application.

The attached has my floundering attempt at a Single View Editor
Application, in which the editor view does not (yet) automatically
display when the .mydat file is opened.

I really appreciate all the great information you provide.




Attachments:
http://forums.netbeans.org//files/mysingleviewapp_144.zip


Some reading:

http://comments.gmane.org/gmane.comp.java.netbeans.modules.openide.devel/44092


And attached is the solution.

Gj



MySingleViewApp-2.zip
 Description:

Download
 Filename:  MySingleViewApp-2.zip
 Filesize:  24.47 KB
 Downloaded:  34 Time(s)

Back to top
gbullock



Joined: 21 Apr 2010
Posts: 20
Location: Pacific Grove, CA

PostPosted: Fri May 31, 2013 6:27 am    Post subject: Reply with quote

Excellent! Thank you so much, Geertjan.
Back to top
Geertjan Wielenga
Posted via mailing list.





PostPosted: Fri May 31, 2013 11:09 am    Post subject: Does the File Type wizard fully support non-text MIME types? Reply with quote

On 05/31/2013 08:27 AM, gbullock wrote:
Quote:
Excellent! Thank you so much, Geertjan.




https://blogs.oracle.com/geertjan/entry/integrating_with_the_netbeans_platform

Above is a full description.

Gj
Back to top
Eirik Bakke
Posted via mailing list.





PostPosted: Fri May 31, 2013 11:26 am    Post subject: Does the File Type wizard fully support non-text MIME types? Reply with quote

Great blog post and responses to this thread in general--they were useful
for me as well.

A follow-up question:

If my DataObject overrides createNodeDelegate and returns a custom
DataNode with a customized display name (or programmatic name for that
matter), this name appears not to be used for the "Open Recent File"
menu--instead the file name is just displayed.

Is there a way to get the "Open Recent File" menu to show a custom display
name for the file?

-- Eirik



On 5/31/13 1:08 PM, "Geertjan Wielenga" <address-removed>
wrote:

Quote:
On 05/31/2013 08:27 AM, gbullock wrote:
Quote:
Excellent! Thank you so much, Geertjan.




https://blogs.oracle.com/geertjan/entry/integrating_with_the_netbeans_plat
form

Above is a full description.

Gj
Back to top
Geertjan Wielenga
Posted via mailing list.





PostPosted: Fri May 31, 2013 11:31 am    Post subject: Does the File Type wizard fully support non-text MIME types? Reply with quote

On 05/31/2013 01:25 PM, Eirik Bakke wrote:
Quote:
Great blog post and responses to this thread in general--they were useful
for me as well.

A follow-up question:

If my DataObject overrides createNodeDelegate and returns a custom
DataNode with a customized display name (or programmatic name for that
matter), this name appears not to be used for the "Open Recent File"
menu--instead the file name is just displayed.

Is there a way to get the "Open Recent File" menu to show a custom display
name for the file?

No, I don't believe that's possible.

On the other hand, since the Recent File Infrastructure consists of two
files only, with no dependencies elsewhere, you could copy them from the
NetBeans sources. Hide the existing menu item. Then use the two classes
to provide your own menu item, with any changes you might want to make,
e.g., the display name.

Gj

Quote:
-- Eirik



On 5/31/13 1:08 PM, "Geertjan Wielenga" <address-removed>
wrote:

Quote:
On 05/31/2013 08:27 AM, gbullock wrote:
Quote:
Excellent! Thank you so much, Geertjan.




https://blogs.oracle.com/geertjan/entry/integrating_with_the_netbeans_plat
form

Above is a full description.

Gj
Back to top
Eirik Bakke
Posted via mailing list.





PostPosted: Fri May 31, 2013 11:54 am    Post subject: Does the File Type wizard fully support non-text MIME types? Reply with quote

OK--makes sense. Thanks!

-- Eirik

On 5/31/13 1:30 PM, "Geertjan Wielenga" <address-removed>
wrote:

Quote:
On 05/31/2013 01:25 PM, Eirik Bakke wrote:
Quote:
Great blog post and responses to this thread in general--they were
useful
for me as well.

A follow-up question:

If my DataObject overrides createNodeDelegate and returns a custom
DataNode with a customized display name (or programmatic name for that
matter), this name appears not to be used for the "Open Recent File"
menu--instead the file name is just displayed.

Is there a way to get the "Open Recent File" menu to show a custom
display
name for the file?

No, I don't believe that's possible.

On the other hand, since the Recent File Infrastructure consists of two
files only, with no dependencies elsewhere, you could copy them from the
NetBeans sources. Hide the existing menu item. Then use the two classes
to provide your own menu item, with any changes you might want to make,
e.g., the display name.

Gj

Quote:
-- Eirik



On 5/31/13 1:08 PM, "Geertjan Wielenga" <address-removed>
wrote:

Quote:
On 05/31/2013 08:27 AM, gbullock wrote:
Quote:
Excellent! Thank you so much, Geertjan.





https://blogs.oracle.com/geertjan/entry/integrating_with_the_netbeans_pl
at
form

Above is a full description.

Gj
Back to top
Eirik Bakke
Posted via mailing list.





PostPosted: Mon Jun 03, 2013 11:26 pm    Post subject: Does the File Type wizard fully support non-text MIME types? Reply with quote

This is now an old thread, but here is a slightly simplified solution that
doesn't rely on Geertjan's solution's MyCustomDataObject.findTopComponent
or Reopenable class:

* Make your custom editor UI subclass CloneableTopCompoent (like in
Geertjan's solution).
* Set the TopComponent's persistenceType =
TopComponent.PERSISTENCE_ONLY_OPENED. If you want to keep your DataObject
around as a member of your TopComponent class, you need to serialize and
deserialize it in writeExternal()/readExternal().
* Make a subclass of org.openide.loaders.OpenSupport with
createCloneableTopComponent() implemented to always return a new instance
of your custom TopComponent.
* In your custom DataObject's constructor, add to the CookieSet a factory
that generates an instance of your custom OpenSupport (preferably caching
the returned OpenSupport in the DataObject, though everything seems to
work even when this is not done).
* Add a dependency on the org-netbeans-modules-utilities module (for "Open
Recent File" support).

This achieves:
* The custom editor opens when you open a file of the custom type for the
DataObject.
* If an editor is already open for a file that is opened, the
already-opened editor is activated instead of creating a new one.
* The custom editor does not assume that the file is a text file (so the
encoding-related errors mentioned earlier in the thread cannot happen).
* The custom editor can be cloned.
* Previously opened files will show up in the "Open Recent Files" list.
* Open editors, including cloned ones, will survive a restart, and
"reopening" files will activate existing editors even if those editors
were opened automatically on restart.

An example of how to do all of this can be found in
image/src/org/netbeans/modules/image/ImageDataObject.java in the NetBeans
source code.

Feedback on this approach is welcome.

-- Eirik




On 5/30/13 10:54 PM, "Geertjan Wielenga" <address-removed>
wrote:

Quote:

Much better solution attached.

- Now the "Open Recent File" action works correctly. (All that's needed
is for the DataObject to be in the Lookup of the TopComponent. When the
TopComponent closes, its DataObject is automatically added to the
RecentFiles list, which is maintained internally and visualized via the
RecentFilesAction shown in the File menu.)

- When a file is already open, and you want to open it again, then the
open file (i.e., its TopComponent) is found and activated, instead of
being recreated.

Gj


On 05/30/2013 04:28 PM, Geertjan Wielenga wrote:
Quote:
On 05/29/2013 07:43 PM, gbullock wrote:
Quote:
Thank you very much, Geertjan.

Indeed, that solves the problem in the case of the MultiView Editor
Application.

The attached has my floundering attempt at a Single View Editor
Application, in which the editor view does not (yet) automatically
display when the .mydat file is opened.

I really appreciate all the great information you provide.




Attachments:
http://forums.netbeans.org//files/mysingleviewapp_144.zip


Some reading:


http://comments.gmane.org/gmane.comp.java.netbeans.modules.openide.devel/
44092


And attached is the solution.

Gj
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Platform Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo