org.eclipse.emf.facet.widgets.nattable
Interface INatTableWidget2


public interface INatTableWidget2

This interface defines every public action a user can perform on the EMF Facet table widget


Method Summary
 void addQueryColumn()
          Open the query selection dialog.
 void addRows(java.util.List<EObject> newElements)
          Add a new row in the table for each given element.
 void copySelectionToClipboard()
          This method performs to usual "copy to clipboard" action.
 void createNewElement()
          This method calls the last launched InstantiationMethod and adds the result to the table if any.
 void createNewElement(InstantiationMethod instantiationMethod)
          This method calls the given InstantiationMethod and adds the result to the table if any.
 void deleteSelection()
          Delete the selected elements from their respective models and remove the corresponding line in the table.
 void editSelectedCell()
          Edit the selected cell.
 Control getComposite()
           
 java.util.List<InstantiationMethod> getInstantionMethodHistory()
           
 java.util.Collection<ISelectionChangedListener> getSelectionChangedListeners()
           
 TableConfiguration getTableConfiguration()
          This method returns the TableConfiguration attached to the table.
 TableInstance getTableInstance()
          This method returns the TableInstance attached to the table.
 java.util.List<Column> getVisibleColumns(boolean setAtTheTop)
          This method does not change the state of the widget.
 boolean isCellsDeletable()
          Return whether the selection of cells can be deleted.
 boolean isCellSelected()
          Return whether there is at least a cell selected in the table
 boolean isColumnSelected()
          Return whether there is at least a column selected in the table
 boolean isOneOfTheLocalCustomizationsNotOnTheTop()
          Indicates if one of the local customization is not at the top of the stack
 boolean isSelectedCellEditable()
          Return true if the selected cell is editable Return false if several cells are selected
 boolean isSelectedColumnDeletable()
          Return whether the selected column can be deleted.
 void openLoadCustomizationDialog()
           
 void openLoadFacetsDialog()
           
 void openSavedTable()
          Allow the opening of an existing saved .table file within the current table widget.
 void putLocalCustomizationOnTheBottom()
          The method to put the local customization on the bottom
 void putLocalCustomizationOnTheTop()
          The method to put the local customization on the top
 void registerActionDelegate(IActionDelegate action)
          Register an ActionDelegate.
 void removeLine()
          Remove the selected lines from the table.
 void save()
          Performs the usual save action.
 void saveAs()
          Open a "Save As" dialog to serialize the table.
 void selectAll()
          Perform the usual "Select All" action on the table's cells
 void selectCell(EObject eObject, EStructuralFeature eStructuralFeature)
          This method selects the cell corresponding to the given EObject at the column representing the given EStructuralFeature
 void selectColumnsToHide()
          Open a selection popup to select which columns to show/hide.
 void selectDefaultLabelCell(EObject eObject)
          This method selects the cell corresponding to the given EObject in the DefaultLabelColumn.
 void selectInstantiationMethodToLaunch()
          Open a dialog to choose the default instantiationMethod to perform when clicking on the "Create" button.
 void selectRows(java.util.List<EObject> elementsToSelect, boolean clearTheSelection)
          This method allows to select the rows representing the EObjcet in the table
 void setFacets(java.util.Collection<Facet> facets)
          Set the facets in order to apply them on the table.
 void setHideEmptyColumns(boolean hideEmptyColumns)
          Whether to hide columns which don't contain any elements.
 void setOnlyShowCommonColumns(boolean onlyShowCommonColumns)
          Whether to show columns which are specific to a few elements (false), or only columns which are common to all the elements (true).
 void showHideColumns(java.util.List<Column> selectedColumns, boolean putOnTheTop)
           
 void sortColumnByNameAtoZ()
          Sort the Columns by alphabetic order.
 void sortColumnByNameZtoA()
          Sort the Columns by reverse alphabetical order.
 void sortColumnsByType()
          Whether to sort columns by type of link (attributes first, then references, then derived references, ...).
 void unregisterActionDelegate(IActionDelegate action)
          Unregister an ActionDelegate
 

Method Detail

createNewElement

void createNewElement()
This method calls the last launched InstantiationMethod and adds the result to the table if any. If no InstantiationMethod is saved, then a selection popup is opened for the user to choose one via INatTableWidget.selectInstantiationMethodToLaunch()


createNewElement

void createNewElement(InstantiationMethod instantiationMethod)
This method calls the given InstantiationMethod and adds the result to the table if any.

Parameters:
instantiationMethod - an InstantiationMethod

selectInstantiationMethodToLaunch

void selectInstantiationMethodToLaunch()
Open a dialog to choose the default instantiationMethod to perform when clicking on the "Create" button.


save

void save()
Performs the usual save action.


saveAs

void saveAs()
Open a "Save As" dialog to serialize the table.


addQueryColumn

void addQueryColumn()
Open the query selection dialog. Add a column which contains the result of the selected query.


copySelectionToClipboard

void copySelectionToClipboard()
This method performs to usual "copy to clipboard" action.


deleteSelection

void deleteSelection()
Delete the selected elements from their respective models and remove the corresponding line in the table.


selectColumnsToHide

void selectColumnsToHide()
Open a selection popup to select which columns to show/hide.


setHideEmptyColumns

void setHideEmptyColumns(boolean hideEmptyColumns)
Whether to hide columns which don't contain any elements.

Parameters:
hideEmptyColumns - true to hide columns which don't contain any elements.

setOnlyShowCommonColumns

void setOnlyShowCommonColumns(boolean onlyShowCommonColumns)
Whether to show columns which are specific to a few elements (false), or only columns which are common to all the elements (true).

Parameters:
onlyShowCommonColumns - Whether to show columns which are specific to a few elements (false), or only columns which are common to all the elements (true)

sortColumnsByType

void sortColumnsByType()
Whether to sort columns by type of link (attributes first, then references, then derived references, ...).

Parameters:
sortColumnsByType - Boolean to sort columns by type of link

openSavedTable

void openSavedTable()
Allow the opening of an existing saved .table file within the current table widget.


removeLine

void removeLine()
Remove the selected lines from the table. The actual elements are not deleted. See INatTableWidget.deleteSelection() for that case.


selectAll

void selectAll()
Perform the usual "Select All" action on the table's cells


getTableConfiguration

TableConfiguration getTableConfiguration()
This method returns the TableConfiguration attached to the table.

Returns:
the TableConfiguration attached to the table.

getInstantionMethodHistory

java.util.List<InstantiationMethod> getInstantionMethodHistory()
Returns:
The history of launched instantiation methods.

getTableInstance

TableInstance getTableInstance()
This method returns the TableInstance attached to the table.

Returns:
returns the TableInstance attached to the table.

isCellSelected

boolean isCellSelected()
Return whether there is at least a cell selected in the table

Returns:
Whether there is at least a cell selected in the table

isColumnSelected

boolean isColumnSelected()
Return whether there is at least a column selected in the table

Returns:
whether there is at least a column selected in the table

isCellsDeletable

boolean isCellsDeletable()
Return whether the selection of cells can be deleted.

Returns:
Whether the selection of cells can be deleted.

isSelectedColumnDeletable

boolean isSelectedColumnDeletable()
Return whether the selected column can be deleted.

Returns:
whether the selected column can be deleted.

getComposite

Control getComposite()
Returns:
the widget composite itself.

addRows

void addRows(java.util.List<EObject> newElements)
Add a new row in the table for each given element.

Parameters:
newElements - the list of elements to add to the table

registerActionDelegate

void registerActionDelegate(IActionDelegate action)
Register an ActionDelegate. It will be notified after the opening of a saved table in a view.

Parameters:
action - the action to be registered

unregisterActionDelegate

void unregisterActionDelegate(IActionDelegate action)
Unregister an ActionDelegate

Parameters:
action - the action to be unregistered

getSelectionChangedListeners

java.util.Collection<ISelectionChangedListener> getSelectionChangedListeners()

openLoadCustomizationDialog

void openLoadCustomizationDialog()

openLoadFacetsDialog

void openLoadFacetsDialog()

sortColumnByNameAtoZ

void sortColumnByNameAtoZ()
Sort the Columns by alphabetic order.


sortColumnByNameZtoA

void sortColumnByNameZtoA()
Sort the Columns by reverse alphabetical order.


setFacets

void setFacets(java.util.Collection<Facet> facets)
               throws CoreException
Set the facets in order to apply them on the table. If FacetReference or FacetAttribute are contained by those facets, new columns FacetReferenceColumn and FacetAttributeColumn are added to the table.

Parameters:
facets - the list of facets to be applied on the table.
Throws:
CoreException

selectDefaultLabelCell

void selectDefaultLabelCell(EObject eObject)
This method selects the cell corresponding to the given EObject in the DefaultLabelColumn.

Parameters:
eObject - the EObject we want to select the DefaultLabelColumn's cell.

selectCell

void selectCell(EObject eObject,
                EStructuralFeature eStructuralFeature)
This method selects the cell corresponding to the given EObject at the column representing the given EStructuralFeature


editSelectedCell

void editSelectedCell()
Edit the selected cell.


showHideColumns

void showHideColumns(java.util.List<Column> selectedColumns,
                     boolean putOnTheTop)
Parameters:
selectedColumns - the columns to hide
putOnTheTop - indicates if the localCustom files should be put on the top of the stack

isOneOfTheLocalCustomizationsNotOnTheTop

boolean isOneOfTheLocalCustomizationsNotOnTheTop()
Indicates if one of the local customization is not at the top of the stack

Returns:

getVisibleColumns

java.util.List<Column> getVisibleColumns(boolean setAtTheTop)
This method does not change the state of the widget.

Parameters:
setAtTheTop - indicates if we need to set the local customization at the top of the stack to get the visibility
Returns:
the visible columns

putLocalCustomizationOnTheTop

void putLocalCustomizationOnTheTop()
The method to put the local customization on the top


putLocalCustomizationOnTheBottom

void putLocalCustomizationOnTheBottom()
The method to put the local customization on the bottom


isSelectedCellEditable

boolean isSelectedCellEditable()
Return true if the selected cell is editable Return false if several cells are selected


selectRows

void selectRows(java.util.List<EObject> elementsToSelect,
                boolean clearTheSelection)
This method allows to select the rows representing the EObjcet in the table

Parameters:
elementsToSelect - the elementToSelect
clearTheSelection - indicates if the current selection should be cleared