Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Viewer with editing support and properties view
Viewer with editing support and properties view [message #755272] Mon, 07 November 2011 16:42 Go to next message
Eclipse UserFriend
I have created a tree viewer with a tabbed properties view and a table viewer with a simple (original) properties view. Both viewers are have editing support implemented.

Problem:
When the value(s) from the tree viewer or table viewer changes due to editing, the properties view is not updated. It is updated only when the selection changes in the tree/table viewer.

Question(s):
1. Since the properties view reacts to selection changes I have tried to add a selection event to the setValue() method of my class extending EditingSupport. I am able to create a new StructuredSelection(changed_viewer_element), but I do not know how to fire this as an event.

2. Is there an automatic mechanism that covers this scenario?
Re: Viewer with editing support and properties view [message #755396 is a reply to message #755272] Tue, 08 November 2011 05:57 Go to previous messageGo to next message
Eclipse UserFriend
Am 07.11.11 22:42, schrieb Catalin Gerea:
> I have created a tree viewer with a tabbed properties view and a table
> viewer with a simple (original) properties view. Both viewers are have
> editing support implemented.
>
> Problem:
> When the value(s) from the tree viewer or table viewer changes due to
> editing, the properties view is not updated. It is updated only when the
> selection changes in the tree/table viewer.
>
> Question(s):
> 1. Since the properties view reacts to selection changes I have tried to
> add a selection event to the setValue() method of my class extending
> EditingSupport. I am able to create a new
> StructuredSelection(changed_viewer_element), but I do not know how to
> fire this as an event.
>
> 2. Is there an automatic mechanism that covers this scenario?

You should simply call viewer.update(o,null) in your
EditingSupport#setValue() after having updated the domain-attribute.

Tom
Re: Viewer with editing support and properties view [message #755578 is a reply to message #755396] Tue, 08 November 2011 15:43 Go to previous message
Eclipse UserFriend
Hello Tom

I do invoke viewer.update(o, null) in my EditingSupport#setValue(). And the table/tree viewer gets updated accordingly.

The problem is that the properties view (either this or this) does not get updated.

What do you mean by "after having updated the domain-attribute"?

My EditingSupport code looks like this:
@Override
  protected void setValue(Object element, Object value) {
    if (element instanceof UserGroup) {
      ((UserGroup) element).setGroupName(String.valueOf(value));
    }
    viewer.update(element, null);
  }

and the code for setting the group name is:
  public void setGroupName(String groupName) {
    propertyChangeSupport.firePropertyChange("groupName", this.groupName,
        this.groupName = groupName);
  }


Am I missing something?
Previous Topic:Can't run my Eclipse project
Next Topic:Master/slave problem
Goto Forum:
  


Current Time: Wed Jul 23 16:27:35 EDT 2025

Powered by FUDForum. Page generated in 0.03478 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top