com.myjavaworld.gui
Interface MTextComponent

All Known Implementing Classes:
IntegerField, MLabelTextField, MPasswordField, MTextArea, MTextField

public interface MTextComponent

An interface that defines the contract for all major kinds of text components.

Version:
1.0
Author:
Sai Pullabhotla, psai [at] jMethods [dot] com

Field Summary
static int LOWER_CASE
          Constant to indicate lower case.
static int MIXED_CASE
          Constant to indicate mixed case.
static int UPPER_CASE
          Constant to indicate upper case.
 
Method Summary
 boolean canCopy()
          Checks to see if text can be copied from this text component.
 boolean canCut()
          Checks to see if text can be cut from this text component.
 boolean canDelete()
          Checks to see if text can be deleted from this text component.
 boolean canPaste()
          Checks to see if text can be pasted in to this text component.
 boolean canRedo()
          Checks to see if the changes made to this component can be redone.
 boolean canSelectAll()
          Checks to see if whole text in this component can be selected.
 boolean canUndo()
          Cecks to see if the changes made to this text component can be undone.
 void copy()
          Copies the selected text from this text component to the system clipboard.
 void cut()
          Cuts the selected text from this text component and places it in the system clipboard.
 void delete()
          Deletes the selected text from this text component.
 int getCharacterCase()
          Gets the current chatacter case in use by this text component.
 int getMaximumLength()
          Returns the maximum number of characters allowed in this text component.
 int getUndoLimit()
          Returns the current undo/redo limit of this text component.
 void paste()
          Pastes the contents of system clipboard at the current caret position.
 void redo()
          Redo the changes to this text component.
 void selectAll()
          Selects all the text in this text component.
 void setCharacterCase(int characterCase)
          Sets the character case to the given characterCase.
 void setMaximumLength(int maximumLength)
          Sets the maxumum number of characters allowed in this text component to the given value, maximumLength.
 void setUndoLimit(int limit)
          Sets the undo/redo limit to the given limit.
 void undo()
          Undo the changes made to this text component.
 

Field Detail

MIXED_CASE

static final int MIXED_CASE
Constant to indicate mixed case.

See Also:
Constant Field Values

LOWER_CASE

static final int LOWER_CASE
Constant to indicate lower case.

See Also:
Constant Field Values

UPPER_CASE

static final int UPPER_CASE
Constant to indicate upper case.

See Also:
Constant Field Values
Method Detail

setCharacterCase

void setCharacterCase(int characterCase)
Sets the character case to the given characterCase.

Parameters:
characterCase - Character case to set for this text component.

getCharacterCase

int getCharacterCase()
Gets the current chatacter case in use by this text component.

Returns:
character case.

setMaximumLength

void setMaximumLength(int maximumLength)
Sets the maxumum number of characters allowed in this text component to the given value, maximumLength.

Parameters:
maximumLength - Maximum length to set.

getMaximumLength

int getMaximumLength()
Returns the maximum number of characters allowed in this text component.

Returns:
maximum length

setUndoLimit

void setUndoLimit(int limit)
Sets the undo/redo limit to the given limit.

Parameters:
limit - Number of changes to be recorded by the undo/redo manager.

getUndoLimit

int getUndoLimit()
Returns the current undo/redo limit of this text component.

Returns:
Undo/Redo limit.

cut

void cut()
Cuts the selected text from this text component and places it in the system clipboard.


copy

void copy()
Copies the selected text from this text component to the system clipboard.


paste

void paste()
Pastes the contents of system clipboard at the current caret position.


delete

void delete()
Deletes the selected text from this text component.


selectAll

void selectAll()
Selects all the text in this text component.


undo

void undo()
Undo the changes made to this text component.


redo

void redo()
Redo the changes to this text component.


canCut

boolean canCut()
Checks to see if text can be cut from this text component.

Returns:
trueIf the text can be cut from this text component. false, otherwise.

canCopy

boolean canCopy()
Checks to see if text can be copied from this text component.

Returns:
true, if text is copiable. false, otherwise.

canPaste

boolean canPaste()
Checks to see if text can be pasted in to this text component.

Returns:
true, if text is pastable. false, otherwise.

canDelete

boolean canDelete()
Checks to see if text can be deleted from this text component. return true, if text can be deleted from this text component. false, otherwise.


canSelectAll

boolean canSelectAll()
Checks to see if whole text in this component can be selected.

Returns:
true, if the text is selectable. false, otherwise.

canUndo

boolean canUndo()
Cecks to see if the changes made to this text component can be undone.

Returns:
true, if the changes can be undone. false, otherwise.

canRedo

boolean canRedo()
Checks to see if the changes made to this component can be redone.

Returns:
true, if the changes can be redone. false, otherwise.


Copyright © 2000-2012 jMethods, Inc.. All Rights Reserved.