Announcement Announcement Module
Collapse
No announcement yet.
Glass pane Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Glass pane

    Hello

    I am using Spring rich-client and JIDE together, which is a great combination so far. Now I have a problem where i want to run a indefinit progress bar waiting for the server to finish its calcuations. The entire client should lock while its happening so I need to access the main frame some how and set the glass pane so I block all input from the user. To do this I do the following:

    ApplicationWindow applicationWindow = Application.instance().getActiveWindow();
    Component glassPane = applicationWindow.getControl().getGlassPane();
    InfiniteProgressPanel infiniteProgressPanel = new InfiniteProgressPanel();
    applicationWindow.getControl().setGlassPane(infini teProgressPanel);
    infiniteProgressPanel.start();
    .
    .
    .....(Task is running here and infiniteProgressPanel runs in its own thread)
    .
    .
    infiniteProgressPanel.start();
    applicationWindow.getControl().setGlassPane(glassP ane);


    So I store a handler to the old glass pane and reset it when task has finished. The problem is that the entire GUI stops working after this task has finished. I have no exceptions at all.

    Is this the way to set the glass pane on the entire application or should I do it some other way?


    Cheers, Magnus

  • #2
    This is what i use to accomplish the same thing using a foxtrot job to execute the work in a background thread:

    private Object executeBlockingJobInBackground(String description, Job job) {
    ProgressMonitor progressMonitor = getStatusBar().getProgressMonitor();
    BusyIndicator.showAt(getWindowControl());
    progressMonitor.taskStarted(description, StatusBar.UNKNOWN);

    Object result = Worker.post(job);

    BusyIndicator.clearAt(getWindowControl());
    progressMonitor.done();

    return result;
    }

    Comment

    Working...
    X