Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » execAboutToShow()(philosophical questions)
execAboutToShow() [message #1533182] Sun, 28 December 2014 11:55 Go to next message
Chris Monty is currently offline Chris MontyFriend
Messages: 26
Registered: July 2013
Junior Member
I'm in the process of upgrading a project from Kepler to Luna. I notice that execPrepareAction() has been deprecated, and replaced with execAboutToShow(). I have two questions:

  1. The javadoc for execAboutToShow() warns not to use it to control visibility or alter menu structure. Fair enough, but what is the preferred alternative if I need to evaluate menu visibility/structure every time the menu is displayed?
  2. I'm curious to know why the name change? It seems to perform the same function as execPrepareAction(). My bugzilla search revealed nothing on the change, though maybe that's the wrong place to look?
I found the updates listed in this thread useful. Thanks to Stefan for that.

[Updated on: Sun, 28 December 2014 12:04]

Report message to a moderator

Re: execAboutToShow() [message #1533450 is a reply to message #1533182] Sun, 28 December 2014 15:39 Go to previous messageGo to next message
Patrick Baenziger is currently offline Patrick BaenzigerFriend
Messages: 96
Registered: September 2011
Member
One of the preferred methods to determine visibility of the menus is overriding the execOwnerValueChanged method.

This method can be used if the desired state of the menu depends on the selection in a table, list, tree...
It is called each time the user selects another item. (See change announcement in N&N for Luna: https://wiki.eclipse.org/Scout/NewAndNoteworthy/4.0#Menu_Refactoring)

If the state of the menu can however change without a selection change, I don't know of any other option than execAboutToShow.
Re: execAboutToShow() [message #1533469 is a reply to message #1533450] Sun, 28 December 2014 15:52 Go to previous messageGo to next message
Chris MontyFriend
Messages: 5
Registered: December 2014
Junior Member
That was helpful, thanks.
Re: execAboutToShow() [message #1534899 is a reply to message #1533469] Mon, 29 December 2014 11:13 Go to previous messageGo to next message
Jeremie Bresson is currently offline Jeremie BressonFriend
Messages: 1252
Registered: October 2011
Senior Member
Hi Chris,

I really appreciate question like yours. In my opinion we need to do a better job in the communication about the changes made to the API. It is useful to document and to explain them in order for the community to follow.
Refactoring of menus with Luna was discussed in several threads in this forum, but we do not have a place where everything is put together. I also regret that we do not have any "migration notes" bug concerning the change: execPrepareAction() => execAboutToShow().

Internally, I am trying to push in order that we manage to do a better job with the Mars release (if we take into consideration that we have started to work on the N-Release on the develop branch)

You can help by telling us where we need to provide a better documentation (this is what you have done with this thread). You can also edit the "New And Notewothy" wiki page (after all it is a wiki) and ask for review in the forum.

In my opinion, each member of the scout community should be concerned and involved. This way we can ship a better product (See my blog post: why should I contribute). This is not only a question for the Scout Dev Team but also for the Scout community.

------------------
execPrepareAction() => execAboutToShow()

(I am not familiar with this API change. This is what I could find about this change by looking at the source. I will also ask Andreas to take a look at this thread. Maybe he can review this and add more comments if needed)

I have looked in the commit history of AbstractMenu to see when the method was introduced and found commit ab1940c (diff on AbstractMenu)

The method was introduced as fix for Bug 411266: Allow context menus on all FormFields

I think that one of the big differences is:
* execPrepareAction was defined at Action level
* execAboutToShow is defined at Menu level (a subtype of Action). It is probabely specific for menu.

I think that the limitations (visibility/structure) that are described on the new execAboutToShow are that same that with execPrepareAction. But now the JavaDoc is doing a better job about what you can and cannot do.

I have added a section on the "New And Noteworthy" > "Menu Refactoring" guide mentioned by Patrick.

------------------
Beeing closer to the scout Community

For the company I am working for (BSI Business Systems Integration AG), it is not so easy to know the scout community. We have started to do it during our first Scout User Group Meeting where we invited scout users we already knew. Feedback was to have something more open (because it is the nature of an open-source project).

You seem to have built something important with scout (otherwise migration would be out of question). Please consider taking the made with Scout Survey. This way we can identify you as someone who has invested (or is investing) on top of the Eclipse Scout Framework. Our goal is not to sell you anything but to have a closer relationship with you (communication, road-map sharing, invitation to events...) than what we have on this forum (almost an anonymous relationship). If this it simpler for you, just drop us an email at scout@bsiag.com.

NB: I have made this proposition to Chris, but anyone reading this and feeling concerned or interested can do the same.


Re: execAboutToShow() [message #1535498 is a reply to message #1534899] Mon, 29 December 2014 19:07 Go to previous messageGo to next message
Chris MontyFriend
Messages: 5
Registered: December 2014
Junior Member
Jeremie, thanks for the detailed information. I really get the sense you've gone out of your way to help.

I'd say that the two areas where I regularly lose time on are:

  1. finding the info I'm looking for (i.e. it's available, but I can't find it - as was the case here), and
  2. configuring my bloody web server (I dabble with openshift, and there is a learning curve for the uninitiated).

Regarding the first point, it seems to me that the scout resources are spread out across the virtual planes. Before posting here, I might:

  • read the code/javadoc
  • search the wiki (tutorials, concepts, new and noteworthy)
  • search the eclipse forums
  • search stack overflow
  • read the Book
  • watch scout youtube tutorials
  • read the blog
  • search bugzilla
  • and today I learned you can even dig through the git repository

It's great to see the javadoc getting some detailed information - that's almost always my starting point. The start sites www.eclipse.org/scout/ and www.eclipse.org/scout/support/ cover most of these. Anyway, it's good that there's a lot of information available, but finding it can be half the challenge.

And as for my second point, webserver configuration is a bit off topic here, though somewhat related. I've managed, but with much trial and error. Maybe someone knew of some useful next-steps resources for taking a scout app into production?

I'll see about taking that questionnaire - not sure if my DIY hobby project carries much weight, but it'll be interesting to be receiving regular Scout updates.

[Updated on: Tue, 30 December 2014 07:32]

Report message to a moderator

Re: execAboutToShow() [message #1541814 is a reply to message #1535498] Fri, 02 January 2015 08:36 Go to previous messageGo to next message
Chris Monty is currently offline Chris MontyFriend
Messages: 8
Registered: January 2015
Junior Member
Actually I discovered that execAboutToShow() isn't called for top-level menu items (i.e. those defined in Desktop.java), whereas execPrepareAction() is. Doesn't seem right to me that the new function should be less useful than the old deprecated one, so I raised a Bugzilla Bug 456492.

Edit: add link

[Updated on: Sat, 03 January 2015 07:13] by Moderator

Report message to a moderator

Re: execAboutToShow() [message #1556463 is a reply to message #1541814] Sat, 10 January 2015 10:30 Go to previous message
Chris Monty is currently offline Chris MontyFriend
Messages: 8
Registered: January 2015
Junior Member
Okay so I've using execOwnerValueChanged() whenever menu visibility can be determined from the table.

I discovered that even when the menu is configured (via getConfiguredMenuTypes() ) to only be visible on single select, it is still called when the row is de-selected. If I am using the input parameter to determine the visibility, this becomes a less elegant as I have to not only cast the newOwnerValue object to a List<ITableRow>, but then also check if it's empty or not.

Anyway, I found a tidy way of doing this in the CollectionsUtility. It goes like this:
      @Override
      protected void execOwnerValueChanged(Object newOwnerValue) throws ProcessingException {
        ITableRow selected = CollectionUtility.firstElement(newOwnerValue);
        setVisible(CompareUtility.equals(ModerateAccessCode.ID, getMembershipColumn().getValue(selected)));
      }

Is this the intended usage of the execOwnerValuechanged() function? It feels a bit like it. If so, the example in the New and Noteworthy could be updated.

(Yes I'm aware you can just use the "getMembershipColumn().getSelectedValue()" method, but doesn't that defeat the purpose of passing in the selected rows into execOwnerChanged() as a paremeter?)

[Updated on: Sat, 10 January 2015 12:45]

Report message to a moderator

Previous Topic:Multi Column SmartField
Next Topic:TableField as template?
Goto Forum:
  


Current Time: Thu Apr 25 18:10:53 GMT 2024

Powered by FUDForum. Page generated in 0.04300 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top