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 applicationmodel?

Thanks for the reminder. This is the reason why the toolbar visible-when stuff is not working with the compat layer. I was thinking of some sort of proxy mechanism in this case that replaces the RunAndTrack code, or modify it to support the lazy loading in the application model. But I need to get a better view and definitely test cases in the platform so Dani doesn't need to revert my changes always a day after the integration tests. :)

Am 11.02.2016 16:18 schrieb "Eric Moffatt" <emoffatt@xxxxxxxxxx>:

Dirk, one thing to consider here is that the commands infrastructure is specifically designed to be able to manage the menus / toolbars *without causing plugins to load*. This is why we have the hacky 'describe if statements in XML' mechanism. Note that while this is a necessity for the workbench almost anything else could (and IMO should) use methods; it's more flexible and...natural...

Onwards,
Eric


Inactive hide details for Dirk Fauth ---02/10/2016 03:21:45 PM---Unfortunately that solution is not working with the compat layDirk Fauth ---02/10/2016 03:21:45 PM---Unfortunately that solution is not working with the compat layer and I need to find a better way.

From: Dirk Fauth <dirk.fauth@xxxxxxxxx>
To: "Eclipse Platform UI component developers list." <platform-ui-dev@xxxxxxxxxxx>
Date: 02/10/2016 03:21 PM
Subject: Re: [platform-ui-dev] Is enableWhen missing the e4 application model?
Sent by: platform-ui-dev-bounces@xxxxxxxxxxx





Unfortunately that solution is not working with the compat layer and I need to find a better way.

IIRC regarding the core expressions Tom had an idea for core expressions that could be specified via Java code rather than with xml.

On Wed, Feb 10, 2016 at 8:50 PM, Wim Jongman <wim.jongman@xxxxxxxxx> wrote:
    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


    _______________________________________________
    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