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);
}
});
}
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);
}
});
}
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);
}
});
}
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);
}
});
}
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);
}
});
}
Aggregations