Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-ui-dev] Is enableWhen missing the e4 application model?

Sounds like either introducing a new annotation like @ActiveWhen. Or adding a model element similar to visibleWhen.

I don't have an idea on the implementation details yet, but typically I am not a big fan of to much custom annotations.

Am 11.02.2016 11:01 schrieb "Wim Jongman" <wim.jongman@xxxxxxxxx>:
No it can't. If you attach two handlers for the same command in one part, only one will be executed/evaluated. I tried fooling this by toggling the @CanExecute for both handlers but only the first handler is ever considered.

TL;DR;
The model and E3 have different concepts for activeWhen. While E3's is more fine grained, E4's concept of activeWhen is mor straightforward but maybe not flexible enough.

It would make a nice addition to be able to add expressions to the handlers. It would not be too difficult to evaluate which one gets preference because there already is a simple evaluation chain which could be extended.

I am not in favor of having to go back to plugin.xml for the definition of the _expression_.

Here is a screenshot from the model:

Inline image 1

Cheers,

W.


On Thu, Feb 11, 2016 at 9:37 AM, Simon Scholz <simon.scholz@xxxxxxxxxxx> wrote:
Attaching specific Handlers to a MPart, MPerspective or MWindow is kind of an activeWhen definition, but CoreExpressions are more powerful than that approach. The PlatformUI's Handler often also evaluate the current selection in order to determine whether a specific Handler should be chosen. IMHO currently there is no equivalent approach for e4 Handlers. What if I want to have 2 copy Handlers for the same part depending on the current selection in the part? IHMO this cannot be archived right now, right?

Cheers,

Simon


On 10.02.2016 19:39, Wim Jongman wrote:
IIRC (a bit rusty):

The conceptual replacement for activeWhen is by moving the handler to the part it is active for. So if the handler is deeper in the model It can be overridden by handlers that precede it.

Given command C, Partstack P with view V1 and V2.
P and V1 have a handler for C.
If V2 is the active part the handler for P is active.

Since the handler E3 extension point does not have structure, the _expression_ framework was there to handle it.

Maybe the expressions for parentless handlers could be evaluated  and put in the correct context if there is a place in the model to store the _expression_ with the handler.

Cheers,

Wim


On Wed, Feb 10, 2016 at 7:25 PM, Lars Vogel <lars.vogel@xxxxxxxxxxx> wrote:

Sorry, last email was wrong.

@CanExecute is an replacement for enabledWhen

For activeWhen I'm not aware of a replacement

Am 10.02.2016 7:23 nachm. schrieb "Dirk Fauth" <dirk.fauth@xxxxxxxxx>:
That was your question from the mail subject

On Wed, Feb 10, 2016 at 7:13 PM, Lars Vogel <lars.vogel@xxxxxxxxxxx> wrote:

@CanExecute is a replacement for enabledWhen

Am 10.02.2016 7:09 nachm. schrieb "Dirk Fauth" <dirk.fauth@xxxxxxxxx>:
Hi,

IIRC there is no activeWhen or enabledWhen because of the @CanExecute that can be used with e4 handlers.

Greez,
Dirk

On Wed, Feb 10, 2016 at 6:32 PM, Lars Vogel <lars.vogel@xxxxxxxxxxx> wrote:
Hi,

I was planning to convert existing e3 IDE handler implementations to
e4 for Eclipse 4.6. This should be pretty straight forward, as most of
our handlers are internal API and you can define e4 handler for e3
commands because of our amazing Eclipse e4 implementation.

But basically every interesting handler implementation I looked at,
was using an activeWhen _expression_ and AFAIK we do not support this in
e4.

Is anyone aware why this is missing? Or do we have a workaround? I
know we have the content hierarchy but this does not allow to define a
active handler for example based on the selected type.

Best regards, Lars

P.S. I'm not posting this to the e4 mailing list, as the  e4
application model has been migrated a long time ago to platform UI.


--
Eclipse Platform UI and e4 project co-lead
CEO vogella GmbH

Haindaalwisch 17a, 22395 Hamburg
Amtsgericht Hamburg: HRB 127058
Geschäftsführer: Lars Vogel, Jennifer Nerlich de Vogel
USt-IdNr.: DE284122352
Fax (040) 5247 6322, Email: lars.vogel@xxxxxxxxxxx, Web: http://www.vogella.com
_______________________________________________
platform-ui-dev mailing list
platform-ui-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/platform-ui-dev


_______________________________________________
platform-ui-dev mailing list
platform-ui-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/platform-ui-dev

_______________________________________________
platform-ui-dev mailing list
platform-ui-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/platform-ui-dev


_______________________________________________
platform-ui-dev mailing list
platform-ui-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/platform-ui-dev

_______________________________________________
platform-ui-dev mailing list
platform-ui-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/platform-ui-dev



_______________________________________________
platform-ui-dev mailing list
platform-ui-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/platform-ui-dev

-- 
Trainer, Consultant and Developer

vogella GmbH
Haindaalwisch 17a, 22395 Hamburg
Amtsgericht Hamburg: HRB 127058
Geschäftsführer: Lars Vogel, Jennifer Nerlich de Vogel
USt-IdNr.: DE284122352
Tel (040) 78804360, Fax (032) 221739404, Email: simon.scholz@xxxxxxxxxxx, Web: http://www.vogella.com 

_______________________________________________
platform-ui-dev mailing list
platform-ui-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/platform-ui-dev


_______________________________________________
platform-ui-dev mailing list
platform-ui-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/platform-ui-dev

Back to the top