001: // @@
002: // @@
003: /*
004: * Wi.Ser Framework
005: *
006: * Version: 1.8.1, 20-September-2007
007: * Copyright (C) 2005 Dirk von der Weiden <dvdw@imail.de>
008: *
009: * This library is free software; you can redistribute it and/or
010: * modify it under the terms of the GNU Lesser General Public
011: * License as published by the Free Software Foundation; either
012: * version 2 of the License, or (at your option) any later version.
013: *
014: * This library is distributed in the hope that it will be useful,
015: * but WITHOUT ANY WARRANTY; without even the implied warranty of
016: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
017: * Lesser General Public License for more details.
018: *
019: * You should have received a copy of the GNU Lesser General Public
020: * License along with this library located in LGPL.txt in the
021: * license directory; if not, write to the
022: * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
023: * Boston, MA 02111-1307, USA.
024: *
025: * If this agreement does not cover your requirements, please contact us
026: * via email to get detailed information about the commercial license
027: * or our service offerings!
028: *
029: */
030: // @@
031: package de.ug2t.unifiedGui.interfaces;
032:
033: import de.ug2t.kernel.*;
034:
035: /**
036: * @author Dirk
037: *
038: * date: 15.09.2003 project: WiSer-Framework
039: *
040: * <p>
041: * IUnInputField is the common interface to an text-input widget. A single line
042: * of text is edited or displayed by this widget
043: * </p>
044: */
045: public interface IUnInputField extends IUnInputComponent, IUnComponent,
046: IUnTextInputComponent {
047: /**
048: * @author Dirk
049: *
050: * date: 29.05.2007 project: WiSer-Framework
051: *
052: * <p>
053: * Factory is a convenience class to create components of the surrounding
054: * interface's type without taking care for the WidgetServer MultiChannel API.
055: * It's use is similar to a constructor.
056: * </p>
057: */
058: public static class Factory {
059: /**
060: * Creates a standard version of this component as described in the factory.
061: * If you create masses of components for e.g. within a renderer use
062: * <i> create(IUnApplication xAppl)</i> for performance
063: * reasons.
064: *
065: * @param xSize
066: * size on screen
067: * @param xLen
068: * maximum number of characters to input
069: * @param xPwd
070: * true indicates a password input, otherwise false
071: *
072: * @return new component
073: */
074: public static IUnInputField create(int xSize, int xLen,
075: boolean xPwd) {
076: IUnApplication l_appl = (IUnApplication) KeRegisteredObject
077: .pcmf_getObjByName(IUnApplication.MY_APPL);
078: return (l_appl.pcmf_getComponentFactory()
079: .pcmf_createInputField(l_appl.pcmf_getApplType(),
080: "", xSize, xLen, "", xPwd, l_appl));
081: }
082:
083: /**
084: * Creates a special version of this component as described in the factory
085: * configuration under the descriptor xFactoryDesc. If you create masses of
086: * components for e.g. within a renderer use <i>
087: * create(IUnApplication xAppl, String xFactoryDesc)</i> for performance
088: * reasons.
089: *
090: * @param xSize
091: * size on screen
092: * @param xLen
093: * maximum number of characters to input
094: * @param xPwd
095: * true indicates a password input, otherwise false
096: * @param xFactoryDesc
097: * descriptor
098: * @return new component
099: */
100: public static IUnInputField create(int xSize, int xLen,
101: boolean xPwd, String xFactoryDesc) {
102: IUnApplication l_appl = (IUnApplication) KeRegisteredObject
103: .pcmf_getObjByName(IUnApplication.MY_APPL);
104: return (l_appl.pcmf_getComponentFactory()
105: .pcmf_createInputFieldPlugin(l_appl
106: .pcmf_getApplType(), "", xSize, xLen, "",
107: xPwd, l_appl, xFactoryDesc));
108: }
109:
110: /**
111: * Creates a standard version of this component as described in the factory
112: * within the given application-context. If you create masses of components
113: * for e.g. within a renderer use this method for performance reasons.
114: *
115: * @param xSize
116: * size on screen
117: * @param xLen
118: * maximum number of characters to input
119: * @param xPwd
120: * true indicates a password input, otherwise false
121: * @param xAppl
122: * application in which context the component is created
123: * @return new component
124: */
125: public static IUnInputField create(int xSize, int xLen,
126: boolean xPwd, IUnApplication xAppl) {
127: return (xAppl.pcmf_getComponentFactory()
128: .pcmf_createInputField(xAppl.pcmf_getApplType(),
129: "", xSize, xLen, "", xPwd, xAppl));
130: }
131:
132: /**
133: * Creates a special version of this component as described in the factory
134: * configuration under the descriptor xFactoryDesc. If you create masses of
135: * components for e.g. within a renderer use this function for performance
136: * reasons.
137: *
138: * @param xSize
139: * size on screen
140: * @param xLen
141: * maximum number of characters to input
142: * @param xPwd
143: * true indicates a password input, otherwise false
144: * @param xFactoryDesc
145: * descriptor
146: * @param xAppl
147: * application in which context the component is created
148: * @return new component
149: */
150: public static IUnInputField create(int xSize, int xLen,
151: boolean xPwd, IUnApplication xAppl, String xFactoryDesc) {
152: return (xAppl.pcmf_getComponentFactory()
153: .pcmf_createInputFieldPlugin(xAppl
154: .pcmf_getApplType(), "", xSize, xLen, "",
155: xPwd, xAppl, xFactoryDesc));
156: }
157: }
158:
159: /**
160: * <p>
161: * Gets the size of input-field.
162: * </p>
163: * <p>
164: *
165: * @return size, amount of displayed characters
166: * </p>
167: * <p>
168: * </p>
169: */
170: public int pcmf_getSize();
171:
172: /**
173: * <p>
174: * Gets the length of the input-field
175: * </p>
176: * <p>
177: *
178: * @return length, amount of characters which can be entered into the field
179: * </p>
180: * <p>
181: * </p>
182: */
183: public int pcmf_getMaxLen();
184:
185: /**
186: * <p>
187: * Sets the text alignment to EAST or WEST
188: * </p>
189: * <p>
190: *
191: * </p>
192: * <p>
193: *
194: * @param xAlign
195: * Alignment can be ALIGN_EAST, ALIGN_CENTER or ALIGN_WEST
196: * </p>
197: */
198: public void pcmf_setTextAlign(int xAlign);
199:
200: /**
201: * <p>
202: * Gets the text alignment mode
203: * </p>
204: * <p>
205: *
206: * @return ALIGN_EAST, ALIGN_CENTER or ALIGN_WEST
207: * </p>
208: * <p>
209: * </p>
210: */
211: public int pcmf_getTextAlign();
212:
213: /**
214: * <p>
215: * Gets whether the field is a password field or not
216: * </p>
217: * <p>
218: *
219: * @return true indicates pwd field, otherwise false
220: * </p>
221: * <p>
222: * </p>
223: */
224: public boolean pcmf_isPwd();
225: }
|