001: /************************************************************************
002: Copyright 2004 Emil Kirschner
003:
004: Licensed under the Apache License, Version 2.0 (the "License");
005: you may not use this file except in compliance with the License.
006: You may obtain a copy of the License at
007:
008: http://www.apache.org/licenses/LICENSE-2.0
009:
010: Unless required by applicable law or agreed to in writing, software
011: distributed under the License is distributed on an "AS IS" BASIS,
012: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013: See the License for the specific language governing permissions and
014: limitations under the License.
015: ************************************************************************/package com.thekirschners.uitoys.autoui.annotations;
016:
017: import java.awt.*;
018: import java.lang.annotation.ElementType;
019: import java.lang.annotation.Retention;
020: import java.lang.annotation.RetentionPolicy;
021: import java.lang.annotation.Target;
022:
023: /**
024: * <p>intructs the UI builder to add a label to the annotated field and lay it out as specified
025: */
026: @Retention(RetentionPolicy.RUNTIME)
027: @Target(ElementType.FIELD)
028: public @interface LabelHints {
029: public enum Placement {
030: BEFORE, AFTER
031: };
032:
033: /**
034: * indicates weather or not the decoration shall be added before or after the editor element
035: */
036: Placement placement() default Placement.BEFORE;
037:
038: /**
039: * the label displayed by the user interface - may be a key for a localized string
040: */
041: String uiLabel();
042:
043: /**
044: * a string that identifies an icon that shall be used to represent this field in the UI
045: */
046: String uiIconID() default "";
047:
048: /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
049: // CONTAINER LAYOUT INFORMATION /////////////////////////////////////////////////////////////////////////////////
050: /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
051: /**
052: * GridBagConstraings value;
053: */
054: int anchor() default Integer.MIN_VALUE;
055:
056: /**
057: * GridBagConstraings value;
058: */
059: int fill() default GridBagConstraints.HORIZONTAL;
060:
061: /**
062: * GridBagConstraings value;
063: */
064: int gridx() default Integer.MIN_VALUE;
065:
066: /**
067: * GridBagConstraings value;
068: */
069: int gridy() default Integer.MIN_VALUE;
070:
071: /**
072: * GridBagConstraings value;
073: */
074: int gridwidth() default 1;
075:
076: /**
077: * GridBagConstraings value;
078: */
079: int gridheight() default 1;
080:
081: /**
082: * GridBagConstraings value;
083: */
084: int ipadx() default Integer.MIN_VALUE;
085:
086: /**
087: * GridBagConstraings value;
088: */
089: int ipady() default Integer.MIN_VALUE;
090:
091: /**
092: * GridBagConstraings value;
093: */
094: int weightx() default 1;
095:
096: /**
097: * GridBagConstraings value;
098: */
099: int weighty() default 0;
100:
101: /**
102: * GridBagConstraings value;
103: */
104: int[] insets() default { 0, 0, 0, 0 };
105: }
|