|
|
Re: visibleWhen expression is not always evaluated when a custom source changes [message #326534 is a reply to message #326080] |
Sun, 23 March 2008 04:46 |
Ryan Norris Messages: 18 Registered: July 2009 |
Junior Member |
|
|
Paul,
Thanks very much for the response. I've included some comments and
questions below.
-Ryan
Paul Webster wrote:
> This is a feature. A view's toolbar visibleWhens are only re-evaluated
> when the view is active. It works at the window level, a window's
> toolbar visibleWhens are only re-evaluated when that window is active.
> Otherwise changing the global state (which is what a source is) would
> cause "uninteresting" components like views your not working on,
> secondary windows that are not active, etc to have their toolbar
> flickering.
>
I'm trying to detect a change in the global state of my application in
all of my views. Perhaps I should describe the design of my application
to illustrate what I'm trying to do...
The application that I work on is an object manager type application.
That is, it contains views for viewing and managing various objects in
our system (each object type has its own view, which contains either a
table or a tree table...6 views total). We have a root object which
contains or has relationships with various other objects. Of the owned
or related objects, each has its own view for displaying and managing
them. The root object has a property which controls which behaviors are
available on the subordinate objects (type 1 allows more behavior, type
2 allows less). When the user enters the application they "open" one of
the available root objects. All views are then filtered based on this
root object. The user can then choose to change the "open" root object.
If the user changes the open object from type 1 to type 2, any open
views need to adapt to either allow or restrict the behaviors based on
this change.
In my previous post, I described a source provider. I created a source
provider that fires a change whenever the open object changes (the
global state for my application). I would like for the actions
contributed to the local menus, local tool bars and context menus of the
views in my application to have their visibleWhen conditions
re-evaluated when this event occurs. For example, if the open object is
type 1 several actions should appear on the action bars and if the open
object is type 2 they should disappear. As described in the previous
post I can only get this to occur for the active view whenever of the
change takes place.
I understand that in general it may not be a good idea for all views to
react to a global change especially for larger open applications like
the Eclipse IDE, however, this is the behavior I would like in my more
closed application.
Can you suggest a way for me to get this behavior to occur? Is there
another way of designing my views or for contributing such that I can
have actions appear and disappear in this manner?
Should I request a new feature? If so I suspect it wouldn't be
something that would or could be completed for 3.4 which is what I will
be shipping with. Perhaps views could register as interested parties
for source changes to enable re-evaluation of only a subset of
non-active views?
|
|
|
|
Powered by
FUDForum. Page generated in 0.03393 seconds