Subversion Repository Public Repository

litesoft

Diff Revisions 947 vs 948 for /trunk/GWT_Sandbox/FormEngine/src/com/temp/client/foundation/widget/dialog/ConfirmationDialogExt.java

Diff revisions: vs.
  @@ -1,36 +1,32 @@
1 1 package com.temp.client.foundation.widget.dialog;
2 2
3 - import com.temp.client.foundation.handler.ActionHandler;
4 - import com.temp.client.foundation.widget.OurPushButton;
5 -
6 - import com.google.gwt.event.dom.client.ClickEvent;
7 - import com.google.gwt.event.dom.client.ClickHandler;
8 - import com.google.gwt.user.client.ui.ButtonBase;
9 -
10 - public class ConfirmationDialogExt<T>{
11 -
12 - private ConfirmationDialog<T> confirmDialog;
13 - private ActionHandler<T> noHandler;
14 -
15 - public ConfirmationDialogExt(final T obj, String title, Integer contentWidth, String... body) {
16 -
17 - ButtonBase noButton = new OurPushButton("noYesSize");
18 - confirmDialog = new ConfirmationDialog<T>(obj, title, contentWidth, null, noButton, body) ;
19 -
20 - noButton.addClickHandler(new ClickHandler() {
21 - @Override
22 - public void onClick(ClickEvent event) {
23 - if (noHandler!= null) {
24 - noHandler.execute(obj);
25 - }
26 - }
27 - });
28 - }
29 -
30 -
31 - public void show(ActionHandler<T> yesHandler, ActionHandler<T> noHandler) {
32 - this.noHandler = noHandler;
33 - confirmDialog.show(yesHandler);
3 + import com.google.gwt.event.dom.client.*;
4 + import com.google.gwt.user.client.ui.*;
5 + import com.temp.client.foundation.handler.*;
6 + import com.temp.client.foundation.widget.*;
7 +
8 + public class ConfirmationDialogExt<T> {
9 +
10 + private ConfirmationDialog<T> confirmDialog;
11 + private ActionHandler<T> noHandler;
12 +
13 + public ConfirmationDialogExt( final T obj, String title, Integer contentWidth, String... body ) {
14 +
15 + ButtonBase noButton = new OurPushButton( "noYesSize" );
16 + confirmDialog = new ConfirmationDialog<T>( obj, title, contentWidth, null, noButton, body );
17 +
18 + noButton.addClickHandler( new ClickHandler() {
19 + @Override
20 + public void onClick( ClickEvent event ) {
21 + if ( noHandler != null ) {
22 + noHandler.execute( obj );
23 + }
24 + }
25 + } );
34 26 }
35 27
28 + public void show( ActionHandler<T> yesHandler, ActionHandler<T> noHandler ) {
29 + this.noHandler = noHandler;
30 + confirmDialog.show( yesHandler );
31 + }
36 32 }