Package org.jdesktop.application

Examples of org.jdesktop.application.ResourceMap


        }
    }
   
    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);
View Full Code Here


        setLayout(layout);

        final JTextPane intro = new JTextPane();

        intro.setContentType("text/html");
        final ResourceMap resourceMap = mediator.getApplication().getContext().getResourceMap();
        intro.setText(ResourceHelper.loadString("about.html", resourceMap));
        intro.setEditable(false);
        intro.addHyperlinkListener(new HyperlinkListener() {

            @Override
View Full Code Here

        setResizable(false);
       
        this.mediator = mediator;

        initComponents();
        ResourceMap resourceMap = mediator.getApplication().getContext().getResourceMap(OptionsDialog.class);
        resourceMap.injectComponents(this);
        setTitle(resourceMap.getString("title"));

        loadPreferences();
        getRootPane().setDefaultButton(okButton);
        this.pack();
    }
View Full Code Here

        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);

        JTabbedPane pane = new JTabbedPane();
        pane.addTab(resourceMap.getString("tab.general"), generalPanel);

        getRootPane().add(pane, BorderLayout.CENTER);
        getRootPane().add(buttonsPanel, BorderLayout.PAGE_END);
    }
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);
View Full Code Here

    }

    public static final String ACTION_SET_FS_BACKGROUND = "setFsBackground";
    @Action(name=ACTION_SET_FS_BACKGROUND)
    public void setFsBackground() {
        ResourceMap resourceMap = mediator.getApplication().getContext().getResourceMap(OptionsDialog.class);
        Color c = JColorChooser.showDialog(this, resourceMap.getString("color.request.title"), fsBackgroundPreview.getBackground());
        if (c != null) {
            fsBackgroundPreview.setBackground(c);
        }
    }
View Full Code Here

            p.put(PREF_DEFAULT_FILE_FOLDER, f);
        }

        demon.resetLastImage();
        JToggleButton bt = (JToggleButton) toolBarMap.get(ACTION_RECORDING);
        ResourceMap resourceMap = application.getContext().getResourceMap(Mediator.class);
        if (isRecording()) {
            bt.setText(resourceMap.getString("recording.Action.selectedText"));
        } else {
            bt.setText(resourceMap.getString("recording.Action.text"));
        }
    }
View Full Code Here

    }

    public static final String ACTION_INSTALL = "install";
    @Action(name = ACTION_INSTALL, block=Task.BlockingScope.WINDOW, enabledProperty=PROP_CONNECTED)
    public Task install() {
        ResourceMap resourceMap = application.getContext().getResourceMap(Mediator.class);
        String path = PathRequestDialog.requestFileFor("", resourceMap.getString("dialog.installfile.title"),
                resourceMap.getString("dialog.installfile.desc"));
       
        if (StringUtils.isNotBlank(path)) {
            return new AppInstaller(this, new File(path));
        } else {
            return null;
View Full Code Here

    }

    public static final String ACTION_CHANGE_DEFAULT_FOLDER = "changeDefaultFolder";
    @Action(name = ACTION_CHANGE_DEFAULT_FOLDER)
    public void changeDefaultFolder() {
        ResourceMap resourceMap = application.getContext().getResourceMap(Mediator.class);
        String folder = PathRequestDialog.requestFolderFor(p.get(PREF_DEFAULT_FILE_FOLDER, null),
                resourceMap.getString("save.request.title"), resourceMap.getString("save.request.desc"));
        if (StringUtils.isNotBlank(folder)) {
            p.put(PREF_DEFAULT_FILE_FOLDER, folder);
        }
    }
View Full Code Here

    }

    public static final String ACTION_CHANGE_SDK_FOLDER = "changeSdkFolder";
    @Action(name = ACTION_CHANGE_SDK_FOLDER)
    public void changeSdkFolder() {
        ResourceMap resourceMap = application.getContext().getResourceMap(OptionsDialog.class);
        String folder = PathRequestDialog.requestFolderFor(p.get(PREF_ANDROID_SDK_PATH, null),
                resourceMap.getString("sdk.request.title"), resourceMap.getString("sdk.request.desc"));
        if (StringUtils.isNotBlank(folder)) {
            if (AndroidSdkHelper.validatePath(folder)) {
                p.put(PREF_ANDROID_SDK_PATH, folder);
            } else {
                application.showErrorMessage("error.sdk");
View Full Code Here

TOP

Related Classes of org.jdesktop.application.ResourceMap

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.