Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » scout » Custom Composite Fields - Scout Explorer(Scout Explorer doesn't allow to add Child Fields)
Custom Composite Fields - Scout Explorer [message #1237775] Thu, 30 January 2014 15:05 Go to next message
João Rebelo is currently offline João Rebelo
Messages: 28
Registered: December 2013
Junior Member
Hi,

We're trying to create a Custom Field that has inner fields, namely in a simpler form a TextField decorated with icons within the field.
We understand how to make it a template, and how to instantiate it.

What I would need to know is how could we mark it (annotation, method, interface, etc.) so that in Scout Explorer it could understand that this template can take other fields (as for example a GroupBox or SplitedBox)?
Comparing GroupBox or SplitedBox we couldn't find any common marker that would instruct the Scout Explorer (hopping it isn't hardcoded there)

As an update, if I directly extend GroupBox the ScoutExplorer works correctly (after closing and opening the view). But I don't feel that I should extend this one, but instead the AbstractCompositeField directly. What would be the better option?

Regards
João

[Updated on: Thu, 30 January 2014 17:17]

Report message to a moderator

Re: Custom Composite Fields - Scout Explorer [message #1238092 is a reply to message #1237775] Fri, 31 January 2014 11:21 Go to previous messageGo to next message
Matthias Villiger is currently offline Matthias Villiger
Messages: 80
Registered: September 2011
Member
Hi João

The Scout SDK offers the relevant operations on an element. So that a custom field implements ICompositeField is not enough information to decide which children it may contain.
E.g. a RadioButtonGroup may only contain buttons. A GroupBox can contain each field. And both implement ICompositeField.

Which operations that are available on an element is configured in the Scout SDK. And for GroupBox it is already configured. Thats why it works as soon as your custom field extends AbstractGroupBox.

If you want your field to extend AbstractCompositeField directly, you must teach the SDK what operations that may be available for that specific field and how it should be presented in the Scout Explorer View.

This can be done by implementing a custom Eclipse Plugin and then using the org.eclipse.scout.sdk.ui.formField Extension Point.
Using this extension point you can define how your custom field should behave in the Scout Explorer. See the following example for RadioButtonGroup:

<FormField active="true" model="org.eclipse.scout.rt.client.ui.form.fields.radiobuttongroup.IRadioButtonGroup" name="Radio Button Group">
  <nodePage nodePage="org.eclipse.scout.sdk.ui.internal.view.outline.pages.project.client.form.field.RadioButtonGroupNodePage"></nodePage>
</FormField>


So if a form field implements IRadioButtonGroup, the RadioButtonGroupNodePage takes care of how this field should be presented in the Scout Explorer and which operations (context menus) that are available.

Unfortunately there is no meta information in the Scout Runtime that defines which child elements an element may contain. That's why this must be configured in the Tooling.

Hope this helps and if you have any further questions on how to extend the Scout SDK, don't hesitate to ask!

Kind regards
matthias
Re: Custom Composite Fields - Scout Explorer [message #1238142 is a reply to message #1238092] Fri, 31 January 2014 14:01 Go to previous message
João Rebelo is currently offline João Rebelo
Messages: 28
Registered: December 2013
Junior Member
Thanks for the help.
I've been reading the code, and I believe I've understand it.

It would be very nice if the Scout Explorer could also inspect the Template annotations (as the Scout Object Property) and set available the correct context menu actions for it. (for what I understood the actions and handling seem similar..)

Regards
João
Previous Topic:Mouse wheel event add to Main Box
Next Topic:Tab key in RAP
Goto Forum:
  


Current Time: Thu Oct 23 16:08:14 GMT 2014

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

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