|
Rational Developer for Power Systems Software V7.6 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.swing.text.View javax.swing.text.PlainView com.ibm.etools.iseries.ui.EditmaskPlainView
public class EditmaskPlainView
EditmaskPlainView extends PlainView. It serves as the view model in an MVC relationship of JFormattedTextField. EditmaskPlainView can change the view to an editmask setting. For example, if editword is set to "(bbb)bbb-bbbb" (where b is a blank), and editmask is "&bbb&bbb&bbbb", the view of the field will be "(bbb)bbb-bbbb". This forces the characters that correspond to the '&'s in the editmask to be anchored in the field. Thus, the parentheses ( and ), and hyphen (-) characters will be part of the view and the field will show "(bbb)bbb-bbbb" before you enter any data into the field. When you enter data in the JFormattedTextField, the cursor will automatically skip over the parentheses ( and ), and hyphen (-) editmask characters.
EditmaskAttributes
,
EditmaskViewBasicTextFieldUI
,
EditmaskViewMetalTextFieldUI
,
EditmaskViewWindowsTextFieldUI
Field Summary | |
---|---|
static String |
Copyright
|
Fields inherited from class javax.swing.text.PlainView |
---|
metrics |
Fields inherited from class javax.swing.text.View |
---|
BadBreakWeight, ExcellentBreakWeight, ForcedBreakWeight, GoodBreakWeight, X_AXIS, Y_AXIS |
Fields inherited from interface javax.swing.SwingConstants |
---|
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
Constructor Summary | |
---|---|
EditmaskPlainView(Element elem)
Constructs a new EditmaskPlainView with the specified Element. |
|
EditmaskPlainView(Element elem,
EditmaskAttributes attributes)
Constructs a new EditmaskPlainView with the specified Element and EditmaskAttributes Please note that the second parameter must be an instance of com.ibm.etools.iseries.ui.EditmaskAttributes; otherwise java.beans.PropertyVetoException will be thrown at run time. |
Method Summary | |
---|---|
static String |
Copyright()
This method returns the copyright notice for this class. |
protected int |
drawUnselectedText(Graphics g,
int x,
int y,
int p0,
int p1)
Renders the given range in the model as normal unselected text. |
EditmaskAttributes |
getEditmaskAttributes()
Gets the editmaskAttributes property (com.ibm.etools.iseries.ui.Attributes) value. |
String |
getFormattedText()
Return the input text in the format of an editmask view. |
protected Rectangle |
lineToRect(Shape s,
int line)
Form the rectangular shape of the text field. |
Shape |
modelToView(int pos,
Shape a,
Position.Bias b)
Provides a mapping from the document model coordinate space to the coordinate space of the view mapped to it. |
void |
setEditmaskAttributes(EditmaskAttributes attrib)
Sets the editmaskAttributes property (com.ibm.etools.iseries.ui.Attributes) value. |
void |
setFormattedText(String formatText)
Replace formatted text. |
Methods inherited from class javax.swing.text.PlainView |
---|
changedUpdate, damageLineRange, drawLine, drawSelectedText, getLineBuffer, getPreferredSpan, getTabSize, insertUpdate, nextTabStop, paint, removeUpdate, setSize, updateDamage, updateMetrics, viewToModel |
Methods inherited from class javax.swing.text.View |
---|
append, breakView, createFragment, forwardUpdate, forwardUpdateToView, getAlignment, getAttributes, getBreakWeight, getChildAllocation, getContainer, getDocument, getElement, getEndOffset, getGraphics, getMaximumSpan, getMinimumSpan, getNextVisualPositionFrom, getParent, getResizeWeight, getStartOffset, getToolTipText, getView, getViewCount, getViewFactory, getViewIndex, getViewIndex, insert, isVisible, modelToView, modelToView, preferenceChanged, remove, removeAll, replace, setParent, updateChildren, updateLayout, viewToModel |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String Copyright
Constructor Detail |
---|
public EditmaskPlainView(Element elem)
elem
- javax.swing.text.Elementpublic EditmaskPlainView(Element elem, EditmaskAttributes attributes)
elem
- javax.swing.text.Elementattributes
- com.ibm.etools.iseries.ui.EditmaskAttributesMethod Detail |
---|
public static String Copyright()
protected int drawUnselectedText(Graphics g, int x, int y, int p0, int p1) throws BadLocationException
drawUnselectedText
in class PlainView
g
- the graphics contextx
- the starting X coordinate >= 0y
- the starting Y coordinate >= 0p0
- the beginning position in the model >= 0p1
- the ending position in the model >= 0
BadLocationException
- If the range is invalid.public EditmaskAttributes getEditmaskAttributes()
setEditmaskAttributes(com.ibm.etools.iseries.ui.EditmaskAttributes)
public String getFormattedText()
protected Rectangle lineToRect(Shape s, int line)
lineToRect
in class PlainView
a
- java.awt.Shapeline
- int
public Shape modelToView(int pos, Shape a, Position.Bias b) throws BadLocationException
modelToView
in class PlainView
pos
- the position to convert >= 0a
- the allocated region to render into
BadLocationException
- if the given position does not
represent a valid location in the associated documentView.modelToView(int, java.awt.Shape, javax.swing.text.Position.Bias)
public void setEditmaskAttributes(EditmaskAttributes attrib)
editmaskAttributes
- The new value for the property.getEditmaskAttributes()
public void setFormattedText(String formatText)
formatText
- java.lang.String
|
Rational Developer for Power Systems Software V7.6 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |