Search in sources :

Example 1 with DialogedTableCellEditor

use of com.ramussoft.gui.qualifier.table.DialogedTableCellEditor in project ramus by Vitaliy-Yakovchuk.

the class ElementAttributesEditor method getCellEditor.

private TableCellEditor getCellEditor(int aRow) {
    Attribute attribute = attributes.get(aRow).attribute;
    AttributePlugin plugin = framework.findAttributePlugin(attribute);
    TableCellEditor cellEditor = plugin.getTableCellEditor(framework.getEngine(), framework.getAccessRules(), attribute);
    if (cellEditor == null) {
        saveValues[aRow] = false;
        cellEditor = new DialogedTableCellEditor(framework.getEngine(), framework.getAccessRules(), attribute, plugin, framework);
    } else
        saveValues[aRow] = plugin.isCellEditable();
    return cellEditor;
}
Also used : TabledAttributePlugin(com.ramussoft.gui.qualifier.table.TabledAttributePlugin) AttributePlugin(com.ramussoft.gui.common.AttributePlugin) Attribute(com.ramussoft.common.Attribute) TableCellEditor(javax.swing.table.TableCellEditor) DialogedTableCellEditor(com.ramussoft.gui.qualifier.table.DialogedTableCellEditor) DialogedTableCellEditor(com.ramussoft.gui.qualifier.table.DialogedTableCellEditor)

Example 2 with DialogedTableCellEditor

use of com.ramussoft.gui.qualifier.table.DialogedTableCellEditor in project ramus by Vitaliy-Yakovchuk.

the class TableEditorTable method setModel.

@Override
public void setModel(TableModel dataModel) {
    super.setModel(dataModel);
    if (!(dataModel instanceof TableEditorModel))
        return;
    TableEditorModel model = (TableEditorModel) dataModel;
    Engine engine = framework.getEngine();
    AccessRules rules = framework.getAccessRules();
    for (int i = 0; i < plugins.length; i++) {
        AttributePlugin plugin = framework.findAttributePlugin(attributes.get(i));
        plugins[i] = plugin;
        cellEditors[i] = plugin.getTableCellEditor(engine, rules, attributes.get(i));
        if (cellEditors[i] == null) {
            cellEditors[i] = new DialogedTableCellEditor(engine, rules, attributes.get(i), plugins[i], framework);
            model.setSaveValue(i, false);
        }
        cellRenderers[i] = plugin.getTableCellRenderer(engine, rules, attributes.get(i));
    }
}
Also used : AttributePlugin(com.ramussoft.gui.common.AttributePlugin) AccessRules(com.ramussoft.common.AccessRules) Engine(com.ramussoft.common.Engine) DialogedTableCellEditor(com.ramussoft.gui.qualifier.table.DialogedTableCellEditor)

Aggregations

AttributePlugin (com.ramussoft.gui.common.AttributePlugin)2 DialogedTableCellEditor (com.ramussoft.gui.qualifier.table.DialogedTableCellEditor)2 AccessRules (com.ramussoft.common.AccessRules)1 Attribute (com.ramussoft.common.Attribute)1 Engine (com.ramussoft.common.Engine)1 TabledAttributePlugin (com.ramussoft.gui.qualifier.table.TabledAttributePlugin)1 TableCellEditor (javax.swing.table.TableCellEditor)1