Package org.jdesktop.application

Examples of org.jdesktop.application.ApplicationActionMap


       
        add(new JScrollPane(tpc));
    }
   
    private void bind() {
        ApplicationActionMap map = Application.getInstance().getContext().getActionMap(this);
       
        systemGroup.add(map.get("email"));
        systemGroup.add(map.get("delete"));
       
        officeGroup.add(map.get("write"));
       
        seeAlsoGroup.add(map.get("exploreInternet"));
        seeAlsoGroup.add(map.get("help"));
    }
View Full Code Here


        return tips;
    }
   
    private void bind() {
        ApplicationActionMap map = Application.getInstance().getContext().getActionMap(this);

        nextTipLink.addActionListener(totd.getActionMap().get("nextTip"));
        dialogLink.addActionListener(map.get("displayTipDialog"));
    }
View Full Code Here

    //TODO hack around loosing actions from map
    private ApplicationActionMap main;
   
    private void installProxyActions() {
        ProxyActionsContainer pac = new ProxyActionsContainer();
        ApplicationActionMap aam = getContext().getActionMap(pac);
        main = getContext().getActionMap();
       
        for (Object key : aam.allKeys()) {
            main.put(key, aam.get(key));
        }
    }
View Full Code Here

    }
   
    private JMenuBar createMenuBar() {
        BindingGroup menuBinding = new BindingGroup();
        ResourceMap resourceMap = application.getContext().getResourceMap(Mediator.class);
        ApplicationActionMap actionMap = getActionMap();
        JMenuBar bar = new JMenuBar();

        // Menu File
        JMenu menuFile = new JMenu(resourceMap.getString("menu.file"));
        menuFileDevices = new JMenu(resourceMap.getString("menu.file.devices.text"));
        menuFileDevices.setIcon(resourceMap.getIcon("menu.file.devices.icon"));
        menuFile.add(menuFileDevices);
        menuBinding.addBinding( bindRead(this, PROP_DEVICES, menuFileDevices, "enabled"));
        menuFile.addSeparator();
        menuFile.add(new JMenuItem(actionMap.get(ACTION_SAVE_SCREENSHOT)));
        menuFile.add(new JCheckBoxMenuItem(actionMap.get(ACTION_RECORDING)));
        menuFile.add(new JMenuItem(actionMap.get(ACTION_OPEN_DESTINATION_FOLDER)));
        menuFile.addSeparator();
        menuFile.add(new JMenuItem(actionMap.get(ACTION_CHANGE_DEFAULT_FOLDER)));
        menuFile.add(new JMenuItem(actionMap.get(ACTION_CHANGE_SDK_FOLDER)));
        menuFile.addSeparator();
        menuFile.add(new JMenuItem(actionMap.get("quit")));

        // Menu Edit
        JMenu menuEdit = new JMenu(resourceMap.getString("menu.edit"));
        menuEdit.add(new JMenuItem(actionMap.get(ACTION_COPY_TO_CLIPBOARD)));

        // Menu View
        JMenu menuView = new JMenu(resourceMap.getString("menu.view"));
        menuView.add(new JCheckBoxMenuItem(actionMap.get(ACTION_SHOW_TOOLBAR_LABELS)));
        menuView.addSeparator();
        menuView.add(new JCheckBoxMenuItem(actionMap.get(ACTION_LANDSCAPE)));
        menuView.add(new JCheckBoxMenuItem(actionMap.get(ACTION_LANDSCAPE_CW)));
        menuView.addSeparator();
        menuView.add(new JMenuItem(actionMap.get(ACTION_ZOOM_IN)));
        menuView.add(new JMenuItem(actionMap.get(ACTION_ZOOM_OUT)));
        menuView.add(new JMenuItem(actionMap.get(ACTION_SIZE_ORIGINAL)));
        menuView.add(new JMenuItem(actionMap.get(ACTION_SIZE_SMALL)));
        menuView.add(new JMenuItem(actionMap.get(ACTION_SIZE_LARGE)));
        menuView.add(new JCheckBoxMenuItem(actionMap.get(ACTION_SIZE_FIT)));
        menuView.addSeparator();
        menuView.add(new JMenuItem(actionMap.get(ACTION_FULL_SCREEN)));
       
        // Menu Tools
        JMenu toolsView = new JMenu(resourceMap.getString("menu.tools"));
        toolsView.add(new JMenuItem(actionMap.get(ACTION_INSTALL)));
        toolsView.addSeparator();
        toolsView.add(new JMenuItem(actionMap.get(ACTION_OPTIONS)));

        // Menu Help
        JMenu menuHelp = new JMenu(resourceMap.getString("menu.help"));
        menuHelp.add(new JMenuItem(actionMap.get(ACTION_CHECK_UPDATES)));
        menuHelp.add(new JMenuItem(actionMap.get(ACTION_ABOUT)));

        bar.add(menuFile);
        bar.add(menuEdit);
        bar.add(menuView);
        bar.add(toolsView);
View Full Code Here

        return bar;
    }

    private JToolBar createToolBar() {
        ApplicationActionMap actionMap = getActionMap();
        JToolBar bar = new JToolBar();
        bar.setRollover(true);
        toolBarMap.clear();
        final boolean hideText = !p.getBoolean(PREF_GUI_SHOW_TEXT_IN_TOOLBAR, true);
        for (String actionName : TOOLBAR) {
            if (TOOLBAR_SEPARATOR.equals(actionName)) {
                bar.addSeparator();
            } else {
                AbstractButton bt;
                if (actionName.startsWith(TOOLBAR_TOGGLE_BUTTON)) {
                    actionName = StringUtils.substring(actionName, TOOLBAR_TOGGLE_BUTTON.length());
                    bt = new JToggleButton(actionMap.get(actionName));
                } else {
                    bt = new JButton(actionMap.get(actionName));
                }
                bt.setFocusable(false);
                bt.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
                bt.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
                bt.setHideActionText(hideText);
View Full Code Here

    }
   
    private JMenuBar createMenuBar() {
        BindingGroup menuBinding = new BindingGroup();
        ResourceMap resourceMap = application.getContext().getResourceMap(Mediator.class);
        ApplicationActionMap actionMap = getActionMap();
        JMenuBar bar = new JMenuBar();

        // Menu File
        JMenu menuFile = new JMenu(resourceMap.getString("menu.file"));
        menuFileDevices = new JMenu(resourceMap.getString("menu.file.devices.text"));
        menuFileDevices.setIcon(resourceMap.getIcon("menu.file.devices.icon"));
        menuFile.add(menuFileDevices);
        menuBinding.addBinding( bindRead(this, PROP_DEVICES, menuFileDevices, "enabled"));
        menuFile.addSeparator();
        menuFile.add(new JMenuItem(actionMap.get(ACTION_SAVE_SCREENSHOT)));
        menuFile.add(new JCheckBoxMenuItem(actionMap.get(ACTION_RECORDING)));
        menuFile.add(new JMenuItem(actionMap.get(ACTION_OPEN_DESTINATION_FOLDER)));
        menuFile.addSeparator();
        menuFile.add(new JMenuItem(actionMap.get(ACTION_CHANGE_DEFAULT_FOLDER)));
        menuFile.add(new JMenuItem(actionMap.get(ACTION_CHANGE_SDK_FOLDER)));
        menuFile.addSeparator();
        menuFile.add(new JMenuItem(actionMap.get("quit")));

        // Menu Edit
        JMenu menuEdit = new JMenu(resourceMap.getString("menu.edit"));
        menuEdit.add(new JMenuItem(actionMap.get(ACTION_COPY_TO_CLIPBOARD)));

        // Menu View
        JMenu menuView = new JMenu(resourceMap.getString("menu.view"));
        menuView.add(new JCheckBoxMenuItem(actionMap.get(ACTION_SHOW_TOOLBAR_LABELS)));
        menuView.addSeparator();
        menuView.add(new JCheckBoxMenuItem(actionMap.get(ACTION_LANDSCAPE)));
        menuView.add(new JCheckBoxMenuItem(actionMap.get(ACTION_LANDSCAPE_CW)));
        menuView.addSeparator();
        menuView.add(new JMenuItem(actionMap.get(ACTION_ZOOM_IN)));
        menuView.add(new JMenuItem(actionMap.get(ACTION_ZOOM_OUT)));
        menuView.add(new JMenuItem(actionMap.get(ACTION_SIZE_ORIGINAL)));
        menuView.add(new JMenuItem(actionMap.get(ACTION_SIZE_SMALL)));
        menuView.add(new JMenuItem(actionMap.get(ACTION_SIZE_LARGE)));
        menuView.add(new JCheckBoxMenuItem(actionMap.get(ACTION_SIZE_FIT)));
        menuView.addSeparator();
        menuView.add(new JMenuItem(actionMap.get(ACTION_FULL_SCREEN)));
       
        // Menu Tools
        JMenu toolsView = new JMenu(resourceMap.getString("menu.tools"));
        toolsView.add(new JMenuItem(actionMap.get(ACTION_INSTALL)));
        toolsView.addSeparator();
        toolsView.add(new JMenuItem(actionMap.get(ACTION_OPTIONS)));

        // Menu Help
        JMenu menuHelp = new JMenu(resourceMap.getString("menu.help"));
        menuHelp.add(new JMenuItem(actionMap.get(ACTION_CHECK_UPDATES)));
        menuHelp.add(new JMenuItem(actionMap.get(ACTION_ABOUT)));

        bar.add(menuFile);
        bar.add(menuEdit);
        bar.add(menuView);
        bar.add(toolsView);
View Full Code Here

        getRootPane().setDefaultButton(okButton);
        this.pack();
    }

    private void initComponents() {
        ApplicationActionMap actionMap = mediator.getApplication().getContext().getActionMap(this);
        ResourceMap resourceMap = mediator.getApplication().getContext().getResourceMap(OptionsDialog.class);
        getRootPane().setLayout(new BorderLayout());

        JPanel buttonsPanel = createButtonsPanel(actionMap, resourceMap);
        JPanel generalPanel = createGeneralPanel(actionMap, resourceMap);
View Full Code Here

        return bar;
    }

    private JToolBar createToolBar() {
        ApplicationActionMap actionMap = getActionMap();
        JToolBar bar = new JToolBar();
        bar.setRollover(true);
        toolBarMap.clear();
        final boolean hideText = !p.getBoolean(PREF_GUI_SHOW_TEXT_IN_TOOLBAR, true);
        for (String actionName : TOOLBAR) {
            if (TOOLBAR_SEPARATOR.equals(actionName)) {
                bar.addSeparator();
            } else {
                AbstractButton bt;
                if (actionName.startsWith(TOOLBAR_TOGGLE_BUTTON)) {
                    actionName = StringUtils.substring(actionName, TOOLBAR_TOGGLE_BUTTON.length());
                    bt = new JToggleButton(actionMap.get(actionName));
                } else {
                    bt = new JButton(actionMap.get(actionName));
                }
                bt.setFocusable(false);
                bt.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
                bt.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
                bt.setHideActionText(hideText);
View Full Code Here

        labelDescription = new JLabel(description);
        textFieldPath = new JTextField(oldPath);
        textFieldPath.setColumns(30);

        ApplicationActionMap actionMap = app.getContext().getActionMap(this);

        buttonOk = new JButton(actionMap.get(ACTION_OK));
        buttonCancel = new JButton(actionMap.get(ACTION_CANCEL));
        buttonBrowse = new JButton(actionMap.get(ACTION_BROWSE));

        JSeparator separator = new JSeparator();

        getRootPane().setDefaultButton(buttonOk);
View Full Code Here

    }
   
    private JMenuBar createMenuBar() {
        BindingGroup menuBinding = new BindingGroup();
        ResourceMap resourceMap = application.getContext().getResourceMap(Mediator.class);
        ApplicationActionMap actionMap = getActionMap();
        JMenuBar bar = new JMenuBar();

        // Menu File
        JMenu menuFile = new JMenu(resourceMap.getString("menu.file"));
        menuFileDevices = new JMenu(resourceMap.getString("menu.file.devices.text"));
        menuFileDevices.setIcon(resourceMap.getIcon("menu.file.devices.icon"));
        menuFile.add(menuFileDevices);
        menuBinding.addBinding( bindRead(this, PROP_DEVICES, menuFileDevices, "enabled"));
        menuFile.addSeparator();
        menuFile.add(new JMenuItem(actionMap.get(ACTION_SAVE_SCREENSHOT)));
        menuFile.add(new JCheckBoxMenuItem(actionMap.get(ACTION_RECORDING)));
        menuFile.add(new JMenuItem(actionMap.get(ACTION_OPEN_DESTINATION_FOLDER)));
        menuFile.addSeparator();
        menuFile.add(new JMenuItem(actionMap.get("quit")));

        // Menu Edit
        JMenu menuEdit = new JMenu(resourceMap.getString("menu.edit"));
        menuEdit.add(new JMenuItem(actionMap.get(ACTION_COPY_TO_CLIPBOARD)));
        menuEdit.addSeparator();
        menuEdit.add(new JMenuItem(actionMap.get(ACTION_OPTIONS)));

        // Menu View
        JMenu menuView = new JMenu(resourceMap.getString("menu.view"));
        menuView.add(new JCheckBoxMenuItem(actionMap.get(ACTION_LANDSCAPE)));
        menuView.add(new JCheckBoxMenuItem(actionMap.get(ACTION_LANDSCAPE_CW)));
        menuView.addSeparator();
        menuView.add(new JMenuItem(actionMap.get(ACTION_ZOOM_IN)));
        menuView.add(new JMenuItem(actionMap.get(ACTION_ZOOM_OUT)));
        menuView.addSeparator();
        menuView.add(new JMenuItem(actionMap.get(ACTION_SIZE_ORIGINAL)));
        menuView.add(new JMenuItem(actionMap.get(ACTION_SIZE_SMALL)));
        menuView.add(new JMenuItem(actionMap.get(ACTION_SIZE_LARGE)));
        menuView.add(new JCheckBoxMenuItem(actionMap.get(ACTION_SIZE_FIT)));
        menuView.addSeparator();
        menuView.add(new JMenuItem(actionMap.get(ACTION_FULL_SCREEN)));

        // Menu Help
        JMenu menuHelp = new JMenu(resourceMap.getString("menu.help"));
        menuHelp.add(new JMenuItem(actionMap.get(ACTION_CHECK_UPDATES)));
        menuHelp.add(new JMenuItem(actionMap.get(ACTION_ABOUT)));

        bar.add(menuFile);
        bar.add(menuEdit);
        bar.add(menuView);
        bar.add(menuHelp);
View Full Code Here

TOP

Related Classes of org.jdesktop.application.ApplicationActionMap

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.