Exemplo n.º 1
0
  JPopupMenu getPopup(int row, int col) {
    JMenuItem menuItem;

    ImageIcon addicon = DDIcons.getAddImageIcon(__("add an item"));
    ImageIcon delicon = DDIcons.getDelImageIcon(__("delete an item"));
    ImageIcon reseticon = DDIcons.getResImageIcon(__("reset item"));
    ImageIcon importicon = DDIcons.getImpImageIcon(__("import information"));
    ImageIcon useUpdateIcon = DDIcons.getImpImageIcon(__("use update"));
    JPopupMenu popup = new JPopupMenu();
    UpdateCustomAction aAction;
    // System.out.println(importicon.toString());
    aAction =
        new UpdateCustomAction(
            this,
            __("Import!"),
            importicon,
            __("Import Mirrors"),
            __("Import"),
            KeyEvent.VK_I,
            UpdateCustomAction.M_IMPORT);
    aAction.putValue("row", new Integer(row));
    menuItem = new JMenuItem(aAction);
    popup.add(menuItem);

    aAction =
        new UpdateCustomAction(
            this,
            __("Delete"),
            delicon,
            __("Delete Mirror"),
            __("Delete"),
            KeyEvent.VK_D,
            UpdateCustomAction.M_DELETE);
    aAction.putValue("row", new Integer(row));
    menuItem = new JMenuItem(aAction);
    popup.add(menuItem);

    aAction =
        new UpdateCustomAction(
            this,
            __("Use This Update"),
            useUpdateIcon,
            __("Use This Update"),
            __("Use This Update"),
            KeyEvent.VK_U,
            UpdateCustomAction.USE_UPDATE);
    aAction.putValue("row", new Integer(row));
    menuItem = new JMenuItem(aAction);
    popup.add(menuItem);

    return popup;
  }
Exemplo n.º 2
0
  JPopupMenu getPopup(int row, int col) {
    JMenuItem menuItem;

    ImageIcon addicon = DDIcons.getAddImageIcon(__("add an item"));
    ImageIcon delicon = DDIcons.getDelImageIcon(__("delete an item"));
    ImageIcon reseticon = DDIcons.getResImageIcon(__("reset item"));
    ImageIcon upicon = DDIcons.getImpImageIcon(__("move up"));
    ImageIcon downicon = DDIcons.getImpImageIcon(__("move down"));
    JPopupMenu popup = new JPopupMenu();
    DirCustomAction aAction;
    // System.out.println(importicon.toString());
    aAction =
        new DirCustomAction(
            this,
            __("Add a Term"),
            addicon,
            __("Add a Term"),
            __("AddTerm"),
            KeyEvent.VK_A,
            DirCustomAction.M_ADD);
    aAction.putValue("row", new Integer(row));
    menuItem = new JMenuItem(aAction);
    popup.add(menuItem);

    aAction =
        new DirCustomAction(
            this,
            __("Move UP"),
            upicon,
            __("Move UP"),
            __("MoveUP"),
            KeyEvent.VK_U,
            DirCustomAction.M_UP);
    aAction.putValue("row", new Integer(row));
    menuItem = new JMenuItem(aAction);
    popup.add(menuItem);

    aAction =
        new DirCustomAction(
            this,
            __("Move Down"),
            downicon,
            __("Move Down"),
            __("MoveDown"),
            KeyEvent.VK_O,
            DirCustomAction.M_DOWN);
    aAction.putValue("row", new Integer(row));
    menuItem = new JMenuItem(aAction);
    popup.add(menuItem);

    aAction =
        new DirCustomAction(
            this,
            __("Delete"),
            delicon,
            __("Delete Mirror"),
            __("Delete"),
            KeyEvent.VK_D,
            DirCustomAction.M_DELETE);
    aAction.putValue("row", new Integer(row));
    menuItem = new JMenuItem(aAction);
    popup.add(menuItem);

    return popup;
  }