litesoft
@ 821
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 76 77 78 79 80 81 82 |
// This Source Code is in the Public Domain per: http://litesoft.org/License.txt package org.litesoft.ui.support; import org.litesoft.core.typeutils.*; import org.litesoft.ui.def.nonpublic.support.*; public final class ActionUsage extends AbstractSharedUsage { public static final long serialVersionUID = -7832343234032168333L; public static final ActionUsage[] EMPTY_ARRAY = new ActionUsage[0]; private String mActionID; /** * @deprecated GWT ONLY */ public ActionUsage() { } public ActionUsage( String pActionID, String pLabelID, boolean pDisabled ) { super( pDisabled, pLabelID ); mActionID = Strings.assertNotNullNotEmpty( "ActionID", pActionID ); } public String getActionID() { return mActionID; } public String getExtLabelID() { String rv = getLabelID(); return (rv != null) ? rv : getActionID(); } public boolean equals( Object o ) { return (this == o) || ((o instanceof ActionUsage) && equals( (ActionUsage) o )); } public boolean equals( ActionUsage them ) { return (this == them) || ((them != null) // && Objects.areNonArraysEqual( this.mActionID, them.mActionID ) // && Objects.areNonArraysEqual( this.getLabelID(), them.getLabelID() ) // && Booleans.areNonArraysEqual( this.isDisabled(), them.isDisabled() ) // ); } public int hashCode() { return mActionID.hashCode(); } public int compareTo( ActionUsage pThem ) { return Compare.first( this.mActionID, pThem.mActionID // ).then( this.getLabelID(), pThem.getLabelID() // ).then( this.isDisabled(), pThem.isDisabled() // ).result(); } public int compareTo( Object pObject ) { return compareTo( (ActionUsage) pObject ); } public String toString() { return toStringBuilder( new StringBuilder().append( "ActionUsage-" ), 0 ).toString(); } public StringBuilder toStringBuilder( StringBuilder pSB, int pDepth ) { pSB.append( mActionID ); addShared( pSB ); return pSB; } } |