Search in sources :

Example 11 with ActionListener

use of com.ramussoft.gui.common.event.ActionListener in project ramus by Vitaliy-Yakovchuk.

the class ShowViewPlugin method setFramework.

@Override
public void setFramework(final GUIFramework framework) {
    super.setFramework(framework);
    framework.addActionListener(com.ramussoft.gui.common.event.ActionEvent.OPEN_STATIC_VIEW, new ActionListener() {

        @Override
        public void onAction(com.ramussoft.gui.common.event.ActionEvent event) {
            framework.openView(event);
        }
    });
}
Also used : ActionListener(com.ramussoft.gui.common.event.ActionListener)

Example 12 with ActionListener

use of com.ramussoft.gui.common.event.ActionListener in project ramus by Vitaliy-Yakovchuk.

the class ReportViewPlugin method addOpenReportEditorListener.

private void addOpenReportEditorListener() {
    framework.addActionListener(OPEN_SCRIPT_REPORT, new ActionListener() {

        @Override
        public void onAction(final ActionEvent event) {
            if (framework.openView(event))
                return;
            final Data data = new Data();
            data.element = (Element) event.getValue();
            data.attributeListener = new ElementAttributeListener() {

                @Override
                public void attributeChanged(AttributeEvent event) {
                    Object value = event.getNewValue();
                    if ((value instanceof String) && (event.getElement().equals(data.element))) {
                        ViewTitleEvent e = new ViewTitleEvent(data.view, value.toString());
                        data.view.titleChanged(e);
                    }
                }
            };
            data.elementListener = new ElementAdapter() {

                @Override
                public void elementDeleted(ElementEvent event) {
                    if (event.getOldElement().equals(data.element)) {
                        data.view.close();
                    }
                }
            };
            engine.addElementListener(ReportPlugin.getReportsQualifier(engine), data.elementListener);
            engine.addElementAttributeListener(ReportPlugin.getReportsQualifier(engine), data.attributeListener);
            String type = (String) engine.getAttribute(data.element, ReportPlugin.getReportTypeAttribute(engine));
            if (ReportPlugin.TYPE_JSSP.equals(type))
                data.view = new ScriptReportEditorView(framework, data.element) {

                    @Override
                    public void close() {
                        super.close();
                        engine.removeElementListener(ReportPlugin.getReportsQualifier(engine), data.elementListener);
                        engine.removeElementAttributeListener(ReportPlugin.getReportsQualifier(engine), data.attributeListener);
                        TabbedEvent tEvent = new TabbedEvent("TabbedTableView", this);
                        tabRemoved(tEvent);
                    }

                    @Override
                    public String getTitle() {
                        return data.element.getName();
                    }
                };
            else if (ReportPlugin.TYPE_JSSP_DOC_BOOK.equals(type))
                data.view = new DocBookScriptReportEditorView(framework, data.element) {

                    @Override
                    public void close() {
                        super.close();
                        engine.removeElementListener(ReportPlugin.getReportsQualifier(engine), data.elementListener);
                        engine.removeElementAttributeListener(ReportPlugin.getReportsQualifier(engine), data.attributeListener);
                        TabbedEvent tEvent = new TabbedEvent("TabbedTableView", this);
                        tabRemoved(tEvent);
                    }

                    @Override
                    public String getTitle() {
                        return data.element.getName();
                    }
                };
            else
                data.view = new XMLReportEditorView(framework, data.element) {

                    @Override
                    public void close() {
                        super.close();
                        engine.removeElementListener(ReportPlugin.getReportsQualifier(engine), data.elementListener);
                        engine.removeElementAttributeListener(ReportPlugin.getReportsQualifier(engine), data.attributeListener);
                        TabbedEvent tEvent = new TabbedEvent("TabbedTableView", this);
                        tabRemoved(tEvent);
                    }

                    @Override
                    public String getTitle() {
                        return data.element.getName();
                    }
                };
            TabbedEvent tEvent = new TabbedEvent(REPORTS_TAB_VIEW, data.view);
            tabCreated(tEvent);
        }
    });
}
Also used : ElementAdapter(com.ramussoft.common.event.ElementAdapter) ActionEvent(com.ramussoft.gui.common.event.ActionEvent) ElementAttributeListener(com.ramussoft.common.event.ElementAttributeListener) Element(com.ramussoft.common.Element) ElementEvent(com.ramussoft.common.event.ElementEvent) AttributeEvent(com.ramussoft.common.event.AttributeEvent) TabbedEvent(com.ramussoft.gui.common.event.TabbedEvent) XMLReportEditorView(com.ramussoft.report.editor.XMLReportEditorView) DocBookScriptReportEditorView(com.ramussoft.report.editor.DocBookScriptReportEditorView) ViewTitleEvent(com.ramussoft.gui.common.event.ViewTitleEvent) ActionListener(com.ramussoft.gui.common.event.ActionListener) ScriptReportEditorView(com.ramussoft.report.editor.ScriptReportEditorView) DocBookScriptReportEditorView(com.ramussoft.report.editor.DocBookScriptReportEditorView)

Example 13 with ActionListener

use of com.ramussoft.gui.common.event.ActionListener in project ramus by Vitaliy-Yakovchuk.

the class ChartGUIPlugin method setFramework.

@Override
public void setFramework(GUIFramework aFramework) {
    super.setFramework(aFramework);
    framework.addActionListener(OPEN_CHART, new ActionListener() {

        @Override
        public void onAction(ActionEvent event) {
            if (framework.openView(event))
                return;
            Element element = (Element) event.getValue();
            ChartView view = new ChartView(framework, element) {

                @Override
                public void close() {
                    super.close();
                    TabbedEvent tEvent = new TabbedEvent("TabbedTableView", this);
                    tabRemoved(tEvent);
                }
            };
            TabbedEvent tEvent = new TabbedEvent(TabbedTableView.MAIN_TABBED_VIEW, view);
            tabCreated(tEvent);
        }
    });
    framework.addActionListener(OPEN_CHART_SET, new ActionListener() {

        @Override
        public void onAction(ActionEvent event) {
            if (framework.openView(event))
                return;
            Element element = (Element) event.getValue();
            ChartSetView view = new ChartSetView(framework, element) {

                @Override
                public void close() {
                    super.close();
                    TabbedEvent tEvent = new TabbedEvent("TabbedTableView", this);
                    tabRemoved(tEvent);
                }
            };
            TabbedEvent tEvent = new TabbedEvent(TabbedTableView.MAIN_TABBED_VIEW, view);
            tabCreated(tEvent);
        }
    });
}
Also used : ActionListener(com.ramussoft.gui.common.event.ActionListener) ActionEvent(com.ramussoft.gui.common.event.ActionEvent) Element(com.ramussoft.common.Element) TabbedEvent(com.ramussoft.gui.common.event.TabbedEvent)

Example 14 with ActionListener

use of com.ramussoft.gui.common.event.ActionListener in project ramus by Vitaliy-Yakovchuk.

the class ElistPlugin method setFramework.

@Override
public void setFramework(final GUIFramework framework) {
    super.setFramework(framework);
    framework.addActionListener(OPEN_ELEMENT_LIST, new ActionListener() {

        @Override
        public void onAction(final ActionEvent event) {
            if (framework.openView(event))
                return;
            Attribute attribute = (Attribute) event.getValue();
            ElistTabView elistTabView = new ElistTabView(framework, attribute) {

                @Override
                public void close() {
                    super.close();
                    TabbedEvent tEvent = new TabbedEvent("TabbedTableView", this);
                    tabRemoved(tEvent);
                }
            };
            TabbedEvent tEvent = new TabbedEvent(TabbedTableView.MAIN_TABBED_VIEW, elistTabView);
            tabCreated(tEvent);
        }
    });
    framework.addActionListener(OPEN_ELEMENT_LIST_IN_TABLE, new ActionListener() {

        @Override
        public void onAction(final ActionEvent event) {
            if (framework.openView(event))
                return;
            Attribute attribute = (Attribute) event.getValue();
            ElistTableTabView elistTabView = new ElistTableTabView(framework, attribute) {

                @Override
                public void close() {
                    super.close();
                    TabbedEvent tEvent = new TabbedEvent("TabbedTableView", this);
                    tabRemoved(tEvent);
                }
            };
            TabbedEvent tEvent = new TabbedEvent(TabbedTableView.MAIN_TABBED_VIEW, elistTabView);
            tabCreated(tEvent);
        }
    });
}
Also used : ActionListener(com.ramussoft.gui.common.event.ActionListener) Attribute(com.ramussoft.common.Attribute) ActionEvent(com.ramussoft.gui.common.event.ActionEvent) TabbedEvent(com.ramussoft.gui.common.event.TabbedEvent)

Example 15 with ActionListener

use of com.ramussoft.gui.common.event.ActionListener in project ramus by Vitaliy-Yakovchuk.

the class ScriptPlugin method setFramework.

@Override
public void setFramework(final GUIFramework framework) {
    super.setFramework(framework);
    framework.addActionListener("OpenScript", new ActionListener() {

        @Override
        public void onAction(com.ramussoft.gui.common.event.ActionEvent event) {
            if (framework.openView(event))
                return;
            TabbedEvent tEvent = new TabbedEvent(TabbedTableView.MAIN_TABBED_VIEW, new ScriptEditor(framework, (String) event.getValue()) {

                @Override
                public void close() {
                    super.close();
                    TabbedEvent tEvent = new TabbedEvent(TabbedTableView.MAIN_TABBED_VIEW, this);
                    tabRemoved(tEvent);
                }
            });
            tabCreated(tEvent);
        }
    });
}
Also used : ActionListener(com.ramussoft.gui.common.event.ActionListener) TabbedEvent(com.ramussoft.gui.common.event.TabbedEvent)

Aggregations

ActionListener (com.ramussoft.gui.common.event.ActionListener)16 ActionEvent (com.ramussoft.gui.common.event.ActionEvent)11 TabbedEvent (com.ramussoft.gui.common.event.TabbedEvent)7 TabView (com.ramussoft.gui.common.TabView)3 ViewTitleEvent (com.ramussoft.gui.common.event.ViewTitleEvent)3 IOException (java.io.IOException)3 Element (com.ramussoft.common.Element)2 ElementAdapter (com.ramussoft.common.event.ElementAdapter)2 ElementEvent (com.ramussoft.common.event.ElementEvent)2 QualifierAdapter (com.ramussoft.common.event.QualifierAdapter)2 QualifierEvent (com.ramussoft.common.event.QualifierEvent)2 TabbedView (com.ramussoft.gui.common.TabbedView)2 UniqueView (com.ramussoft.gui.common.UniqueView)2 View (com.ramussoft.gui.common.View)2 CloseMainFrameAdapter (com.ramussoft.gui.common.event.CloseMainFrameAdapter)2 NDataPlugin (com.ramussoft.pb.data.negine.NDataPlugin)2 ArrayList (java.util.ArrayList)2 List (java.util.List)2 Entry (java.util.Map.Entry)2 CControl (bibliothek.gui.dock.common.CControl)1