public class ActiveCellEditorRegistry extends Object
ICellEditor
does not know about the NatTable
instance it is activated in, and NatTable does not have some kind of global context
to register this information to, it is currently not possible to solve this in
another way.
On activating a cell editor for inline editing, the activated cell editor will be registered here. If the editor is closed, it needs to unregister itself.
Any position in code that needs to be aware of an open cell editor can request it from here. This is especially necessary for automatic closing of cell editors on other actions, e.g. trying to scroll with an activated editor which should lead to close the editor first.
This can cause serious side effects if you are trying to create a custom editor that is based on NatTable as editor control. This needs to be solved with some kind of NatTable context where such instance can be registered (e.g. Dependency Injection) and therefore will be addressed in a future architecture design.
Constructor and Description |
---|
ActiveCellEditorRegistry() |
Modifier and Type | Method and Description |
---|---|
static ICellEditor |
getActiveCellEditor() |
static void |
registerActiveCellEditor(ICellEditor editor)
Register the given
ICellEditor as the current active one. |
static void |
unregisterActiveCellEditor()
Will unregister the current active cell editor if there is one.
|
public static void registerActiveCellEditor(ICellEditor editor)
ICellEditor
as the current active one.editor
- The editor that should be registered as the current
active one.public static void unregisterActiveCellEditor()
public static ICellEditor getActiveCellEditor()
ICellEditor
or null
if
there is none.Copyright © 2013. All Rights Reserved.