Search in sources :

Example 1 with CloseEvent

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

the class HistoryDialog method closed.

private void closed(final QualifierHistoryPlugin plugin, final Element element, final Attribute attribute) {
    plugin.windowClosed(framework, element, attribute);
    CloseEvent event = new CloseEvent(this);
    for (CloseListener listener : getCloseListeners()) listener.closed(event);
    Options.saveOptions(this);
}
Also used : CloseEvent(com.ramussoft.gui.qualifier.table.event.CloseEvent) CloseListener(com.ramussoft.gui.qualifier.table.event.CloseListener)

Example 2 with CloseEvent

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

the class TableEditorModel method close.

public void close() {
    Qualifier qualifier = StandardAttributesPlugin.getTableQualifierForAttribute(engine, tableAttribute);
    engine.removeElementAttributeListener(qualifier, listener);
    engine.removeElementListener(qualifier, elementListener);
    CloseEvent event = new CloseEvent(this);
    for (CloseListener listener : getCloseListeners()) {
        listener.closed(event);
    }
    framework.removeActionListener(UPDATE_TABLE_VALUE, tableValueListener);
}
Also used : CloseEvent(com.ramussoft.gui.qualifier.table.event.CloseEvent) CloseListener(com.ramussoft.gui.qualifier.table.event.CloseListener) Qualifier(com.ramussoft.common.Qualifier)

Example 3 with CloseEvent

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

the class ElementAttributesEditor method reload.

protected void reload() {
    CloseEvent event = new CloseEvent(this);
    CloseListener[] listeners = getCloseListeners();
    for (CloseListener listener : listeners) {
        listener.closed(event);
        removeCloseListener(listener);
    }
    loadCurrentQualifierAttributes();
    Engine engine = framework.getEngine();
    AccessRules rules = framework.getAccessRules();
    getters = new ValueGetter[attributes.size()];
    renderers = new TableCellRenderer[attributes.size()];
    values = new Object[attributes.size()];
    saveValues = new boolean[attributes.size()];
    Arrays.fill(saveValues, true);
    Arrays.fill(getters, new ValueGetter() {

        @Override
        public Object getValue(TableNode node, int index) {
            return node.getValueAt(index);
        }
    });
    for (int i = 0; i < attributes.size(); i++) {
        Attribute attr = attributes.get(i).attribute;
        AttributePlugin plugin = framework.findAttributePlugin(attr);
        if (plugin instanceof TabledAttributePlugin) {
            ValueGetter getter = ((TabledAttributePlugin) plugin).getValueGetter(attr, engine, framework, this);
            if (getter != null)
                getters[i] = getter;
        }
        renderers[i] = plugin.getTableCellRenderer(engine, rules, attr);
    }
    loadElement();
}
Also used : CloseEvent(com.ramussoft.gui.qualifier.table.event.CloseEvent) TabledAttributePlugin(com.ramussoft.gui.qualifier.table.TabledAttributePlugin) AttributePlugin(com.ramussoft.gui.common.AttributePlugin) Attribute(com.ramussoft.common.Attribute) TabledAttributePlugin(com.ramussoft.gui.qualifier.table.TabledAttributePlugin) ValueGetter(com.ramussoft.gui.qualifier.table.ValueGetter) CloseListener(com.ramussoft.gui.qualifier.table.event.CloseListener) TableNode(com.ramussoft.gui.qualifier.table.TableNode) AccessRules(com.ramussoft.common.AccessRules) Engine(com.ramussoft.common.Engine)

Aggregations

CloseEvent (com.ramussoft.gui.qualifier.table.event.CloseEvent)3 CloseListener (com.ramussoft.gui.qualifier.table.event.CloseListener)3 AccessRules (com.ramussoft.common.AccessRules)1 Attribute (com.ramussoft.common.Attribute)1 Engine (com.ramussoft.common.Engine)1 Qualifier (com.ramussoft.common.Qualifier)1 AttributePlugin (com.ramussoft.gui.common.AttributePlugin)1 TableNode (com.ramussoft.gui.qualifier.table.TableNode)1 TabledAttributePlugin (com.ramussoft.gui.qualifier.table.TabledAttributePlugin)1 ValueGetter (com.ramussoft.gui.qualifier.table.ValueGetter)1