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 8895907
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T23:54:16+00:00 2026-06-14T23:54:16+00:00

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

  • 0

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 when I want to update the view.

In this view I have a GridData in a Group with multiple labels. I have several services which register to the programe and whose status should be shown in this GridData.

Edit: In order to better show my problem I updated this post and added the whole code:


CreatePartControl():

public void createPartControl(Composite _parent) {
  parent = _parent;
  createContents();
  addBindings();
  makeActions();
  contributeToActionBars();
}

CreateContents():

protected void createContents() {

  // fixed
  checkIcon = //...
  errorIcon = //...
  smallFont = SWTResourceManager.getFont("Segoe UI", 7, SWT.NORMAL);

  // content
  gl_shell = new GridLayout(1, false);
  //margins, etc. for gl_shell
  parent.setLayout(gl_shell);

  final Label lblGreeting = new Label(parent, SWT.NONE);
  lblGreeting.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false, 1, 1));
  lblGreeting.setText("Hi " + Preferences.getPreName());

  // -- GROUP YOUR STATS (show all services)
  createStatusGroupBox();
}

createStatusGroupBox():

private Group grpYourStatus = null; // outside the method for access in listener (below)

private void createStatusGroupBox() {
  grpYourStatus = new Group(parent, SWT.NONE);
  grpYourStatus.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false, 1, 1));
  grpYourStatus.setText("Your upload status");
  grpYourStatus.setLayout(new GridLayout(3, false));

  // add message if no service is registered
  if ( r.getServiceList().size() == 0 ) {
     Label status = new Label(grpYourStatus, SWT.NONE);
     status.setText("No service registered.");
     new Label(grpYourStatus, SWT.NONE); //empty
     new Label(grpYourStatus, SWT.NONE); //empty
  }

  // add labels (status, message, name) for each registered service
  for ( IRecorderObject service : r.getServiceList() ) {
     Label name = new Label(grpYourStatus, SWT.NONE);
     Label status = new Label(grpYourStatus, SWT.NONE);
     Label message = new Label(grpYourStatus, SWT.NONE);
     message.setFont(smallFont);
     message.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 1, 1));

     service.getServiceViewItem().setLabelsAndIcons(name, status, message, checkIcon, errorIcon); //this also sets the values of the labels (label.setText(...) via data binding)
}

Unfortunately, I don’t know what the right way is to update/reset it. I tried the following:

listener (which should update the view / the services-list):

r.addPropertyChangeListener(BindingNames.SERVICE_ADDED, new PropertyChangeListener() {
  public void propertyChange(final PropertyChangeEvent evt) {   
    Display.getDefault().asyncExec(new Runnable() {
      public void run() {
        // This "redraws" the view, but just places the whole content (generated in createStatusGroupBox()) above the other parts.
        //Display.getCurrent().update();
        //createStatusGroupBox();
        //parent.layout(true);
        //parent.redraw();

        // disposes grpYourStatus-Group but doesn't show anything then
        grpYourStatus.dispose();
        createStatusGroupBox();
        grpYourStatus.layout();
        grpYourStatus.redraw(); 
      }
    });
  }
});

I also tried the following statements (individually); all without success:

parent.redraw();
parent.update();
parent.layout();
parent.layout(true);
parent.refresh();

In this post I read the following:

createPartControls is that time of the life cycle of a view, where its
contained widgets are created (when the view becomes visible
initially). This code is only executed once during the view life
cycle, therefore you cannot add anything here directly to refresh your
view.

Eclipse parts typically update their content as a reaction to a
changed selection inside of the workbench (e.g. the user might click
on another stack frame in the debug view).

Unfortunately, I don’t know what to else I could try and I didn’t find anything helpful with searches… thank’s for your help and suggestions!

  • 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-06-14T23:54:17+00:00Added an answer on June 14, 2026 at 11:54 pm

    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
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have in one of our applications a single eclipse project that contains all
I have this kind of problem. I have Clojure code contained in Eclipse plug-in
I am doing a Eclipse plug-in project to implement an IDE like Eclipse. I
in eclipse plugin i have two plug-in which are used there own class loader
I am working under Eclipse plug-in development. I have implemented two view parts to
I have an Eclipse RCP plug-in project, called proj.a. I have another Eclipse RCP
I am using Eclipse 3.7 (Indigo) for an Eclipse plug-in. This plugin will be
I have all my Eclipse Plug-Ins checked out in one Hudson workspace. For every
I'm developing an Eclipse plug-in and I have a problem which is reproduced here:
I am a newbie to Eclipse. I have some plug-ins installed in my eclipse

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.