How to update/refresh a view in an eclipse plug-in?

前端 未结 2 650
别跟我提以往
别跟我提以往 2021-01-03 10:01

I have an eclipse plug-in with a single view (like the eclipse helloworld-view-plugin-project). In the view-file I get an event whe

相关标签:
2条回答
  • 2021-01-03 10:45

    I finally found the answer (together with AndreiC's help!):

    my listener now looks like this:

    r.addPropertyChangeListener(BindingNames.SERVICE_ADDED, new PropertyChangeListener() {
      public void propertyChange(final PropertyChangeEvent evt) {   
        Display.getDefault().asyncExec(new Runnable() {
          public void run() {
             // remove grpYourStatus from parent
             grpYourStatus.dispose();
    
             // add grpYourStatus (with updated values) to parent
             createStatusGroupBox();
    
             // refresh view
             parent.pack();
             parent.layout(true);
          }
        });
      }
    });
    

    The rest is the same like the code above.

    0 讨论(0)
  • 2021-01-03 10:57

    I do not know the API by heart, but have you tried parent.update()?

    0 讨论(0)
提交回复
热议问题