Subversion Repository Public Repository

litesoft

Diff Revisions 949 vs 950 for /trunk/Java/GWT/OldServer/src/org/litesoft/GWT/forms/server/support/CreateAMDParams.java

Diff revisions: vs.
  @@ -1,76 +1,76 @@
1 - // This Source Code is in the Public Domain per: http://unlicense.org
2 - package org.litesoft.GWT.forms.server.support;
3 -
4 - import org.litesoft.GWT.forms.server.*;
5 - import org.litesoft.commonfoundation.base.*;
6 - import org.litesoft.ui.support.*;
7 - import org.litesoft.ui_1_5.*;
8 -
9 - public class CreateAMDParams {
10 - protected ExternalizationInterface mExternalization;
11 - protected String mLocalReference;
12 - protected String mExtLabelID;
13 - protected AttributeUsage mUsage;
14 - protected FormAccessControl.Field mField;
15 - protected CachedString mFieldLabel;
16 - protected CachedString mFieldTooltip;
17 -
18 - private CreateAMDParams( ExternalizationInterface pExternalization, String pLocalReference, //
19 - String pExtLabelID, AttributeUsage pUsage, FormAccessControl.Field pField, //
20 - CachedString pFieldLabel, CachedString pFieldTooltip ) {
21 - mExternalization = pExternalization;
22 - mLocalReference = pLocalReference;
23 - mExtLabelID = pExtLabelID;
24 - mUsage = pUsage;
25 - mField = pField;
26 - mFieldLabel = pFieldLabel;
27 - mFieldTooltip = pFieldTooltip;
28 - }
29 -
30 - public CreateAMDParams( ExternalizationInterface pExternalization, String pLocalReference, //
31 - AttributeUsage pUsage, FormAccessControl.Field pField ) {
32 - this( pExternalization, pLocalReference, calcExtLabelID( pUsage, pLocalReference ), pUsage, pField,
33 - new CachedString(), new CachedString() );
34 - }
35 -
36 - public CreateAMDParams( CreateAMDParams pParams ) {
37 - this( pParams.mExternalization, pParams.mLocalReference, //
38 - pParams.mExtLabelID, pParams.mUsage, pParams.mField, //
39 - pParams.mFieldLabel, pParams.mFieldTooltip );
40 - }
41 -
42 - private static String calcExtLabelID( AttributeUsage pUsage, String pLocalReference ) {
43 - String rv = pUsage.getLabelID();
44 - return (rv != null) ? rv : pLocalReference;
45 - }
46 -
47 - public ExternalizationInterface getExternalization() {
48 - return mExternalization;
49 - }
50 -
51 - public String getLocalReference() {
52 - return mLocalReference;
53 - }
54 -
55 - public AttributeUsage getUsage() {
56 - return mUsage;
57 - }
58 -
59 - public FormAccessControl.Field getField() {
60 - return mField;
61 - }
62 -
63 - public String getFieldLabel() {
64 - if ( !mFieldLabel.isValid() ) {
65 - mFieldLabel.setValue( mExternalization.resolveLabel( mExtLabelID ) );
66 - }
67 - return mFieldLabel.getValue();
68 - }
69 -
70 - public String getFieldTooltip() {
71 - if ( !mFieldTooltip.isValid() ) {
72 - mFieldTooltip.setValue( mExternalization.resolveInputTooltip( mExtLabelID ) );
73 - }
74 - return mFieldTooltip.getValue();
75 - }
76 - }
1 + // This Source Code is in the Public Domain per: http://unlicense.org
2 + package org.litesoft.GWT.forms.server.support;
3 +
4 + import org.litesoft.GWT.forms.server.*;
5 + import org.litesoft.commonfoundation.base.*;
6 + import org.litesoft.ui.support.*;
7 + import org.litesoft.ui_1_5.*;
8 +
9 + public class CreateAMDParams {
10 + protected ExternalizationInterface mExternalization;
11 + protected String mLocalReference;
12 + protected String mExtLabelID;
13 + protected AttributeUsage mUsage;
14 + protected FormAccessControl.Field mField;
15 + protected CachedString mFieldLabel;
16 + protected CachedString mFieldTooltip;
17 +
18 + private CreateAMDParams( ExternalizationInterface pExternalization, String pLocalReference, //
19 + String pExtLabelID, AttributeUsage pUsage, FormAccessControl.Field pField, //
20 + CachedString pFieldLabel, CachedString pFieldTooltip ) {
21 + mExternalization = pExternalization;
22 + mLocalReference = pLocalReference;
23 + mExtLabelID = pExtLabelID;
24 + mUsage = pUsage;
25 + mField = pField;
26 + mFieldLabel = pFieldLabel;
27 + mFieldTooltip = pFieldTooltip;
28 + }
29 +
30 + public CreateAMDParams( ExternalizationInterface pExternalization, String pLocalReference, //
31 + AttributeUsage pUsage, FormAccessControl.Field pField ) {
32 + this( pExternalization, pLocalReference, calcExtLabelID( pUsage, pLocalReference ), pUsage, pField,
33 + new CachedString(), new CachedString() );
34 + }
35 +
36 + public CreateAMDParams( CreateAMDParams pParams ) {
37 + this( pParams.mExternalization, pParams.mLocalReference, //
38 + pParams.mExtLabelID, pParams.mUsage, pParams.mField, //
39 + pParams.mFieldLabel, pParams.mFieldTooltip );
40 + }
41 +
42 + private static String calcExtLabelID( AttributeUsage pUsage, String pLocalReference ) {
43 + String rv = pUsage.getLabelID();
44 + return (rv != null) ? rv : pLocalReference;
45 + }
46 +
47 + public ExternalizationInterface getExternalization() {
48 + return mExternalization;
49 + }
50 +
51 + public String getLocalReference() {
52 + return mLocalReference;
53 + }
54 +
55 + public AttributeUsage getUsage() {
56 + return mUsage;
57 + }
58 +
59 + public FormAccessControl.Field getField() {
60 + return mField;
61 + }
62 +
63 + public String getFieldLabel() {
64 + if ( !mFieldLabel.isValid() ) {
65 + mFieldLabel.setValue( mExternalization.resolveLabel( mExtLabelID ) );
66 + }
67 + return mFieldLabel.getValue();
68 + }
69 +
70 + public String getFieldTooltip() {
71 + if ( !mFieldTooltip.isValid() ) {
72 + mFieldTooltip.setValue( mExternalization.resolveInputTooltip( mExtLabelID ) );
73 + }
74 + return mFieldTooltip.getValue();
75 + }
76 + }