Class XViewerTextWidget
java.lang.Object
org.eclipse.nebula.widgets.xviewer.util.internal.XViewerWidget
org.eclipse.nebula.widgets.xviewer.util.internal.XViewerTextWidget
public class XViewerTextWidget extends XViewerWidget
Generic label and text field object for use by single entry artifact attributes
-
Field Summary
Fields Modifier and Type Field Description protected org.eclipse.swt.custom.StyledText
sText
protected java.lang.String
text
Fields inherited from class org.eclipse.nebula.widgets.xviewer.util.internal.XViewerWidget
displayLabel, editable, fillHorizontally, fillVertically, label, labelWidget, reportType, requiredEntry, RPT_MULTI_LINE, RPT_NONE, RPT_SINGLE_LINE, toolkit, toolTip, verticalLabel, xmlRoot, xmlSubRoot
-
Constructor Summary
Constructors Constructor Description XViewerTextWidget()
XViewerTextWidget(java.lang.String displayLabel)
XViewerTextWidget(java.lang.String displayLabel, java.lang.String xmlRoot)
XViewerTextWidget(java.lang.String displayLabel, java.lang.String xmlRoot, java.lang.String xmlSubRoot)
-
Method Summary
Modifier and Type Method Description void
addModifyListener(org.eclipse.swt.events.ModifyListener modifyListener)
void
append(java.lang.String text)
void
createWidgets(org.eclipse.swt.widgets.Composite parent, int horizontalSpan)
Create Text Widgets.void
createWidgets(org.eclipse.swt.widgets.Composite parent, int horizontalSpan, boolean fillText)
void
dispose()
Create Widgets used to display label and entry for wizards and editorsvoid
forceFocus()
java.lang.String
get()
org.eclipse.swt.widgets.Control
getControl()
java.lang.Object
getData()
org.eclipse.swt.widgets.Menu
getDefaultMenu()
double
getFloat()
org.eclipse.swt.graphics.Font
getFont()
int
getInt()
int
getInteger()
java.lang.String
getReportData()
Return data for display in Report (without label) NOTE: There should be no newlines at end of Stringorg.eclipse.swt.custom.StyledText
getStyledText()
java.lang.String
getText()
java.lang.String
getXmlData()
Return string to save off between xml tags Used by call to toXml() String returned will be sent through AXml.textToXml() before being saved Used by: toXmlboolean
isFloat()
boolean
isInteger()
boolean
isValid()
Return true if entry is validvoid
refresh()
Refresh the entry widgetboolean
requiredEntry()
void
set(java.lang.String text)
void
set(XViewerTextWidget text)
void
setEditable(boolean editable)
void
setEnabled(boolean enabled)
void
setFocus()
Set focus to the entry widgetvoid
setFont(org.eclipse.swt.graphics.Font font)
void
setFromXml(java.lang.String xml)
void
setHeight(int height)
void
setMaxTextLimit(int limit)
Set max character limit on text fieldvoid
setRequiredEntry(boolean requiredEntry)
void
setSize(int width, int height)
void
setText(java.lang.String text)
void
setXmlData(java.lang.String str)
Called with string found between xml tags Used by setFromXml() String will be sent through AXml.xmlToText() before being sent to setXmlData implementation.java.lang.String
toHTML(java.lang.String labelFont)
java.lang.String
toHTML(java.lang.String labelFont, boolean newLineText)
java.lang.String
toString()
java.lang.String
toXml()
java.lang.String
toXml(java.lang.String xmlRoot)
java.lang.String
toXml(java.lang.String xmlRoot, java.lang.String xmlSubRoot)
protected void
updateTextWidget()
Methods inherited from class org.eclipse.nebula.widgets.xviewer.util.internal.XViewerWidget
adaptControls, addXModifiedListener, createWidgets, getDisplayLabels, getLabel, getLabelWidget, getReportType, getToolTip, getXmlRoot, getXmlSubRoot, isDisplayLabel, isEditable, isFillHorizontally, isFillVertically, isRequiredEntry, isVerticalLabel, notifyXModifiedListeners, openHelp, setDisplayLabel, setDisplayLabel, setFillHorizontally, setFillVertically, setLabel, setLabelError, setLabelWidget, setReportType, setToolTip, setVerticalLabel, setXmlRoot, setXmlSubRoot, toReport, toReport
-
Field Details
-
Constructor Details
-
XViewerTextWidget
public XViewerTextWidget() -
XViewerTextWidget
public XViewerTextWidget(java.lang.String displayLabel) -
XViewerTextWidget
public XViewerTextWidget(java.lang.String displayLabel, java.lang.String xmlRoot) -
XViewerTextWidget
public XViewerTextWidget(java.lang.String displayLabel, java.lang.String xmlRoot, java.lang.String xmlSubRoot)
-
-
Method Details
-
setEnabled
public void setEnabled(boolean enabled) -
setSize
public void setSize(int width, int height) -
setHeight
public void setHeight(int height) -
toString
public java.lang.String toString()- Overrides:
toString
in classXViewerWidget
-
getControl
public org.eclipse.swt.widgets.Control getControl()- Specified by:
getControl
in classXViewerWidget
-
createWidgets
public void createWidgets(org.eclipse.swt.widgets.Composite parent, int horizontalSpan)Create Text Widgets. Widgets Created: Label: "text entry" horizonatalSpan takes up 2 columns; horizontalSpan must be >=2- Specified by:
createWidgets
in classXViewerWidget
-
createWidgets
public void createWidgets(org.eclipse.swt.widgets.Composite parent, int horizontalSpan, boolean fillText) -
getText
public java.lang.String getText()- Returns:
- text including xml tags replaced for references
-
setText
public void setText(java.lang.String text) -
getDefaultMenu
public org.eclipse.swt.widgets.Menu getDefaultMenu() -
dispose
public void dispose()Description copied from class:XViewerWidget
Create Widgets used to display label and entry for wizards and editors- Specified by:
dispose
in classXViewerWidget
-
setFocus
public void setFocus()Description copied from class:XViewerWidget
Set focus to the entry widget- Specified by:
setFocus
in classXViewerWidget
-
setEditable
public void setEditable(boolean editable)- Overrides:
setEditable
in classXViewerWidget
-
setMaxTextLimit
public void setMaxTextLimit(int limit)Set max character limit on text field- Parameters:
limit
- - if 0, then limit is 999, else sets to limit
-
forceFocus
public void forceFocus() -
isInteger
public boolean isInteger() -
isFloat
public boolean isFloat() -
getInteger
public int getInteger() -
getFloat
public double getFloat() -
setRequiredEntry
public void setRequiredEntry(boolean requiredEntry)- Overrides:
setRequiredEntry
in classXViewerWidget
-
requiredEntry
public boolean requiredEntry() -
addModifyListener
public void addModifyListener(org.eclipse.swt.events.ModifyListener modifyListener) -
get
public java.lang.String get() -
getXmlData
public java.lang.String getXmlData()Description copied from class:XViewerWidget
Return string to save off between xml tags Used by call to toXml() String returned will be sent through AXml.textToXml() before being saved Used by: toXml- Specified by:
getXmlData
in classXViewerWidget
-
toXml
public java.lang.String toXml()- Overrides:
toXml
in classXViewerWidget
-
toXml
public java.lang.String toXml(java.lang.String xmlRoot)- Overrides:
toXml
in classXViewerWidget
-
toXml
public java.lang.String toXml(java.lang.String xmlRoot, java.lang.String xmlSubRoot)- Overrides:
toXml
in classXViewerWidget
-
setXmlData
public void setXmlData(java.lang.String str)Description copied from class:XViewerWidget
Called with string found between xml tags Used by setFromXml() String will be sent through AXml.xmlToText() before being sent to setXmlData implementation. Used by: setFromXml- Specified by:
setXmlData
in classXViewerWidget
-
setFromXml
public void setFromXml(java.lang.String xml)- Overrides:
setFromXml
in classXViewerWidget
-
getInt
public int getInt() -
updateTextWidget
protected void updateTextWidget() -
set
public void set(java.lang.String text) -
set
-
append
public void append(java.lang.String text) -
refresh
public void refresh()Description copied from class:XViewerWidget
Refresh the entry widget- Specified by:
refresh
in classXViewerWidget
-
getReportData
public java.lang.String getReportData()Description copied from class:XViewerWidget
Return data for display in Report (without label) NOTE: There should be no newlines at end of String- Specified by:
getReportData
in classXViewerWidget
-
toHTML
public java.lang.String toHTML(java.lang.String labelFont, boolean newLineText) -
toHTML
public java.lang.String toHTML(java.lang.String labelFont)- Specified by:
toHTML
in classXViewerWidget
-
isValid
public boolean isValid()Description copied from class:XViewerWidget
Return true if entry is valid- Specified by:
isValid
in classXViewerWidget
- Returns:
- Return boolean validity indication.
-
getData
public java.lang.Object getData()- Specified by:
getData
in classXViewerWidget
-
getStyledText
public org.eclipse.swt.custom.StyledText getStyledText()- Returns:
- the sText
-
getFont
public org.eclipse.swt.graphics.Font getFont()- Returns:
- the font
-
setFont
public void setFont(org.eclipse.swt.graphics.Font font)- Parameters:
font
- the font to set
-