private Icon getIcon(TextOutputCallback callback) throws UnsupportedCallbackException { switch (callback.getMessageType()) { case TextOutputCallback.INFORMATION: return iconFactory.getInfoIcon(iconFactory.getSmallIconSize()); case TextOutputCallback.WARNING: return iconFactory.getWarningIcon(iconFactory.getSmallIconSize()); case TextOutputCallback.ERROR: return iconFactory.getErrorIcon(iconFactory.getSmallIconSize()); default: throw new UnsupportedCallbackException(callback, "Unrecognized message type"); } }
@Override public void valueChange(ValueChangeEvent evt) { viewComponent.setIcon(getIconFactory() .getIcon(propertyDescriptor.getIconImageURL(String.valueOf(evt.getNewValue())), getEnumerationIconDimension(propertyViewDescriptor))); } });
JButton optionButton = new JButton(text); if (option == ConfirmationCallback.YES || option == ConfirmationCallback.OK) { optionButton.setIcon(iconFactory.getOkYesIcon(iconFactory .getSmallIconSize())); optionButton.addActionListener(new ActionListener() { } else { if (option == ConfirmationCallback.NO) { optionButton.setIcon(iconFactory.getNoIcon(iconFactory .getSmallIconSize())); } else if (option == ConfirmationCallback.CANCEL) { optionButton.setIcon(iconFactory.getCancelIcon(iconFactory .getSmallIconSize()));
private Icon getIcon(TextOutputCallback callback) throws UnsupportedCallbackException { switch (callback.getMessageType()) { case TextOutputCallback.INFORMATION: return iconFactory.getInfoIcon(IIconFactory.SMALL_ICON_SIZE); case TextOutputCallback.WARNING: return iconFactory.getWarningIcon(IIconFactory.SMALL_ICON_SIZE); case TextOutputCallback.ERROR: return iconFactory.getErrorIcon(IIconFactory.SMALL_ICON_SIZE); default: throw new UnsupportedCallbackException(callback, "Unrecognized message type"); } }
@Override public void run() { JOptionPane.showMessageDialog( SwingUtil.getWindowOrInternalFrame(sourceComponent), message, title, JOptionPane.INFORMATION_MESSAGE, getIconFactory().getIcon(iconImageUrl, getIconFactory().getLargeIconSize())); } });
public void valueChange(ValueChangeEvent evt) { ((SLabel) viewComponent).setIcon(getIconFactory().getIcon( propertyDescriptor.getIconImageURL(String.valueOf(evt .getNewValue())), getIconFactory().getTinyIconSize())); } });
/** * {@inheritDoc} */ @Override public Component getTreeCellRendererComponent(JTree tree, Object value, boolean sel, boolean expanded, boolean leaf, int row, boolean nodeHasFocus) { JLabel renderer = (JLabel) super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row, nodeHasFocus); if (value instanceof IValueConnector) { if (value instanceof IRenderableCompositeValueConnector) { renderer.setText(((IRenderableCompositeValueConnector) value).getDisplayValue()); if (displayIcon) { renderer.setIcon(getIconFactory().getIcon(((IRenderableCompositeValueConnector) value).getDisplayIcon(), getIconFactory().getSmallIconSize())); } String displayDescription = ((IRenderableCompositeValueConnector) value).getDisplayDescription(); if (displayDescription != null && displayDescription.length() > 0) { ToolTipManager.sharedInstance().registerComponent(tree); renderer.setToolTipText(displayDescription); } } else { renderer.setText(value.toString()); } } return renderer; } }
.getBackwardIcon(IIconFactory.SMALL_ICON_SIZE)); final JButton nextButton = new JButton(getIconFactory(context) .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( IIconFactory.SMALL_ICON_SIZE)); cancelButton.setText(getTranslationProvider(context).getTranslation(
/** * Creates an empty error message command. * * @return a empty error message command. */ protected RemoteErrorMessageCommand createDetailedErrorMessageCommand() { RemoteErrorMessageCommand messageCommand = new RemoteErrorMessageCommand(); messageCommand.setTitle(getTranslation("error", getLocale())); messageCommand.setTitleIcon(getIconFactory().getErrorIcon(getIconFactory().getTinyIconSize())); messageCommand.setMessageIcon(getIconFactory().getErrorIcon(getIconFactory().getLargeIconSize())); return messageCommand; }
/** * {@inheritDoc} */ @Override public void popupYesNo(RComponent sourceComponent, String title, String iconImageUrl, String message, IAction yesAction, IAction noAction, Map<String, Object> context) { RemoteYesNoCommand messageCommand = new RemoteYesNoCommand(); messageCommand.setTitle(title); messageCommand.setMessage(message); messageCommand.setTitleIcon(getIconFactory().getQuestionIcon(getIconFactory().getTinyIconSize())); if (iconImageUrl != null) { messageCommand.setMessageIcon(getIconFactory().getIcon(iconImageUrl, getIconFactory().getLargeIconSize())); } else { messageCommand.setMessageIcon(getIconFactory().getQuestionIcon(getIconFactory().getLargeIconSize())); } if (yesAction != null) { messageCommand.setYesAction(createRAction(yesAction, context)); } if (noAction != null) { messageCommand.setNoAction(createRAction(noAction, context)); } registerCommand(messageCommand); }
/** * {@inheritDoc} */ @Override public void popupInfo(RComponent sourceComponent, String title, String iconImageUrl, String message) { RemoteMessageCommand messageCommand = new RemoteMessageCommand(); messageCommand.setTitle(title); messageCommand.setMessage(message); messageCommand.setTitleIcon(getIconFactory().getInfoIcon(getIconFactory().getTinyIconSize())); if (iconImageUrl != null) { messageCommand.setMessageIcon(getIconFactory().getIcon(iconImageUrl, getIconFactory().getLargeIconSize())); } else { messageCommand.setMessageIcon(getIconFactory().getInfoIcon(getIconFactory().getLargeIconSize())); } registerCommand(messageCommand); }
/** * {@inheritDoc} */ @Override public void popupOkCancel(RComponent sourceComponent, String title, String iconImageUrl, String message, IAction okAction, IAction cancelAction, Map<String, Object> context) { RemoteOkCancelCommand messageCommand = new RemoteOkCancelCommand(); messageCommand.setTitle(title); messageCommand.setMessage(message); messageCommand.setTitleIcon(getIconFactory().getWarningIcon(getIconFactory().getTinyIconSize())); if (iconImageUrl != null) { messageCommand.setMessageIcon(getIconFactory().getIcon(iconImageUrl, getIconFactory().getLargeIconSize())); } else { messageCommand.setMessageIcon(getIconFactory().getWarningIcon(getIconFactory().getLargeIconSize())); } if (okAction != null) { messageCommand.setOkAction(createRAction(okAction, context)); } if (cancelAction != null) { messageCommand.setCancelAction(createRAction(cancelAction, context)); } registerCommand(messageCommand); }
.escapeForHTML(userFriendlyExceptionMessage))), getTranslation("error", getLocale()), JOptionPane.ERROR_MESSAGE, getIconFactory().getErrorIcon(getIconFactory().getLargeIconSize())); } else { traceUnexpectedException(ex); JErrorDialog dialog = JErrorDialog.createInstance(null, this, getLocale()); dialog.setMessageIcon(getIconFactory().getErrorIcon( getIconFactory().getMediumIconSize())); dialog.setTitle(getTranslation("error", getLocale())); dialog.setMessage(HtmlHelper.toHtml(HtmlHelper.emphasis(HtmlHelper
if (option == ConfirmationCallback.YES || option == ConfirmationCallback.OK) { optionButton.setIcon(iconFactory .getOkYesIcon(IIconFactory.SMALL_ICON_SIZE)); optionButton.addActionListener(new ActionListener() { if (option == ConfirmationCallback.NO) { optionButton.setIcon(iconFactory .getNoIcon(IIconFactory.SMALL_ICON_SIZE)); } else if (option == ConfirmationCallback.CANCEL) { optionButton.setIcon(iconFactory .getCancelIcon(IIconFactory.SMALL_ICON_SIZE));
viewActionList.setName(actionList.getName()); viewActionList.setDescription(actionList.getDescription()); Dimension iconDimension = getIconFactory().getSmallIconSize(); if (isAsideActionDisplay(view.getDescriptor())) { iconDimension = getIconFactory().getTinyIconSize(); viewActionList.setIcon(getIconFactory().getIcon(actionList.getIcon(), iconDimension)); List<RAction> actions = new ArrayList<>(); for (IDisplayableAction action : actionList.getActions()) {
.getMessage()), getTranslationProvider().getTranslation("error", getLocale()), JOptionPane.ERROR_MESSAGE, getIconFactory() .getErrorIcon(IIconFactory.LARGE_ICON_SIZE)); } else if (ex instanceof BusinessException) { JOptionPane.showMessageDialog(sourceComponent, HtmlHelper getTranslationProvider(), getLocale())), getTranslationProvider() .getTranslation("error", getLocale()), JOptionPane.ERROR_MESSAGE, getIconFactory().getErrorIcon(IIconFactory.LARGE_ICON_SIZE)); } else if (ex instanceof ConcurrencyFailureException) { JOptionPane.showMessageDialog(sourceComponent, HtmlHelper "concurrency.error.description", getLocale())), getTranslationProvider().getTranslation("error", getLocale()), JOptionPane.ERROR_MESSAGE, getIconFactory().getErrorIcon( IIconFactory.LARGE_ICON_SIZE)); } else { JErrorDialog dialog = JErrorDialog.createInstance(sourceComponent, getTranslationProvider(), getLocale()); dialog.setMessageIcon(getIconFactory().getErrorIcon( IIconFactory.MEDIUM_ICON_SIZE)); dialog.setTitle(getTranslationProvider().getTranslation("error",
SErrorDialog dialog = SErrorDialog.createInstance(sourceComponent, this, getLocale()); dialog.setMessageIcon(getIconFactory().getErrorIcon( getIconFactory().getMediumIconSize())); dialog.setTitle(getTranslation("error", getLocale()));
for (IDisplayableAction action : actionList.getActions()) { JButton button = new JButton(getViewFactory().getActionFactory().createAction(action, getViewFactory().getIconFactory().getSmallIconSize(), this, loginView, getLocale())); buttonBox.add(button); if (i == 0) { exitButton.setIcon(getIconFactory().getCancelIcon(getIconFactory().getSmallIconSize())); buttonBox.add(exitButton);
loginButton.setIcon(getIconFactory().getOkYesIcon( getIconFactory().getSmallIconSize())); loginButton.addActionListener(new ActionListener() {
/** * {@inheritDoc} */ public Action createAction(IAction action, Dimension dimension, IActionHandler actionHandler, IView<SComponent> view, Locale locale) { Dimension d = dimension; if (d == null) { d = getIconFactory().getTinyIconSize(); } Action wingsAction = new ActionAdapter(action, d, actionHandler, view, locale); if (action instanceof IDisplayableAction) { attachActionGates(((IDisplayableAction) action), actionHandler, view, wingsAction); } return wingsAction; }