private void expandActionGroup( List<Action> newVisibleActions, ActionManager actionManager, ActionGroup mainActionGroup) { final Action[] children = mainActionGroup.getChildren(null); for (final Action action : children) { final Presentation presentation = presentationFactory.getPresentation(action); final ActionEvent e = new ActionEvent(presentation, actionManager); action.update(e); if (presentation.isVisible()) { // add only visible items newVisibleActions.add(action); } if (action2barItem.containsKey(action)) { action2barItem.get(action).update(); } } }
private void expandActionGroup( List<Action> newVisibleActions, ActionManager actionManager, ActionGroup mainActionGroup) { final Action[] children = mainActionGroup.getChildren(null); for (final Action action : children) { final Presentation presentation = presentationFactory.getPresentation(action); final ActionEvent e = new ActionEvent(presentation, actionManager); action.update(e); if (presentation.isVisible()) { // add only visible items newVisibleActions.add(action); } if (action2barItem.containsKey(action)) { action2barItem.get(action).update(); } } }
final int time = calculateTimeForDeceleration(distance); if (time > 0) { action.update(-dx, -dy, time, mDecelerateInterpolator);
@Override public void performAction(String actionId, Map<String, String> parameters) { final Action action; if (actionId != null && (action = getAction(actionId)) != null) { final Presentation presentation = presentationFactory.getPresentation(action); final ActionEvent actionEvent = new ActionEvent(presentation, this, parameters); action.update(actionEvent); if (presentation.isEnabled() && presentation.isVisible()) { action.actionPerformed(actionEvent); } } }
child.update(new ActionEvent(presentation, actionManager));
@Override public void onActionSelected(Action action) { ActionEvent e = new ActionEvent(presentationFactory.getPresentation(action), actionManager); action.update(e); if (e.getPresentation().isEnabled() && e.getPresentation().isVisible()) { view.hide(); action.actionPerformed(e); } }
/** * Finds and runs an action cancelling original key event * * @param actionIds list containing action ids * @param keyEvent original key event */ private void runActions(List<String> actionIds, Event keyEvent) { for (String actionId : actionIds) { Action action = actionManager.getAction(actionId); if (action == null) { continue; } ActionEvent e = new ActionEvent(presentationFactory.getPresentation(action), actionManager); action.update(e); if (e.getPresentation().isEnabled()) { /** Stop handling the key event */ keyEvent.preventDefault(); keyEvent.stopPropagation(); /** Perform the action */ action.actionPerformed(e); } } }
private void handleKey(NativeEvent event) { SignalEvent signalEvent = SignalEventUtils.create((Event) event, false); CharCodeWithModifiers keyBinding = keyBindingAgent.getKeyBinding(JavaExtension.JAVA_CLASS_STRUCTURE); if (signalEvent == null || keyBinding == null) { return; } int digest = CharCodeWithModifiers.computeKeyDigest(signalEvent); if (digest == keyBinding.getKeyDigest()) { Action action = actionManager.getAction(JavaExtension.JAVA_CLASS_STRUCTURE); if (action != null) { ActionEvent e = new ActionEvent(presentationFactor.getPresentation(action), actionManager); action.update(e); if (e.getPresentation().isEnabled()) { event.preventDefault(); event.stopPropagation(); action.actionPerformed(e); } } } } }
anAction.update(new ActionEvent(presentation, actionManager)); if (anAction instanceof ActionGroup) { ActionGroup childGroup = (ActionGroup) anAction;