litesoft
@ 948
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
package org.litesoft.datt.client.ui.widgets; import org.litesoft.GWT.client.widgets.Button; import org.litesoft.GWT.client.widgets.*; import org.litesoft.GWT.forms.client.*; import org.litesoft.datt.client.boviews.*; import org.litesoft.uispecification.*; import com.google.gwt.user.client.ui.*; import static org.litesoft.uispecification.FormWidgetAspectCtrl.*; import static org.litesoft.uispecification.FormWidgetCtrl.*; public class StoryFieldsPanel extends SizeableVerticalSplitPairPanel implements StoryViewNames { private Widget mPointerField; public StoryFieldsPanel( FormBinder<StoryView> pFB, FormEngine pFE, Button pTaskButton ) { stretchable(); add( createUpperPanel( pFB, pFE, pTaskButton ) ); add( pFB.add( aChanges ) ); } private Widget createUpperPanel( FormBinder<StoryView> pFB, FormEngine pFE, Button pTaskButton ) { SizeableVerticalPanel zPanel = new SizeableVerticalPanel().stretchable(); zPanel.add( mPointerField = pFB.add( aName ) ); zPanel.add( pFB.add( aDescription ) ); zPanel.add( createIsDonePlusPriority( pFB ) ); SizeableHorizontalPanel zHorizontalPanel = new SizeableHorizontalPanel().stretchableHorizontally(); zHorizontalPanel.add( pFB.add( aCreatorFullName ) ); zHorizontalPanel.add( new SizeableSpacer().stretchableHorizontally() ); if ( pTaskButton != null ) { zHorizontalPanel.add( pFE.addButton( Visible( Edit ).enable( Edit_Existing_NoChanges ), pTaskButton ) ); } zPanel.add( zHorizontalPanel ); return zPanel; } public Widget getPointerField() { return mPointerField; } private Widget createIsDonePlusPriority( FormBinder<StoryView> pFB ) { SizeableHorizontalPanel zPanel = new SizeableHorizontalPanel().stretchableHorizontally(); zPanel.add( pFB.add( aIsDone ) ); zPanel.add( new SizeableSpacer( 10 ) ); // todo: put back .stretchableHorizontally() ); zPanel.add( pFB.add( aShowDone ) ); return zPanel; } public static WidgetCtrlMap createWidgetCtrlMap( FormWidgetCtrl pDefaultCtrl ) { WidgetCtrlMap zWidgetCtrlMap = new WidgetCtrlMap( pDefaultCtrl ); zWidgetCtrlMap.add( SEARCH_FILTER.unique(), aName ); zWidgetCtrlMap.add( SEARCH_FILTER, aDescription ); zWidgetCtrlMap.add( SEARCH_FILTER.enable( FormWidgetAspectCtrl.Search ), aCreatorFullName ); zWidgetCtrlMap.add( SEARCH_ONLY.searchFilter(), aShowDone ); zWidgetCtrlMap.add( EDIT_ONLY, aIsDone ); zWidgetCtrlMap.add( Visible( Existing ).enable( No ), aChanges ); return zWidgetCtrlMap; } } |