Example usage for javax.swing Action SHORT_DESCRIPTION

List of usage examples for javax.swing Action SHORT_DESCRIPTION

Introduction

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

Prototype

String SHORT_DESCRIPTION

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

Click Source Link

Document

The key used for storing a short String description for the action, used for tooltip text.

Usage

From source file:com.intuit.tank.tools.debugger.ActionProducer.java

/**
 * //from   w w  w . j  av  a  2 s  .  c o m
 * @return
 */
public Action getNextStepAction() {
    Action ret = actionMap.get(ACTION_NEXT);
    if (ret == null) {
        ret = new AbstractAction(ACTION_NEXT, getIcon("control_play_blue.png", IconSize.SMALL)) {
            private static final long serialVersionUID = 1L;

            @Override
            public void actionPerformed(ActionEvent e) {
                debuggerFrame.next();
            }
        };
        ret.putValue(Action.SHORT_DESCRIPTION, "Execute the next step.");
        actionMap.put(ACTION_NEXT, ret);
    }
    return ret;
}

From source file:com.intuit.tank.tools.debugger.ActionProducer.java

/**
 * /*from www  .j  av a  2  s  . c  o  m*/
 * @return
 */
public Action getClearBookmarksAction() {
    Action ret = actionMap.get(ACTION_REMOVE_BOOKMARKS);
    if (ret == null) {
        ret = new AbstractAction(ACTION_REMOVE_BOOKMARKS, getIcon("bookmark-remove.png", IconSize.SMALL)) {
            private static final long serialVersionUID = 1L;

            @Override
            public void actionPerformed(ActionEvent e) {
                debuggerFrame.clearBookmarks();
            }
        };
        ret.putValue(Action.SHORT_DESCRIPTION, ACTION_REMOVE_BOOKMARKS);
        actionMap.put(ACTION_REMOVE_BOOKMARKS, ret);
    }
    return ret;
}

From source file:com.intuit.tank.tools.debugger.ActionProducer.java

/**
 * //  w w w . j  av a 2 s .  c  o m
 * @return
 */
public Action getClearSkipsAction() {
    Action ret = actionMap.get(ACTION_REMOVE_SKIP);
    if (ret == null) {
        ret = new AbstractAction(ACTION_REMOVE_SKIP, getIcon("remove-all-skips.png", IconSize.SMALL)) {
            private static final long serialVersionUID = 1L;

            @Override
            public void actionPerformed(ActionEvent e) {
                debuggerFrame.clearSkips();
            }
        };
        ret.putValue(Action.SHORT_DESCRIPTION, ACTION_REMOVE_SKIP);
        actionMap.put(ACTION_REMOVE_SKIP, ret);
    }
    return ret;
}

From source file:com.intuit.tank.tools.debugger.ActionProducer.java

/**
 * /*from  ww  w .j a  va 2s  .  c  o  m*/
 * @return
 */
public Action getEndDebugAction() {
    Action ret = actionMap.get(ACTION_STOP);
    if (ret == null) {
        ret = new AbstractAction(ACTION_STOP, getIcon("control_stop_blue.png", IconSize.SMALL)) {
            private static final long serialVersionUID = 1L;

            @Override
            public void actionPerformed(ActionEvent e) {
                debuggerFrame.stop();
            }
        };
        ret.putValue(Action.SHORT_DESCRIPTION, "Stop Debugging.");
        actionMap.put(ACTION_STOP, ret);
    }
    return ret;
}

From source file:com.intuit.tank.tools.debugger.ActionProducer.java

/**
 * //  w  w w  .  j a  va2 s  . c om
 * @return
 */
public Action getRunToAction() {
    Action ret = actionMap.get(ACTION_RUN_TO);
    if (ret == null) {
        ret = new AbstractAction(ACTION_RUN_TO, getIcon("control_fastforward_blue.png", IconSize.SMALL)) {
            private static final long serialVersionUID = 1L;

            @Override
            public void actionPerformed(ActionEvent e) {
                debuggerFrame.runToBreakpoint();
            }
        };
        ret.putValue(Action.SHORT_DESCRIPTION, ACTION_RUN_TO);
        actionMap.put(ACTION_RUN_TO, ret);
    }
    return ret;
}

From source file:com.intuit.tank.tools.debugger.ActionProducer.java

/**
 * /*from   www  . j  a  v a2 s  .c o  m*/
 * @return
 */
public Action getPauseAction() {
    Action ret = actionMap.get(ACTION_PAUSE);
    if (ret == null) {
        ret = new AbstractAction(ACTION_PAUSE, getIcon("control_pause_blue.png", IconSize.SMALL)) {
            private static final long serialVersionUID = 1L;

            @Override
            public void actionPerformed(ActionEvent e) {
                debuggerFrame.pause();
            }
        };
        ret.putValue(Action.SHORT_DESCRIPTION, ACTION_PAUSE);
        actionMap.put(ACTION_PAUSE, ret);
    }
    return ret;
}

From source file:com.intuit.tank.tools.debugger.ActionProducer.java

/**
 * //from w  ww  .  j  a  va 2s .co  m
 * @return
 */
public Action getSkipAction() {
    Action ret = actionMap.get(ACTION_SKIP);
    if (ret == null) {
        ret = new AbstractAction(ACTION_SKIP, getIcon("control_repeat_blue.png", IconSize.SMALL)) {
            private static final long serialVersionUID = 1L;

            @Override
            public void actionPerformed(ActionEvent e) {
                debuggerFrame.skip();
            }
        };
        ret.putValue(Action.SHORT_DESCRIPTION, ACTION_SKIP);
        actionMap.put(ACTION_SKIP, ret);
    }
    return ret;
}

From source file:com.intuit.tank.tools.debugger.ActionProducer.java

/**
 * //w  ww. j  a  va2 s .  c o m
 * @return
 */
public Action getSkipStepAction() {
    Action ret = actionMap.get(ACTION_SKIP_STEP);
    if (ret == null) {
        ret = new AbstractAction(ACTION_SKIP_STEP, getIcon("skip.png", IconSize.SMALL)) {
            private static final long serialVersionUID = 1L;

            @Override
            public void actionPerformed(ActionEvent e) {
                debuggerFrame.toggleSkip();
            }
        };
        ret.putValue(Action.SHORT_DESCRIPTION, ACTION_SKIP_STEP);
        actionMap.put(ACTION_SKIP_STEP, ret);
    }
    return ret;
}

From source file:com.intuit.tank.tools.debugger.ActionProducer.java

/**
 * /*from  www .  j av  a 2 s  .com*/
 * @return
 */
public Action getToggleBreakpointAction() {
    Action ret = actionMap.get(ACTION_TOGGLE_BREAKPOINT);
    if (ret == null) {
        ret = new AbstractAction(ACTION_TOGGLE_BREAKPOINT, getIcon("bullet_blue.png", IconSize.SMALL)) {
            private static final long serialVersionUID = 1L;

            @Override
            public void actionPerformed(ActionEvent e) {
                debuggerFrame.toggleBreakPoint();
            }
        };
        ret.putValue(Action.SHORT_DESCRIPTION, ACTION_TOGGLE_BREAKPOINT);
        actionMap.put(ACTION_TOGGLE_BREAKPOINT, ret);
    }
    return ret;
}

From source file:ca.phon.ipamap.IpaMap.java

private JButton getMapButton(Cell cell) {
    PhonUIAction action = new PhonUIAction(this, "onCellClicked", cell);
    action.putValue(Action.NAME, cell.getText());
    action.putValue(Action.SHORT_DESCRIPTION, cell.getText());

    JButton retVal = new CellButton(cell);
    retVal.setAction(action);/*  w  ww  .  j  a  v  a  2  s .  c om*/

    final Cell cellData = cell;
    retVal.addMouseListener(new MouseInputAdapter() {

        @Override
        public void mouseEntered(MouseEvent me) {
            String txt = cellData.getText();
            txt = txt.replaceAll("\u25cc", "");

            final IPATokens tokens = IPATokens.getSharedInstance();
            String uniVal = "";
            String name = "";
            for (Character c : txt.toCharArray()) {
                String cText = "0x" + StringUtils.leftPad(Integer.toHexString((int) c), 4, '0');
                uniVal += (uniVal.length() > 0 ? " + " : "") + cText;

                String cName = tokens.getCharacterName(c);
                name += (name.length() > 0 ? " + " : "") + cName;
            }
            String infoTxt = "[" + uniVal + "] " + name;
            infoLabel.setText(infoTxt);
        }

        @Override
        public void mouseExited(MouseEvent me) {
            infoLabel.setText("[]");
        }
    });

    retVal.addMouseListener(new ContextMouseHandler());

    // set tooltip delay to 10 minutes for the buttons
    retVal.addMouseListener(new MouseAdapter() {
        final int defaultDismissTimeout = ToolTipManager.sharedInstance().getDismissDelay();
        final int dismissDelayMinutes = (int) TimeUnit.MINUTES.toMillis(10); // 10 minutes

        @Override
        public void mouseEntered(MouseEvent me) {
            ToolTipManager.sharedInstance().setDismissDelay(dismissDelayMinutes);
        }

        @Override
        public void mouseExited(MouseEvent me) {
            ToolTipManager.sharedInstance().setDismissDelay(defaultDismissTimeout);
        }
    });

    return retVal;
}