Package com.iizigo.vs
Class TablePanel
java.lang.Object
org.eclipse.swt.widgets.Widget
org.eclipse.swt.widgets.Control
org.eclipse.swt.widgets.Scrollable
org.eclipse.swt.widgets.Composite
org.eclipse.swt.custom.SashForm
com.iizix.swt.CustomSashForm
com.iizigo.vs.TablePanel
- All Implemented Interfaces:
IComplexOperationSelection,IContextMenuContributor,IContextMenuContributorFormControl<org.eclipse.jface.viewers.Viewer>,IFilterListener,ISavePanel,IVirtualSpacePanel,EventListener,IVSColumnBestValueListener,IVSColumnListener,IVSComponentListener,IVSComponentState,IVSTableListener,EventListener,org.eclipse.swt.events.DisposeListener,org.eclipse.swt.graphics.Drawable,org.eclipse.swt.internal.SWTEventListener
public class TablePanel extends CustomSashForm implements IVirtualSpacePanel, org.eclipse.swt.events.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.ICustomSashFormListenerNested classes/interfaces inherited from interface com.iizix.prop.vs.IVSComponentState
IVSComponentState.StateField 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_INDEXFields inherited from class org.eclipse.swt.custom.SashForm
SASH_WIDTHFields inherited from class org.eclipse.swt.widgets.Control
handleMethod Summary
Modifier and TypeMethodDescriptionvoidappendMenuItems(org.eclipse.jface.viewers.Viewer viewer, IzMenu menu, DesignerProp target) Called to append menu items.booleandoAddExpandCollapseAll(org.eclipse.jface.viewers.Viewer viewer, IzMenu menu, DesignerProp target) Checks if expand/collapse all menu items should be added.voiddoComplexOperationSelection(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.booleanChecks if this interface returns the selection before the operation takes place or not.voidonBroken(VSRelativeReference<?> reference, VSColumnHeader column) Called when the property reference has been broken, i.e.voidonBroken(VSRelativeReference<?> reference, VSTable table) Called when the property reference has been broken, i.e.voidonCellStateChanged(VSField cell, IVSComponentState.State state, boolean on) Called when the cell changes state.voidonCellValueChanged(VSColumnHeader column, VSField cell, Value value, GProp<?> trigger, IPostEventProcessing postProcessing) Called when the cell value is set in the column.voidonCellValueChanged(VSField cell, Value value, GProp<?> trigger, IPostEventProcessing postProcessing) Called when the cell value is set.voidonConnections(IVSColumnListener[] listeners) Called to update the connections.voidonConnections(IVSTableListener[] listeners) Called to update the connections.voidonEditedProperty(GProp<?> comp) Selection changed for panel.voidProperty event.voidCalled when a filter text has been applied.voidonParentStateChanged(IVSComponent parent, IVSComponentState.State state, boolean on) Called when the parent changes state.voidonResolved(VSRelativeReference<?> reference, VSColumnHeader column) Called when the property reference has been resolved.voidonResolved(VSRelativeReference<?> reference, VSTable table) Called when the property reference has been resolved.voidonRowAdded(VSColumnHeader column, VSRow row, int rowIndex) Called when a row has been added to the table.voidonRowAdded(VSRow row, int index) Called when a row is added.voidonRowRemoved(VSColumnHeader column, VSRow row, int rowIndex) Called when a row has been removed from the table.voidonRowRemoved(VSRow row, int index) Called when a row is removed.voidonRowStateChanged(VSRow row, IVSComponentState.State state, boolean on) Called when a row selection state changed.voidonSelectionChanged(VSColumnHeader column, VSRow row, int rowIndex, boolean isSelected) Called when the row selection is changed to forward to column listeners.voidonSingleSelectionChanged(VSColumnHeader column, int rowIndex) Called when the row selection in table single-selection mode is changed to forward to column listeners.voidonSingleSelectionChanged(VSTable table, int index) Called when the single selection changes.voidonStateChanged(VSColumnHeader table, IVSComponentState.State state, boolean on) Called when the column changes state.voidonStateChanged(VSColumnHeader column, VSField cell, IVSComponentState.State state, boolean on) Called when a cell in the column changes state.voidonStateChanged(VSTable table, IVSComponentState.State state, boolean on) Called when the table changes state.voidprependMenuItems(org.eclipse.jface.viewers.Viewer viewer, IzMenu menu, DesignerProp target) Called to prepend menu items.voidCalled to save settings.booleansetCellFocus(EditorVSField field) Selects the field in the table by placing the cursor on the cell and selecting the row.voidwidgetDisposed(org.eclipse.swt.events.DisposeEvent e) 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, upRestoreClickedMethods inherited from class org.eclipse.swt.custom.SashForm
getMaximizedControl, getOrientation, getSashWidth, getStyle, getWeights, setBackground, setForeground, setLayout, setMaximizedControl, setOrientation, setSashWidth, setToolTipTextMethods inherited from class org.eclipse.swt.widgets.Composite
changed, checkSubclass, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayoutDeferred, setTabList, toStringMethods inherited from class org.eclipse.swt.widgets.Scrollable
computeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBarMethods inherited from class org.eclipse.swt.widgets.Control
addControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTouchListener, addTraverseListener, computeSize, 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, 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, updateMethods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setDataMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.swt.graphics.Drawable
isAutoScalableMethods inherited from interface com.iizigo.editor.complex.IComplexOperationSelection
isDisposed
Method Details
saveSettings
public void saveSettings()Called to save settings.- Specified by:
saveSettingsin interfaceISavePanel- Specified by:
saveSettingsin 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:
onEditedPropertyin interfaceIVirtualSpacePanel
onEvent
Property event.- Specified by:
onEventin interfaceEventListener- Parameters:
event- The event.
widgetDisposed
public void widgetDisposed(org.eclipse.swt.events.DisposeEvent e) Sent when the widget is disposed.- Specified by:
widgetDisposedin interfaceorg.eclipse.swt.events.DisposeListener- Parameters:
e- an event containing information about the dispose
onFilter
Called when a filter text has been applied.- Specified by:
onFilterin interfaceIFilterListener- Parameters:
text- The filter text to apply, null for none (never empty string).
doComplexOperationSelection
Performs the selection of the components.- Specified by:
doComplexOperationSelectionin interfaceIComplexOperationSelection
isReturningSelectionBeforeOperation
public boolean isReturningSelectionBeforeOperation()Checks if this interface returns the selection before the operation takes place or not.- Specified by:
isReturningSelectionBeforeOperationin 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:
getSelectionBeforein interfaceIComplexOperationSelection- Parameters:
op- The complex operation.- Returns:
- The selection that can be restored, null for none.
prependMenuItems
public void prependMenuItems(org.eclipse.jface.viewers.Viewer viewer, IzMenu menu, DesignerProp target) Called to prepend menu items.- Specified by:
prependMenuItemsin interfaceIContextMenuContributor- Specified by:
prependMenuItemsin interfaceIContextMenuContributorFormControl<org.eclipse.jface.viewers.Viewer>- Parameters:
viewer- The viewer.menu- The pop-up menu.target- The selected target in the viewer, null for none.
appendMenuItems
public void appendMenuItems(org.eclipse.jface.viewers.Viewer viewer, IzMenu menu, DesignerProp target) Called to append menu items.- Specified by:
appendMenuItemsin interfaceIContextMenuContributor- Specified by:
appendMenuItemsin interfaceIContextMenuContributorFormControl<org.eclipse.jface.viewers.Viewer>- Parameters:
viewer- The viewer.menu- The pop-up menu.target- The selected target in the viewer, null for none.
doAddExpandCollapseAll
public boolean doAddExpandCollapseAll(org.eclipse.jface.viewers.Viewer viewer, IzMenu menu, DesignerProp target) Checks if expand/collapse all menu items should be added.- Specified by:
doAddExpandCollapseAllin interfaceIContextMenuContributor
getTarget
Gets the default target when none other is found for the pop-up menu in the viewer.- Specified by:
getTargetin interfaceIContextMenuContributor- Specified by:
getTargetin interfaceIContextMenuContributorFormControl<org.eclipse.jface.viewers.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:IVSColumnBestValueListenerRequests the value type that would best suit the listener.- Specified by:
getBestVSColumnHeaderValueTypein interfaceIVSColumnBestValueListener- Parameters:
reference- The VSRelativeReference instance holding the reference.- Returns:
- null if none is available.
onResolved
Description copied from interface:IVSColumnListenerCalled when the property reference has been resolved. UI components use this method to set its state according to the field.- Specified by:
onResolvedin interfaceIVSColumnListener- Parameters:
reference- The VSRelativeReference instance holding the reference.column- The target reference.
onBroken
Description copied from interface:IVSColumnListenerCalled when the property reference has been broken, i.e. unresolved.- Specified by:
onBrokenin interfaceIVSColumnListener- Parameters:
reference- The VSRelativeReference instance holding the reference.column- The target reference.
onStateChanged
Description copied from interface:IVSColumnListenerCalled when the column changes state.- Specified by:
onStateChangedin 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:IVSComponentListenerCalled when the parent changes state.- Specified by:
onParentStateChangedin 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:IVSColumnListenerCalled when the row selection in table single-selection mode is changed to forward to column listeners.- Specified by:
onSingleSelectionChangedin interfaceIVSColumnListener- Parameters:
column- The column.rowIndex- The row index selected, -1 for none.
onSelectionChanged
Description copied from interface:IVSColumnListenerCalled when the row selection is changed to forward to column listeners.- Specified by:
onSelectionChangedin 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:IVSColumnListenerCalled when a cell in the column changes state.- Specified by:
onStateChangedin 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:IVSColumnListenerCalled when the cell value is set in the column.- Specified by:
onCellValueChangedin 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:IVSColumnListenerCalled when a row has been added to the table.- Specified by:
onRowAddedin interfaceIVSColumnListener- Parameters:
column- The column.row- The row that was added.rowIndex- The row index where it was inserted.
onRowRemoved
Description copied from interface:IVSColumnListenerCalled when a row has been removed from the table.- Specified by:
onRowRemovedin interfaceIVSColumnListener- Parameters:
column- The column.row- The row that was removed.rowIndex- The row index before removal.
onResolved
Description copied from interface:IVSTableListenerCalled when the property reference has been resolved. UI components use this method to set its state according to the field.- Specified by:
onResolvedin interfaceIVSTableListener- Parameters:
reference- The VSRelativeReference instance holding the reference.table- The target reference.
onBroken
Description copied from interface:IVSTableListenerCalled when the property reference has been broken, i.e. unresolved.- Specified by:
onBrokenin interfaceIVSTableListener- Parameters:
reference- The VSRelativeReference instance holding the reference.table- The target reference.
onStateChanged
Description copied from interface:IVSTableListenerCalled when the table changes state.- Specified by:
onStateChangedin interfaceIVSTableListener- Parameters:
table- The VS table.state- The state change.on- New state.
onSingleSelectionChanged
Description copied from interface:IVSTableListenerCalled when the single selection changes.- Specified by:
onSingleSelectionChangedin interfaceIVSTableListener- Parameters:
table- The table.index- The row index, -1 if table is unselected.
onRowAdded
Description copied from interface:IVSTableListenerCalled when a row is added.- Specified by:
onRowAddedin interfaceIVSTableListener- Parameters:
row- The row.index- The index.
onRowRemoved
Description copied from interface:IVSTableListenerCalled when a row is removed.- Specified by:
onRowRemovedin interfaceIVSTableListener- Parameters:
row- The row.index- The index.
onRowStateChanged
Description copied from interface:IVSTableListenerCalled when a row selection state changed.- Specified by:
onRowStateChangedin interfaceIVSTableListener- Parameters:
row- The row.state- The state change.on- New state.
onCellStateChanged
Description copied from interface:IVSTableListenerCalled when the cell changes state.- Specified by:
onCellStateChangedin 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:IVSTableListenerCalled when the cell value is set.- Specified by:
onCellValueChangedin 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.