use of com.ramussoft.gui.common.event.TabbedEvent in project ramus by Vitaliy-Yakovchuk.
the class IDEF0ViewPlugin method addOpenDiagramListener.
private void addOpenDiagramListener() {
framework.addActionListener(OPEN_DIAGRAM, new ActionListener() {
@Override
public void onAction(final ActionEvent event) {
if (framework.openView(event))
return;
final DiagramData data = new DiagramData();
data.openDiagram = (OpenDiagram) event.getValue();
data.listener = new QualifierAdapter() {
@Override
public void qualifierDeleted(QualifierEvent event) {
if (event.getOldQualifier().equals(data.openDiagram.getQualifier())) {
data.view.close();
}
}
@Override
public void qualifierUpdated(QualifierEvent event) {
if (data.openDiagram.getQualifier().equals(event.getNewQualifier())) {
IDEF0TabView view = (IDEF0TabView) data.view;
if (view.isBaseFunctionSelected()) {
ViewTitleEvent event2 = new ViewTitleEvent(data.view, event.getNewQualifier().getName());
view.titleChanged(event2);
}
}
}
};
data.elementListener = new ElementAdapter() {
@Override
public void elementDeleted(ElementEvent event) {
if (((IDEF0TabView) data.view).isSelectedElementId(event.getOldElement()))
data.view.close();
}
};
engine.addQualifierListener(data.listener);
engine.addElementListener(data.openDiagram.getQualifier(), data.elementListener);
data.view = new IDEF0TabView(framework, NDataPluginFactory.getDataPlugin(data.openDiagram.getQualifier(), engine, rules), data.openDiagram.getFunctionId(), frame, rules) {
@Override
public void close() {
super.close();
engine.removeQualifierListener(data.listener);
engine.removeElementListener(data.openDiagram.getQualifier(), data.elementListener);
TabbedEvent tEvent = new TabbedEvent(IDEF0TabbedView.IDEF0_TAB_VIEW, this);
tabRemoved(tEvent);
}
};
TabbedEvent tEvent = new TabbedEvent(IDEF0TabbedView.IDEF0_TAB_VIEW, (TabView) data.view);
tabCreated(tEvent);
}
});
}
use of com.ramussoft.gui.common.event.TabbedEvent in project ramus by Vitaliy-Yakovchuk.
the class IDEF0ViewPlugin method addOpenStreamsViewListener.
private void addOpenStreamsViewListener() {
framework.addActionListener(OPEN_STREAMS, new ActionListener() {
@Override
public void onAction(final ActionEvent event) {
if (framework.openView(event))
return;
final StreamsData data = new StreamsData();
data.view = new StreamsTabView(framework) {
@Override
public void close() {
super.close();
TabbedEvent tEvent = new TabbedEvent(IDEF0TabbedView.IDEF0_TAB_VIEW, this);
tabRemoved(tEvent);
}
};
TabbedEvent tEvent = new TabbedEvent(IDEF0TabbedView.IDEF0_TAB_VIEW, (TabView) data.view);
tabCreated(tEvent);
}
});
}
use of com.ramussoft.gui.common.event.TabbedEvent 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.TabbedEvent 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.TabbedEvent 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);
}
});
}
Aggregations