Could you give an idea for help me.

Post here questions and problems related to oXygen frameworks/document types.
lauryfriese
Posts: 1
Joined: Wed Aug 23, 2023 5:31 am
Contact:

Could you give an idea for help me.

Post by lauryfriese »

I have an Oxygen customized framework, which contain a custom action.
This action can often take long time (with a specific thread).
That why I want indicate to the user, that the action is in progress.
How I can disable the toolbar button, unfortunatly I'm in the Oxygen framework's module and so I can't access to the toolbar.
Radu
Posts: 9246
Joined: Fri Jul 09, 2004 5:18 pm

Re: Could you give an idea for help me.

Post by Radu »

Hi,
I assume your framework is for the standalone Java-Swing based Oxygen desktop installation.
You cannot disable the toolbar button but maybe you can show some kind of progress dialog while the thread is running.
Something like:

Code: Select all

    //Modal dialog
    JDialog msgDialog = new JDialog((JFrame)PluginWorkspaceProvider.getPluginWorkspace().getParentFrame(), true);
    msgDialog.getContentPane().add(new JLabel("Working on it..."));
    msgDialog.setSize(300, 300);

    //Start the thread
    new Thread() {
      @Override
      public void run() {
        try {
          //Thread has ended, close the message dialog
        }finally {
          msgDialog.setVisible(false);
        }
      };
    }.start();

    //Show modal dialog
    msgDialog.setVisible(true);  
  
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply