Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-ui-dev] Adding "visibleWhen" Expression to every UI Element

Hi Jan,

Thanks for bringing this question to the attention of the mailing list subscribers.  I would suggest that all interested parties cc themselves on bug 201052 so that we can have a detailed discussion on the bug itself.

Boris

--
Boris Bokowski
Eclipse Platform UI committer
IBM Rational Software, Ottawa Lab


On Nov 12, 2007 10:15 AM, Jan-Hendrik Diederich < Jan-Hendrik.Diederich@xxxxxxxxx> wrote:
Hello,
for enhancement https://bugs.eclipse.org/bugs/show_bug.cgi?id=201052, I
want to add the _expression_ "visibleWhen", with a property tester, to
every "basic" UI element ("basic" should stand for Views, Editors, and
similar things).
An example XML code:
  <visibleWhen>
     <test
          property="org.eclipse.rcpauth.expressions.rightsProperty"
          args="read"/>
  </visibleWhen>
I know there were already similar thoughts about this earlier, but they
weren't realized. I had the impression it was a "nice to have feature"
which hasn't enough people which needed it, so it was never done.

Now, I want to implement it, for the enhancement I mentioned above.

But I have a question: while it's quite easy to implement it, once you
learned how the code in "org.eclipse.ui.internal.registry ",
"org.eclipse.ui.internal", "org.eclipse.ui", etc. works together, I have
too much possibilities where I can implement my solution. The commands
(ext.-point "org.eclipse.ui.commands "), have already the ability to
process Expressions, i.e. to process them in all XML declarations which
use their command declarations (via "commmandId"). Menus do this, for
example. But views, editors and such things are another case: they are
not commands, neither in their actual implementation nor in their
abstract logic. So I implemented the logic to read and bind the
visibleWhen _expression_ to a View, in the
"org.eclipse.ui.internal.registry.ViewRegistryReader#readElement ", and
store the _expression_ in the "ViewDescriptor".
While the logic to read and store the Expressions for _commands_ is
handled in "org.eclipse.ui.workbench.HandlerPersistence#read" (and
stored in a global list). Although my solution works very good, I'm not
sure what fits better to Eclipses (original?) Expressions concept:
Should the basic Expressions handling all be done in HandlerPersistence,
or locale, in the Registry-Readers of the UI elements itself?

Or should there be a new standalone class and registry for all Expressions?


Thanks for any answers,
Jan Diederich

--
BREDEX GmbH
Mauernstr. 33
38100 Braunschweig

Tel.: +49-531-24330-0
Fax:  +49-531-24330-99
http: www.bredex.de

Geschäftsführer: Hans-J. Brede, Achim Lörke, Ulrich Obst
Amtsgericht Braunschweig HRB 2450
_______________________________________________
platform-ui-dev mailing list
platform-ui-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/platform-ui-dev


Back to the top