|
@@ -1,74 +1,74 @@ |
1 |
|
- |
// This Source Code is in the Public Domain per: http://unlicense.org |
2 |
|
- |
package org.litesoft.GWT.client.view; |
3 |
|
- |
|
4 |
|
- |
import org.litesoft.GWT.client.*; |
5 |
|
- |
import org.litesoft.GWT.client.widgets.*; |
6 |
|
- |
import org.litesoft.GWT.forms.client.*; |
7 |
|
- |
import org.litesoft.core.simpletypes.temporal.*; |
8 |
|
- |
import org.litesoft.uispecification.*; |
9 |
|
- |
|
10 |
|
- |
import com.google.gwt.user.client.ui.*; |
11 |
|
- |
|
12 |
|
- |
import java.util.*; |
13 |
|
- |
|
14 |
|
- |
public abstract class ReportDialogView extends DialogView { |
15 |
|
- |
protected String mReportID; |
16 |
|
- |
protected FormEngine mFE; |
17 |
|
- |
|
18 |
|
- |
protected ReportDialogView( ViewDef pViewDef ) { |
19 |
|
- |
super( title( pViewDef ), Opaqueness.Semi ); |
20 |
|
- |
mReportID = pViewDef.getFragmentID(); |
21 |
|
- |
} |
22 |
|
- |
|
23 |
|
- |
protected ReportDialogView( String pSection, ViewDef pViewDef ) { |
24 |
|
- |
super( title( pSection, pViewDef ), Opaqueness.Semi ); |
25 |
|
- |
mReportID = pViewDef.getFragmentID(); |
26 |
|
- |
} |
27 |
|
- |
|
28 |
|
- |
public void setNamedComponentError( String pName, String pError ) |
29 |
|
- |
throws NoSuchElementException { |
30 |
|
- |
setDialogErrorMessage( pError ); |
31 |
|
- |
mFE.setNamedComponentError( pName, pError ); |
32 |
|
- |
} |
33 |
|
- |
|
34 |
|
- |
@Override |
35 |
|
- |
public void aboutToShow() { |
36 |
|
- |
super.aboutToShow(); |
37 |
|
- |
mFE.initialize(); |
38 |
|
- |
} |
39 |
|
- |
|
40 |
|
- |
@Override |
41 |
|
- |
protected void justLoaded() { |
42 |
|
- |
super.justLoaded(); |
43 |
|
- |
setDefaultValues(); |
44 |
|
- |
setDialogErrorMessage( null ); |
45 |
|
- |
mFE.setFocus(); |
46 |
|
- |
} |
47 |
|
- |
|
48 |
|
- |
protected void setDefaultValues() { |
49 |
|
- |
} |
50 |
|
- |
|
51 |
|
- |
@Override |
52 |
|
- |
public Widget getBottomBar() { |
53 |
|
- |
return createButtomBar(); |
54 |
|
- |
} |
55 |
|
- |
|
56 |
|
- |
protected LeftCenterRightHorizontalPanel createButtomBar() { |
57 |
|
- |
LeftCenterRightHorizontalPanel zActionPanel = new LeftCenterRightHorizontalPanel(); |
58 |
|
- |
zActionPanel.addLeft( createCancelButton() ); |
59 |
|
- |
zActionPanel.addRight( mFE.addEditSubmitButton( createSubmitButton() ) ); |
60 |
|
- |
return zActionPanel; |
61 |
|
- |
} |
62 |
|
- |
|
63 |
|
- |
@Override |
64 |
|
- |
protected void submitRequested() { |
65 |
|
- |
UriFragmentIdParams zParams = createSubmitParams(); |
66 |
|
- |
if ( zParams != null ) { |
67 |
|
- |
String zWhen = new SimpleTimestamp( TimeRes.ToMIN, new Date() ).toString().replace( ' ', '-' ).replace( ':', '-' ); |
68 |
|
- |
UtilsGwt.windowOpen( "Report/" + zParams.toParamsString() + "/" + mReportID + "-" + zWhen + ".html", mReportID, "" ); |
69 |
|
- |
close(); |
70 |
|
- |
} |
71 |
|
- |
} |
72 |
|
- |
|
73 |
|
- |
abstract protected UriFragmentIdParams createSubmitParams(); |
74 |
|
- |
} |
|
1 |
+ |
// This Source Code is in the Public Domain per: http://unlicense.org |
|
2 |
+ |
package org.litesoft.GWT.client.view; |
|
3 |
+ |
|
|
4 |
+ |
import org.litesoft.GWT.client.*; |
|
5 |
+ |
import org.litesoft.GWT.client.widgets.*; |
|
6 |
+ |
import org.litesoft.GWT.forms.client.*; |
|
7 |
+ |
import org.litesoft.core.simpletypes.temporal.*; |
|
8 |
+ |
import org.litesoft.uispecification.*; |
|
9 |
+ |
|
|
10 |
+ |
import com.google.gwt.user.client.ui.*; |
|
11 |
+ |
|
|
12 |
+ |
import java.util.*; |
|
13 |
+ |
|
|
14 |
+ |
public abstract class ReportDialogView extends DialogView { |
|
15 |
+ |
protected String mReportID; |
|
16 |
+ |
protected FormEngine mFE; |
|
17 |
+ |
|
|
18 |
+ |
protected ReportDialogView( ViewDef pViewDef ) { |
|
19 |
+ |
super( title( pViewDef ), Opaqueness.Semi ); |
|
20 |
+ |
mReportID = pViewDef.getFragmentID(); |
|
21 |
+ |
} |
|
22 |
+ |
|
|
23 |
+ |
protected ReportDialogView( String pSection, ViewDef pViewDef ) { |
|
24 |
+ |
super( title( pSection, pViewDef ), Opaqueness.Semi ); |
|
25 |
+ |
mReportID = pViewDef.getFragmentID(); |
|
26 |
+ |
} |
|
27 |
+ |
|
|
28 |
+ |
public void setNamedComponentError( String pName, String pError ) |
|
29 |
+ |
throws NoSuchElementException { |
|
30 |
+ |
setDialogErrorMessage( pError ); |
|
31 |
+ |
mFE.setNamedComponentError( pName, pError ); |
|
32 |
+ |
} |
|
33 |
+ |
|
|
34 |
+ |
@Override |
|
35 |
+ |
public void aboutToShow() { |
|
36 |
+ |
super.aboutToShow(); |
|
37 |
+ |
mFE.initialize(); |
|
38 |
+ |
} |
|
39 |
+ |
|
|
40 |
+ |
@Override |
|
41 |
+ |
protected void justLoaded() { |
|
42 |
+ |
super.justLoaded(); |
|
43 |
+ |
setDefaultValues(); |
|
44 |
+ |
setDialogErrorMessage( null ); |
|
45 |
+ |
mFE.setFocus(); |
|
46 |
+ |
} |
|
47 |
+ |
|
|
48 |
+ |
protected void setDefaultValues() { |
|
49 |
+ |
} |
|
50 |
+ |
|
|
51 |
+ |
@Override |
|
52 |
+ |
public Widget getBottomBar() { |
|
53 |
+ |
return createButtomBar(); |
|
54 |
+ |
} |
|
55 |
+ |
|
|
56 |
+ |
protected LeftCenterRightHorizontalPanel createButtomBar() { |
|
57 |
+ |
LeftCenterRightHorizontalPanel zActionPanel = new LeftCenterRightHorizontalPanel(); |
|
58 |
+ |
zActionPanel.addLeft( createCancelButton() ); |
|
59 |
+ |
zActionPanel.addRight( mFE.addEditSubmitButton( createSubmitButton() ) ); |
|
60 |
+ |
return zActionPanel; |
|
61 |
+ |
} |
|
62 |
+ |
|
|
63 |
+ |
@Override |
|
64 |
+ |
protected void submitRequested() { |
|
65 |
+ |
UriFragmentIdParams zParams = createSubmitParams(); |
|
66 |
+ |
if ( zParams != null ) { |
|
67 |
+ |
String zWhen = new SimpleTimestamp( TimeRes.ToMIN, new Date() ).toString().replace( ' ', '-' ).replace( ':', '-' ); |
|
68 |
+ |
UtilsGwt.windowOpen( "Report/" + zParams.toParamsString() + "/" + mReportID + "-" + zWhen + ".html", mReportID, "" ); |
|
69 |
+ |
close(); |
|
70 |
+ |
} |
|
71 |
+ |
} |
|
72 |
+ |
|
|
73 |
+ |
abstract protected UriFragmentIdParams createSubmitParams(); |
|
74 |
+ |
} |