Class ConfigurationTableEditor
- java.lang.Object
-
- org.eclipse.jface.viewers.Viewer
-
- org.eclipse.jface.viewers.ContentViewer
-
- org.eclipse.jface.viewers.StructuredViewer
-
- org.eclipse.jface.viewers.ColumnViewer
-
- org.eclipse.jface.viewers.AbstractTreeViewer
-
- org.eclipse.jface.viewers.TreeViewer
-
- net.ssehub.easy.producer.ui.productline_editor.configuration.ConfigurationTableEditor
-
- All Implemented Interfaces:
IGUIConfigChangeListener,IGUIConfigurationContainer,IConfigurationChangeListener,org.eclipse.jface.viewers.IInputProvider,org.eclipse.jface.viewers.IInputSelectionProvider,org.eclipse.jface.viewers.IPostSelectionProvider,org.eclipse.jface.viewers.ISelectionProvider
- Direct Known Subclasses:
AttributeValuesPage.AttributeTableEditor,ConfigurationTableEditorFactory.ConfigTableEditor
public class ConfigurationTableEditor extends org.eclipse.jface.viewers.TreeViewer implements IGUIConfigChangeListener, IConfigurationChangeListener, IGUIConfigurationContainer
The table for editing the configuration, without surrounding buttons or other stuff.- Author:
- El-Sharkawy
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceConfigurationTableEditor.IUpdateListenerA listener which is called when the editor performs (async) updates.
-
Field Summary
Fields Modifier and Type Field Description private Configurationconfigprivate GUIConfigurationguiConfigprivate ConfigurationTableEditor.IUpdateListenerlistenerprivate IEASyEditorPageparentPage
-
Constructor Summary
Constructors Modifier Constructor Description protectedConfigurationTableEditor(Configuration configuration, IEASyEditorPage parent)Sole constructor for this editor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidchanged(GUIConfiguration changedConfiguration)Will be called when something inside theGUIConfigurationwas changed.voidclose()On-close method for this table editor, release allocated ressources.voidconfigurationRefreshed(Configuration config)Notification that the whole configuration was refreshed, e.g.protected org.eclipse.jface.viewers.CellLabelProvidercreateColumnLabelProvider()Creates a label provider for a column.private voidcreateContextMenu()Creates a context menu inside the cells.private voidcreateProductEditorTableColumns()Method creates the columns for the product table.private voidexecOnParent(java.lang.Runnable runnable, boolean async)Executes a runnable on the parent display.protected java.lang.String[]getColumnTitles()Returns the titles of the columns.protected int[]getColumnWidths()Returns the widths of the columns.ConfigurationgetConfig()Returns the configuration instance.GUIConfigurationgetGuiConfig()Returns the GUI configuration instance.intgetItemCount()Returns the number of items.voidimtemsChanged(GUIConfiguration changedConfiguration)Will be called when something inside theGUIConfigurationwas changed.voiditemChanged(Configuration config, IDecisionVariable changedVariable, Value oldValue)Notification that aDecisionVariablechanged inside theConfiguration.voidrefresh()voidsetUpdateListener(ConfigurationTableEditor.IUpdateListener listener)Changes the update listener.voidstateChanged(Configuration config, IDecisionVariable changedVariable)Notification that the state of aDecisionVariablehas been changed inside theConfiguration.voidupdateItem(GUIVariable variable)Informs the container that a single item has changed (not added/deleted).-
Methods inherited from class org.eclipse.jface.viewers.TreeViewer
addTreeListener, assertContentProviderType, createViewerEditor, disassociate, doGetColumnCount, editElement, getChild, getChildren, getColumnViewerOwner, getControl, getExpanded, getItemAt, getItemCount, getItemCount, getItems, getLabelProvider, getParentElement, getParentItem, getRawChildren, getSelection, getTree, getViewerRowFromItem, handleTreeCollapse, handleTreeExpand, hookControl, internalAdd, internalInitializeTree, internalRefreshStruct, isExpandable, mapElement, newItem, remove, removeAll, replace, setChildCount, setContentProvider, setExpanded, setHasChildren, setSelection, setSelection, showItem, updatePlus
-
Methods inherited from class org.eclipse.jface.viewers.AbstractTreeViewer
add, add, addSelectionListener, addTreeListener, associate, buildLabel, collapseAll, collapseToLevel, createChildren, createTreeItem, doFindInputItem, doFindItem, doUpdateItem, doUpdateItem, expandAll, expandAll, expandToLevel, expandToLevel, expandToLevel, expandToLevel, fireTreeCollapsed, fireTreeExpanded, getAutoExpandLevel, getChildren, getExpandedElements, getExpandedState, getExpandedTreePaths, getNextItem, getPreviousItem, getSelection, getSelectionFromWidget, getSortedChildren, getStructuredSelection, getTreePathFromItem, getVisibleExpandedElements, handleDoubleSelect, indexForElement, inputChanged, insert, internalCollapseToLevel, internalExpand, internalExpandToLevel, internalFindItems, internalGetWidgetToSelect, internalIsInputOrEmptyPath, internalRefresh, internalRefresh, internalRefresh, internalRemove, internalRemove, isSameSelection, labelProviderChanged, remove, remove, remove, removeTreeListener, reveal, scrollDown, scrollUp, setAutoExpandLevel, setExpandedElements, setExpandedState, setExpandedTreePaths, setExpandPreCheckFilters, setSelectionToWidget, setSelectionToWidget, updateChildren
-
Methods inherited from class org.eclipse.jface.viewers.ColumnViewer
applyEditorValue, cancelEditing, checkBusy, getCell, getCellEditors, getCellModifier, getColumnProperties, getColumnViewerEditor, getItem, getLabelProvider, getViewerRow, handleDispose, hookEditingSupport, isBusy, isCellEditorActive, refresh, refresh, setBusy, setCellEditors, setCellModifier, setColumnProperties, setColumnViewerEditor, setLabelProvider, triggerEditorActivationEvent, update
-
Methods inherited from class org.eclipse.jface.viewers.StructuredViewer
addDoubleClickListener, addDragSupport, addDropSupport, addFilter, addOpenListener, addPostSelectionChangedListener, assertElementsNotNull, equals, filter, findItem, findItems, fireDoubleClick, fireOpen, firePostSelectionChanged, getColorAndFontCollector, getComparator, getComparer, getFilteredChildren, getFilters, getRoot, getSorter, handleInvalidSelection, handleLabelProviderChanged, handleOpen, handlePostSelect, handleSelect, hasFilters, internalUpdate, needsRefilter, preservingSelection, refresh, refreshItem, removeDoubleClickListener, removeFilter, removeOpenListener, removePostSelectionChangedListener, resetFilters, setComparator, setComparer, setFilters, setInput, setSorter, setUseHashlookup, testFindItem, testFindItems, unmapAllElements, unmapElement, unmapElement, update, updateItem, updateSelection, usingElementMap
-
Methods inherited from class org.eclipse.jface.viewers.Viewer
addHelpListener, addSelectionChangedListener, fireHelpRequested, fireSelectionChanged, getData, handleHelpRequest, removeHelpListener, removeSelectionChangedListener, setData, setSelection
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.ssehub.easy.producer.ui.productline_editor.configuration.IGUIConfigurationContainer
addFilter, removeFilter, setFilters
-
-
-
-
Field Detail
-
config
private Configuration config
-
guiConfig
private GUIConfiguration guiConfig
-
parentPage
private IEASyEditorPage parentPage
-
listener
private ConfigurationTableEditor.IUpdateListener listener
-
-
Constructor Detail
-
ConfigurationTableEditor
protected ConfigurationTableEditor(Configuration configuration, IEASyEditorPage parent)
Sole constructor for this editor.- Parameters:
configuration- The configuration which should be edited in this editor.parent- TheIEASyEditorPageholding this table.
-
-
Method Detail
-
setUpdateListener
public void setUpdateListener(ConfigurationTableEditor.IUpdateListener listener)
Changes the update listener.- Parameters:
listener- the new update listener (may be null)
-
createColumnLabelProvider
protected org.eclipse.jface.viewers.CellLabelProvider createColumnLabelProvider()
Creates a label provider for a column. [customization]- Returns:
- the label provider instance (need to comply with
getColumnWidths()andgetColumnTitles()
-
getColumnTitles
protected java.lang.String[] getColumnTitles()
Returns the titles of the columns. [customization]- Returns:
- the titles of the columns (need to comply with
getColumnWidths()andcreateColumnLabelProvider()
-
getColumnWidths
protected int[] getColumnWidths()
Returns the widths of the columns. [customization]- Returns:
- the widths of the columns (need to comply with
getColumnTitles()andcreateColumnLabelProvider()
-
createProductEditorTableColumns
private void createProductEditorTableColumns()
Method creates the columns for the product table.
-
createContextMenu
private void createContextMenu()
Creates a context menu inside the cells. Part of the constructor.
-
refresh
public void refresh()
- Overrides:
refreshin classorg.eclipse.jface.viewers.StructuredViewer
-
changed
public void changed(GUIConfiguration changedConfiguration)
Description copied from interface:IGUIConfigChangeListenerWill be called when something inside theGUIConfigurationwas changed.- Specified by:
changedin interfaceIGUIConfigChangeListener- Parameters:
changedConfiguration- A reference of theGUIConfigurationwhich was changed.
-
itemChanged
public void itemChanged(Configuration config, IDecisionVariable changedVariable, Value oldValue)
Description copied from interface:IConfigurationChangeListenerNotification that aDecisionVariablechanged inside theConfiguration.- Specified by:
itemChangedin interfaceIConfigurationChangeListener- Parameters:
config- TheConfigurationwhere the change occurred.changedVariable- TheDecisionVariablewhich changed.oldValue- the old value ofchangedVariablebefore the change
-
execOnParent
private void execOnParent(java.lang.Runnable runnable, boolean async)Executes a runnable on the parent display.- Parameters:
runnable- the runnable to be executedasync- whether execution shall happen asynchronously or synchronously
-
configurationRefreshed
public void configurationRefreshed(Configuration config)
Description copied from interface:IConfigurationChangeListenerNotification that the whole configuration was refreshed, e.g. because the project was reparsed.- Specified by:
configurationRefreshedin interfaceIConfigurationChangeListener- Parameters:
config- The configuration which was refreshed.
-
close
public void close()
On-close method for this table editor, release allocated ressources.
-
imtemsChanged
public void imtemsChanged(GUIConfiguration changedConfiguration)
Description copied from interface:IGUIConfigChangeListenerWill be called when something inside theGUIConfigurationwas changed. Contrary toIGUIConfigChangeListener.changed(GUIConfiguration), this method should be used if only the view shall be updated.- Specified by:
imtemsChangedin interfaceIGUIConfigChangeListener- Parameters:
changedConfiguration- A reference of theGUIConfigurationwhich was changed.
-
getItemCount
public int getItemCount()
Returns the number of items.- Returns:
- the number of items
-
getGuiConfig
public GUIConfiguration getGuiConfig()
Description copied from interface:IGUIConfigurationContainerReturns the GUI configuration instance.- Specified by:
getGuiConfigin interfaceIGUIConfigurationContainer- Returns:
- the GUI configuration instance
-
getConfig
public Configuration getConfig()
Description copied from interface:IGUIConfigurationContainerReturns the configuration instance.- Specified by:
getConfigin interfaceIGUIConfigurationContainer- Returns:
- the configuration instance
-
stateChanged
public void stateChanged(Configuration config, IDecisionVariable changedVariable)
Description copied from interface:IConfigurationChangeListenerNotification that the state of aDecisionVariablehas been changed inside theConfiguration.- Specified by:
stateChangedin interfaceIConfigurationChangeListener- Parameters:
config- TheConfigurationwhere the change occurred.changedVariable- TheDecisionVariablewhich changed.
-
updateItem
public void updateItem(GUIVariable variable)
Description copied from interface:IGUIConfigurationContainerInforms the container that a single item has changed (not added/deleted). This is much more efficient than to refresh the whole container and in case of an editor, does not force to collapse open items.- Specified by:
updateItemin interfaceIGUIConfigurationContainer- Parameters:
variable- The item which has been modified (not added or deleted).
-
-