|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jidesoft.grid.CellEditorManager
public class CellEditorManager
A global object that can register cell editor with a type and a EditorContext.
Nested Class Summary | |
---|---|
static interface |
CellEditorManager.CellEditorCustomizer
A cell editor customizer interface. |
Constructor Summary | |
---|---|
CellEditorManager()
|
Method Summary | |
---|---|
static void |
addCellEditorCustomizer(CellEditorManager.CellEditorCustomizer cellEditorCustomizer)
Adds a cell editor customizer. |
static void |
addRegistrationListener(RegistrationListener l)
Adds a listener to the list that's notified each time a change to the manager occurs. |
static void |
clear()
|
static CellEditorManager.CellEditorCustomizer[] |
getCellEditorCustomizers()
Gets all the cell editor customizers in an array. |
static CellEditor |
getEditor(Class<?> clazz)
Gets the registered editor using default context. |
static CellEditor |
getEditor(Class<?> clazz,
EditorContext context)
Gets the registered editor. |
static EditorContext[] |
getEditorContexts(Class<?> clazz)
Gets the available EditorContext registered with the class. |
static RegistrationListener[] |
getRegistrationListeners()
Returns an array of all the registration listeners registered on this manager. |
static void |
initDefaultEditor()
Initial the default editors. |
static boolean |
isAutoInit()
Checks the value of autoInit. |
static void |
registerEditor(Class<?> clazz,
CellEditor editor)
Deprecated. use registerEditor(Class, CellEditorFactory) . JTable don't support sharing the same instance
of CellEditor. If you use this method to register a cell editor instance, it may cause problem when
you try to edit two tables simultaneous. If you register a CellEditorFactory, a new cell editor will
be created every time which avoids the problem of sharing cell editor. |
static void |
registerEditor(Class<?> clazz,
CellEditor editor,
EditorContext context)
Deprecated. use registerEditor(Class, CellEditorFactory, EditorContext) JTable don't support sharing the
same instance of CellEditor. If you use this method to register a cell editor instance, it may cause
problem when you try to edit two tables simultaneous. If you register a CellEditorFactory, a new cell
editor will be created every time which avoids the problem of sharing cell editor. |
static void |
registerEditor(Class<?> clazz,
CellEditorFactory editorFactory)
Registers a editor with a class and default context. |
static void |
registerEditor(Class<?> clazz,
CellEditorFactory editorFactory,
EditorContext context)
Registers a editorFactory with a class and a context. |
static void |
removeCellEditorCustomizer(CellEditorManager.CellEditorCustomizer cellEditorCustomizer)
Removes a cell editor Customizer that was added before. |
static void |
removeRegistrationListener(RegistrationListener l)
Removes a listener from the list that's notified each time a change to the manager occurs. |
static void |
resetInit()
If initDefaultEditor() is called once, calling it again will have no effect because an internal flag is
set. |
static void |
setAutoInit(boolean autoInit)
Sets autoInit to true or false. |
static void |
unregisterAllEditors()
Unregisters all the editors which registered before. |
static void |
unregisterAllEditors(Class<?> clazz)
Unregisters all editors which register with the class. |
static void |
unregisterEditor(Class<?> clazz)
Unregisters the editor which registers with the class and the default context. |
static void |
unregisterEditor(Class<?> clazz,
EditorContext context)
Unregisters the editor which registers with the class and the context. |
static void |
updateUI()
Updates the UI of the registered cell editors when LookAndFeel changed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CellEditorManager()
Method Detail |
---|
@Deprecated public static void registerEditor(Class<?> clazz, CellEditor editor, EditorContext context)
registerEditor(Class, CellEditorFactory, EditorContext)
JTable don't support sharing the
same instance of CellEditor. If you use this method to register a cell editor instance, it may cause
problem when you try to edit two tables simultaneous. If you register a CellEditorFactory, a new cell
editor will be created every time which avoids the problem of sharing cell editor.
clazz
- the typeeditor
- the editorcontext
- the editor context@Deprecated public static void registerEditor(Class<?> clazz, CellEditor editor)
registerEditor(Class, CellEditorFactory)
. JTable don't support sharing the same instance
of CellEditor. If you use this method to register a cell editor instance, it may cause problem when
you try to edit two tables simultaneous. If you register a CellEditorFactory, a new cell editor will
be created every time which avoids the problem of sharing cell editor.
clazz
- the typeeditor
- the editorpublic static void registerEditor(Class<?> clazz, CellEditorFactory editorFactory, EditorContext context)
clazz
- the typeeditorFactory
- the editor factorycontext
- the editor contextpublic static void registerEditor(Class<?> clazz, CellEditorFactory editorFactory)
clazz
- the typeeditorFactory
- the editorpublic static void unregisterEditor(Class<?> clazz, EditorContext context)
clazz
- the type of which the cell editor will be unregistered.context
- the editor context.public static void unregisterEditor(Class<?> clazz)
clazz
- the type of which the cell editor will be unregistered.public static void unregisterAllEditors(Class<?> clazz)
clazz
- the type of which the cell editor will be unregistered.public static void unregisterAllEditors()
public static CellEditor getEditor(Class<?> clazz, EditorContext context)
clazz
- the type.context
- the editor context.
public static CellEditor getEditor(Class<?> clazz)
clazz
- the type.
public static void updateUI()
public static boolean isAutoInit()
setAutoInit(boolean)
public static void setAutoInit(boolean autoInit)
initDefaultEditor()
will be called if it has never be called. By default, autoInit is true.
This might affect the behavior if users provide their own CellEditors and want to overwrite default CellEditors.
In this case, instead of depending on autoInit to initialize default CellEditors, you should call initDefaultEditor()
first, then call registerCellEditor to add your own CellEditors.
autoInit
- true or false.public static void addRegistrationListener(RegistrationListener l)
l
- the RegistrationListenerpublic static void removeRegistrationListener(RegistrationListener l)
l
- the RegistrationListenerpublic static RegistrationListener[] getRegistrationListeners()
RegistrationListener
s or an empty array if no registration
listeners are currently registeredaddRegistrationListener(com.jidesoft.utils.RegistrationListener)
,
removeRegistrationListener(com.jidesoft.utils.RegistrationListener)
public static CellEditorManager.CellEditorCustomizer[] getCellEditorCustomizers()
public static void addCellEditorCustomizer(CellEditorManager.CellEditorCustomizer cellEditorCustomizer)
CellEditorManager.addCellEditorCustomizer(new CellEditorManager.CellEditorCustomizer(){
public void customize(CellEditor cellEditor) {
if(cellEditor instanceof AbstractJideCellEditor) {
((AbstractJideCellEditor) cellEditor).setClickCountToStart(2);
}
else if(cellEditor instanceof DefaultCellEditor) {
((DefaultCellEditor) cellEditor).setClickCountToStart(2);
}
}
});
cellEditorCustomizer
- the cell editor customer to be added.public static void removeCellEditorCustomizer(CellEditorManager.CellEditorCustomizer cellEditorCustomizer)
cellEditorCustomizer
- the cell editor customer to be removed.public static EditorContext[] getEditorContexts(Class<?> clazz)
clazz
- the class.
public static void initDefaultEditor()
public static void resetInit()
initDefaultEditor()
is called once, calling it again will have no effect because an internal flag is
set. This method will reset the internal flag so that you can call initDefaultEditor()
in case you
unregister all editors using unregisterAllEditors()
.
public static void clear()
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |