Community
Participate
Working Groups
The counterpart for org.eclipse.swt.widgets.ExpandBar is missing in RWT
Created attachment 99453 [details] First version of the ExpandBar widget
Created attachment 99969 [details] ExpandBar is added to the Control Demo. Some bugfixes.
Comments on expandbar patch: 1) We have to adjust since tags in the final version (depending on the release Version, probably 1.2) 2) Coding Conventions: (Remember by reading this that I didn't check which parts are original SWT ExpandBar code...) ExpandAdapter: final before method parameters is missing sometimes, spaces in parameter list is missing ExpandBar: missing parenthesis in if-control structure with single statement, final before method parameters is missing sometimes, we don't use return statements to end method execution, we don't use break to end while loops ExpandItem: final before method parameters is missing sometimes, we don't use single character local variable names (exceptions to the latter rule are index names like i,j,k etc. and coordinats like x,y) Code like this: width = Math.max( getPreferredWidth(), parent.computeSize( SWT.DEFAULT, SWT.DEFAULT, false ).x - 2 * parent.spacing - parent.v_scroll ); would be more readable if written like: int parentWidth = parent.computeSize( SWT.DEFAULT, SWT.DEFAULT, false ).x; int availableWidth = parentWidth - 2 * parent.spacing - parent.v_scroll; width = Math.max( getPreferredWidth(), availableWidth ); Maybe the variable names are not fitting, I just wanted to provide a sketch. ExpandItemLCA: To match the character per line limitations code like this: (1) public static final String EVENT_ITEM_EXPANDED = "org.eclipse.swt.events.expandItemExpanded"; (2) adapter.preserve( PROP_EXPANDED, Boolean.valueOf( expandItem.getExpanded() ) ); (3) writer.set( PROP_HEADER_HEIGHT, "headerHeight", headerHeight, DEFAULT_HEADER_HEIGHT ); can be formatted like: (1) public static final String EVENT_ITEM_EXPANDED = "org.eclipse.swt.events.expandItemExpanded"; (2) adapter.preserve( PROP_EXPANDED, Boolean.valueOf( expandItem.getExpanded() ) ); (3) writer.set( PROP_HEADER_HEIGHT, "headerHeight", headerHeight, DEFAULT_HEADER_HEIGHT ); 3) TypedEvent (Rüdiger) EVENT_ORDER check whether this is ok 4) ExpandItem (Rüdiger): readData: I don't think that the use of ProcessActionRunner should be necessary, as the ExpandEvent is part of the TypedEvents. 5) No TestCases - see Table_Test as an example 6) Demo: would be nice having buttons for adding and removing additional expandbar items 7) Image Problem: The image in the right upper corner of an item is not displayed correctly - see attached PNG.
Created attachment 100159 [details] Chevron images
Created attachment 100655 [details] Control demo is updated. JUnit tests added. Some bugfixes.
Created attachment 106076 [details] Updated computeSize and item layout calculation.
Created attachment 106937 [details] Patch without the binary data (images). Patch without the binary data (images). The binary data (images) are removed from the patch. Put the images from the zip in: org.eclipse.rap.rwt.q07\js\resource\widget\rap\expanditem and org.eclipse.rap.rwt.test.mockup\js\resource\widget\rap\expanditem
Created attachment 107580 [details] Sync the patch with CVS HEAD. Put the images from the zip in: org.eclipse.rap.rwt.q07\js\resource\widget\rap\expanditem and org.eclipse.rap.rwt.test.mockup\js\resource\widget\rap\expanditem
ExpandBar added to CVS HEAD.
ExpandBar commited. Close the bug.