use of com.ramussoft.gui.common.event.ViewTitleListener 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.ViewTitleListener 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);
}
}
});
}
Aggregations