Search in sources :

Example 1 with PomInfo

use of se.trixon.almond.util.PomInfo in project java-jotasync by trixon.

the class MainFrame method initActions.

private void initActions() {
    mActionManager = ActionManager.getInstance().init(getRootPane().getActionMap(), getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW));
    // about
    PomInfo pomInfo = new PomInfo(MainFrame.class, "se.trixon", "jotasync");
    AboutModel aboutModel = new AboutModel(SystemHelper.getBundle(MainFrame.class, "about"), SystemHelper.getResourceAsImageIcon(MainFrame.class, "sync-256px.png"));
    aboutModel.setAppVersion(pomInfo.getVersion());
    AboutPanel aboutPanel = new AboutPanel(aboutModel);
    AlmondAction action = AboutPanel.getAction(MainFrame.this, aboutPanel);
    getRootPane().getActionMap().put(ActionManager.ABOUT, action);
    // File
    connectMenuItem.setAction(mActionManager.getAction(ActionManager.CONNECT));
    disconnectMenuItem.setAction(mActionManager.getAction(ActionManager.DISCONNECT));
    startServerMenuItem.setAction(mActionManager.getAction(ActionManager.START_SERVER));
    shutdownServerMenuItem.setAction(mActionManager.getAction(ActionManager.SHUTDOWN_SERVER));
    shutdownServerQuitMenuItem.setAction(mActionManager.getAction(ActionManager.SHUTDOWN_SERVER_QUIT));
    saveMenuItem.setAction(mActionManager.getAction(ActionManager.SAVE_TAB));
    quitMenuItem.setAction(mActionManager.getAction(ActionManager.QUIT));
    // Tools
    cronCheckBoxMenuItem.setAction(mActionManager.getAction(ActionManager.CRON));
    jobEditorMenuItem.setAction(mActionManager.getAction(ActionManager.JOB_EDITOR));
    optionsMenuItem.setAction(mActionManager.getAction(ActionManager.OPTIONS));
    // Help
    helpMenuItem.setAction(mActionManager.getAction(ActionManager.HELP));
    aboutMenuItem.setAction(mActionManager.getAction(ActionManager.ABOUT));
    aboutRsyncMenuItem.setAction(mActionManager.getAction(ActionManager.ABOUT_RSYNC));
}
Also used : PomInfo(se.trixon.almond.util.PomInfo) AlmondAction(se.trixon.almond.util.AlmondAction) AboutModel(se.trixon.almond.util.swing.dialogs.about.AboutModel) AboutPanel(se.trixon.almond.util.swing.dialogs.about.AboutPanel)

Example 2 with PomInfo

use of se.trixon.almond.util.PomInfo in project java-jotasync by trixon.

the class Main method displayVersion.

private static void displayVersion() {
    PomInfo pomInfo = new PomInfo(se.trixon.jota.client.Main.class, "se.trixon", "jotasync");
    System.out.println(String.format(sBundle.getString("version_info"), pomInfo.getVersion()));
}
Also used : PomInfo(se.trixon.almond.util.PomInfo)

Example 3 with PomInfo

use of se.trixon.almond.util.PomInfo in project java-jotasync by trixon.

the class Main method displayVersion.

private static void displayVersion() {
    PomInfo pomInfo = new PomInfo(Main.class, "se.trixon", "jotasync");
    System.out.println(String.format(sBundle.getString("version_info"), pomInfo.getVersion()));
}
Also used : PomInfo(se.trixon.almond.util.PomInfo)

Example 4 with PomInfo

use of se.trixon.almond.util.PomInfo in project java-mapollage by trixon.

the class MainFrame method initActions.

private void initActions() {
    mActionManager = ActionManager.getInstance().init(getRootPane().getActionMap(), getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW));
    InputMap inputMap = mPopupMenu.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
    ActionMap actionMap = mPopupMenu.getActionMap();
    Action action = new AbstractAction("HideMenu") {

        @Override
        public void actionPerformed(ActionEvent e) {
            mPopupMenu.setVisible(false);
        }
    };
    String key = "HideMenu";
    actionMap.put(key, action);
    KeyStroke keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0);
    inputMap.put(keyStroke, key);
    // about
    PomInfo pomInfo = new PomInfo(Mapollage.class, "se.trixon", "mapollage");
    AboutModel aboutModel = new AboutModel(SystemHelper.getBundle(Mapollage.class, "about"), SystemHelper.getResourceAsImageIcon(MainFrame.class, "icon-1024px.png"));
    aboutModel.setAppVersion(pomInfo.getVersion());
    AboutPanel aboutPanel = new AboutPanel(aboutModel);
    action = AboutPanel.getAction(MainFrame.this, aboutPanel);
    getRootPane().getActionMap().put(ActionManager.ABOUT, action);
    // File
    quitMenuItem.setAction(mActionManager.getAction(ActionManager.QUIT));
    // Profile
    addMenuItem.setAction(mActionManager.getAction(ActionManager.ADD));
    cloneMenuItem.setAction(mActionManager.getAction(ActionManager.CLONE));
    renameMenuItem.setAction(mActionManager.getAction(ActionManager.RENAME));
    removeMenuItem.setAction(mActionManager.getAction(ActionManager.REMOVE));
    removeAllMenuItem.setAction(mActionManager.getAction(ActionManager.REMOVE_ALL));
    // Tools
    optionsMenuItem.setAction(mActionManager.getAction(ActionManager.OPTIONS));
    // Help
    helpMenuItem.setAction(mActionManager.getAction(ActionManager.HELP));
    aboutDateFormatMenuItem.setAction(mActionManager.getAction(ActionManager.ABOUT_DATE_FORMAT));
    aboutMenuItem.setAction(mActionManager.getAction(ActionManager.ABOUT));
    // Toolbar
    startButton.setAction(mActionManager.getAction(ActionManager.START));
    cancelButton.setAction(mActionManager.getAction(ActionManager.CANCEL));
    menuButton.setAction(mActionManager.getAction(ActionManager.MENU));
    SwingHelper.clearText(toolBar);
}
Also used : AbstractAction(javax.swing.AbstractAction) Action(javax.swing.Action) PomInfo(se.trixon.almond.util.PomInfo) Mapollage(se.trixon.mapollage.Mapollage) ActionMap(javax.swing.ActionMap) ActionEvent(java.awt.event.ActionEvent) KeyStroke(javax.swing.KeyStroke) InputMap(javax.swing.InputMap) AboutModel(se.trixon.almond.util.swing.dialogs.about.AboutModel) AboutPanel(se.trixon.almond.util.swing.dialogs.about.AboutPanel) AbstractAction(javax.swing.AbstractAction)

Example 5 with PomInfo

use of se.trixon.almond.util.PomInfo in project java-mapollage by trixon.

the class Mapollage method displayVersion.

private void displayVersion() {
    PomInfo pomInfo = new PomInfo(Mapollage.class, "se.trixon", "mapollage");
    System.out.println(String.format(sBundle.getString("version_info"), pomInfo.getVersion()));
}
Also used : PomInfo(se.trixon.almond.util.PomInfo)

Aggregations

PomInfo (se.trixon.almond.util.PomInfo)5 AboutModel (se.trixon.almond.util.swing.dialogs.about.AboutModel)2 AboutPanel (se.trixon.almond.util.swing.dialogs.about.AboutPanel)2 ActionEvent (java.awt.event.ActionEvent)1 AbstractAction (javax.swing.AbstractAction)1 Action (javax.swing.Action)1 ActionMap (javax.swing.ActionMap)1 InputMap (javax.swing.InputMap)1 KeyStroke (javax.swing.KeyStroke)1 AlmondAction (se.trixon.almond.util.AlmondAction)1 Mapollage (se.trixon.mapollage.Mapollage)1