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())); } }
/** * Constructs a new <code>QuitAction</code> instance. */ public QuitAction() { putValue(Action.NAME, getTranslationProvider().getTranslation( "quit.name", getLocale())); putValue(Action.SHORT_DESCRIPTION, getTranslationProvider() .getTranslation("quit.description", getLocale())); }
private JMenu createWorkspacesMenu() { JMenu workspacesMenu = new JMenu(getTranslationProvider().getTranslation( "workspaces", getLocale())); workspacesMenu.setIcon(getIconFactory().getIcon( getWorkspacesMenuIconImageUrl(), IIconFactory.SMALL_ICON_SIZE)); for (String workspaceName : getWorkspaceNames()) { IViewDescriptor workspaceViewDescriptor = getWorkspace(workspaceName) .getViewDescriptor(); JMenuItem workspaceMenuItem = new JMenuItem(new WorkspaceSelectionAction( workspaceName, workspaceViewDescriptor)); workspacesMenu.add(workspaceMenuItem); } workspacesMenu.addSeparator(); workspacesMenu.add(new JMenuItem(new QuitAction())); return workspacesMenu; }
private JMenu createActionMenu(ActionList actionList) { JMenu menu = new JMenu(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 JMenuItem(getViewFactory().getActionFactory().createAction( action, this, menu, null, null, getLocale()))); } return menu; }
/** * 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)); }
/** * {@inheritDoc} */ @Override protected CallbackHandler createLoginCallbackHandler() { DialogCallbackHandler callbackHandler = new DialogCallbackHandler(); callbackHandler.setLocale(getLocale()); callbackHandler.setTranslationProvider(getTranslationProvider()); callbackHandler.setIconFactory(getIconFactory()); return callbackHandler; }
if (ex instanceof SecurityException) { JOptionPane.showMessageDialog(sourceComponent, HtmlHelper.emphasis(ex .getMessage()), getTranslationProvider().getTranslation("error", getLocale()), JOptionPane.ERROR_MESSAGE, getIconFactory() .getErrorIcon(IIconFactory.LARGE_ICON_SIZE)); JOptionPane.showMessageDialog(sourceComponent, HtmlHelper .emphasis(((BusinessException) ex).getI18nMessage( getTranslationProvider(), getLocale())), getTranslationProvider() .getTranslation("error", getLocale()), JOptionPane.ERROR_MESSAGE, getIconFactory().getErrorIcon(IIconFactory.LARGE_ICON_SIZE)); } else if (ex instanceof ConcurrencyFailureException) { JOptionPane.showMessageDialog(sourceComponent, HtmlHelper .emphasis(getTranslationProvider().getTranslation( "concurrency.error.description", getLocale())), getTranslationProvider().getTranslation("error", getLocale()), JOptionPane.ERROR_MESSAGE, getIconFactory().getErrorIcon( IIconFactory.LARGE_ICON_SIZE)); ex.printStackTrace(); JErrorDialog dialog = JErrorDialog.createInstance(sourceComponent, getTranslationProvider(), getLocale()); dialog.setMessageIcon(getIconFactory().getErrorIcon( IIconFactory.MEDIUM_ICON_SIZE)); dialog.setTitle(getTranslationProvider().getTranslation("error", getLocale())); dialog.setMessage(HtmlHelper.emphasis(ex.getLocalizedMessage()));
/** * Creates a new JInternalFrame and populates it with a view. * * @param view * the view to be set into the internal frame. * @return the constructed internal frame. */ private JInternalFrame createJInternalFrame(IView<JComponent> view) { JInternalFrame internalFrame = new JInternalFrame(view.getDescriptor() .getI18nName(getTranslationProvider(), getLocale())); internalFrame.setFrameIcon(getIconFactory().getIcon( view.getDescriptor().getIconImageURL(), IIconFactory.SMALL_ICON_SIZE)); internalFrame.setResizable(true); internalFrame.setClosable(false); internalFrame.setMaximizable(true); internalFrame.setIconifiable(true); internalFrame.getContentPane().add(view.getPeer(), BorderLayout.CENTER); internalFrame.setDefaultCloseOperation(WindowConstants.HIDE_ON_CLOSE); internalFrame.setGlassPane(createHermeticGlassPane()); return internalFrame; }