use of org.csstudio.swt.widgets.figures.ActionButtonFigure.ButtonActionListener in project yamcs-studio by yamcs.
the class Draw2DButtonEditPartDelegate method hookMouseClickAction.
/* (non-Javadoc)
* @see org.csstudio.opibuilder.widgets.editparts.IButtonEditPartDelegate#hookMouseClickAction()
*/
@Override
public void hookMouseClickAction() {
((ActionButtonFigure) editpart.getFigure()).addActionListener(new ButtonActionListener() {
@Override
public void actionPerformed(int mouseEventState) {
List<AbstractWidgetAction> actions = editpart.getHookedActions();
if (actions != null) {
for (AbstractWidgetAction action : actions) {
if (action instanceof OpenDisplayAction)
((OpenDisplayAction) action).runWithModifiers((mouseEventState & SWT.CONTROL) != 0, (mouseEventState & SWT.SHIFT) != 0);
else
action.run();
}
}
}
});
}
Aggregations