Home » Eclipse Projects » Sirius » [Properties View] Customizable layouts([Properties View] Customizable layouts)
|
Re: [Properties View] Customizable layouts [message #1751172 is a reply to message #1751103] |
Thu, 05 January 2017 10:57 |
|
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
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 ) 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
|
|
| | |
Goto Forum:
Current Time: Tue Apr 23 07:14:44 GMT 2024
Powered by FUDForum. Page generated in 0.03251 seconds
|