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 private static booleandebugprivate org.eclipse.swt.graphics.Fontfontprivate intheightprivate intmaxTextCharsprivate org.eclipse.swt.widgets.Compositeparentprotected org.eclipse.swt.custom.StyledTextsTextprotected java.lang.Stringtextprivate intwidth-
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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidaddModificationListener()voidaddModifyListener(org.eclipse.swt.events.ModifyListener modifyListener)voidappend(java.lang.String text)private org.eclipse.swt.widgets.CompositecreateComposite(org.eclipse.swt.widgets.Composite parent, int horizontalSpan)private voidcreateLabelWidget(org.eclipse.swt.widgets.Composite composite)voidcreateWidgets(org.eclipse.swt.widgets.Composite parent, int horizontalSpan)Create Text Widgets.voidcreateWidgets(org.eclipse.swt.widgets.Composite parent, int horizontalSpan, boolean fillText)voiddispose()Create Widgets used to display label and entry for wizards and editorsvoidforceFocus()java.lang.Stringget()org.eclipse.swt.widgets.ControlgetControl()java.lang.ObjectgetData()org.eclipse.swt.widgets.MenugetDefaultMenu()doublegetFloat()org.eclipse.swt.graphics.FontgetFont()intgetInt()intgetInteger()java.lang.StringgetReportData()Return data for display in Report (without label) NOTE: There should be no newlines at end of Stringorg.eclipse.swt.custom.StyledTextgetStyledText()java.lang.StringgetText()java.lang.StringgetXmlData()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: toXmlbooleanisFloat()booleanisInteger()booleanisValid()Return true if entry is validvoidrefresh()Refresh the entry widgetbooleanrequiredEntry()voidset(java.lang.String text)voidset(XViewerTextWidget text)voidsetEditable(boolean editable)voidsetEnabled(boolean enabled)voidsetFocus()Set focus to the entry widgetvoidsetFont(org.eclipse.swt.graphics.Font font)voidsetFromXml(java.lang.String xml)voidsetHeight(int height)voidsetMaxTextLimit(int limit)Set max character limit on text fieldvoidsetRequiredEntry(boolean requiredEntry)voidsetSize(int width, int height)voidsetText(java.lang.String text)voidsetXmlData(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.StringtoHTML(java.lang.String labelFont)java.lang.StringtoHTML(java.lang.String labelFont, boolean newLineText)java.lang.StringtoString()java.lang.StringtoXml()java.lang.StringtoXml(java.lang.String xmlRoot)java.lang.StringtoXml(java.lang.String xmlRoot, java.lang.String xmlSubRoot)protected voidupdateTextWidget()-
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 Detail
-
sText
protected org.eclipse.swt.custom.StyledText sText
-
parent
private org.eclipse.swt.widgets.Composite parent
-
text
protected java.lang.String text
-
maxTextChars
private int maxTextChars
-
debug
private static final boolean debug
- See Also:
- Constant Field Values
-
width
private int width
-
height
private int height
-
font
private org.eclipse.swt.graphics.Font font
-
-
Constructor Detail
-
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 Detail
-
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:
toStringin classXViewerWidget
-
getControl
public org.eclipse.swt.widgets.Control getControl()
- Specified by:
getControlin 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:
createWidgetsin classXViewerWidget
-
createWidgets
public void createWidgets(org.eclipse.swt.widgets.Composite parent, int horizontalSpan, boolean fillText)
-
addModificationListener
private void addModificationListener()
-
createLabelWidget
private void createLabelWidget(org.eclipse.swt.widgets.Composite composite)
-
createComposite
private org.eclipse.swt.widgets.Composite createComposite(org.eclipse.swt.widgets.Composite parent, int horizontalSpan)
-
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:XViewerWidgetCreate Widgets used to display label and entry for wizards and editors- Specified by:
disposein classXViewerWidget
-
setFocus
public void setFocus()
Description copied from class:XViewerWidgetSet focus to the entry widget- Specified by:
setFocusin classXViewerWidget
-
setEditable
public void setEditable(boolean editable)
- Overrides:
setEditablein 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:
setRequiredEntryin 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:XViewerWidgetReturn 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:
getXmlDatain classXViewerWidget
-
toXml
public java.lang.String toXml()
- Overrides:
toXmlin classXViewerWidget
-
toXml
public java.lang.String toXml(java.lang.String xmlRoot)
- Overrides:
toXmlin classXViewerWidget
-
toXml
public java.lang.String toXml(java.lang.String xmlRoot, java.lang.String xmlSubRoot)- Overrides:
toXmlin classXViewerWidget
-
setXmlData
public void setXmlData(java.lang.String str)
Description copied from class:XViewerWidgetCalled 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:
setXmlDatain classXViewerWidget
-
setFromXml
public void setFromXml(java.lang.String xml)
- Overrides:
setFromXmlin classXViewerWidget
-
getInt
public int getInt()
-
updateTextWidget
protected void updateTextWidget()
-
set
public void set(java.lang.String text)
-
set
public void set(XViewerTextWidget text)
-
append
public void append(java.lang.String text)
-
refresh
public void refresh()
Description copied from class:XViewerWidgetRefresh the entry widget- Specified by:
refreshin classXViewerWidget
-
getReportData
public java.lang.String getReportData()
Description copied from class:XViewerWidgetReturn data for display in Report (without label) NOTE: There should be no newlines at end of String- Specified by:
getReportDatain 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:
toHTMLin classXViewerWidget
-
isValid
public boolean isValid()
Description copied from class:XViewerWidgetReturn true if entry is valid- Specified by:
isValidin classXViewerWidget- Returns:
- Return boolean validity indication.
-
getData
public java.lang.Object getData()
- Specified by:
getDatain 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
-
-