public class WGridStackDashboard extends FormComponent
form, INTERNAL_STATE_RECORD_PROPERTY
Constructor and Description |
---|
WGridStackDashboard() |
Modifier and Type | Method and Description |
---|---|
RecordHolder |
addWidget(RecordHolder component,
RecordHolder position,
boolean autoposition)
Adds a widget to the dashboard.
|
protected GridStackDashboard |
createWidget()
Called once, to create the actual Vaadin component.
|
String |
getCaption(RecordHolder widget)
Gets a widget caption.
|
Decimal |
getComponentCount()
Gets the component count.
|
ListHolder |
getComponents()
Gets a list of components in the grid.
|
RecordHolder |
getPosition(RecordHolder widget)
Gets a position of a widget.
|
EnumerationImpl |
getState(RecordHolder dwidget)
Gets a widget state.
|
GridStackDashboard |
getWidget()
Gets the Vaadin representation of this component.
|
ListHolder |
getWidgets()
Gets a list of widgets.
|
protected void |
onUpdate(GridStackDashboardUpdateEvent e) |
void |
preventGC(Set<ValueHolder> set)
Override for all components which are actively using some record holders, not directly linked to the model.
|
void |
removeWidget(RecordHolder dwidget)
Removes the widget from the dashboard.
|
protected void |
restoreInternalState(Map<String,Object> state)
Restores the UI state of this component which was previously written
by
FormComponent.writeInternalState(Map) . |
void |
setCaption(RecordHolder widget,
String caption)
Sets a caption to a widget.
|
void |
setMaximizeWindowTooltip(String maximizeTooltip,
String restoreTooltip)
Tooltip for maximize widget button.
|
void |
setMinimizeWindowTooltip(String minimizeTooltip,
String restoreTooltip)
Tooltip for minimize widget button.
|
void |
setPosition(RecordHolder widget,
RecordHolder position)
Sets the widget position.
|
void |
setState(RecordHolder widget,
EnumerationImpl state)
Sets a state to a widget.
|
void |
setToolbar(RecordHolder widget,
RecordHolder component)
Sets a toolbar to a widget.
|
protected void |
writeInternalState(Map<String,Object> state)
Writes the UI state of this component to the provided map.
|
addDataErrorMessage, addStyleName, attach, call, clearDataErrorMessages, createEvent, equals, getCaption, getComponentAlignment, getContextClickHandler, getCustomErrorMessage, getDataErrorMessages, getDescription, getExpandRatio, getHasChildrenAdapter, getHeight, getIcon, getModelingId, getNamespace, getStyleName, getTabIndex, getWidth, hashCode, isEnabled, isReadOnly, isVisible, localize, markAsDirty, removeStyleName, restoreState, saveState, setCaption, setComponentAlignment, setContextClickHandler, setContextMenuItems, setCustomErrorMessage, setDescription, setEnabled, setExpandRatio, setHeight, setIcon, setReadOnly, setStyleName, setTabIndex, setVisible, setWidth, toString
protected GridStackDashboard createWidget()
FormComponent
createWidget
in class FormComponent
public GridStackDashboard getWidget()
FormComponent
getWidget
in class FormComponent
public RecordHolder addWidget(RecordHolder component, RecordHolder position, boolean autoposition)
component
- the component to be set as a widget content.position
- the widget positionautoposition
- forms::GSDashboardWidget
public void removeWidget(RecordHolder dwidget)
dwidget
- the widget to remove.public ListHolder getWidgets()
forms::GSDashboardWidget
records.public Decimal getComponentCount()
public ListHolder getComponents()
getWidgets()
.public EnumerationImpl getState(RecordHolder dwidget)
dwidget
- the widget for which to query the stateforms::WidgetState
enumeration values.public String getCaption(RecordHolder widget)
widget
- the widghets the caption of which should be returned.public void setCaption(RecordHolder widget, String caption)
widget
- the widgetcaption
- the caption to setpublic void setState(RecordHolder widget, EnumerationImpl state)
widget
- the widgetstate
- the state value represented by forms::WidgetState
enumeration.public void setPosition(RecordHolder widget, RecordHolder position)
widget
- position
- public RecordHolder getPosition(RecordHolder widget)
widget
- public void setToolbar(RecordHolder widget, RecordHolder component)
widget
- component
- the toolbar componentprotected void onUpdate(GridStackDashboardUpdateEvent e)
public void setMinimizeWindowTooltip(String minimizeTooltip, String restoreTooltip)
minimizeTooltip
- tooltip when the widget has normal sizerestoreTooltip
- tooltip when the widget is minimizedpublic void setMaximizeWindowTooltip(String maximizeTooltip, String restoreTooltip)
maximizeTooltip
- tooltip when the widget has normal sizerestoreTooltip
- tooltip when the widget is maximizedpublic void preventGC(Set<ValueHolder> set)
FormComponent
WTabSheet
maintains a set of opened tabs. These tab records are not referenced
directly from forms::TabSheet and will therefore be garbage-collected. We however need those records to not to be GCed as the user
may ask for them simply by calling getTab(Integer).
Please note that the component definition records (e.g. forms::Button) are already GC-protected and they do not need to be added to this set.
Also, any child components currently attached to the UI are automatically protected and are not required to be registered in the set.preventGC
in class FormComponent
set
- a set of records which are to be GC-prevented, never null. The component should add any records here.
Default implementation does nothing.protected void writeInternalState(Map<String,Object> state)
FormComponent
Many UI attributes such as size, caption, etc. are not held in the records but are stored exclusively in the Vaadin components. In the records the getter/setter methods of such attributes directly delegate to the underlying component. For the purposes of the Save Document/Todo use case the state of such attributes has to be preserved.
Subclasses should override this method. The overriding method should call
super.writeInternalState(state)
to store the state form the super
class as well. The attributes should be written to the provided state
parameter. The type of the values written to the state
can only by
Java representation of LSPS types. That is java.util.Date
,
java.lang.String
, Decimal
, RecordHolder
,
ListHolder
, ... The name of the attributes stored in the map
should be unique and should not collide with the names used by any
of the superclass. It is the responsibility of the overridden method to ensure
that.
Subclasses overriding this method should also override
FormComponent.restoreInternalState(Map)
and restore the state written
by this method.
writeInternalState
in class FormComponent
state
- a map to which this method should write the component's UI state.FormComponent.restoreInternalState(Map)
,
FormComponent.saveState()
protected void restoreInternalState(Map<String,Object> state)
FormComponent
FormComponent.writeInternalState(Map)
.
Subclasses should override and call super.restoreInternalState(state);
restoreInternalState
in class FormComponent
state
- a map of attributes and their valuesFormComponent.writeInternalState(Map)
Copyright © 2007-2018 Whitestein Technologies. All Rights Reserved.