|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.table.TextCell
public class TextCell
Provides a cell view for displaying and editing a paragraph of text.
Field Summary |
---|
Fields inherited from class com.sas.table.CellView |
---|
cell |
Fields inherited from interface com.sas.table.CellViewInterface |
---|
FORMATTED_DATA, RAW_DATA |
Constructor Summary | |
---|---|
TextCell()
Constructs a new TextCell object. |
Method Summary | |
---|---|
int |
getCaretPosition()
Returns the current caret position in the text string. |
java.lang.String |
getFormattedData()
Alias for getText . |
int |
getMaximumStringWidth()
Returns the maximum character length allowed for strings. |
int |
getMinimumStringWidth()
Returns the minimum character length allowed for strings. |
int |
getMinimumWidth(java.awt.Graphics g)
Returns the minimum width of the current cell in pixels. |
java.lang.Object |
getObjectData()
Returns the data associated with the current cell. |
int |
getPreferredHeight(java.awt.Graphics g,
int width)
Returns the preferred height of the current cell in pixels. |
int |
getPreferredInputType()
Returns FORMATTED_DATA as the preferred input type. |
int |
getPreferredOutputType()
Returns FORMATTED_DATA as the preferred output type. |
int |
getPreferredWidth(java.awt.Graphics g,
int height)
Returns the preferred width of the current cell in pixels. |
java.lang.String |
getText()
Returns the text value of the current cell. |
protected boolean |
isCharacterValid(char ch)
Controls whether a character is inserted into the cell's data. |
boolean |
isPartiallyDisplayed()
Indicates whether the TextCell's contents are currently displayed by the table view, but also clipped. |
void |
onActiveStateChanged(int oldState,
int newState,
java.awt.Point point)
Notifies the view of a change to Cell.activeState. |
void |
paint(java.awt.Graphics g)
Paints the TextCell |
void |
processFocusEvent(java.awt.event.FocusEvent event)
Process focus events which occur on the TextCell. |
void |
processKeyEvent(java.awt.event.KeyEvent event)
Process key events which occur on the TextCell. |
void |
processMouseEvent(java.awt.event.MouseEvent event)
Process mouse events which occur on the TextCell. |
void |
processMouseMotionEvent(java.awt.event.MouseEvent event)
Process mouse motion events which occur on the TextCell. |
void |
setFormattedData(java.lang.String data)
Sets the text of the TextCell. |
void |
setMaximumStringWidth(int newValue)
Gets the maximum character length allowed for strings. |
void |
setMinimumStringWidth(int newValue)
Gets the minimum character length allowed for strings. |
void |
setObjectData(java.lang.Object newData)
Sets the data associated with the current cell. |
void |
setText(java.lang.String newValue)
Sets the text value of the current cell. |
Methods inherited from class com.sas.table.CellView |
---|
getCell, getMinimumHeight, setCell |
Constructor Detail |
---|
public TextCell()
Method Detail |
---|
public int getCaretPosition()
TextCell
is not in edit mode -1 is returned.
Edit mode is determined by the cell's activation level.
public java.lang.String getFormattedData()
getText
.
getFormattedData
in interface CellViewInterface
getFormattedData
in class CellView
getText()
public int getMaximumStringWidth()
setMaximumStringWidth(int)
public int getMinimumStringWidth()
setMinimumStringWidth(int)
public int getMinimumWidth(java.awt.Graphics g)
getMinimumWidth
in interface CellViewInterface
getMinimumWidth
in class CellView
g
- The graphics context to measure the cell in.
CellView.getMinimumHeight(java.awt.Graphics)
public java.lang.Object getObjectData()
getFormattedData
since the preferred input
type of TextCell is FORMATTED_DATA
.
getObjectData
in interface com.sas.lang.ObjectDataInterface
setObjectData(java.lang.Object)
,
getFormattedData()
public int getPreferredHeight(java.awt.Graphics g, int width)
getPreferredHeight
in interface CellViewInterface
g
- The graphics context to measure the cell in.width
- The width (in pixels) to constrain by. Specify -1 to not constrain.
getPreferredWidth(java.awt.Graphics, int)
public int getPreferredInputType()
FORMATTED_DATA
as the preferred input type.
getPreferredInputType
in interface CellViewInterface
getPreferredInputType
in class CellView
FORMATTED_DATA
CellViewInterface.getPreferredInputType()
public int getPreferredOutputType()
FORMATTED_DATA
as the preferred output type.
getPreferredOutputType
in interface CellViewInterface
getPreferredOutputType
in class CellView
FORMATTED_DATA
CellViewInterface.getPreferredOutputType()
public int getPreferredWidth(java.awt.Graphics g, int height)
getPreferredWidth
in interface CellViewInterface
g
- The graphics context to measure the cell in.height
- The height (in pixels) to constrain by. Specify -1 to not constrain.
getPreferredHeight(java.awt.Graphics, int)
public java.lang.String getText()
getText
in interface com.sas.lang.StringDataInterface
setText(java.lang.String)
protected boolean isCharacterValid(char ch)
ch
- the character to validate
true
if the character is valid,
false
otherwisepublic boolean isPartiallyDisplayed()
isPartiallyDisplayed
in interface CellViewInterface
isPartiallyDisplayed
in class CellView
true
if the TextCell's contents are displayed but clipped, and
false
otherwise.public void onActiveStateChanged(int oldState, int newState, java.awt.Point point)
CellView
onActiveStateChanged
in interface CellViewInterface
onActiveStateChanged
in class CellView
oldState
- The previous value of Cell.activeState.newState
- The new value of Cell.activeState.point
- Optional xy-coordinate (relative to the view's origin) where the
activation was initiated. Could be used to position a text cursor,
for example.CellViewInterface.onActiveStateChanged(int, int, java.awt.Point)
public void paint(java.awt.Graphics g)
paint
in interface CellViewInterface
g
- the graphics context to paint topublic void processFocusEvent(java.awt.event.FocusEvent event)
processFocusEvent
in interface CellViewInterface
processFocusEvent
in class CellView
event
- the event to handlepublic void processKeyEvent(java.awt.event.KeyEvent event)
processKeyEvent
in interface CellViewInterface
processKeyEvent
in class CellView
event
- the event to handlepublic void processMouseEvent(java.awt.event.MouseEvent event)
processMouseEvent
in interface CellViewInterface
processMouseEvent
in class CellView
event
- the event to handlepublic void processMouseMotionEvent(java.awt.event.MouseEvent event)
processMouseMotionEvent
in interface CellViewInterface
processMouseMotionEvent
in class CellView
event
- the event to handlepublic final void setFormattedData(java.lang.String data)
setFormattedData
in interface CellViewInterface
setFormattedData
in class CellView
data
- the new text valueCellView.getFormattedData()
public void setMaximumStringWidth(int newValue)
newValue
- the new maximum character length allowed for stringsgetMaximumStringWidth()
public void setMinimumStringWidth(int newValue)
newValue
- the new minimum character length allowed for stringsgetMinimumStringWidth()
public final void setObjectData(java.lang.Object newData)
FORMATTED_DATA
, the result of toString
on newData will be set as the text.
setObjectData
in interface com.sas.lang.ObjectDataInterface
newData
- the data to associate with the current cellgetObjectData()
public void setText(java.lang.String newValue)
setText
in interface com.sas.lang.StringDataInterface
newValue
- the new text valuegetText()
|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |