org.havi.ui.HSinglelineEntry Maven / Gradle / Ivy
package org.havi.ui;
/*
* Copyright 2000-2003 by HAVi, Inc. Java is a trademark of Sun
* Microsystems, Inc. All rights reserved.
*/
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.Dimension;
import java.awt.Color;
import java.awt.event.KeyEvent;
import org.havi.ui.event.*;
/**
The {@link org.havi.ui.HSinglelineEntry} is a user interface
component used to receive a single line of alphanumeric entry from
the user and can also be used for password input.
Upon creation the {@link org.havi.ui.HSinglelineEntry} is set to a
non-editable mode identical in functionality to an {@link
org.havi.ui.HText}.
On keyboard-based systems, if the user navigates to the component
using the keyboard then the component must first be switched into
edit mode before it will accept any key presses (other than for
navigation to another component). The mechanism by which the
component is switched into and out of edit mode is via
HTextEvent
events with ids {@link
org.havi.ui.event.HTextEvent#TEXT_START_CHANGE}
and {@link org.havi.ui.event.HTextEvent#TEXT_END_CHANGE},
which may be triggered in response to a
key stroke or other Java AWT event.
On entering its editable mode the component will send an
HTextEvent
event with an id of {@link
org.havi.ui.event.HTextEvent#TEXT_START_CHANGE}
to all registered {@link org.havi.ui.event.HTextListener}
listeners. The {@link org.havi.ui.HSinglelineEntry}
will then respond to key events by inserting
characters into the text string or positioning the insertion point
(caret) via further {@link org.havi.ui.event.HTextEvent}
events.
For example, on platforms which do not provide a means of
positioning the caret independently from navigating to components, the
navigation keys will be interpreted as caret positioning keys in
this mode.
While in the editing mode, the component will generate an
HTextEvent
event with an id of {@link
org.havi.ui.event.HTextEvent#TEXT_CHANGE}
whenever the text content of the HSinglelineEntry changes
(e.g. a character is inserted).
On receiving an HTextEvent
event with an id of {@link
org.havi.ui.event.HTextEvent#TEXT_END_CHANGE}
the component shall leave its editable mode and send an
HTextEvent
event with an id of {@link
org.havi.ui.event.HTextEvent#TEXT_END_CHANGE}
to all registered {@link org.havi.ui.event.HTextListener
HTextListener} listeners. The user can then navigate out of the {@link
org.havi.ui.HSinglelineEntry}.
On mouse-based systems, if the user selects the component by clicking
a mouse button inside its bounds then the {@link
org.havi.ui.HSinglelineEntry} will automatically
switch into edit mode and generate an HTextEvent
with
an id of {@link
org.havi.ui.event.HTextEvent#TEXT_START_CHANGE}.
It will stay in edit mode so long as the
mouse pointer remains within the bounds of the component. Once the
mouse pointer leaves the bounds then it will switch back into
non-editable mode and generate an HTextEvent
with an
id of {@link
org.havi.ui.event.HTextEvent#TEXT_END_CHANGE}.
By default {@link org.havi.ui.HSinglelineEntry} uses the {@link
org.havi.ui.HSinglelineEntryLook} to render itself.
The parameters to the constructors are as follows, in cases where
parameters are not used, then the constructor should use the default
values.
Default parameter values exposed in the constructors
Parameter Description Default value
Set method Get method
x
x-coordinate of top left hand corner of this component in pixels,
relative to its parent container (subject to layout management).
---
java.awt.Component#setBounds
java.awt.Component#getBounds
y
y-coordinate of top left hand corner of this component in pixels,
relative to its parent container (subject to layout management).
---
java.awt.Component#setBounds
java.awt.Component#getBounds
width
width of this component in pixels (subject to layout management).
---
java.awt.Component#setBounds
java.awt.Component#getBounds
height
height of this component in pixels (subject to layout management).
---
java.awt.Component#setBounds
java.awt.Component#getBounds
text
The text within this {@link org.havi.ui.HSinglelineEntry},
to be used as the displayed and editable content
for all states.
null
{@link org.havi.ui.HVisible#setTextContent}
{@link org.havi.ui.HVisible#getTextContent}
maxChars
The maximum number of characters allowed in this {@link
org.havi.ui.HSinglelineEntry}.
16 characters
{@link org.havi.ui.HSinglelineEntry#setMaxChars}
{@link org.havi.ui.HSinglelineEntry#getMaxChars}
font
The font to be used for this component.
---
java.awt.Component#setFont
.
java.awt.Component#getFont
.
color
The color to be used for this component.
---
java.awt.Component#setForeground
.
java.awt.Component#getForeground
.
Default parameter values not exposed in the constructors
Description Default value Set method
Get method
Associated matte ({@link org.havi.ui.HMatte HMatte}).
none (i.e. getMatte() returns null
)
{@link org.havi.ui.HComponent#setMatte setMatte}
{@link org.havi.ui.HComponent#getMatte getMatte}
The text layout manager responsible for text
formatting.
An {@link org.havi.ui.HDefaultTextLayoutManager}
object.
{@link org.havi.ui.HVisible#setTextLayoutManager}
{@link org.havi.ui.HVisible#getTextLayoutManager}
The background painting mode
{@link org.havi.ui.HVisible#NO_BACKGROUND_FILL}
{@link org.havi.ui.HVisible#setBackgroundMode}
{@link org.havi.ui.HVisible#getBackgroundMode}
The default preferred size
not set (i.e. NO_DEFAULT_SIZE) unless specified by width
and height
parameters
{@link org.havi.ui.HVisible#setDefaultSize}
{@link org.havi.ui.HVisible#getDefaultSize}
The horizontal content alignment
{@link org.havi.ui.HVisible#HALIGN_CENTER}
{@link org.havi.ui.HVisible#setHorizontalAlignment}
{@link org.havi.ui.HVisible#getHorizontalAlignment}
The vertical content alignment
{@link org.havi.ui.HVisible#VALIGN_CENTER}
{@link org.havi.ui.HVisible#setVerticalAlignment}
{@link org.havi.ui.HVisible#getVerticalAlignment}
The content scaling mode
{@link org.havi.ui.HVisible#RESIZE_NONE}
{@link org.havi.ui.HVisible#setResizeMode}
{@link org.havi.ui.HVisible#getResizeMode}
The border mode
true
{@link org.havi.ui.HVisible#setBordersEnabled}
{@link org.havi.ui.HVisible#getBordersEnabled}
Caret position
At the end of the current text string
{@link HSinglelineEntry#setCaretCharPosition}
{@link HSinglelineEntry#getCaretCharPosition}
Input type
{@link HSinglelineEntry#INPUT_ANY}
{@link HSinglelineEntry#setType}
{@link HSinglelineEntry#getType}
Customized input range
null
{@link HSinglelineEntry#setValidInput}
{@link HSinglelineEntry#getValidInput}
Password protection (the echo character)
Zero (ASCII NUL), i.e. not password protected.
{@link HSinglelineEntry#setEchoChar}
{@link HSinglelineEntry#getEchoChar} and
{@link HSinglelineEntry#echoCharIsSet}
The default "look" for this class.
A platform specific {@link org.havi.ui.HSinglelineEntryLook HSinglelineEntryLook}
{@link org.havi.ui.HSinglelineEntry#setDefaultLook HSinglelineEntry.setDefaultLook}
{@link org.havi.ui.HSinglelineEntry#getDefaultLook HSinglelineEntry.getDefaultLook}
The "look" for this object.
The {@link org.havi.ui.HSinglelineEntryLook HSinglelineEntryLook} returned from
HSinglelineEntry.getDefaultLook when this object was created.
{@link org.havi.ui.HSinglelineEntry#setLook HSinglelineEntry.setLook}
{@link org.havi.ui.HSinglelineEntry#getLook HSinglelineEntry.getLook}
The gain focus sound.
null
{@link org.havi.ui.HSinglelineEntry#setGainFocusSound setGainFocusSound}
{@link org.havi.ui.HSinglelineEntry#getGainFocusSound getGainFocusSound}
The lose focus sound.
null
{@link org.havi.ui.HSinglelineEntry#setLoseFocusSound setLoseFocusSound}
{@link org.havi.ui.HSinglelineEntry#getLoseFocusSound getLoseFocusSound}
*/
public class HSinglelineEntry
extends HVisible
implements HTextValue
{
/**
* Creates an {@link org.havi.ui.HSinglelineEntry}
* object. See the class description for details
* of constructor parameters and default values.
*/
public HSinglelineEntry()
{
}
/**
* Creates an {@link org.havi.ui.HSinglelineEntry}
* object. See the class description for details
* of constructor parameters and default values.
*/
public HSinglelineEntry(String text, int x, int y, int width, int height,
int maxChars, Font font, Color color)
{
}
/**
* Creates an {@link org.havi.ui.HSinglelineEntry}
* object. See the class description for details
* of constructor parameters and default values.
*/
public HSinglelineEntry(int x, int y, int width, int height,
int maxChars)
{
}
/**
* Creates an {@link org.havi.ui.HSinglelineEntry}
* object. See the class description for details
* of constructor parameters and default values.
*/
public HSinglelineEntry(String text, int maxChars, Font font,
Color color)
{
}
/**
* Creates an {@link org.havi.ui.HSinglelineEntry}
* object. See the class description for details
* of constructor parameters and default values.
*/
public HSinglelineEntry(int maxChars)
{
}
/**
* Sets the text content used in this {@link
* org.havi.ui.HSinglelineEntry}.
*
* Note that {@link org.havi.ui.HSinglelineEntry}
* components do not support separate pieces of textual content per
* state (as defined in {@link org.havi.ui.HState}) ---
* rather a single piece of content is defined for all its
* interaction states.
*
* Additionally, the {@link
* org.havi.ui.HSinglelineEntry#setTextContent}
* method truncates the string according to the current maxChars
* setting.
*
* @param string The content. If the content is null, then any
* currently assigned content shall be removed for the specified
* state.
* @param state The state of the component for which this content
* should be displayed. This parameter shall be ignored and
* considered to have the value {@link HState#ALL_STATES}.
*
* @see HSinglelineEntry#getTextContent
*/
public void setTextContent(String string, int state)
{
}
/**
* Gets the text content used in this {@link
* org.havi.ui.HSinglelineEntry HSinglelineEntry}.
*
* Note that {@link org.havi.ui.HSinglelineEntry}
* components do not support separate pieces of textual content per
* state (as defined in {@link org.havi.ui.HState}) ---
* rather a single piece of content is defined for all its
* interaction states.
*
* @param state The state of the component for which this content
* should be displayed. This parameter shall be ignored.
* @return the text content used in this {@link
* org.havi.ui.HSinglelineEntry}
* @see HSinglelineEntry#setTextContent
*/
public String getTextContent(int state)
{
return (null);
}
/**
* Gets the position of the text insertion caret for this the
* current line in this text component. The valid values of the
* caret position are from 0 to the length of the string retrieved
* using {@link org.havi.ui.HSinglelineEntry#getTextContent
* getTextContent}, where 0 implies insertion as the first
* character (i.e. at the start of the string) and {@link
* org.havi.ui.HSinglelineEntry#getTextContent
* (getTextContent()).length()} implies that further characters
* are to be appended onto the end of the string. Hence, the valid
* caret positions for the string "abc" of length 3, are
* 0, 1, 2 and 3 --- with caret locations as shown below:
*
* 0 "a" 1 "b" 2 "c" 3
*
*
* @return the position of the text insertion caret.
*/
public int getCaretCharPosition()
{
return (0);
}
/**
* Sets the position of the text insertion caret for this text
* component. If position is not valid for the current content the
* caret is moved to the nearest position.
*
* @param position the new position of the text insertion caret.
* @return the new caret position.
*/
public int setCaretCharPosition(int position)
{
return (0);
}
/**
* Set to indicate to the system which input keys are required by this
* component. The input type constants can be added to define the
* union of the character sets corresponding to the respective
* constants.
*
* @param type sum of one or several of {@link
* org.havi.ui.HKeyboardInputPreferred#INPUT_ANY},
* {@link org.havi.ui.HKeyboardInputPreferred#INPUT_NUMERIC}, {@link
* org.havi.ui.HKeyboardInputPreferred#INPUT_ALPHA} or
* {@link org.havi.ui.HKeyboardInputPreferred#INPUT_CUSTOMIZED}.
*/
public void setType(int type)
{
}
/**
* Defines the set of the characters which are valid for
* customized keyboard input, i.e. when the input type is set to
* {@link org.havi.ui.HKeyboardInputPreferred#INPUT_CUSTOMIZED}.
*
* @param inputChars an array of characters which comprises the
* valid input characters.
*/
public void setValidInput(char[] inputChars)
{
}
/**
* Determine if this component has an echo character set, i.e. if
* the echo character is non-zero.
*
* @return true if an echo character is set, false otherwise.
*/
public boolean echoCharIsSet()
{
return (false);
}
/**
* Returns the character to be used for echoing.
*
* @return the character to be used for echoing or 0 (ASCII NUL)
* if no echo character is set.
*/
public char getEchoChar()
{
return (0);
}
/**
* Sets the number of character to echo for this component.
*
* @param c the character used to echo any input, e.g. if c == '*'
* a password-style input will be displayed. If c is zero (ASCII
* NUL), then all characters will be echoed on-screen, this is the
* default behavior.
*/
public void setEchoChar(char c)
{
}
/**
* Sets the default {@link org.havi.ui.HLook HLook} for further
* {@link org.havi.ui.HSinglelineEntry}
* Components.
*
* @param look The {@link org.havi.ui.HLook} that will be
* used by default when creating a new {@link
* org.havi.ui.HSinglelineEntry} component.
* Note that this parameter may be null, in which case newly
* created components shall not draw themselves until a non-null
* look is set using the {@link
* org.havi.ui.HSinglelineEntry#setLook} method.
*/
public static void setDefaultLook(HSinglelineEntryLook look)
{
}
/**
* Returns the currently set default {@link org.havi.ui.HLook}
* for {@link org.havi.ui.HSinglelineEntry}
* components.
*
* @return The {@link org.havi.ui.HLook} that is used by
* default when creating a new {@link org.havi.ui.HSinglelineEntry}
* component.
*/
public static HSinglelineEntryLook getDefaultLook()
{
return (null);
}
/**
* Sets the {@link org.havi.ui.HLook} for this component.
*
* @param hlook The {@link org.havi.ui.HLook} that is to be
* used for this component.
* Note that this parameter may be null, in which case the
* component will not draw itself until a look is set.
* @exception HInvalidLookException If the Look is not an {@link
* org.havi.ui.HSinglelineEntryLook}.
*/
public void setLook(HLook hlook)
throws HInvalidLookException
{
}
/**
* Insert a character at the current caret position, subject to
* the maximum number of input characters.
*
* @param c the character to insert
* @return true if the character was inserted, false otherwise.
*/
public boolean insertChar(char c)
{
return (true);
}
/**
* Delete a character behind the current caret position.
*
* @return true if a character was deleted, false otherwise.
*/
public boolean deletePreviousChar()
{
return (true);
}
/**
* Delete a character forward of the current caret position.
*
* @return true if a character was deleted, false otherwise.
*/
public boolean deleteNextChar()
{
return (true);
}
/**
* Move the caret to the next character. The caret position is
* constrained such that the insert point lies within the range as
* defined by the {@link
* org.havi.ui.HSinglelineEntry#getCaretCharPosition}
* method.
*/
public void caretNextCharacter()
{
}
/**
* Move the caret to the previous character. The caret position is
* constrained such that the insert point lies within the range as
* defined by the {@link
* org.havi.ui.HSinglelineEntry#getCaretCharPosition}
* method.
*/
public void caretPreviousCharacter()
{
}
/**
* Set maximum number of characters.
*
* @param maxChars - the maximum number of characters.
*/
public void setMaxChars(int maxChars)
{
}
/**
* Get maximum number of characters. The behavior of the component when the
* last character on a line is typed is implementation dependent.
*
* @return the maximum number of characters.
*/
public int getMaxChars()
{
return (0);
}
/**
* Defines the navigation path from the current {@link
* org.havi.ui.HNavigable HNavigable} to another {@link
* org.havi.ui.HNavigable HNavigable} when a particular key is
* pressed. Note that {@link
* org.havi.ui.HNavigable#setFocusTraversal setFocusTraversal} is
* equivalent to multiple calls to {@link
* org.havi.ui.HNavigable#setMove setMove}, where the key codes
* VK_UP
, VK_DOWN
, VK_LEFT
,
* VK_RIGHT
are used.
*
* @param keyCode The key code of the pressed key. Any numerical
* keycode is allowed, but the platform may not be able to
* generate all keycodes. Application authors should only use keys
* for which HRcCapabilities.isSupported()
or
* HKeyCapabilities.isSupported()
returns true.
* @param target The target {@link org.havi.ui.HNavigable
* HNavigable} object that should be navigated to. If a target is
* to be removed from a particular navigation path, then
* null
shall be specified.
*/
public void setMove(int keyCode, HNavigable target)
{
return;
}
/**
* Provides the {@link org.havi.ui.HNavigable HNavigable} object
* that is navigated to when a particular key is pressed.
*
* @param keyCode The key code of the pressed key.
* @return Returns the {@link org.havi.ui.HNavigable HNavigable}
* object or null
if no {@link org.havi.ui.HNavigable
* HNavigable} is associated with the keyCode.
*/
public HNavigable getMove(int keyCode)
{
return(null);
}
/**
* Set the focus control for an {@link org.havi.ui.HNavigable
* HNavigable} component. Note {@link
* org.havi.ui.HNavigable#setFocusTraversal setFocusTraversal} is a
* convenience function for application programmers where a standard
* up, down, left and right focus traversal between components is
* required.
*
* Note {@link org.havi.ui.HNavigable#setFocusTraversal
* setFocusTraversal} is equivalent to multiple calls to {@link
* org.havi.ui.HNavigable#setMove setMove}, where the key codes
* VK_UP, VK_DOWN, VK_LEFT, VK_RIGHT are used.
Note that this
* API does not prevent the creation of "isolated"
* {@link org.havi.ui.HNavigable HNavigable} components --- authors
* should endeavor to avoid confusing the user.
*
* @param up The {@link org.havi.ui.HNavigable HNavigable} component
* to move to, when the user generates a VK_UP KeyEvent. If there is no {@link
* org.havi.ui.HNavigable HNavigable} component to move
* "up" to, then null shall be specified.
* @param down The {@link org.havi.ui.HNavigable HNavigable}
* component to move to, when the user generates a VK_DOWN KeyEvent. If there
* is no {@link org.havi.ui.HNavigable HNavigable} component to move
* "down" to, then null shall be specified.
* @param left The {@link org.havi.ui.HNavigable HNavigable}
* component to move to, when the user generates a VK_LEFT KeyEvent. If there
* is no {@link org.havi.ui.HNavigable HNavigable} component to move
* "left" to, then null shall be specified.
* @param right The {@link org.havi.ui.HNavigable HNavigable}
* component to move to, when the user generates a VK_RIGHT KeyEvent. If there
* is no {@link org.havi.ui.HNavigable HNavigable} component to move
* "right" to, then null shall be specified.
*/
public void setFocusTraversal(HNavigable up, HNavigable down, HNavigable left, HNavigable right)
{
return;
}
/**
* Indicates if this component has focus.
*
* @return true
if the component has focus, otherwise
* returns false
.
*/
public boolean isSelected()
{
return(false);
}
/**
* Associate a sound with gaining focus, i.e. when the {@link
* org.havi.ui.HNavigable HNavigable} receives a
* {@link org.havi.ui.event.HFocusEvent HFocusEvent} event of type
* FOCUS_GAINED
. This sound will start to be played
* when an object implementing this interface gains focus. It is
* not guaranteed to be played to completion. If the object
* implementing this interface loses focus before the audio
* completes playing, the audio will be truncated. Applications
* wishing to ensure the audio is always played to completion must
* implement special logic to slow down the focus transitions.
* By default, an {@link org.havi.ui.HNavigable HNavigable} object
* does not have any gain focus sound associated with it.
Note
* that the ordering of playing sounds is dependent on the order
* of the focus lost, gained events.
*
* @param sound the sound to be played, when the component gains
* focus. If sound content is already set, the original content is
* replaced. To remove the sound specify a null {@link
* org.havi.ui.HSound HSound}.
*/
public void setGainFocusSound(HSound sound)
{
return;
}
/**
* Associate a sound with losing focus, i.e. when the {@link
* org.havi.ui.HNavigable HNavigable} receives a
* {@link org.havi.ui.event.HFocusEvent HFocusEvent} event of type
* FOCUS_LOST. This sound will start to be played when an object
* implementing this interface loses focus. It is not guaranteed to be
* played to completion. It is implementation dependent whether and when
* this sound will be truncated by any gain focus sound played by the next
* object to gain focus.
By default, an {@link
* org.havi.ui.HNavigable HNavigable} object does not have any
* lose focus sound associated with it.
Note that the ordering
* of playing sounds is dependent on the order of the focus lost,
* gained events.
*
* @param sound the sound to be played, when the component loses
* focus. If sound content is already set, the original content is
* replaced. To remove the sound specify a null {@link
* org.havi.ui.HSound HSound}.
*/
public void setLoseFocusSound(HSound sound)
{
return;
}
/**
* Get the sound associated with the gain focus event.
*
* @return The sound played when the component gains focus. If no
* sound is associated with gaining focus, then null shall be
* returned.
*/
public HSound getGainFocusSound()
{
return(null);
}
/**
* Get the sound associated with the lost focus event.
*
* @return The sound played when the component loses focus. If no
* sound is associated with losing focus, then null shall be
* returned.
*/
public HSound getLoseFocusSound()
{
return(null);
}
/**
* Adds the specified {@link org.havi.ui.event.HFocusListener HFocusListener} to
* receive {@link org.havi.ui.event.HFocusEvent HFocusEvent} events sent from
* this {@link org.havi.ui.HNavigable HNavigable}: If the listener has
* already been added further calls will add further references to the listener,
* which will then receive multiple copies of a single event.
*
* @param l the HFocusListener to add
*/
public void addHFocusListener(org.havi.ui.event.HFocusListener l)
{
return;
}
/**
* Removes the specified {@link org.havi.ui.event.HFocusListener HFocusListener}
* so that it no longer receives {@link org.havi.ui.event.HFocusEvent
* HFocusEvent} events from this {@link org.havi.ui.HNavigable HNavigable}. If
* the specified listener is not registered, the method has no effect. If
* multiple references to a single listener have been registered it should be
* noted that this method will only remove one reference per call.
*
* @param l the HFocusListener to remove
*/
public void removeHFocusListener(org.havi.ui.event.HFocusListener l)
{
return;
}
/**
* Retrieve the set of key codes which this component maps to
* navigation targets.
*
* @return an array of key codes, or null
if no
* navigation targets are set on this component.
*/
public int[] getNavigationKeys()
{
return(null);
}
/**
* Process an {@link org.havi.ui.event.HFocusEvent
* HFocusEvent} sent to this {@link org.havi.ui.HSinglelineEntry
* HSinglelineEntry}.
*
* @param evt the {@link org.havi.ui.event.HFocusEvent
* HFocusEvent} to process.
*/
public void processHFocusEvent(org.havi.ui.event.HFocusEvent evt)
{
return;
}
/**
* Adds the specified {@link org.havi.ui.event.HKeyListener HKeyListener} to
* receive {@link org.havi.ui.event.HKeyEvent HKeyEvent} events sent from this
* {@link org.havi.ui.HTextValue HTextValue}: If the listener has already been
* added further calls will add further references to the listener, which will
* then receive multiple copies of a single event.
*
* @param l the HKeyListener to add
*/
public void addHKeyListener(org.havi.ui.event.HKeyListener l)
{
return;
}
/**
* Removes the specified {@link org.havi.ui.event.HKeyListener HKeyListener} so
* that it no longer receives {@link org.havi.ui.event.HKeyEvent HKeyEvent}
* events from this {@link org.havi.ui.HTextValue HTextValue}. If the specified
* listener is not registered, the method has no effect. If multiple references
* to a single listener have been registered it should be noted that this method
* will only remove one reference per call.
*
* @param l the HKeyListener to remove
*/
public void removeHKeyListener(org.havi.ui.event.HKeyListener l)
{
return;
}
/**
* Adds the specified {@link org.havi.ui.event.HTextListener HTextListener} to
* receive {@link org.havi.ui.event.HTextEvent HTextEvent} events sent from this
* {@link org.havi.ui.HTextValue HTextValue}: If the listener has already been
* added further calls will add further references to the listener, which will
* then receive multiple copies of a single event.
*
* @param l the HTextListener to add
*/
public void addHTextListener(org.havi.ui.event.HTextListener l)
{
return;
}
/**
* Removes the specified {@link org.havi.ui.event.HTextListener HTextListener}
* so that it no longer receives {@link org.havi.ui.event.HTextEvent HTextEvent}
* events from this {@link org.havi.ui.HTextValue HTextValue}. If the specified
* listener is not registered, the method has no effect. If multiple references
* to a single listener have been registered it should be noted that this method
* will only remove one reference per call.
*
* @param l the HTextListener to remove
*/
public void removeHTextListener(org.havi.ui.event.HTextListener l)
{
return;
}
/**
* Get the editing mode for this {@link org.havi.ui.HSinglelineEntry}.
* If the returned value is true
the
* component is in edit mode, and its textual content may be
* changed through user interaction such as keyboard events.
*
* The component is switched into and out of edit mode on
* receiving {@link
* org.havi.ui.event.HTextEvent#TEXT_START_CHANGE}
* and {@link
* org.havi.ui.event.HTextEvent#TEXT_END_CHANGE}
* events.
*
* @return true
if this component is in edit mode,
* false
otherwise.
*/
public boolean getEditMode()
{
return(true);
}
/**
* Set the editing mode for this {@link org.havi.ui.HSinglelineEntry}.
*
* This method is provided for the convenience of component
* implementors. Interoperable applications shall not call this
* method. It cannot be made protected because interfaces cannot have
* protected methods.
*
* @param edit true to switch this component into edit mode, false
* otherwise.
* @see HKeyboardInputPreferred#getEditMode
*/
public void setEditMode(boolean edit)
{
return;
}
/**
* Retrieve the desired input type for this component. This value
* should be set to indicate to the system which input keys are
* required by this component. The input type constants can be added to
* define the union of the character sets corresponding to the respective
* constants.
*
*
* @return The sum of one or several of {@link
* org.havi.ui.HKeyboardInputPreferred#INPUT_ANY},
* {@link
* org.havi.ui.HKeyboardInputPreferred#INPUT_NUMERIC},
* {@link
* org.havi.ui.HKeyboardInputPreferred#INPUT_ALPHA},
* or {@link org.havi.ui.HKeyboardInputPreferred#INPUT_CUSTOMIZED}.
*/
public int getType()
{
return(0);
}
/**
* Retrieve the customized input character range. If
* getType()
returns a value with the INPUT_CUSTOMIZED
* bit set then this method shall return an array containing the
* range of customized input keys. If the range of customized input
* keys has not been set then this method shall return a zero length
* char array. This method shall return null if
* getType()
returns a value without the
* INPUT_CUSTOMIZED bit set.
* @return an array containing the characters which this component
* expects the platform to provide, or null
.
*/
public char[] getValidInput()
{
return(null);
}
/**
* Process an {@link org.havi.ui.event.HTextEvent
* HTextEvent} sent to this {@link org.havi.ui.HSinglelineEntry}.
*
* @param evt the {@link org.havi.ui.event.HTextEvent}
* to process.
*/
public void processHTextEvent(org.havi.ui.event.HTextEvent evt)
{
return;
}
/**
* Process an {@link org.havi.ui.event.HKeyEvent}
* sent to this {@link org.havi.ui.HSinglelineEntry}.
*
* @param evt the {@link org.havi.ui.event.HKeyEvent}
* to process.
*/
public void processHKeyEvent(org.havi.ui.event.HKeyEvent evt)
{
return;
}
}