Subversion Repository Public Repository

litesoft

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

Diff revisions: vs.
  @@ -1,31 +1,31 @@
1 - // This Source Code is in the Public Domain per: http://unlicense.org
2 - package org.litesoft.GWT.forms.server.support.converters;
3 -
4 - import org.litesoft.GWT.forms.server.support.nonpublic.*;
5 - import org.litesoft.core.simpletypes.*;
6 - import org.litesoft.orsup.base.*;
7 - import org.litesoft.ui_1_5.*;
8 -
9 - public class SendableExternalizedKeyValuePairConverter extends AbstractSendableKeyValuePairConverter {
10 - private ExternalizationInterface mExternalization;
11 -
12 - public SendableExternalizedKeyValuePairConverter( ExternalizationInterface pExternalization ) {
13 - mExternalization = pExternalization;
14 - }
15 -
16 - protected SimpleKeyValuePair createSimpleKeyValuePair( Object pOption ) {
17 - if ( pOption == null ) {
18 - return new StringKeyValuePair( "" );
19 - }
20 - if ( pOption instanceof SimpleKeyValuePair ) {
21 - return (SimpleKeyValuePair) pOption;
22 - }
23 - if ( pOption instanceof PersistentObject ) {
24 - PersistentObject po = (PersistentObject) pOption;
25 - return new StringKeyValuePair( po.getPersistentObjectUniqueKey().toString(),
26 - po.getDisplayValue() );
27 - }
28 - String zOptionAsString = pOption.toString();
29 - return new StringKeyValuePair( zOptionAsString, mExternalization.resolveLabel( zOptionAsString ) );
30 - }
31 - }
1 + // This Source Code is in the Public Domain per: http://unlicense.org
2 + package org.litesoft.GWT.forms.server.support.converters;
3 +
4 + import org.litesoft.GWT.forms.server.support.nonpublic.*;
5 + import org.litesoft.core.simpletypes.*;
6 + import org.litesoft.orsup.base.*;
7 + import org.litesoft.ui_1_5.*;
8 +
9 + public class SendableExternalizedKeyValuePairConverter extends AbstractSendableKeyValuePairConverter {
10 + private ExternalizationInterface mExternalization;
11 +
12 + public SendableExternalizedKeyValuePairConverter( ExternalizationInterface pExternalization ) {
13 + mExternalization = pExternalization;
14 + }
15 +
16 + protected SimpleKeyValuePair createSimpleKeyValuePair( Object pOption ) {
17 + if ( pOption == null ) {
18 + return new StringKeyValuePair( "" );
19 + }
20 + if ( pOption instanceof SimpleKeyValuePair ) {
21 + return (SimpleKeyValuePair) pOption;
22 + }
23 + if ( pOption instanceof PersistentObject ) {
24 + PersistentObject po = (PersistentObject) pOption;
25 + return new StringKeyValuePair( po.getPersistentObjectUniqueKey().toString(),
26 + po.getDisplayValue() );
27 + }
28 + String zOptionAsString = pOption.toString();
29 + return new StringKeyValuePair( zOptionAsString, mExternalization.resolveLabel( zOptionAsString ) );
30 + }
31 + }