use of com.ramussoft.gui.common.event.ViewTitleEvent in project ramus by Vitaliy-Yakovchuk.
the class GUIPluginFactory method initActions.
private void initActions(final String id, final View view, final DefaultCDockable dockable) {
Action[] actions = view.getActions();
addActions(id, view, dockable, actions);
dockable.addSeparator();
view.addViewTitleListener(new ViewTitleListener() {
@Override
public void titleChanged(ViewTitleEvent event) {
dockable.setTitleText(event.getNewTitle());
}
});
view.addActionChangeListener(new ActionChangeAdapter() {
@Override
public void actionsAdded(ActionChangeEvent event) {
Action[] actions = event.getActions();
List<Action> list = new ArrayList<Action>();
for (Action a : actions) {
if (a != null)
list.add(a);
}
addActions(id, view, dockable, list.toArray(new Action[list.size()]));
}
@Override
public void actionsRemoved(ActionChangeEvent event) {
for (Action a : event.getActions()) if (a != null) {
CDecorateableAction button = actionButtons.remove(a);
if (button != null)
dockable.removeAction(button);
}
}
});
}
use of com.ramussoft.gui.common.event.ViewTitleEvent in project ramus by Vitaliy-Yakovchuk.
the class SimleGUIPluginFactory method initActions.
private void initActions(final String id, final View view, final DFrame dockable) {
Action[] actions = view.getActions();
addActions(id, view, dockable, actions);
dockable.addSeparator();
view.addViewTitleListener(new ViewTitleListener() {
@Override
public void titleChanged(ViewTitleEvent event) {
dockable.setTitleText(event.getNewTitle());
}
});
view.addActionChangeListener(new ActionChangeAdapter() {
@Override
public void actionsAdded(ActionChangeEvent event) {
Action[] actions = event.getActions();
List<Action> list = new ArrayList<Action>();
for (Action a : actions) {
if (a != null)
list.add(a);
}
addActions(id, view, dockable, list.toArray(new Action[list.size()]));
}
@Override
public void actionsRemoved(ActionChangeEvent event) {
for (Action a : event.getActions()) if (a != null) {
dockable.removeAction(a);
}
}
});
}
use of com.ramussoft.gui.common.event.ViewTitleEvent 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.ViewTitleEvent in project ramus by Vitaliy-Yakovchuk.
the class ChartView method titleChanged.
protected void titleChanged(String newTitle) {
ViewTitleEvent event2 = new ViewTitleEvent(ChartView.this, newTitle);
titleChanged(event2);
reload();
}
use of com.ramussoft.gui.common.event.ViewTitleEvent in project ramus by Vitaliy-Yakovchuk.
the class IDEF0TabView method refreshTitle.
private void refreshTitle() {
ViewTitleEvent titleEvent = new ViewTitleEvent(IDEF0TabView.this, getTitle());
titleChanged(titleEvent);
}
Aggregations