/** * Quits the application. * <p> * {@inheritDoc} */ public void actionPerformed(@SuppressWarnings("unused") ActionEvent e) { stop(); } }
private List<SMenu> createHelpActionMenus() { return createMenus(getHelpActions()); }
private List<SMenu> createActionMenus() { return createMenus(getActionMap()); }
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 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; }
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 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; }
/** * 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())); }
/** * displays the selected workspace. * <p> * {@inheritDoc} */ public void actionPerformed(@SuppressWarnings("unused") ActionEvent e) { try { getBackendController().checkWorkspaceAccess(workspaceName); displayWorkspace(workspaceName); } catch (SecurityException ex) { handleException(ex, null); } } }
private void displayControllerFrame() { controllerFrame = createControllerFrame(); updateFrameTitle(); controllerFrame.setVisible(true); }
/** * 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)); }
private void updateControllerFrame() { controllerFrame.getContentPane().add(createApplicationMenuBar(), SBorderLayout.NORTH); updateFrameTitle(); }
private SMenuItem createMenuItem(IDisplayableAction action) { return new SMenuItem(getViewFactory().getActionFactory().createAction( action, this, null, getLocale())); }
/** * {@inheritDoc} */ @Override protected void setSelectedWorkspaceName(String workspaceName) { super.setSelectedWorkspaceName(workspaceName); ((SCardLayout) cardPanel.getLayout()).show(workspaceName); updateFrameTitle(); }
public void actionPerformed(ActionEvent e) { IAction nextAction = null; if (SOptionPane.OK_ACTION.equals(e.getActionCommand())) { nextAction = okAction; } else if (SOptionPane.CANCEL_ACTION.equals(e.getActionCommand())) { nextAction = cancelAction; } if (nextAction != null) { execute(nextAction, context); } } });
/** * Creates the initial view from the root view descriptor, then a SFrame * containing this view and presents it to the user. * <p> * {@inheritDoc} */ @Override public boolean start(IBackendController backendController, Locale clientLocale) { if (super.start(backendController, clientLocale)) { initLoginProcess(); return true; } return false; }
private List<SMenu> createMenus(ActionMap actionMap) { List<SMenu> menus = new ArrayList<SMenu>(); if (actionMap != null) { for (ActionList actionList : actionMap.getActionLists()) { SMenu menu = createActionMenu(actionList); menus.add(menu); } } return menus; }
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(ActionEvent e) { IAction nextAction = null; if (SOptionPane.YES_ACTION.equals(e.getActionCommand())) { nextAction = yesAction; } else if (SOptionPane.NO_ACTION.equals(e.getActionCommand())) { nextAction = noAction; } if (nextAction != null) { execute(nextAction, context); } }
public void actionPerformed(ActionEvent e) { IAction nextAction = null; if (SOptionPane.YES_ACTION.equals(e.getActionCommand())) { nextAction = yesAction; } else if (SOptionPane.NO_ACTION.equals(e.getActionCommand())) { nextAction = noAction; } else if (SOptionPane.CANCEL_ACTION.equals(e.getActionCommand())) { nextAction = cancelAction; } if (nextAction != null) { execute(nextAction, context); } }