litesoft
@ 821
litesoft / trunk / Java / core / Anywhere / src / org / litesoft / uispecification / ViewDef.java
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
// This Source Code is in the Public Domain per: http://litesoft.org/License.txt package org.litesoft.uispecification; import java.io.*; import org.litesoft.core.simpletypes.nonpublic.*; import org.litesoft.core.typeutils.*; public final class ViewDef extends EqualSupport implements Serializable { public static final ViewDef HOME = new ViewDef( "Home" ); private final String mFragmentID; private final String mUiString; /** * Each "page" has a unique identifier which is part of the uri's FragmentID, this is * created from the passed UiString. * * @param pUiString the text displayed to the user, which in turn is transformed into FragmentID. */ public ViewDef( String pUiString ) { this( ParameterizedUriFragmentId.transformToValidFragmentReference( pUiString ), pUiString ); } /** * Each "page" has a unique identifier which is part of the uri's FragmentID. * * @param pFragmentID a unique identifier (part of the uri's FragmentID) which can appear in the * location bar of the browser (no funny characters or spaces?). * @param pUiString the text displayed to the user */ public ViewDef( String pFragmentID, String pUiString ) { mFragmentID = Strings.assertNotNullNotEmpty( "FragmentID", pFragmentID ); mUiString = Strings.assertNotNullNotEmpty( "UiString", pUiString ); } public String getFragmentID() { return mFragmentID; } public String getUiString() { return mUiString; } @Override public int hashCode() { return mFragmentID.hashCode(); } public boolean equals( ViewDef pThem ) { return (this == pThem) || // ((pThem != null) // && equal( this.mFragmentID, pThem.mFragmentID ) // ); } @Override public boolean equals( Object o ) { return (this == o) || // ((o instanceof ViewDef) && equals( (ViewDef) o )); } @Override public String toString() { return mUiString; } } |