Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » [Properties View] Customizable layouts([Properties View] Customizable layouts)
[Properties View] Customizable layouts [message #1751103] Wed, 04 January 2017 13:39 Go to next message
Claudia Irvine is currently offline Claudia IrvineFriend
Messages: 30
Registered: July 2015
Member
Are there plans to add more features to the built-in layouts? For instance, there is no way to edit the GridData of the GridLayout.

Compared to the old EEF properties, the new default layout has the checkboxes shifted to the right one column and select widgets are not filling the horizontal space. If I use a new GridLayout, I now have bigger margins, select is still not filling and now I can't line up the columns. FillLayout looks the same as GridLayout with one column.

Please see attachment examples.
Re: [Properties View] Customizable layouts [message #1751172 is a reply to message #1751103] Thu, 05 January 2017 10:57 Go to previous messageGo to next message
Stephane Begaudeau is currently offline Stephane BegaudeauFriend
Messages: 458
Registered: April 2010
Location: Nantes (France)
Senior Member

Hi,

Thanks for your feedback, you will find some answers below but first of all, let me start by saying that keeping the exact same appearance as EEF (1.5.x and before) was not one of our major goal with the brand new version of EEF (1.6 and after). Since we have started with a new approach from scratch, some things may be quite different, some better and some worse, hopefully not a lot Smile

1) The new default layout for checkboxes (shifted to the right column) is the new expected behavior (we have tested several options with their various tradeoffs before making this decision). I don't believe that we will change that since the impact of such a change may not be trivial.
2) I don't think that we had a specific reason to use this approach for the new default layout for the select widget. We could fill the horizontal space by default, it's something that should be discussed with the team.
3) The result that you have with the grid layout is odd, at the very least the columns should be lined up... Can you share here a small odesign showing this issue?
4) The fill layout is implemented using a grid layout since we can have an enormous amount of variation of containers and widgets etc, it was far easier to consider that everything is a grid layout in order to manage the various layouts and their layout data.

I don't know if the issue with the column of the grid layout is coming from your use of the grid layout or from our code (or both Razz) but your feedback raises another question regarding the detailed manipulation of the grid data. I am not sure that we want to expose this option declaratively in the odesign, it seems way to specific and complex for each widget (we can still change or improve our default behavior). If you really really really want to change the grid data of a widget, for example the select widget, you may be able to do it with another approach (depending on the widget and its implementation).

It can be done programmatically but first a warning, while it can technically be done, it requires the manipulation of the way the widgets are created internally and as a result, it will require the manipulation of internal APIs. It may not even be possible to change the grid data of everything (for example the buttons of the reference widget). So while it can be done, it can easily be broken by a future release and we won't try to maintain any backward compatibility on those internals APIs.

First you would have to use the extension point org.eclipse.eef.ide.ui.eefLifecycleManagerProvider to create an instance of IEEFLifecycleManagerProvider which would have to return a new IEEFLifecycleManager for the description of a select widget. Something like that:

public class CustomSelectLifecycleManagerProvider implements IEEFLifecycleManagerProvider {

	@Override
	public boolean canHandle(EEFControlDescription controlDescription) {
		return controlDescription instanceof EEFSelectDescription;
	}

	@Override
	public IEEFLifecycleManager getLifecycleManager(EEFControlDescription controlDescription, IVariableManager variableManager,
							IInterpreter interpreter, EditingContextAdapter contextAdapter) {
		return new CustomEEFSelectLifecycleManager((EEFSelectDescription) controlDescription, variableManager, interpreter, contextAdapter);
	}
}


Then you custom implementation of the EEFSelectLifecycleManager would just extends the creation of the controls to modify the grid data afterwards:

public class CustomEEFSelectLifecycleManager extends EEFSelectLifecycleManager {

	public CustomEEFSelectLifecycleManager(EEFSelectDescription description, EObject target, EReference eReference,
						IVariableManager variableManager, IInterpreter interpreter, EditingContextAdapter contextAdapter) {
		super(description, target, eReference, variableManager, interpreter, contextAdapter);
	}

	@Override
	protected void createMainControl(Composite parent, IEEFFormContainer formContainer) {
		super.createMainControl(parent, formContainer);
		Combo combo = (Combo) this.getValidationControl();
		// TODO change the grid data
	}
}


With this code, your implementation of the EEFSelectLifecycleManager will be responsible of all the Select widget in the Properties view (you can narrow it down with the canHandle method). I would not recommend going with this approach since it depends on internal code, which may not move a lot in the future but still, it can. It would be cleaner to create a custom widget from scratch (but more costly) but it will work (for now).

Regards,

Stephane Begaudeau, Obeo

[Updated on: Thu, 05 January 2017 10:58]

Report message to a moderator

Re: [Properties View] Customizable layouts [message #1751197 is a reply to message #1751172] Thu, 05 January 2017 15:02 Go to previous messageGo to next message
Claudia Irvine is currently offline Claudia IrvineFriend
Messages: 30
Registered: July 2015
Member
Thank you for your reply. I should have included that while I was not necessarily expecting the same results as EEF 1.5, I was really just more interested in the ways I could customize using the odesign since it does not produce code I can customize directly. I do understand the vast number of options in regards to layout of both containers and widgets can preclude this user option.

1. I can live with the checkbox indentation.
2. We have internal formatting standards that state that all widgets fill the empty space. For a select widget, the width of the box varies depending on the contents so I feel it looks better when all the widgets are the same width (especially since the text boxes fill the space already).
3. I should be more specific. When I said line up the columns, I meant that I expected the labels to be in column and the widgets to be lined up in their column which is not the case. So, this is probably miscommunication on my part. The default layout seems to be what I am looking for anyways. I have attached an odesign anyways. Container in question is in group: org.eclipse.sirius.ui.properties.groupBatch
4. I rarely use Fill Layout but just wanted to take a look at my options.
5. Side note: Are default reference widgets limited to non-containment elements because none of my containment references are showing up using the default rules?

While I haven't played with the custom widgets yet, thanks for the example. I was having some difficulties finding examples to look at in regards to the new Properties View. I still can't get reference widgets to work and haven't figured out why yet.
  • Attachment: flow.odesign
    (Size: 10.39KB, Downloaded 145 times)
Re: [Properties View] Customizable layouts [message #1751207 is a reply to message #1751197] Thu, 05 January 2017 16:20 Go to previous message
Claudia Irvine is currently offline Claudia IrvineFriend
Messages: 30
Registered: July 2015
Member
I was able to get reference widgets working once I figured out what to put in Reference Owner Expression and Reference Name Expression after stepping through the code.
Previous Topic:[Properties view] Using the selection in an action for the Reference widget
Next Topic:Multiple Tabs (Design/Source)
Goto Forum:
  


Current Time: Fri May 27 03:36:38 GMT 2022

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

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

Back to the top