Example usage for javax.swing Action LONG_DESCRIPTION

List of usage examples for javax.swing Action LONG_DESCRIPTION

Introduction

In this page you can find the example usage for javax.swing Action LONG_DESCRIPTION.

Prototype

String LONG_DESCRIPTION

To view the source code for javax.swing Action LONG_DESCRIPTION.

Click Source Link

Document

The key used for storing a longer String description for the action, could be used for context-sensitive help.

Usage

From source file:ca.sfu.federation.action.CreateProjectAction.java

/**
 * CreateProjectAction default constructor.
 *//*from w w w  .j av  a 2 s  .  c  om*/
public CreateProjectAction() {
    super("New Project", null);
    Icon icon = ImageIconUtils.loadIconById("file-new-project-icon");
    this.putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke("control shift N"));
    this.putValue(Action.LONG_DESCRIPTION, "Create a new project");
    this.putValue(Action.MNEMONIC_KEY, KeyEvent.VK_N);
    this.putValue(Action.SHORT_DESCRIPTION, "Create a new project");
    this.putValue(Action.SMALL_ICON, icon);
}

From source file:com.sshtools.sshterm.FullScreenAction.java

public FullScreenAction(SshToolsApplication application, SshToolsApplicationContainer container) {
    this.application = application;
    this.container = container;
    putValue(Action.NAME, NAME_FULL_SCREEN);
    putValue(Action.SMALL_ICON, getIcon(SMALL_ICON_FULL_SCREEN));
    putValue(LARGE_ICON, getIcon(LARGE_ICON_FULL_SCREEN));
    putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_F, KeyEvent.ALT_MASK));
    putValue(Action.SHORT_DESCRIPTION, SHORT_DESCRIPTION_FULL_SCREEN);
    putValue(Action.LONG_DESCRIPTION, LONG_DESCRIPTION_FULL_SCREEN);
    putValue(Action.MNEMONIC_KEY, new Integer(MNEMONIC_KEY_FULL_SCREEN));
    putValue(Action.ACTION_COMMAND_KEY, ACTION_COMMAND_KEY_FULL_SCREEN);
    putValue(StandardAction.ON_MENUBAR, new Boolean(true));
    putValue(StandardAction.MENU_NAME, "View");
    putValue(StandardAction.MENU_ITEM_GROUP, new Integer(20));
    putValue(StandardAction.MENU_ITEM_WEIGHT, new Integer(20));
    putValue(StandardAction.ON_TOOLBAR, new Boolean(true));
    putValue(StandardAction.TOOLBAR_GROUP, new Integer(5));
    putValue(StandardAction.TOOLBAR_WEIGHT, new Integer(30));
}

From source file:com.sshtools.powervnc.VncFullScreenAction.java

public VncFullScreenAction(SshToolsApplication application, SshToolsApplicationContainer container) {
    this.application = application;
    this.container = container;
    putValue(Action.NAME, NAME_FULL_SCREEN);
    putValue(Action.SMALL_ICON, getIcon(SMALL_ICON_FULL_SCREEN));
    putValue(LARGE_ICON, getIcon(LARGE_ICON_FULL_SCREEN));
    putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_F, KeyEvent.ALT_MASK));
    putValue(Action.SHORT_DESCRIPTION, SHORT_DESCRIPTION_FULL_SCREEN);
    putValue(Action.LONG_DESCRIPTION, LONG_DESCRIPTION_FULL_SCREEN);
    putValue(Action.MNEMONIC_KEY, new Integer(MNEMONIC_KEY_FULL_SCREEN));
    putValue(Action.ACTION_COMMAND_KEY, ACTION_COMMAND_KEY_FULL_SCREEN);
    putValue(StandardAction.ON_MENUBAR, new Boolean(true));
    putValue(StandardAction.MENU_NAME, "View");
    putValue(StandardAction.MENU_ITEM_GROUP, new Integer(20));
    putValue(StandardAction.MENU_ITEM_WEIGHT, new Integer(20));
    putValue(StandardAction.ON_TOOLBAR, new Boolean(true));
    putValue(StandardAction.TOOLBAR_GROUP, new Integer(5));
    putValue(StandardAction.TOOLBAR_WEIGHT, new Integer(30));
}

From source file:ca.sfu.federation.action.CreateProjectAction.java

/**
 * CreateProjectAction constructor./*from   w w  w .ja v a2 s  . com*/
 * @param Name Action name that will appear in menus.
 * @param MyIcon Action icon.
 * @param ToolTip Action description that will appear in Tool Tip.
 * @param MnemonicId Key mnemonic.
 */
public CreateProjectAction(String Name, Icon MyIcon, String ToolTip, Integer MnemonicId) {
    super(Name, MyIcon);
    this.putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke("control N"));
    this.putValue(Action.LONG_DESCRIPTION, ToolTip);
    this.putValue(Action.MNEMONIC_KEY, MnemonicId);
    this.putValue(Action.SHORT_DESCRIPTION, ToolTip);
    this.putValue(Action.SMALL_ICON, MyIcon);
}

From source file:com.meghnasoft.async.AbstractAsynchronousAction.java

/**
 * Constructor, private.//from w w  w. j  av a  2s . c  o m
 *
 *
 */
private AbstractAsynchronousAction() {
    //The key used for storing a longer description for the action, could be 
    //used for context-sensitive help.
    putValue(Action.LONG_DESCRIPTION, "Starts an asynchronous task");
    //The key used for storing the name for the action, used for a menu or button.
    //static String
    putValue(Action.NAME, "Start(long)");
    //The key used for storing a short description for the action, 
    //used for tooltip text.
    putValue(Action.SHORT_DESCRIPTION, "Start");
    //Useful constants that can be used as the storage-retreival key when 
    //setting or getting one of this object's properties (text or icon)
    putValue(Action.DEFAULT, "AsynchronousAction");
}

From source file:biz.wolschon.finance.jgnucash.accountProperties.AccountProperties.java

/**
 * Initialize./*  w w w. j a v  a  2 s .  co m*/
 */
public AccountProperties() {
    this.putValue(Action.NAME, "Account Properties...");
    this.putValue(Action.LONG_DESCRIPTION, "Show the properties of an account.");
    this.putValue(Action.SHORT_DESCRIPTION, "Show the properties of an account.");
}

From source file:userinterface.graph.SeriesEditorDialog.java

/** Creates new form GUIConstantsPicker */
private SeriesEditorDialog(GUIPlugin plugin, JFrame parent, JPanel graph, java.util.List<SeriesKey> series) {
    super(parent, "Graph Series Editor", true);
    this.plugin = plugin;
    this.editors = new ArrayList<SeriesEditor>();

    initComponents();/*w  w  w.  jav a 2  s . c o m*/

    AbstractAction cut = new AbstractAction() {
        public void actionPerformed(ActionEvent e) {
            editors.get(tabbedPane.getSelectedIndex()).cut();
        }
    };
    cut.putValue(Action.LONG_DESCRIPTION, "Cut the current selection to the clipboard");
    //exitAction.putValue(Action.SHORT_DESCRIPTION, "Exit");
    cut.putValue(Action.NAME, "Cut");
    cut.putValue(Action.SMALL_ICON, GUIPrism.getIconFromImage("smallCut.png"));
    //cut.putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_X, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));

    AbstractAction copy = new AbstractAction() {
        public void actionPerformed(ActionEvent e) {
            editors.get(tabbedPane.getSelectedIndex()).copy();
        }
    };
    copy.putValue(Action.LONG_DESCRIPTION, "Copies the current selection to the clipboard");
    //exitAction.putValue(Action.SHORT_DESCRIPTION, "Exit");
    copy.putValue(Action.NAME, "Copy");
    copy.putValue(Action.SMALL_ICON, GUIPrism.getIconFromImage("smallCopy.png"));
    //copy.putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_C, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));

    AbstractAction paste = new AbstractAction() {
        public void actionPerformed(ActionEvent e) {
            editors.get(tabbedPane.getSelectedIndex()).paste();
        }
    };
    paste.putValue(Action.LONG_DESCRIPTION, "Pastes the clipboard to the current selection");
    //exitAction.putValue(Action.SHORT_DESCRIPTION, "Exit");
    paste.putValue(Action.NAME, "Paste");
    paste.putValue(Action.SMALL_ICON, GUIPrism.getIconFromImage("smallPaste.png"));
    //paste.putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_V, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));

    AbstractAction delete = new AbstractAction() {
        public void actionPerformed(ActionEvent e) {
            editors.get(tabbedPane.getSelectedIndex()).delete();
        }
    };
    delete.putValue(Action.LONG_DESCRIPTION, "Deletes the current");
    //exitAction.putValue(Action.SHORT_DESCRIPTION, "Exit");
    delete.putValue(Action.NAME, "Delete");
    delete.putValue(Action.SMALL_ICON, GUIPrism.getIconFromImage("smallDelete.png"));

    for (SeriesKey key : series) {
        SeriesSettings settings = null;
        if (graph instanceof Graph)
            settings = ((Graph) graph).getGraphSeries(key);
        if (graph instanceof Histogram)
            settings = ((Histogram) graph).getGraphSeries(key);
        if (graph instanceof Graph3D)
            settings = ((Graph3D) graph).getSeriesSettings();

        Object DataSeries = null;
        if (graph instanceof Graph)
            DataSeries = (PrismXYSeries) ((Graph) graph).getXYSeries(key);
        if (graph instanceof Histogram)
            DataSeries = ((Histogram) graph).getXYSeries(key);
        if (graph instanceof Graph3D)
            DataSeries = ((Graph3D) graph).getScatterSeries();

        SeriesEditor editor = new SeriesEditor(graph, DataSeries, settings, cut, copy, paste, delete);
        editor.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));

        tabbedPane.addTab(settings.getSeriesHeading(), editor);
        editors.add(editor);
    }

    this.getRootPane().setDefaultButton(okayButton);

    toolBar.add(cut);
    toolBar.add(copy);
    toolBar.add(paste);
    toolBar.add(delete);

    this.add(toolBar, BorderLayout.NORTH);

    this.cancelled = false;

    super.setBounds(new Rectangle(550, 300));
    setResizable(true);
    setLocationRelativeTo(getParent()); // centre
}

From source file:userinterface.properties.GUIGraphHandler.java

private void initComponents() {
    theTabs = new JTabbedPane() {

        @Override/*  ww  w.  j a  v  a 2  s.c om*/
        public String getTitleAt(int index) {
            try {
                TabClosePanel panel = (TabClosePanel) getTabComponentAt(index);
                return panel.getTitle();
            } catch (Exception e) {
                return "";
            }
        }

        @Override
        public String getToolTipTextAt(int index) {
            return ((TabClosePanel) getTabComponentAt(index)).getToolTipText();
        }

        @Override
        public void setTitleAt(int index, String title) {

            if (((TabClosePanel) getTabComponentAt(index)) == null) {
                return;
            }

            ((TabClosePanel) getTabComponentAt(index)).setTitle(title);
        }

        @Override
        public void setIconAt(int index, Icon icon) {
            ((TabClosePanel) getTabComponentAt(index)).setIcon(icon);
        }

        @Override
        public void setToolTipTextAt(int index, String toolTipText) {
            ((TabClosePanel) getTabComponentAt(index)).setToolTip(toolTipText);
        }

    };

    theTabs.addMouseListener(this);
    theTabs.addMouseWheelListener(new MouseWheelListener() {

        @Override
        public void mouseWheelMoved(MouseWheelEvent e) {
            if (e.getPreciseWheelRotation() > 0.0) {

                if (theTabs.getSelectedIndex() != (theTabs.getTabCount() - 1))
                    theTabs.setSelectedIndex(theTabs.getSelectedIndex() + 1);
            } else {

                if (theTabs.getSelectedIndex() != 0)
                    theTabs.setSelectedIndex(theTabs.getSelectedIndex() - 1);
            }
        }
    });

    setLayout(new BorderLayout());
    add(theTabs, BorderLayout.CENTER);

    graphOptions = new AbstractAction() {
        public void actionPerformed(ActionEvent e) {
            GraphOptions graphOptions = options.get(theTabs.getSelectedIndex());
            graphOptions.setVisible(true);
        }
    };

    graphOptions.putValue(Action.NAME, "Graph options");
    graphOptions.putValue(Action.MNEMONIC_KEY, new Integer(KeyEvent.VK_G));
    graphOptions.putValue(Action.SMALL_ICON, GUIPrism.getIconFromImage("smallOptions.png"));
    graphOptions.putValue(Action.LONG_DESCRIPTION, "Displays the options dialog for the graph.");

    zoomIn = new AbstractAction() {
        public void actionPerformed(ActionEvent e) {
            JPanel mgm = models.get(theTabs.getSelectedIndex());

            if (mgm instanceof ChartPanel)
                ((ChartPanel) mgm).zoomInBoth(-1, -1);
            else if (mgm instanceof Graph3D) {
                double rho = ((Graph3D) mgm).getChart3DPanel().getViewPoint().getRho();
                ((Graph3D) mgm).getChart3DPanel().getViewPoint().setRho(rho - 5);
                ((Graph3D) mgm).getChart3DPanel().repaint();
            }
        }
    };

    zoomIn.putValue(Action.NAME, "In");
    zoomIn.putValue(Action.MNEMONIC_KEY, new Integer(KeyEvent.VK_I));
    zoomIn.putValue(Action.SMALL_ICON, GUIPrism.getIconFromImage("smallPlayerFwd.png"));
    zoomIn.putValue(Action.LONG_DESCRIPTION, "Zoom in on the graph.");

    zoomOut = new AbstractAction() {
        public void actionPerformed(ActionEvent e) {
            JPanel mgm = models.get(theTabs.getSelectedIndex());

            if (mgm instanceof ChartPanel)
                ((ChartPanel) mgm).zoomOutBoth(-1, -1);
            else if (mgm instanceof Graph3D) {
                double rho = ((Graph3D) mgm).getChart3DPanel().getViewPoint().getRho();
                ((Graph3D) mgm).getChart3DPanel().getViewPoint().setRho(rho + 5);
                ((Graph3D) mgm).getChart3DPanel().repaint();
            }
        }
    };

    zoomOut.putValue(Action.NAME, "Out");
    zoomOut.putValue(Action.MNEMONIC_KEY, new Integer(KeyEvent.VK_O));
    zoomOut.putValue(Action.SMALL_ICON, GUIPrism.getIconFromImage("smallPlayerRew.png"));
    zoomOut.putValue(Action.LONG_DESCRIPTION, "Zoom out of the graph.");

    zoomDefault = new AbstractAction() {
        public void actionPerformed(ActionEvent e) {
            JPanel mgm = models.get(theTabs.getSelectedIndex());

            if (mgm instanceof ChartPanel)
                ((ChartPanel) mgm).restoreAutoBounds();
            else if (mgm instanceof Graph3D) {
                ((Graph3D) mgm).getChart3DPanel().zoomToFit();
                ((Graph3D) mgm).getChart3DPanel().getDrawable()
                        .setViewPoint(new ViewPoint3D(-Math.PI / 2, Math.PI * 1.124, 70.0, 0.0));
                ((Graph3D) mgm).getChart3DPanel().repaint();

            }
        }
    };

    zoomDefault.putValue(Action.NAME, "Default");
    zoomDefault.putValue(Action.MNEMONIC_KEY, new Integer(KeyEvent.VK_D));
    zoomDefault.putValue(Action.SMALL_ICON, GUIPrism.getIconFromImage("smallPlayerStart.png"));
    zoomDefault.putValue(Action.LONG_DESCRIPTION, "Set the default zoom for the graph.");

    importXML = new AbstractAction() {
        public void actionPerformed(ActionEvent e) {
            if (plug.showOpenFileDialog(graFilter) != JFileChooser.APPROVE_OPTION)
                return;
            try {
                Graph mgm = Graph.load(plug.getChooserFile());
                addGraph(mgm);
            } catch (GraphException ex) {
                plug.error("Could not import PRISM graph file:\n" + ex.getMessage());
            }
        }
    };
    importXML.putValue(Action.NAME, "PRISM graph (*.gra)");
    importXML.putValue(Action.MNEMONIC_KEY, new Integer(KeyEvent.VK_I));
    importXML.putValue(Action.SMALL_ICON, GUIPrism.getIconFromImage("smallFileGraph.png"));
    importXML.putValue(Action.LONG_DESCRIPTION, "Imports a saved PRISM graph from a file.");

    addFunction = new AbstractAction() {

        @Override
        public void actionPerformed(ActionEvent e) {

            plotNewFunction();
        }
    };
    addFunction.putValue(Action.NAME, "Plot function");
    addFunction.putValue(Action.MNEMONIC_KEY, new Integer(KeyEvent.VK_P));
    addFunction.putValue(Action.SMALL_ICON, GUIPrism.getIconFromImage("smallFunction.png"));
    addFunction.putValue(Action.LONG_DESCRIPTION, "Plots a new specified function on the current graph");

    exportXML = new AbstractAction() {
        public void actionPerformed(ActionEvent e) {
            if (plug.showSaveFileDialog(graFilter) != JFileChooser.APPROVE_OPTION)
                return;
            Graph mgm = (Graph) models.get(theTabs.getSelectedIndex());
            try {
                mgm.save(plug.getChooserFile());
            } catch (PrismException ex) {
                plug.error("Could not export PRISM graph file:\n" + ex.getMessage());
            }
        }
    };
    exportXML.putValue(Action.NAME, "PRISM graph (*.gra)");
    exportXML.putValue(Action.MNEMONIC_KEY, new Integer(KeyEvent.VK_X));
    exportXML.putValue(Action.SMALL_ICON, GUIPrism.getIconFromImage("smallFileGraph.png"));
    exportXML.putValue(Action.LONG_DESCRIPTION, "Export graph as a PRISM graph file.");

    exportImageJPG = new AbstractAction() {
        public void actionPerformed(ActionEvent e) {
            JPanel model = getModel(theTabs.getSelectedIndex());

            GUIImageExportDialog imageDialog = new GUIImageExportDialog(plug.getGUI(), model,
                    GUIImageExportDialog.JPEG);
            saveImage(imageDialog);
        }
    };
    exportImageJPG.putValue(Action.NAME, "JPEG Interchange Format (*.jpg, *.jpeg)");
    exportImageJPG.putValue(Action.MNEMONIC_KEY, new Integer(KeyEvent.VK_J));
    exportImageJPG.putValue(Action.SMALL_ICON, GUIPrism.getIconFromImage("smallFileImage.png"));
    exportImageJPG.putValue(Action.LONG_DESCRIPTION, "Export graph as a JPEG file.");

    exportImagePNG = new AbstractAction() {
        public void actionPerformed(ActionEvent e) {
            JPanel model = getModel(theTabs.getSelectedIndex());
            GUIImageExportDialog imageDialog = new GUIImageExportDialog(plug.getGUI(), model,
                    GUIImageExportDialog.PNG);
            saveImage(imageDialog);

        }
    };
    exportImagePNG.putValue(Action.NAME, "Portable Network Graphics (*.png)");
    exportImagePNG.putValue(Action.MNEMONIC_KEY, new Integer(KeyEvent.VK_P));
    exportImagePNG.putValue(Action.SMALL_ICON, GUIPrism.getIconFromImage("smallFileImage.png"));
    exportImagePNG.putValue(Action.LONG_DESCRIPTION, "Export graph as a Portable Network Graphics file.");

    exportPDF = new AbstractAction() {

        @Override
        public void actionPerformed(ActionEvent e) {

            if (plug.showSaveFileDialog(pdfFilter) != JFileChooser.APPROVE_OPTION)
                return;

            JPanel mgm = models.get(theTabs.getSelectedIndex());

            if (mgm instanceof ChartPanel)
                Graph.exportToPDF(plug.getChooserFile(), ((ChartPanel) mgm).getChart());
            else if (mgm instanceof Graph3D) {

                Graph3D.exportToPDF(plug.getChooserFile(), ((Graph3D) mgm).getChart3DPanel());
            }

        }
    };
    exportPDF.putValue(Action.NAME, "Portable document format (*.pdf)");
    exportPDF.putValue(Action.MNEMONIC_KEY, new Integer(KeyEvent.VK_P));
    exportPDF.putValue(Action.SMALL_ICON, GUIPrism.getIconFromImage("smallFilePdf.png"));
    exportPDF.putValue(Action.LONG_DESCRIPTION, "Export the graph as a Portable document format file.");

    exportImageEPS = new AbstractAction() {
        public void actionPerformed(ActionEvent e) {
            JPanel model = getModel(theTabs.getSelectedIndex());

            if (model instanceof ChartPanel) {

                GUIImageExportDialog imageDialog = new GUIImageExportDialog(plug.getGUI(), (ChartPanel) model,
                        GUIImageExportDialog.EPS);

                saveImage(imageDialog);

            }
        }
    };
    exportImageEPS.putValue(Action.NAME, "Encapsulated PostScript (*.eps)");
    exportImageEPS.putValue(Action.MNEMONIC_KEY, new Integer(KeyEvent.VK_E));
    exportImageEPS.putValue(Action.SMALL_ICON, GUIPrism.getIconFromImage("smallFilePdf.png"));
    exportImageEPS.putValue(Action.LONG_DESCRIPTION, "Export graph as an Encapsulated PostScript file.");

    exportMatlab = new AbstractAction() {
        public void actionPerformed(ActionEvent e) {
            if (plug.showSaveFileDialog(matlabFilter) != JFileChooser.APPROVE_OPTION)
                return;

            JPanel mgm = models.get(theTabs.getSelectedIndex());

            if (mgm instanceof Graph) {

                try {

                    ((Graph) mgm).exportToMatlab(plug.getChooserFile());

                } catch (IOException ex) {
                    plug.error("Could not export Matlab file:\n" + ex.getMessage());
                }

            } else if (mgm instanceof Graph3D) {

                try {

                    ((Graph3D) mgm).exportToMatlab(plug.getChooserFile());

                } catch (IOException e1) {

                    plug.error("Could not export Matlab file:\n" + e1.getMessage());
                    e1.printStackTrace();
                }
            }

        }
    };
    exportMatlab.putValue(Action.NAME, "Matlab file (*.m)");
    exportMatlab.putValue(Action.MNEMONIC_KEY, new Integer(KeyEvent.VK_M));
    exportMatlab.putValue(Action.SMALL_ICON, GUIPrism.getIconFromImage("smallFileMatlab.png"));
    exportMatlab.putValue(Action.LONG_DESCRIPTION, "Export graph as a Matlab file.");

    exportGnuplot = new AbstractAction() {

        @Override
        public void actionPerformed(ActionEvent e) {

            if (plug.showSaveFileDialog(gnuplotFilter) != JFileChooser.APPROVE_OPTION)
                return;

            JPanel mgm = models.get(theTabs.getSelectedIndex());

            if (mgm instanceof ChartPanel) {

                try {
                    if (mgm instanceof Graph && !(mgm instanceof ParametricGraph)) {

                        ((Graph) mgm).exportToGnuplot(plug.getChooserFile());
                    } else if (mgm instanceof ParametricGraph) {

                        ((ParametricGraph) mgm).exportToGnuplot(plug.getChooserFile());
                    } else if (mgm instanceof Histogram) {
                        ((Histogram) mgm).exportToGnuplot(plug.getChooserFile());
                    }

                } catch (IOException ex) {
                    plug.error("Could not export Gnuplot file:\n" + ex.getMessage());
                }
            }

            else if (mgm instanceof Graph3D) {

                try {

                    ((Graph3D) mgm).exportToGnuplot(plug.getChooserFile());

                } catch (IOException ex) {

                    plug.error("Could not export Gnuplot file:\n" + ex.getMessage());
                    ex.printStackTrace();
                }
            }

        }
    };

    exportGnuplot.putValue(Action.NAME, "GNU Plot file(*.gnuplot)");
    exportGnuplot.putValue(Action.MNEMONIC_KEY, new Integer(KeyEvent.VK_G));
    exportGnuplot.putValue(Action.SMALL_ICON, GUIPrism.getIconFromImage("smallgnuplot.png"));
    exportGnuplot.putValue(Action.LONG_DESCRIPTION, "Export graph as a GNU plot file.");

    printGraph = new AbstractAction() {
        public void actionPerformed(ActionEvent e) {
            JPanel graph = models.get(theTabs.getSelectedIndex());

            if (graph instanceof ChartPanel) {

                if (graph instanceof Graph) {

                    if (!((Graph) graph).getDisplaySettings().getBackgroundColor().equals(Color.white)) {
                        if (plug.questionYesNo(
                                "Your graph has a coloured background, this background will show up on the \n"
                                        + "printout. Would you like to make the current background colour white?") == 0) {

                            ((Graph) graph).getDisplaySettings().setBackgroundColor(Color.white);
                        }
                    }

                } else if (graph instanceof Histogram) {

                    if (!((Histogram) graph).getDisplaySettings().getBackgroundColor().equals(Color.white)) {
                        if (plug.questionYesNo(
                                "Your graph has a coloured background, this background will show up on the \n"
                                        + "printout. Would you like to make the current background colour white?") == 0) {
                            ((Histogram) graph).getDisplaySettings().setBackgroundColor(Color.white);
                        }
                    }

                }

                ((ChartPanel) graph).createChartPrintJob();
            }

            if (graph instanceof Graph3D) {

                ((Graph3D) graph).createPrintJob();
            }
        }
    };

    printGraph.putValue(Action.NAME, "Print graph");
    printGraph.putValue(Action.MNEMONIC_KEY, new Integer(KeyEvent.VK_P));
    printGraph.putValue(Action.SMALL_ICON, GUIPrism.getIconFromImage("smallPrint.png"));
    printGraph.putValue(Action.LONG_DESCRIPTION, "Print the graph to a printer or file");

    deleteGraph = new AbstractAction() {
        public void actionPerformed(ActionEvent e) {
            JPanel graph = models.get(theTabs.getSelectedIndex());

            models.remove(theTabs.getSelectedIndex());
            options.remove(theTabs.getSelectedIndex());
            theTabs.remove(graph);
        }
    };
    deleteGraph.putValue(Action.NAME, "Delete graph");
    deleteGraph.putValue(Action.MNEMONIC_KEY, new Integer(KeyEvent.VK_D));
    deleteGraph.putValue(Action.SMALL_ICON, GUIPrism.getIconFromImage("smallDelete.png"));
    deleteGraph.putValue(Action.LONG_DESCRIPTION, "Deletes the graph.");

    zoomMenu = new JMenu("Zoom");
    zoomMenu.setMnemonic('Z');
    zoomMenu.setIcon(GUIPrism.getIconFromImage("smallView.png"));
    zoomMenu.add(zoomIn);
    zoomMenu.add(zoomOut);
    zoomMenu.add(zoomDefault);

    exportMenu = new JMenu("Export graph");
    exportMenu.setMnemonic('E');
    exportMenu.setIcon(GUIPrism.getIconFromImage("smallExport.png"));
    exportMenu.add(exportXML);
    exportMenu.add(exportImagePNG);
    exportMenu.add(exportPDF);
    exportMenu.add(exportImageEPS);
    exportMenu.add(exportImageJPG);

    exportMenu.add(exportMatlab);
    exportMenu.add(exportGnuplot);

    importMenu = new JMenu("Import graph");
    importMenu.setMnemonic('I');
    importMenu.setIcon(GUIPrism.getIconFromImage("smallImport.png"));
    importMenu.add(importXML);

    graphMenu.add(graphOptions);
    graphMenu.add(zoomMenu);
    graphMenu.addSeparator();
    graphMenu.add(printGraph);
    graphMenu.add(deleteGraph);
    graphMenu.addSeparator();
    graphMenu.add(exportMenu);
    graphMenu.add(importMenu);
    graphMenu.add(addFunction);

    /* Tab context menu */
    backMenu.add(importXML);
}

From source file:com.anrisoftware.prefdialog.miscswing.actions.AbstractResourcesAction.java

/**
 * Returns the long description the action.
 *
 * @return the {@link String} long description or {@code null} if not set.
 * @see Action#LONG_DESCRIPTION//  w w w.java  2s . com
 * @since 3.1
 */
public final String getLongDescription() {
    return (String) getValue(Action.LONG_DESCRIPTION);
}

From source file:org.colombbus.tangara.commons.resinject.ActionInjecter.java

private void injectLongDescription() {
    String longDescKey = actionKey + LONG_DESCRIPTION_SUFFIX;
    if (classResource.containsKey(longDescKey)) {
        String longDescValue = classResource.getString(longDescKey);
        action.putValue(Action.LONG_DESCRIPTION, longDescValue);
    }//from   w  ww. j  av  a 2  s .  co m
}