Subversion Repository Public Repository

litesoft

Diff Revisions 133 vs 137 for /trunk/Java/GWT/Client/src/org/litesoft/GWT/client/widgets/DefButtonNamedTypedFactory.java

Diff revisions: vs.
  @@ -6,6 +6,7 @@
6 6 import org.litesoft.GWT.client.command.*;
7 7 import org.litesoft.GWT.client.widgets.nonpublic.*;
8 8 import org.litesoft.core.util.*;
9 + import org.litesoft.uispecification.*;
9 10
10 11 import com.google.gwt.event.dom.client.*;
11 12 import com.google.gwt.user.client.*;
  @@ -19,7 +20,7 @@
19 20
20 21 private final DefButtonNamedTyped mTyped;
21 22 private final Form mForm;
22 - private String mCustomStyle,mEnabledToolTip, mDisabledToolTip; // initialized to null
23 + private String mCustomStyle, mEnabledToolTip, mDisabledToolTip; // initialized to null
23 24 private boolean mDisabled = false;
24 25 private List<ClickHandler> mClickHandlers;
25 26
  @@ -98,6 +99,33 @@
98 99 return (pCommand == null) ? this : add( new ClickHandlerCommandAdaptor( pCommand ) );
99 100 }
100 101
102 + public final DefButtonNamedTypedFactory add( final ViewDef pTarget )
103 + {
104 + UtilsCommon.assertNotNull( "Target (ViewDef)", pTarget );
105 + return add( new ClickHandler()
106 + {
107 + @Override
108 + public void onClick( ClickEvent event )
109 + {
110 + new ShowScreenCommand( pTarget ).execute();
111 + }
112 + } );
113 + }
114 +
115 + public final DefButtonNamedTypedFactory add( final ViewDef pTarget, final UriFragmentIdParams.ScreenParamsFactory pFactory )
116 + {
117 + UtilsCommon.assertNotNull( "Target (ViewDef)", pTarget );
118 + UtilsCommon.assertNotNull( "Factory", pFactory );
119 + return add( new ClickHandler()
120 + {
121 + @Override
122 + public void onClick( ClickEvent event )
123 + {
124 + new ShowScreenCommand( pTarget, pFactory.create( pTarget ) ).execute();
125 + }
126 + } );
127 + }
128 +
101 129 public String getCustomStyle()
102 130 {
103 131 return mCustomStyle;
  @@ -123,7 +151,7 @@
123 151
124 152 public final Button create()
125 153 {
126 - Button zButton = ButtonFactory.getFactory().create( this );
154 + Button zButton = ButtonFactoryFactory.getFactory().create( this );
127 155 for ( ClickHandler zHandler : getClickHandlers() )
128 156 {
129 157 zButton.addClickHandler( zHandler );