DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
  • Refcardz
  • Trend Reports
  • Webinars
  • Zones
  • |
    • Agile
    • AI
    • Big Data
    • Cloud
    • Database
    • DevOps
    • Integration
    • IoT
    • Java
    • Microservices
    • Open Source
    • Performance
    • Security
    • Web Dev
DZone >

Change of RecentFile behaviour at NetBeans Platform

Stefan Hütter user avatar by
Stefan Hütter
·
Nov. 17, 14 · · Code Snippet
Like (0)
Save
Tweet
601 Views

Join the DZone community and get the full member experience.

Join For Free

If a netbeans platform application uses the module org.netbeans.modules.utilities it provides an action for opening recently opened files. A file would be added to the list of recently opened files when it is closed within the application. (See https://blogs.oracle.com/geertjan/entry/integrating_with_the_netbeans_platform for more information)

For users of Microsoft products like office it seems to be unusual that a file will be only added to the list of recent files only if the file has been closed within the application but when the whole application has been closed after the file has been opened.

To change that behaviour a developer needs to get the sources from that module and change the class org.netbeans.modules.openfile.RecentFiles.WindowRegistryL. The change to be made is published by this code snippet. The changes are made based on NetBeans Platform Version 8.

    /** Receives info about opened and closed TopComponents from window system.
     */
    private static class WindowRegistryL implements PropertyChangeListener {

        @Override
        public void propertyChange(PropertyChangeEvent evt) {
            String name = evt.getPropertyName();
            if (TopComponent.Registry.PROP_TC_OPENED.equals(name)) {
                addFile((TopComponent) evt.getNewValue());
            }
        }
    }
NetBeans

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • How to Use Geofences for Precise Audience Messaging
  • A Guide to Understanding Vue Lifecycle Hooks
  • Image Classification Using SingleStore DB, Keras, and Tensorflow
  • Top 20 Git Commands With Examples

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • MVB Program
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends:

DZone.com is powered by 

AnswerHub logo