Examples of ActionEvent


Examples of java.awt.event.ActionEvent

      //Util.pr(Globals.focusListener.getFocused().toString());
      JComponent source = Globals.focusListener.getFocused();
      try {
        source.getActionMap().get(command).actionPerformed
            (new ActionEvent(source, 0, command));
      } catch (NullPointerException ex) {
        // No component is focused, so we do nothing.
      }
    }
View Full Code Here

Examples of java.awt.event.ActionEvent

    BibtexEntry bibtexEntry = new BibtexEntry();
    bibtexEntry.setField("author", "Brigitte Laurant");
    FieldEditor authorTextField = new FieldTextArea("author", "Hans Meiser");
    EntryEditor editor = new EntryEditor(jabref.jrf, jabref.jrf.basePanel(), bibtexEntry);
    // perform action ...
    editor.storeFieldAction.actionPerformed(new ActionEvent(authorTextField, 0, ""));
    // test content of stored words in autocompleter ...
    AbstractAutoCompleter autoCompleter = jabref.jrf.basePanel().getAutoCompleter("author");
    assertTrue(autoCompleter.indexContainsWord("Hans Meiser"));
    assertTrue(autoCompleter.indexContainsWord("Meiser, Hans"));
View Full Code Here

Examples of java.awt.event.ActionEvent

    BibtexEntry bibtexEntry = new BibtexEntry();
    bibtexEntry.setField("journal", "Testtext");
    FieldEditor authorTextField = new FieldTextArea("journal", "New Testtext");
    EntryEditor editor = new EntryEditor(jabref.jrf, jabref.jrf.basePanel(), bibtexEntry);
    // perform action ...
    editor.storeFieldAction.actionPerformed(new ActionEvent(authorTextField, 0, ""));
    // test content of stored words in autocompleter ...
    AbstractAutoCompleter autoCompleter = jabref.jrf.basePanel().getAutoCompleter("journal");
    assertTrue(autoCompleter.indexContainsWord("New Testtext"));

    TestUtils.closeJabRef();
View Full Code Here

Examples of java.awt.event.ActionEvent

                // This is a single item, it can lead to child creation => add the adequate listener
              item.addActionListener(new ActionListener() {
                      public void actionPerformed(ActionEvent e) {
                          ActiveNode child = nf.create(parent);
                          if(child!=null){
                            listener.actionPerformed(new ActionEvent(child,1,"childCreated"));
                          }
                      }
              });
            }
                if (depth==0) {
View Full Code Here

Examples of java.awt.event.ActionEvent

    addActionListener(this);
  }

  /** apply its state to enable/disable other components */
  public void apply() {
    actionPerformed(new ActionEvent(this,0,"apply"));
  }
View Full Code Here

Examples of java.awt.event.ActionEvent

        updateName();
      }
      public void updateName() {
        name = tfName.getText();
        if (name.equals("")) name = null;
        actionListener.actionPerformed(new ActionEvent(pane, 1, (name==null) ? resources.getString("UnnamedMapper") : name));
      }
    });

    table.addSelectionListener(new ListSelectionListener() {
      public void valueChanged(ListSelectionEvent event) {
        int r = table.getSelectedRow();
        if (r==-1) {
          del.setEnabled(false);
          up.setEnabled(false);
          down.setEnabled(false);
          return;
        }
        del.setEnabled(true);
        Expression e = (Expression)table.tableModel.expressions.get(r);
        if (e.value instanceof Interval) {
          up.setEnabled((r>0) && (((Expression)table.tableModel.expressions.get(r-1)).value instanceof Interval));
          down.setEnabled(r<table.tableModel.expressions.size()-1);
        } else {
          up.setEnabled(false);
          down.setEnabled(false);
        }
      }
    });

    newv.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        Long key = null;
        for (int k = 0; k < Integer.MAX_VALUE; k++) {
          key = new Long(k);
          if (map.get(key)==null) break;
        }
        map.put(key, createNewValue());
        int r = 0;
        for (Iterator it = map.keySet().iterator(); it.hasNext(); r++) {
          if (it.next().equals(key)) break;
        }
        table.tableModel.update(0,map.size()+intervals.size()-1);
        table.tableModel.fireTableRowsInserted(r,r);
        table.setRowSelectionInterval(r,r);
      }
    });

    newi.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        intervals.add(new Interval(false,0,false,createNewValue()));
        int r = map.size()+intervals.size()-1;
        table.tableModel.fireTableRowsInserted(r,r);
        table.tableModel.update(0,r);
        table.setRowSelectionInterval(r,r);
      }
    });

    del.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        int r = table.getSelectedRow();
        if (r<0) return;
        Expression exp = (Expression)table.tableModel.expressions.get(r);
        if (r<map.size()) {
          map.remove(exp.value);
          table.tableModel.fireTableRowsDeleted(r,r);
          table.tableModel.update(0,map.size()+intervals.size()-1);
          return;
        }
        intervals.remove(exp.value);
        table.tableModel.fireTableRowsDeleted(r,r);
        table.tableModel.update(0,map.size()+intervals.size()-1);
      }
    });

    up.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        int r = table.getSelectedRow();
        int i = r - map.size();
        if ((i<1) || (i>=intervals.size())) return;
        Object o = intervals.get(i-1);
        Object p = intervals.get(i);
        intervals.set(i-1,p);
        intervals.set(i,o);
        table.tableModel.update(r-1,r);
        table.setRowSelectionInterval(r-1,r-1);
      }
    });

    down.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        int r = table.getSelectedRow();
        int i = r - map.size();
        if ((i<0) || (i>=intervals.size()-1)) return;
        Object o = intervals.get(i);
        Object p = intervals.get(i+1);
        intervals.set(i,p);
        intervals.set(i+1,o);
        table.tableModel.update(r,r+1);
        table.setRowSelectionInterval(r+1,r+1);
      }
    });

    if (listener!=null) ok.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        actionListener.actionPerformed(new ActionEvent(pane, 2,""));
      }
    });
   
    return pane;
  }
View Full Code Here

Examples of java.awt.event.ActionEvent

    public void mouseClicked(MouseEvent e)
    {
        if ( action != null )
        {
            action.actionPerformed( new ActionEvent( this, 0, "" ) );
        }
    }
View Full Code Here

Examples of java.awt.event.ActionEvent

            Template.setCurrentTemplate(template);
            setCurrentAction(this);
           
            // do action
            actionListener.actionPerformed(
                    new ActionEvent(TemplateMenuBox.this,
                            ActionEvent.ACTION_PERFORMED, ""));
        }
View Full Code Here

Examples of java.awt.event.ActionEvent

            dstree.getScrollPane().setViewportView(dstree.getSourceTree());
            
            ActionListener[] al = cbxformat.getActionListeners();
            if (al != null) {
                for (int i = 0; i < al.length; ++i) {
                    al[i].actionPerformed(new ActionEvent(cbxformat, 0, ""));
                }
            }
            String name = DataInfo.getLabel(source);
            if ((name == null) || (name.equals(""))) {
                name = tfText.getText();
View Full Code Here

Examples of java.awt.event.ActionEvent

            mostRecentEventTime2 = ie.getWhen();
        } else if (e instanceof InputMethodEvent) {
            InputMethodEvent ime = (InputMethodEvent)e;
            mostRecentEventTime2 = ime.getWhen();
        } else if (e instanceof ActionEvent) {
            ActionEvent ae = (ActionEvent)e;
            mostRecentEventTime2 = ae.getWhen();
        } else if (e instanceof InvocationEvent) {
            InvocationEvent ie = (InvocationEvent)e;
            mostRecentEventTime2 = ie.getWhen();
        }
        mostRecentEventTime = Math.max(mostRecentEventTime, mostRecentEventTime2);
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.