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?

Apparently, core expressions can be referenced from the model. However, you need to put the _expression_ in plugin.xml and then reference it from the model.

https://www.eclipse.org/forums/index.php?t=msg&th=452550&goto=1007681&#msg_1007681

Dirk even made a pass at a solution here:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=400217
 

On Wed, Feb 10, 2016 at 8:24 PM, Dirk Fauth <dirk.fauth@xxxxxxxxx> wrote:
But if I understand it correctly, Wim had the best explanation. The handler can be attached to the context in charge (e.g. for a part) and it will become active if the part is active. If another part is active, another handler will become active or non at all.

Not sure about the use cases you are seeing Lars, but regarding a selection or anything else for which a core _expression_ might be needed, the enabledWhen should be sufficient. Or do I see things to simple?

On Wed, Feb 10, 2016 at 8:14 PM, Wim Jongman <wim.jongman@xxxxxxxxx> wrote:
I think the example if the save command is executable is a typical for enabled when:

The editor has a handler for the save command so this handler is active
If that handler sees the editor is dirty it is enabled

It is a wonderful concept but it always needs some concentration.

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

activeWhen is used to determine if a handler can be executed, e.g. the save command is only executable if there is something to save.

enabledWhen is used to define if a handler is relevant. Similar to defining a handler for a part but more flexible, e.g., you can use core expressions to define this. Eclipse can only have one enabled handler at the same time.

Am 10.02.2016 7:40 nachm. schrieb "Dirk Fauth" <dirk.fauth@xxxxxxxxx>:
Maybe a stupid question, but what is the difference between activeWhen and enabledWhen? Eclipse 3.x development is so long ago...

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

Ahhh... Wrong again, sounds like my mind is wired wrong.

This one should be correct:

@CanExecute is a replacement for enabledWhen

activeWhen is missing, I think

Am 10.02.2016 7:25 nachm. schrieb "Lars Vogel" <lars.vogel@xxxxxxxxxxx>:

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

_______________________________________________
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


Back to the top