Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7607879
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T00:46:38+00:00 2026-05-31T00:46:38+00:00

We are using NetBeans Platform 7.0.1, and have implemented support for a new language

  • 0

We are using NetBeans Platform 7.0.1, and have implemented support for a new language using this (now “obsolete”) tutorial.

Since all our contents are stored in a database, and not on files, we open them like this:

 FileSystem fs = FileUtil.createMemoryFileSystem();
 FileObject fo = fs.getRoot().createData(fileName, fileExtension);
… write contents from database to `fo` ….

DataObject data = MyMultiDataObject.find(fo);
EditorCookie.Observable cookie = data.getCookie(EditorCookie.Observable.class);
cookie.open();
… forces undock of editor window …

And, in our layer.xml, have added a custom button to Save that sends the content back to the database.

However, when the user closes the file (by either closing the tab or the window), we haven’t figured a way of saving it.

Adding a PropertyChangeListener to the Cookie and watching for PROP_DOCUMENT (and newValue() == null) seems to do the trick for when the window is closed. But how does one get the return value from the confirmation window (I’m referring to when the file is closed after changes, the message File xxx.xxx is modified. Save it?)?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T00:46:40+00:00Added an answer on May 31, 2026 at 12:46 am

    Well, it seems we’ve been approaching the problem in the wrong way.

    Since we are opening the file in-memory, it was suggested in the netbeans-dev list that we should listen for changes in the file itself, by using

    fo.addFileChangeListener(new CustomFileChangeListener());
    
    public class CustomFileChangeListener implements FileChangeListener {
        @Override
        public void fileChanged(FileEvent fe) {
           ... file has been saved in the editor, sync with database ...
        }
    }
    

    And keep it synchronized that way, taking advantage of the built-in NetBeans Platform “save” functionality.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently building a small visual designer using the Netbeans Platform. All my
Has anybody had any success with developing for Android platform using Netbeans (5.5+ )
I'm creating a cross platform application using Swing and Netbeans (Group Layout). Is there
I'm using NetBeans 6.5 for developing PHP and I have xdebug setup. Is there
Since I've started using NetBeans, I've learned of some powerful ways to abstract away
I have also posted this question on the netbeans forums - hoping for maximum
I've created a NetBeans Platform application that is launched using Java Web Start. I
Ok, I have Netbeans 6.7.1 installed with the default Java SDK. I'm using Linux
I'm using NetBeans IDE 7.1 From this IDE I run first build and wait
Applications built on top of the NetBeans platform have a <myappdir>/etc/<myapp>.conf file determining, among

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.