Package tvbrowser.ui.filter.dlgs

Examples of tvbrowser.ui.filter.dlgs.EditFilterComponentDlg


    JMenuItem menuItemAdd = createMenuItem("channelGroupNew",
        "Add channel group", null, true);
    menuItemAdd.addActionListener(new ActionListener() {

      public void actionPerformed(ActionEvent e) {
        EditFilterComponentDlg dlg = new EditFilterComponentDlg(null, null,
            ChannelFilterComponent.class);
        FilterComponent rule = dlg.getFilterComponent();
        if ((rule != null) && (rule instanceof ChannelFilterComponent)) {
          FilterComponentList.getInstance().add(rule);
          FilterComponentList.getInstance().store();
          MainFrame.getInstance()
              .setChannelGroup((ChannelFilterComponent) rule);
        }
      }
    });
    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
          FilterComponentList.getInstance().remove(rule.getName());
          EditFilterComponentDlg dlg = new EditFilterComponentDlg(null, rule);
          FilterComponent newRule = dlg.getFilterComponent();
          if (newRule == null) { // restore original rule
            newRule = rule;
          }
          FilterComponentList.getInstance().add(newRule);
          FilterComponentList.getInstance().store();
View Full Code Here


    mChannels.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        // user defined selection
        if (mChannels.getSelectedIndex() == mChannels.getItemCount()-1) {
          EditFilterComponentDlg dlg = new EditFilterComponentDlg(null, null, ChannelFilterComponent.class);
          FilterComponent rule = dlg.getFilterComponent();
          if (rule == null) {
            return;
          }
          if (! (rule instanceof ChannelFilterComponent)) {
            return;
View Full Code Here

TOP

Related Classes of tvbrowser.ui.filter.dlgs.EditFilterComponentDlg

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.