if (action instanceof IDisplayableAction) { putValue(Action.NAME, ((IDisplayableAction) action).getI18nName(actionHandler, locale)); putValue(Action.ACTION_COMMAND_KEY, ""); String i18nDescription = ((IDisplayableAction) action) .getI18nDescription(actionHandler, locale); if (i18nDescription != null) { putValue(Action.SHORT_DESCRIPTION, i18nDescription + TOOLTIP_ELLIPSIS); Action.SMALL_ICON, getIconFactory().getIcon( ((IDisplayableAction) action).getIconImageURL(), dimension)); if (((IDisplayableAction) action).getMnemonicAsString() != null) { putValue( Action.MNEMONIC_KEY, new Integer(KeyStroke.getKeyStroke( ((IDisplayableAction) action).getMnemonicAsString()) .getKeyCode()));
/** * {@inheritDoc} */ public Object invoke(@SuppressWarnings("unused") Object proxy, Method method, Object[] args) throws Throwable { if (method.getName().equals("getName")) { return delegate.getI18nName(translationProvider, locale); } else if (method.getName().equals("getDescription")) { return delegate.getI18nDescription(translationProvider, locale); } return method.invoke(delegate, args); } }
if (action instanceof IDisplayableAction) { putValue(Action.NAME, ((IDisplayableAction) action).getI18nName(actionHandler, locale)); putValue(Action.ACTION_COMMAND_KEY, ""); String actionDescription = computeActionDescription(action, actionHandler, locale); getIconFactory().getIcon(((IDisplayableAction) action).getIcon(), dimension)); if (((IDisplayableAction) action).getMnemonicAsString() != null) { putValue( Action.MNEMONIC_KEY, KeyStroke.getKeyStroke(((IDisplayableAction) action).getMnemonicAsString()).getKeyCode());
RAction remoteAction = new RAction(guidGenerator.generateGUID()); if (action instanceof IDisplayableAction) { remoteAction.setName(((IDisplayableAction) action).getI18nName( actionHandler, locale)); String actionDescription = computeActionDescription(action, actionHandler, locale); ((IDisplayableAction) action).getIcon(), dimension)); remoteAction.setMnemonicAsString(((IDisplayableAction) action).getMnemonicAsString()); remoteAction.setRepeatPeriodMillis(((IDisplayableAction) action).getRepeatPeriodMillis()); if (((IDisplayableAction) action).getHiddenWhenDisabled() != null) { remoteAction.setHiddenWhenDisabled(((IDisplayableAction) action).getHiddenWhenDisabled());
.getForwardIcon(IIconFactory.SMALL_ICON_SIZE)); final JButton finishButton = new JButton(getIconFactory(context).getIcon( finishAction.getIconImageURL(), IIconFactory.SMALL_ICON_SIZE)); finishButton.setText(finishAction.getI18nName( getTranslationProvider(context), getLocale(context))); JButton cancelButton = new JButton(getIconFactory(context).getCancelIcon(
actionButton.setAction(wingsAction); actionButton.setDisabledIcon(actionButton.getIcon()); if (action.getAcceleratorAsString() != null) { KeyStroke ks = KeyStroke.getKeyStroke(action .getAcceleratorAsString()); view.getPeer().getActionMap() .put(wingsAction.getValue(Action.NAME), wingsAction);
break; if (mainAction.getAcceleratorAsString() != null) { KeyStroke ks = KeyStroke.getKeyStroke(mainAction.getAcceleratorAsString()); view.getPeer().getActionMap().put(swingAction.getValue(Action.NAME), swingAction); view.getPeer().getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(ks, for (IDisplayableAction menuAction : actions) { boolean hiddenWhenDisabled = hideActionWhenDisabled; if (menuAction.getHiddenWhenDisabled() != null) { hiddenWhenDisabled = menuAction.getHiddenWhenDisabled(); break; if (menuAction.getAcceleratorAsString() != null) { KeyStroke ks = KeyStroke.getKeyStroke(menuAction.getAcceleratorAsString()); view.getPeer().getActionMap().put(swingAction.getValue(Action.NAME), swingAction); view.getPeer().getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(ks, if (actionHandler.isAccessGranted(action)) { boolean hiddenWhenDisabled = hideActionWhenDisabled; if (action.getHiddenWhenDisabled() != null) { hiddenWhenDisabled = action.getHiddenWhenDisabled(); if (action.getAcceleratorAsString() != null) { KeyStroke ks = KeyStroke.getKeyStroke(action.getAcceleratorAsString()); view.getPeer().getActionMap().put(swingAction.getValue(Action.NAME), swingAction); view.getPeer().getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(ks,
for (IDisplayableAction userAction : userActions) { String actionDescription = getActionDescription(userAction, Collections.<String, Object>emptyMap()); String actionNameEN = userAction.getI18nName(frontendController, Locale.ENGLISH); String actionNameFR = userAction.getI18nName(frontendController, Locale.FRENCH); appendToInventory(userActionsInventory, actionDescription, actionNameEN, actionNameFR);
/** * {@inheritDoc} */ @Override public boolean execute(IActionHandler actionHandler, Map<String, Object> context) { List<IDisplayableAction> actions = new ArrayList<IDisplayableAction>(); Object component = context.get(ActionContextConstants.ACTION_PARAM); okAction.putInitialContext(ActionContextConstants.SOURCE_VIEW_CONNECTOR, getViewConnector(context)); okAction.putInitialContext(ActionContextConstants.ACTION_PARAM, component); actions.add(okAction); actions.add(cancelAction); context.put(ActionContextConstants.DIALOG_ACTIONS, actions); IView<SComponent> componentView = getViewFactory(context).createView( getViewDescriptor(context), actionHandler, getLocale(context)); context.put(ActionContextConstants.DIALOG_VIEW, componentView); IValueConnector componentConnector = modelConnectorFactory .createModelConnector(ACTION_MODEL_NAME, getViewDescriptor(context) .getModelDescriptor()); componentConnector.setConnectorValue(getModel(context)); getMvcBinder(context) .bind(componentView.getConnector(), componentConnector); return super.execute(actionHandler, context); }
Action swingAction = new ActionAdapter(action, actionHandler, sourceComponent, modelDescriptor, viewConnector, locale); if (action.getActionabilityGates() != null) { Collection<IGate> clonedGates = new HashSet<IGate>(); for (IGate gate : action.getActionabilityGates()) { final IGate clonedGate = gate.clone(); if (clonedGate instanceof IModelGate) {
.getForwardIcon(IIconFactory.SMALL_ICON_SIZE)); final SButton finishButton = new SButton(getIconFactory(context).getIcon( finishAction.getIconImageURL(), IIconFactory.SMALL_ICON_SIZE)); finishButton.setText(finishAction.getI18nName( getTranslationProvider(context), getLocale(context))); SButton cancelButton = new SButton(getIconFactory(context).getCancelIcon(
/** * {@inheritDoc} */ @Override public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { if (method.getName().equals("getName")) { return delegate.getI18nName(translationProvider, locale); } if (method.getName().equals("getDescription")) { return delegate.getI18nDescription(translationProvider, locale); } return method.invoke(delegate, args); } }
JButton actionButton = createJButton(); actionButton.setAction(swingAction); if (action.getAcceleratorAsString() != null) { KeyStroke ks = KeyStroke.getKeyStroke(action .getAcceleratorAsString()); view.getPeer().getActionMap().put( swingAction.getValue(Action.NAME), swingAction);
try { boolean hiddenWhenDisabled = hideActionWhenDisabled; if (action.getHiddenWhenDisabled() != null) { hiddenWhenDisabled = action.getHiddenWhenDisabled(); rAction.setAcceleratorAsString(action.getAcceleratorAsString()); rAction.setHiddenWhenDisabled(hiddenWhenDisabled); actions.add(rAction);
/** * {@inheritDoc} */ @Override public boolean execute(IActionHandler actionHandler, Map<String, Object> context) { List<IDisplayableAction> actions = new ArrayList<IDisplayableAction>(); okAction.putInitialContext(ActionContextConstants.SOURCE_VIEW_CONNECTOR, getViewConnector(context)); actions.add(okAction); actions.add(cancelAction); context.put(ActionContextConstants.DIALOG_ACTIONS, actions); IModelValueConnector componentsModelConnector = (IModelValueConnector) context .get(ActionContextConstants.ACTION_PARAM); BasicTableViewDescriptor tableViewDescriptor = new BasicTableViewDescriptor(); tableViewDescriptor.setModelDescriptor(componentsModelConnector .getModelDescriptor()); IView<JComponent> collectionView = getViewFactory(context).createView( tableViewDescriptor, actionHandler, getLocale(context)); context.put(ActionContextConstants.DIALOG_VIEW, collectionView); getMvcBinder(context).bind(collectionView.getConnector(), componentsModelConnector); return super.execute(actionHandler, context); }
IAction ulcAction = new ActionAdapter(action, actionHandler, sourceComponent, modelDescriptor, viewConnector, locale); if (action.getActionabilityGates() != null) { Collection<IGate> clonedGates = new HashSet<IGate>(); for (IGate gate : action.getActionabilityGates()) { final IGate clonedGate = gate.clone(); if (clonedGate instanceof IModelGate) {
this.viewConnector = viewConnector; putValue(Action.NAME, action.getI18nName(translationProvider, locale)); String i18nDescription = action.getI18nDescription(translationProvider, locale); if (i18nDescription != null) { putValue(Action.SHORT_DESCRIPTION, i18nDescription + TOOLTIP_ELLIPSIS); putValue(Action.SMALL_ICON, iconFactory.getIcon(action.getIconImageURL(), IIconFactory.TINY_ICON_SIZE)); if (action.getMnemonicAsString() != null) { putValue(Action.MNEMONIC_KEY, new Integer(KeyStroke.getKeyStroke( action.getMnemonicAsString()).getKeyCode()));
context).getForwardIcon(IIconFactory.SMALL_ICON_SIZE)); final ULCExtendedButton finishButton = new ULCExtendedButton( getIconFactory(context).getIcon(finishAction.getIconImageURL(), IIconFactory.SMALL_ICON_SIZE)); finishButton.setText(finishAction.getI18nName( getTranslationProvider(context), getLocale(context))); ULCExtendedButton cancelButton = new ULCExtendedButton(getIconFactory(
actionButton.setShowAsFormComponent(false); actionButton.setAction(wingsAction); if (action.getAcceleratorAsString() != null) { KeyStroke ks = KeyStroke.getKeyStroke(action .getAcceleratorAsString()); view.getPeer().getActionMap().put( wingsAction.getValue(Action.NAME), wingsAction);
/** * {@inheritDoc} */ @Override public boolean execute(IActionHandler actionHandler, Map<String, Object> context) { List<IDisplayableAction> actions = new ArrayList<IDisplayableAction>(); okAction.putInitialContext(ActionContextConstants.SOURCE_VIEW_CONNECTOR, getViewConnector(context)); actions.add(okAction); actions.add(cancelAction); context.put(ActionContextConstants.DIALOG_ACTIONS, actions); IModelValueConnector componentsModelConnector = (IModelValueConnector) context .get(ActionContextConstants.ACTION_PARAM); BasicTableViewDescriptor tableViewDescriptor = new BasicTableViewDescriptor(); tableViewDescriptor.setModelDescriptor(componentsModelConnector .getModelDescriptor()); IView<SComponent> collectionView = getViewFactory(context).createView( tableViewDescriptor, actionHandler, getLocale(context)); context.put(ActionContextConstants.DIALOG_VIEW, collectionView); getMvcBinder(context).bind(collectionView.getConnector(), componentsModelConnector); return super.execute(actionHandler, context); }