Package com.iizigo.vs
Class TablePanel
- All Implemented Interfaces:
IComplexOperationSelection
,IContextMenuContributor
,IContextMenuContributorFormControl<Viewer>
,IFilterListener
,ISavePanel
,IVirtualSpacePanel
,EventListener
,IVSColumnBestValueListener
,IVSColumnListener
,IVSComponentListener
,IVSComponentState
,IVSTableListener
,EventListener
,DisposeListener
,Drawable
,SWTEventListener
public class TablePanel extends CustomSashForm implements IVirtualSpacePanel, DisposeListener, EventListener, IFilterListener, IComplexOperationSelection, IVSColumnListener, IVSTableListener, IContextMenuContributor, ISavePanel
Panel used to display a selected Table in the VirtualSpace.
- Author:
- Christopher Mindus
Nested Class Summary
Nested classes/interfaces inherited from class com.iizix.swt.CustomSashForm
CustomSashForm.ICustomSashFormListener
Nested classes/interfaces inherited from interface com.iizix.prop.vs.IVSComponentState
IVSComponentState.State
Field Summary
Fields inherited from class com.iizix.swt.CustomSashForm
ARROW_DRAWN_INDEX, ARROW_HEIGHT, ARROW_MARGIN, ARROW_TYPE_INDEX, ARROW_WIDTH, arrowColor, borderColor, currentSashInfo, customSashFormListeners, DOWN_HIDE_ARROW, DOWN_RESTORE_ARROW, HEIGHT_INDEX, HIDE_ARROWS, inMouseClick, NO_HIDE_DOWN, NO_HIDE_LEFT, NO_HIDE_RIGHT, NO_HIDE_UP, noHideDown, noHideUp, sashBorders, UP_HIDE_ARROW, UP_RESTORE_ARROW, WIDTH_INDEX, X_INDEX, Y_INDEX
Fields inherited from class org.eclipse.swt.custom.SashForm
SASH_WIDTH
Method Summary
Modifier and TypeMethodDescriptionvoid
appendMenuItems
(Viewer viewer, IzMenu menu, DesignerProp target) Called to append menu items.boolean
doAddExpandCollapseAll
(Viewer viewer, IzMenu menu, DesignerProp target) Checks if expand/collapse all menu items should be added.void
doComplexOperationSelection
(GProp<?>[] props) Performs the selection of the components.getBestVSColumnHeaderValueType
(VSRelativeReference<?> reference) Requests the value type that would best suit the listener.Override this method to return the initial selection that is suitable for restoring a selection usingdoComplexOperationSelection(GProp [])
.Gets the default target when none other is found for the pop-up menu in the viewer.boolean
Checks if this interface returns the selection before the operation takes place or not.void
onBroken
(VSRelativeReference<?> reference, VSColumnHeader column) Called when the property reference has been broken, i.e.void
onBroken
(VSRelativeReference<?> reference, VSTable table) Called when the property reference has been broken, i.e.void
onCellStateChanged
(VSField cell, IVSComponentState.State state, boolean on) Called when the cell changes state.void
onCellValueChanged
(VSColumnHeader column, VSField cell, Value value, GProp<?> trigger, IPostEventProcessing postProcessing) Called when the cell value is set in the column.void
onCellValueChanged
(VSField cell, Value value, GProp<?> trigger, IPostEventProcessing postProcessing) Called when the cell value is set.void
onConnections
(IVSColumnListener[] listeners) Called to update the connections.void
onConnections
(IVSTableListener[] listeners) Called to update the connections.void
onEditedProperty
(GProp<?> comp) Selection changed for panel.void
Property event.void
Called when a filter text has been applied.void
onParentStateChanged
(IVSComponent parent, IVSComponentState.State state, boolean on) Called when the parent changes state.void
onResolved
(VSRelativeReference<?> reference, VSColumnHeader column) Called when the property reference has been resolved.void
onResolved
(VSRelativeReference<?> reference, VSTable table) Called when the property reference has been resolved.void
onRowAdded
(VSColumnHeader column, VSRow row, int rowIndex) Called when a row has been added to the table.void
onRowAdded
(VSRow row, int index) Called when a row is added.void
onRowRemoved
(VSColumnHeader column, VSRow row, int rowIndex) Called when a row has been removed from the table.void
onRowRemoved
(VSRow row, int index) Called when a row is removed.void
onRowStateChanged
(VSRow row, IVSComponentState.State state, boolean on) Called when a row selection state changed.void
onSelectionChanged
(VSColumnHeader column, VSRow row, int rowIndex, boolean isSelected) Called when the row selection is changed to forward to column listeners.void
onSingleSelectionChanged
(VSColumnHeader column, int rowIndex) Called when the row selection in table single-selection mode is changed to forward to column listeners.void
onSingleSelectionChanged
(VSTable table, int index) Called when the single selection changes.void
onStateChanged
(VSColumnHeader table, IVSComponentState.State state, boolean on) Called when the column changes state.void
onStateChanged
(VSColumnHeader column, VSField cell, IVSComponentState.State state, boolean on) Called when a cell in the column changes state.void
onStateChanged
(VSTable table, IVSComponentState.State state, boolean on) Called when the table changes state.void
prependMenuItems
(Viewer viewer, IzMenu menu, DesignerProp target) Called to prepend menu items.void
Called to save settings.boolean
setCellFocus
(EditorVSField field) Selects the field in the table by placing the cursor on the cell and selecting the row.void
Sent when the widget is disposed.Methods inherited from class com.iizix.swt.CustomSashForm
addCustomSashFormListener, downHideClicked, downRestoreClicked, drawArrow, drawDownHideArrow, drawDownRestoreArrow, drawLeftHideArrow, drawLeftRestoreArrow, drawRightHideArrow, drawRightRestoreArrow, drawSashBorder, drawUpHideArrow, drawUpRestoreArrow, fireDividerMoved, getNewSashArray, getRestoreWeight, getSash, getSavedSizes, getWeightsForSave, hideDown, hideLeft, hideRight, hideUp, isFirstSashVisible, isFocusAncestorA, isNoHideDown, isNoHideLeft, isNoHideRight, isNoHideUp, isSecondSashVisible, layout, recomputeSashInfo, removeCustomSashFormListener, setFirstSashVisible, setNoHideDown, setNoHideLeft, setNoHideRight, setNoHideUp, setRestoreWeight, setSashBorders, setSecondSashVisible, setWeights, upHideClicked, upRestoreClicked
Methods inherited from class org.eclipse.swt.custom.SashForm
getMaximizedControl, getOrientation, getSashWidth, getStyle, getWeights, setBackground, setForeground, setLayout, setMaximizedControl, setOrientation, setSashWidth, setToolTipText
Methods inherited from class org.eclipse.swt.widgets.Composite
changed, checkSubclass, computeSize, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, redraw, setBackgroundMode, setFocus, setLayoutDeferred, setTabList, toString
Methods inherited from class org.eclipse.swt.widgets.Scrollable
computeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBar, setScrollbarsMode
Methods inherited from class org.eclipse.swt.widgets.Control
addControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTouchListener, addTraverseListener, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getParent, getRegion, getShell, getSize, getTextDirection, getToolTipText, getTouchEnabled, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTouchListener, removeTraverseListener, requestLayout, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setFont, setLayoutData, setLocation, setLocation, setMenu, setParent, setRedraw, setRegion, setSize, setSize, setTextDirection, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, update
Methods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, addTypedListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, getTypedListeners, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, removeTypedListener, reskin, setData, setData
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.eclipse.swt.graphics.Drawable
isAutoScalable
Methods inherited from interface com.iizigo.editor.complex.IComplexOperationSelection
isDisposed
Method Details
saveSettings
public void saveSettings()Called to save settings.- Specified by:
saveSettings
in interfaceISavePanel
- Specified by:
saveSettings
in interfaceIVirtualSpacePanel
setCellFocus
Selects the field in the table by placing the cursor on the cell and selecting the row.- Returns:
- true if successful, false if field cell is not inside table.
onEditedProperty
Selection changed for panel.- Specified by:
onEditedProperty
in interfaceIVirtualSpacePanel
onEvent
Property event.- Specified by:
onEvent
in interfaceEventListener
- Parameters:
event
- The event.
widgetDisposed
Sent when the widget is disposed.- Specified by:
widgetDisposed
in interfaceDisposeListener
- Parameters:
e
- an event containing information about the dispose
onFilter
Called when a filter text has been applied.- Specified by:
onFilter
in interfaceIFilterListener
- Parameters:
text
- The filter text to apply, null for none (never empty string).
doComplexOperationSelection
Performs the selection of the components.- Specified by:
doComplexOperationSelection
in interfaceIComplexOperationSelection
isReturningSelectionBeforeOperation
public boolean isReturningSelectionBeforeOperation()Checks if this interface returns the selection before the operation takes place or not.- Specified by:
isReturningSelectionBeforeOperation
in interfaceIComplexOperationSelection
- Returns:
- false, must be overridden to return the selection before.
getSelectionBefore
Override this method to return the initial selection that is suitable for restoring a selection usingdoComplexOperationSelection(GProp [])
.Use the method
ComplexOperation.newContainerSelection(GProp)
to create the array elements.- Specified by:
getSelectionBefore
in interfaceIComplexOperationSelection
- Parameters:
op
- The complex operation.- Returns:
- The selection that can be restored, null for none.
prependMenuItems
Called to prepend menu items.- Specified by:
prependMenuItems
in interfaceIContextMenuContributor
- Specified by:
prependMenuItems
in interfaceIContextMenuContributorFormControl<Viewer>
- Parameters:
viewer
- The viewer.menu
- The pop-up menu.target
- The selected target in the viewer, null for none.
appendMenuItems
Called to append menu items.- Specified by:
appendMenuItems
in interfaceIContextMenuContributor
- Specified by:
appendMenuItems
in interfaceIContextMenuContributorFormControl<Viewer>
- Parameters:
viewer
- The viewer.menu
- The pop-up menu.target
- The selected target in the viewer, null for none.
doAddExpandCollapseAll
Checks if expand/collapse all menu items should be added.- Specified by:
doAddExpandCollapseAll
in interfaceIContextMenuContributor
getTarget
Gets the default target when none other is found for the pop-up menu in the viewer.- Specified by:
getTarget
in interfaceIContextMenuContributor
- Specified by:
getTarget
in interfaceIContextMenuContributorFormControl<Viewer>
- Returns:
- The target, or null to use the default edited property.
onConnections
Called to update the connections.onConnections
Called to update the connections.getBestVSColumnHeaderValueType
Description copied from interface:IVSColumnBestValueListener
Requests the value type that would best suit the listener.- Specified by:
getBestVSColumnHeaderValueType
in interfaceIVSColumnBestValueListener
- Parameters:
reference
- The VSRelativeReference instance holding the reference.- Returns:
- null if none is available.
onResolved
Description copied from interface:IVSColumnListener
Called when the property reference has been resolved. UI components use this method to set its state according to the field.- Specified by:
onResolved
in interfaceIVSColumnListener
- Parameters:
reference
- The VSRelativeReference instance holding the reference.column
- The target reference.
onBroken
Description copied from interface:IVSColumnListener
Called when the property reference has been broken, i.e. unresolved.- Specified by:
onBroken
in interfaceIVSColumnListener
- Parameters:
reference
- The VSRelativeReference instance holding the reference.column
- The target reference.
onStateChanged
Description copied from interface:IVSColumnListener
Called when the column changes state.- Specified by:
onStateChanged
in interfaceIVSColumnListener
- Parameters:
table
- The VS table column.state
- The state change, possible values ENABLED, READONLY, VISIBLE or SELECTED.on
- New state.
onParentStateChanged
Description copied from interface:IVSComponentListener
Called when the parent changes state.- Specified by:
onParentStateChanged
in interfaceIVSComponentListener
- Parameters:
parent
- The parent who's state was changed.state
- The state change, possible values PARENT_ENABLED, PARENT_READONLY, PARENT_VISIBLE.on
- New state.
onSingleSelectionChanged
Description copied from interface:IVSColumnListener
Called when the row selection in table single-selection mode is changed to forward to column listeners.- Specified by:
onSingleSelectionChanged
in interfaceIVSColumnListener
- Parameters:
column
- The column.rowIndex
- The row index selected, -1 for none.
onSelectionChanged
Description copied from interface:IVSColumnListener
Called when the row selection is changed to forward to column listeners.- Specified by:
onSelectionChanged
in interfaceIVSColumnListener
- Parameters:
column
- The column.row
- The row that was changed.rowIndex
- The row index.isSelected
- The selected state.
onStateChanged
public void onStateChanged(VSColumnHeader column, VSField cell, IVSComponentState.State state, boolean on) Description copied from interface:IVSColumnListener
Called when a cell in the column changes state.- Specified by:
onStateChanged
in interfaceIVSColumnListener
- Parameters:
column
- The VS column.cell
- The VS field.state
- The state change.on
- New state.
onCellValueChanged
public void onCellValueChanged(VSColumnHeader column, VSField cell, Value value, GProp<?> trigger, IPostEventProcessing postProcessing) Description copied from interface:IVSColumnListener
Called when the cell value is set in the column.- Specified by:
onCellValueChanged
in interfaceIVSColumnListener
- Parameters:
column
- The VS column.cell
- The VS field.value
- The value, never null, butvalue.isNull()
could be true.trigger
- The trigger property that may be null.postProcessing
- Post-processing instance.
onRowAdded
Description copied from interface:IVSColumnListener
Called when a row has been added to the table.- Specified by:
onRowAdded
in interfaceIVSColumnListener
- Parameters:
column
- The column.row
- The row that was added.rowIndex
- The row index where it was inserted.
onRowRemoved
Description copied from interface:IVSColumnListener
Called when a row has been removed from the table.- Specified by:
onRowRemoved
in interfaceIVSColumnListener
- Parameters:
column
- The column.row
- The row that was removed.rowIndex
- The row index before removal.
onResolved
Description copied from interface:IVSTableListener
Called when the property reference has been resolved. UI components use this method to set its state according to the field.- Specified by:
onResolved
in interfaceIVSTableListener
- Parameters:
reference
- The VSRelativeReference instance holding the reference.table
- The target reference.
onBroken
Description copied from interface:IVSTableListener
Called when the property reference has been broken, i.e. unresolved.- Specified by:
onBroken
in interfaceIVSTableListener
- Parameters:
reference
- The VSRelativeReference instance holding the reference.table
- The target reference.
onStateChanged
Description copied from interface:IVSTableListener
Called when the table changes state.- Specified by:
onStateChanged
in interfaceIVSTableListener
- Parameters:
table
- The VS table.state
- The state change.on
- New state.
onSingleSelectionChanged
Description copied from interface:IVSTableListener
Called when the single selection changes.- Specified by:
onSingleSelectionChanged
in interfaceIVSTableListener
- Parameters:
table
- The table.index
- The row index, -1 if table is unselected.
onRowAdded
Description copied from interface:IVSTableListener
Called when a row is added.- Specified by:
onRowAdded
in interfaceIVSTableListener
- Parameters:
row
- The row.index
- The index.
onRowRemoved
Description copied from interface:IVSTableListener
Called when a row is removed.- Specified by:
onRowRemoved
in interfaceIVSTableListener
- Parameters:
row
- The row.index
- The index.
onRowStateChanged
Description copied from interface:IVSTableListener
Called when a row selection state changed.- Specified by:
onRowStateChanged
in interfaceIVSTableListener
- Parameters:
row
- The row.state
- The state change.on
- New state.
onCellStateChanged
Description copied from interface:IVSTableListener
Called when the cell changes state.- Specified by:
onCellStateChanged
in interfaceIVSTableListener
- Parameters:
cell
- The VS cell.state
- The state change.on
- New state.
onCellValueChanged
public void onCellValueChanged(VSField cell, Value value, GProp<?> trigger, IPostEventProcessing postProcessing) Description copied from interface:IVSTableListener
Called when the cell value is set.- Specified by:
onCellValueChanged
in interfaceIVSTableListener
- Parameters:
cell
- The VS field.value
- The value, never null, butvalue.isNull()
could be true.trigger
- The trigger property that may be null.postProcessing
- Post-processing instance.