Package javax.swing

Examples of javax.swing.JMenuItem.addActionListener()


    });
    menu.add(menuItemAdd);
    // edit channel group
    JMenuItem menuItemEdit = createMenuItem("channelGroupEdit",
        "Edit current channel group", null, true);
    menuItemEdit.addActionListener(new ActionListener() {

      public void actionPerformed(ActionEvent e) {
        FilterComponent rule = MainFrame.getInstance().getChannelGroup();
        if (rule != null) {
          // rule must be removed before editing it, otherwise the dialog doesn't save it
View Full Code Here


    menuItemEdit.setEnabled(!MainFrame.isStarting() && MainFrame.getInstance().getChannelGroup() != null);
  }

  private JMenuItem createDateMenuItem(final Date date) {
    JMenuItem item = new JMenuItem(date.getLongDateString());
    item.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        mMainFrame.goTo(date);
      }
    });
    return item;
View Full Code Here

    Icon icon = null;
    if (Settings.propShowChannelIconsInChannellist.getBoolean()) {
      icon = UiUtilities.createChannelIcon(channel.getIcon());
    }
    JMenuItem item = new JMenuItem(channel.getName(), icon);
    item.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        mMainFrame.showChannel(channel);
      }
    });
View Full Code Here

  private JMenuItem createTimeMenuItem(final int time) {
    int h = time / 60;
    int min = time % 60;
    JMenuItem item = new JMenuItem((h < 10 ? "0" : "") + h + ":"
        + (min < 10 ? "0" : "") + min);
    item.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        mMainFrame.scrollToTime(time);
      }
    });
    return item;
View Full Code Here

      if (license != null) {
        String name = service.getInfo().getName();
        JMenuItem item = new JMenuItem(name, new ImageIcon(
            "imgs/tvbrowser16.png"));
        setMnemonic(item);
        item.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            LicenseBox box = new LicenseBox(mMainFrame, license, false);
            util.ui.UiUtilities.centerAndShow(box);
          }
        });
View Full Code Here

  }

  private JMenuItem pluginHelpMenuItem(final String name, final String helpUrl) {
    JMenuItem item = new JMenuItem(name);
    setMnemonic(item);
    item.addActionListener(new ActionListener() {

      public void actionPerformed(ActionEvent e) {
        Launch.openURL(helpUrl);
      }
    });
View Full Code Here

    private void showPopup(MouseEvent e) {
      JPopupMenu menu = new JPopupMenu();
     
      JMenuItem configure = new JMenuItem(mLocalizer.msg("configure","Configure"));
      configure.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
          MainFrame.getInstance().showSettingsDialog(SettingsItem.TIMEBUTTONS);
        }
      });
     
View Full Code Here

    final String selectedName = name;
    JPopupMenu resultListMenu = new JPopupMenu();
   
    JMenuItem visMainBuffer = new JMenuItem("View in main window");
    if (selectedName != null) {
      visMainBuffer.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
      m_history.setSingle(selectedName);
    }
  });
    } else {
View Full Code Here

    }
    resultListMenu.add(visMainBuffer);
   
    JMenuItem visSepBuffer = new JMenuItem("View in separate window");
    if (selectedName != null) {
      visSepBuffer.addActionListener(new ActionListener() {
  public void actionPerformed(ActionEvent e) {
    m_history.openFrame(selectedName);
  }
      });
    } else {
View Full Code Here

    }
    resultListMenu.add(visSepBuffer);
   
    JMenuItem saveOutput = new JMenuItem("Save result buffer");
    if (selectedName != null) {
      saveOutput.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
      SaveBuffer m_SaveOut = new SaveBuffer(null, panel);
      StringBuffer sb = m_history.getNamedBuffer(selectedName);
      if (sb != null) {
        m_SaveOut.save(sb);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.