private void updateFrameTitle() { String workspaceName = getSelectedWorkspaceName(); if (workspaceName != null) { controllerFrame.setTitle(getWorkspace(getSelectedWorkspaceName()) .getViewDescriptor().getI18nDescription(this, getLocale()) + " - " + getI18nName(this, getLocale())); } else { controllerFrame.setTitle(getI18nName(this, getLocale())); } }
public void actionPerformed(@SuppressWarnings("unused") ActionEvent e) { if (performLogin()) { dialog.dispose(); updateControllerFrame(); execute(getStartupAction(), getInitialActionContext()); } else { SOptionPane.showMessageDialog(dialog, getTranslation(LoginUtils.LOGIN_FAILED, getLocale()), getTranslation("error", getLocale()), SOptionPane.ERROR_MESSAGE); } } });
private void updateFrameTitle() { String workspaceName = getSelectedWorkspaceName(); if (workspaceName != null) { controllerFrame.setTitle(getWorkspace(getSelectedWorkspaceName()) .getViewDescriptor().getI18nDescription(getTranslationProvider(), getLocale()) + " - " + getI18nName(getTranslationProvider(), getLocale())); } else { controllerFrame.setTitle(getI18nName(getTranslationProvider(), getLocale())); } }
private SMenuItem createMenuItem(IDisplayableAction action) { return new SMenuItem(getViewFactory().getActionFactory().createAction( action, this, null, getLocale())); }
/** * Constructs a new <code>WorkspaceSelectionAction</code> instance. * * @param workspaceName * @param workspaceViewDescriptor */ public WorkspaceSelectionAction(String workspaceName, IViewDescriptor workspaceViewDescriptor) { this.workspaceName = workspaceName; putValue(Action.NAME, workspaceViewDescriptor.getI18nName( getTranslationProvider(), getLocale())); putValue(Action.SHORT_DESCRIPTION, workspaceViewDescriptor .getI18nDescription(getTranslationProvider(), getLocale()) + IViewFactory.TOOLTIP_ELLIPSIS); putValue(Action.SMALL_ICON, getIconFactory().getIcon( workspaceViewDescriptor.getIconImageURL(), IIconFactory.TINY_ICON_SIZE)); }
SOptionPane.showMessageDialog(sourceComponent, HtmlHelper.emphasis(ex .getMessage()), getTranslationProvider().getTranslation("error", getLocale()), SOptionPane.ERROR_MESSAGE); } else if (ex instanceof BusinessException) { SOptionPane.showMessageDialog(sourceComponent, HtmlHelper .emphasis(((BusinessException) ex).getI18nMessage( getTranslationProvider(), getLocale())), getTranslationProvider() .getTranslation("error", getLocale()), SOptionPane.ERROR_MESSAGE); } else if (ex instanceof ConcurrencyFailureException) { SOptionPane.showMessageDialog(sourceComponent, HtmlHelper .emphasis(getTranslationProvider().getTranslation( "concurrency.error.description", getLocale())), getTranslationProvider().getTranslation("error", getLocale()), SOptionPane.ERROR_MESSAGE); } else { SOptionPane.showMessageDialog(sourceComponent, String.valueOf(ex .getMessage()), getTranslationProvider().getTranslation("error", getLocale()), SOptionPane.ERROR_MESSAGE); SErrorDialog dialog = SErrorDialog.createInstance(sourceComponent, getTranslationProvider(), getLocale()); dialog.setMessageIcon(getIconFactory().getErrorIcon( IIconFactory.MEDIUM_ICON_SIZE)); dialog.setTitle(getTranslationProvider().getTranslation("error", getLocale())); dialog.setMessage(HtmlHelper.emphasis(ex.getLocalizedMessage())); dialog.setDetails(ex);
HtmlHelper.toHtml(HtmlHelper.emphasis(HtmlHelper.escapeForHTML(ex .getMessage()))), getTranslation("error", getLocale()), SOptionPane.ERROR_MESSAGE); } else if (ex instanceof BusinessException) { .toHtml(HtmlHelper.emphasis(HtmlHelper .escapeForHTML(((BusinessException) ex).getI18nMessage( this, getLocale())))), getTranslation("error", getLocale()), SOptionPane.ERROR_MESSAGE); } else if (ex instanceof DataIntegrityViolationException) { .getTranslation( refineIntegrityViolationTranslationKey((DataIntegrityViolationException) ex), getLocale())))), this .getTranslation("error", getLocale()), SOptionPane.ERROR_MESSAGE); } else if (ex instanceof ConcurrencyFailureException) { .toHtml(HtmlHelper.emphasis(HtmlHelper .escapeForHTML(getTranslation( "concurrency.error.description", getLocale())))), getTranslation("error", getLocale()), SOptionPane.ERROR_MESSAGE); } else { SOptionPane.showMessageDialog(sourceComponent, String.valueOf(ex .getMessage()),
private SMenu createActionMenu(ActionList actionList) { SMenu menu = new SMenu(actionList.getI18nName(getTranslationProvider(), getLocale())); if (actionList.getDescription() != null) { menu.setToolTipText(actionList.getI18nDescription( getTranslationProvider(), getLocale()) + IActionFactory.TOOLTIP_ELLIPSIS); } menu.setIcon(getIconFactory().getIcon(actionList.getIconImageURL(), IIconFactory.SMALL_ICON_SIZE)); for (IDisplayableAction action : actionList.getActions()) { menu.add(new SMenuItem(getViewFactory().getActionFactory().createAction( action, this, menu, null, null, getLocale()))); } return menu; }
private SMenu createMenu(ActionList actionList) { SMenu menu = new SMenu(actionList.getI18nName(this, getLocale())); if (actionList.getDescription() != null) { menu.setToolTipText(actionList.getI18nDescription( this, getLocale()) + IActionFactory.TOOLTIP_ELLIPSIS); } menu.setIcon(getIconFactory().getIcon(actionList.getIconImageURL(), getIconFactory().getSmallIconSize())); for (SMenuItem menuItem : createMenuItems(actionList)) { menu.add(menuItem); } return menu; }
getLocale()), true); dialog.setDraggable(true); "ok", getLocale())); loginButton.setIcon(getIconFactory().getOkYesIcon( getIconFactory().getSmallIconSize())); mainPanel.add( new SLabel(getTranslation( LoginUtils.CRED_MESSAGE, getLocale())), SBorderLayout.NORTH); mainPanel.add(loginView.getPeer(), SBorderLayout.CENTER); mainPanel.add(actionPanel, SBorderLayout.SOUTH);
private SMenu createWorkspacesMenu() { SMenu workspacesMenu = new SMenu(getTranslationProvider().getTranslation( "workspaces", getLocale())); workspacesMenu.setIcon(getIconFactory().getIcon( getWorkspacesMenuIconImageUrl(), IIconFactory.SMALL_ICON_SIZE)); for (String workspaceName : getWorkspaceNames()) { IViewDescriptor workspaceViewDescriptor = getWorkspace(workspaceName) .getViewDescriptor(); SMenuItem workspaceMenuItem = new SMenuItem(new WorkspaceSelectionAction( workspaceName, workspaceViewDescriptor)); workspacesMenu.add(workspaceMenuItem); } SMenuItem separator = new SMenuItem("---------"); separator.setBorder(new SLineBorder(1)); workspacesMenu.add(separator); workspacesMenu.add(new SMenuItem(new QuitAction())); return workspacesMenu; }