Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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
Catalin Gerea is currently offline Catalin Gerea
Messages: 89
Registered: July 2009
Location: Bucharest, Romania
Member

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?


Time is what you make of it.
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
Thomas Schindl is currently offline Thomas Schindl
Messages: 5296
Registered: July 2009
Senior Member
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
Catalin Gerea is currently offline Catalin Gerea
Messages: 89
Registered: July 2009
Location: Bucharest, Romania
Member

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?


Time is what you make of it.
Previous Topic:Can't run my Eclipse project
Next Topic:Master/slave problem
Goto Forum:
  


Current Time: Mon Sep 01 22:13:23 EDT 2014

Powered by FUDForum. Page generated in 0.01665 seconds