how can i change binding properties without using initData?

SWT Designer allows you to create the views, editors, perspectives, pref pages, composites, etc. that comprise Eclipse SWT & RCP applications and plug-ins.

Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg

how can i change binding properties without using initData?

Postby emaayan » Mon Apr 11, 2011 6:04 am

hi..
i'm trying to bind a combo to a grid, and it works, but i need to add aditional properties :
final CellEditor cellEditor_1 = new ComboBoxCellEditor(tvProperties.getTable(), new String[0]);
final IValueProperty cellEditorProperty_1 = CellEditorProperties.control().value(WidgetProperties.selection());
final IBeanValueProperty valueProperty_1 = BeanProperties.value("value");
tvcMylynFields.setEditingSupport(ObservableValueEditingSupport.create(tvProperties, bindingContext, cellEditor_1, cellEditorProperty_1, valueProperty_1));

for example, i need to have the combo not allow editing inside it, or accept a list of predefined properties
i was told not to change the method as it always re-generated
emaayan
 
Posts: 19
Joined: Fri Nov 26, 2010 1:58 am

Re: how can i change binding properties without using initDa

Postby Eric Clayberg » Thu Apr 14, 2011 7:05 am

Currently, WB does not offer any way to manipulate the properties of CellEditors created in initDataBindings().

The only way around this at the moment, would be to add your own method (e.g., postInitBindings()) and call it after initDataBindings(). You could reference the BindingContext and do anything you wanted at that point.

If all you want to do is make the CellEditor read-only, you can make that change directly in initDataBindings(), and it will be preserved the next time that method is written.

Code: Select all
final CellEditor cellEditor_1 = new ComboBoxCellEditor(tvProperties.getTable(), new String[0], SWT.READ_ONLY);
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA


Return to SWT Designer

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 1 guest

cron