Class AbstractPTWidget
- java.lang.Object
-
- org.eclipse.nebula.widgets.opal.propertytable.AbstractPTWidget
-
- All Implemented Interfaces:
PTWidget
- Direct Known Subclasses:
PTWidgetTable
,PTWidgetTree
public abstract class AbstractPTWidget extends java.lang.Object implements PTWidget
This abstract class contains all common methods for widgets that are part of a property table
-
-
Field Summary
Fields Modifier and Type Field Description protected org.eclipse.swt.custom.StyledText
descriptionLabel
private PropertyTable
parentPropertyTable
-
Constructor Summary
Constructors Constructor Description AbstractPTWidget()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description PTWidget
build()
Build the widget (Table or TreeTable)private void
buildButtons(org.eclipse.swt.widgets.Composite parent, boolean sorted, boolean showAsCategory, boolean showDescription)
Build the buttons (Sort, switch category/flat list, show/hide description)private void
buildCategoryButton(org.eclipse.swt.widgets.Composite parent, boolean showAsCategory)
private void
buildDescriptionButton(org.eclipse.swt.widgets.Composite parent, boolean showDescription)
private void
buildDescriptionPanel(org.eclipse.swt.widgets.Composite parent)
Build the description panelprivate void
buildSortButton(org.eclipse.swt.widgets.Composite parent, boolean sorted)
protected abstract void
buildWidget(org.eclipse.swt.widgets.Composite parent)
Build the widget itselfprivate void
dispose()
Dispose the previous widgetPTWidget
disposeAndBuild(PropertyTable table)
Dispose the previous widget and build a new one (when ones switch from Category View to Flat List view)protected PropertyTable
getParentPropertyTable()
abstract void
refillData()
Clear all data and fill the widgetvoid
setParentPropertyTable(PropertyTable table)
Inject the parent property table in the widgetvoid
updateDescriptionPanel(java.lang.Object selection)
Update the description panel (if it exists)
-
-
-
Field Detail
-
parentPropertyTable
private PropertyTable parentPropertyTable
-
descriptionLabel
protected org.eclipse.swt.custom.StyledText descriptionLabel
-
-
Method Detail
-
refillData
public abstract void refillData()
Description copied from interface:PTWidget
Clear all data and fill the widget- Specified by:
refillData
in interfacePTWidget
- See Also:
PTWidget.refillData()
-
buildWidget
protected abstract void buildWidget(org.eclipse.swt.widgets.Composite parent)
Build the widget itself- Parameters:
parent
-
-
build
public PTWidget build()
Description copied from interface:PTWidget
Build the widget (Table or TreeTable)- Specified by:
build
in interfacePTWidget
- Returns:
- the built widget
- See Also:
PTWidget.build()
-
buildButtons
private void buildButtons(org.eclipse.swt.widgets.Composite parent, boolean sorted, boolean showAsCategory, boolean showDescription)
Build the buttons (Sort, switch category/flat list, show/hide description)- Parameters:
parent
- parent compositesorted
- iftrue
, the sort button is pushedshowAsCategory
- iftrue
, the "show as category" button is pushedshowDescription
- iftrue
, the "description" button is pushed
-
buildSortButton
private void buildSortButton(org.eclipse.swt.widgets.Composite parent, boolean sorted)
- Parameters:
parent
- parent compositesorted
- iftrue
, the sort button is pushed
-
buildCategoryButton
private void buildCategoryButton(org.eclipse.swt.widgets.Composite parent, boolean showAsCategory)
- Parameters:
parent
- parent compositeshowAsCategory
- iftrue
, the "show as category" button is pushed
-
buildDescriptionButton
private void buildDescriptionButton(org.eclipse.swt.widgets.Composite parent, boolean showDescription)
- Parameters:
parent
- parent compositeshowDescription
- iftrue
, the "description" button is pushed
-
buildDescriptionPanel
private void buildDescriptionPanel(org.eclipse.swt.widgets.Composite parent)
Build the description panel- Parameters:
parent
- parent composite
-
disposeAndBuild
public PTWidget disposeAndBuild(PropertyTable table)
Description copied from interface:PTWidget
Dispose the previous widget and build a new one (when ones switch from Category View to Flat List view)- Specified by:
disposeAndBuild
in interfacePTWidget
- Parameters:
table
- the PropertyTable to dispose- Returns:
- the built widget
- See Also:
PTWidget.disposeAndBuild(org.eclipse.nebula.widgets.opal.propertytable.PropertyTable)
-
dispose
private void dispose()
Dispose the previous widget
-
getParentPropertyTable
protected PropertyTable getParentPropertyTable()
- Returns:
- the parent PropertyTable
-
setParentPropertyTable
public void setParentPropertyTable(PropertyTable table)
Description copied from interface:PTWidget
Inject the parent property table in the widget- Specified by:
setParentPropertyTable
in interfacePTWidget
- Parameters:
parentPropertyTable
- the parent PropertyTable to set
-
updateDescriptionPanel
public void updateDescriptionPanel(java.lang.Object selection)
Description copied from interface:PTWidget
Update the description panel (if it exists)- Specified by:
updateDescriptionPanel
in interfacePTWidget
- Parameters:
selection
- selected property- See Also:
PTWidget.updateDescriptionPanel(java.lang.Object)
-
-