Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » scout » Proposal: ToolButtons in a form
Proposal: ToolButtons in a form [message #1224628] Fri, 27 December 2013 04:25 Go to next message
Jeremie Bresson is currently offline Jeremie Bresson
Messages: 657
Registered: October 2011
Senior Member
We are evaluating the possibility of adding ToolButtons in a Scout Form. Here some intermediate results to check if there is any interest.

The current solution can be used without any Scout runtime modification. It is realized with custom code to overload some functions (Form in the scout model, SwtEnvironment...). We haven't published the code anywhere, but I am happy to share it, if someone wants to have a look at it.

Scout model

Tools buttons for forms could be defined as inner classes of the form class:
  @Order(10.0)
  public class AboutButton extends AbstractToolButton {

    @Override
    protected String getConfiguredText() {
      return TEXTS.get("About");
    }

    @Override
    protected String getConfiguredIconId() {
      return Icons.About;
    }

    @Override
    protected void execAction() throws ProcessingException {
      ScoutInfoForm form = new ScoutInfoForm();
      form.startModify();
    }
  }


Of course you need to use a subclass of AbstractForm (say AbstractMyAppForm) and add code that will check for the presence or not of ToolButtons in the form.
* getToolButtons()
* getToolButton(Class<T>) where "T extends IToolButton"
* additional code in initConfig() to look for the ToolButtons


SWT rendering engine

For now we have added some code to be able to render it in the SWT (views and dialog):

index.php/fa/17135/0/

index.php/fa/17136/0/


What's next?

Depending on the interest, we might be able to take this feature in the scout runtime.

Here a list of open tasks I could think of:
* Change request in Bugzilla for the runtime
* Merge the code of this proposal into the Scout code base.
* Implementations for Swing and RAP
* Documentation (Form page, maybe a mention in a tutorial? maybe something in the book?)
* Tests
* Example in one of the Scout Demo applications
* Change request in Bugzilla for the SDK
* ...
Re: Proposal: ToolButtons in a form [message #1228003 is a reply to message #1224628] Mon, 06 January 2014 02:22 Go to previous messageGo to next message
Urs Beeli is currently offline Urs Beeli
Messages: 322
Registered: October 2012
Location: Bern, Switzerland
Senior Member
I think we could use this in our project. Our current approach is to add a view-toolbar (which only works for SWT) but there have trouble with keeping the state of the buttons in sync with the scout model. Having these form tool buttons might be an alternative (though I'll need to check with our project, as they are not placed in the same place as the view toolbar).
Re: Proposal: ToolButtons in a form [message #1231831 is a reply to message #1228003] Wed, 15 January 2014 09:06 Go to previous messageGo to next message
Jeremie Bresson is currently offline Jeremie Bresson
Messages: 657
Registered: October 2011
Senior Member
Hi Urs,

Thanks for your feedback. I hope we will hear from you.

I my opinion, extending the scout model in the scout framework only make sense if multiple projects want to use it. Otherwise the extension can stay in the single project that is using the feature.

This is why I started this topic.

The corresponding change request in Bugzilla is Bug 422646.
Re: Proposal: ToolButtons in a form [message #1234322 is a reply to message #1224628] Tue, 21 January 2014 12:36 Go to previous messageGo to next message
Filipe Lopes is currently offline Filipe Lopes
Messages: 3
Registered: January 2014
Junior Member
Hi Jeremie,

As suggested by you, can you share this code?

Thx,
Filipe
Re: Proposal: ToolButtons in a form [message #1234551 is a reply to message #1234322] Wed, 22 January 2014 03:43 Go to previous messageGo to next message
Jeremie Bresson is currently offline Jeremie Bresson
Messages: 657
Registered: October 2011
Senior Member
Hi,

Find the source code of the simple project I used to do the screenshots attached.

It should work with a Luna version (M4) of Eclipse Scout (available as "Developer Preview Download"). A backport to an older version is possible.

If you want to dynamically change the property of the tool button (enable the button and disable it later, you also need the fixes contained in bug 424525).


I assume you have interest to see this in the Scout. Please tell us.

If we move forward on this, do you want to participate (testing?, wiki update?, ...).


.
Re: Proposal: ToolButtons in a form [message #1234582 is a reply to message #1234551] Wed, 22 January 2014 05:01 Go to previous messageGo to next message
Filipe Lopes is currently offline Filipe Lopes
Messages: 3
Registered: January 2014
Junior Member
Hi,

Thx for sharing the project. I have successfully imported it to my workspace.
Yes, I do have interest to see this in scout. Actually the team where I belong, we are currently evaluating/trying Scout in order to port a complex RCP application to Scout. Besides the SWT version we also need to have a RAP version of it, so, among other things, we are trying to see how much common code can Scout provide for both versions.
If we move forward with Scout, then we'll definitely be interested in this feature (toolbuttons in forms), so we'll be able to contribute to it.

Filipe
Re: Proposal: ToolButtons in a form [message #1271156 is a reply to message #1234582] Fri, 14 March 2014 07:38 Go to previous message
Jeremie Bresson is currently offline Jeremie Bresson
Messages: 657
Registered: October 2011
Senior Member
This proposal have moved forward. There is an early acces included in M6 (and some minor fixes comming with M7).

Here the new and noteworthy entry for M6:
https://wiki.eclipse.org/Scout/NewAndNoteworthy/4.0#Toolbuttons_in_Form

(feel free to improve the entry in the wiki).

TODO:
* Update the ToolButtton page to mention that the buttons can be added in Form as well.
* Update the Form page (description of the new property: getConfiguredToobarLocation()).
Previous Topic:Websphere - access datasource in server start
Next Topic:An AbstractBooleanColumn does never display the icon AbstractIcons.StatusError?
Goto Forum:
  


Current Time: Wed Aug 20 12:42:18 EDT 2014

Powered by FUDForum. Page generated in 0.02717 seconds