Search in sources :

Example 1 with IEventExecutor

use of com.servoy.j2db.ui.IEventExecutor in project servoy-client by Servoy.

the class TableView method editCellAt.

/*
	 * (non-Javadoc)
	 *
	 * @see com.servoy.j2db.gui.FixedJTable#editCellAt(int, int, java.util.EventObject)
	 */
@Override
public boolean editCellAt(int row, int column, EventObject e) {
    boolean b = super.editCellAt(row, column, e);
    Component comp = getEditorComponent();
    if (comp instanceof ISupportEventExecutor) {
        // focus lost event comes after editor is removed from hierarchy
        IEventExecutor executor = ((ISupportEventExecutor) comp).getEventExecutor();
        if (executor instanceof BaseEventExecutor) {
            ((BaseEventExecutor) executor).setFormName(fc.getName());
        }
    }
    if (b && !isEditable() && comp instanceof IScriptableProvider && ((IScriptableProvider) comp).getScriptObject() instanceof HasRuntimeReadOnly && !((HasRuntimeReadOnly) ((IScriptableProvider) comp).getScriptObject()).isReadOnly()) {
        // the component is editable again, we have to set it back
        ((HasRuntimeReadOnly) ((IScriptableProvider) comp).getScriptObject()).setReadOnly(true);
    }
    return b;
}
Also used : HasRuntimeReadOnly(com.servoy.j2db.ui.runtime.HasRuntimeReadOnly) IEventExecutor(com.servoy.j2db.ui.IEventExecutor) IComponent(com.servoy.j2db.ui.IComponent) Component(java.awt.Component) GraphicalComponent(com.servoy.j2db.persistence.GraphicalComponent) IFieldComponent(com.servoy.j2db.ui.IFieldComponent) JComponent(javax.swing.JComponent) JTextComponent(javax.swing.text.JTextComponent) IRuntimeComponent(com.servoy.j2db.ui.runtime.IRuntimeComponent) ISupportEventExecutor(com.servoy.j2db.ui.ISupportEventExecutor) BaseEventExecutor(com.servoy.j2db.ui.BaseEventExecutor) IScriptableProvider(com.servoy.j2db.scripting.IScriptableProvider)

Aggregations

GraphicalComponent (com.servoy.j2db.persistence.GraphicalComponent)1 IScriptableProvider (com.servoy.j2db.scripting.IScriptableProvider)1 BaseEventExecutor (com.servoy.j2db.ui.BaseEventExecutor)1 IComponent (com.servoy.j2db.ui.IComponent)1 IEventExecutor (com.servoy.j2db.ui.IEventExecutor)1 IFieldComponent (com.servoy.j2db.ui.IFieldComponent)1 ISupportEventExecutor (com.servoy.j2db.ui.ISupportEventExecutor)1 HasRuntimeReadOnly (com.servoy.j2db.ui.runtime.HasRuntimeReadOnly)1 IRuntimeComponent (com.servoy.j2db.ui.runtime.IRuntimeComponent)1 Component (java.awt.Component)1 JComponent (javax.swing.JComponent)1 JTextComponent (javax.swing.text.JTextComponent)1