Back to index

wims  3.65+svn20090927
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Attributes | Package Attributes
rene.gui.HistoryTextField Class Reference

A TextField, which display the old input, when cursor up is pressed. More...

Inheritance diagram for rene.gui.HistoryTextField:
Inheritance graph
[legend]
Collaboration diagram for rene.gui.HistoryTextField:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 HistoryTextField (DoActionListener l, String name)
 HistoryTextField (DoActionListener l, String name, int s)
void keyPressed (KeyEvent ev)
void keyReleased (KeyEvent e)
void keyTyped (KeyEvent e)
void remember (String s)
void deleteFromHistory (String s)
void remember ()
void saveHistory (String name)
void loadHistory (String name)
boolean filterHistory (String name)
ListClass getHistory ()
void setTrigger (boolean f)
void doAction (String o)
void itemAction (String o, boolean flag)
void triggerAction ()
void focusGained (FocusEvent e)
void focusLost (FocusEvent e)
void setText (String s)
String getOldText ()
boolean isChanged ()

Static Public Member Functions

static void main (String args[])

Public Attributes

int MaxLength = 48

Protected Attributes

ActionTranslator T

Package Attributes

ListClass H
PopupMenu M = null
boolean Trigger = false
String Last = ""
String S

Detailed Description

A TextField, which display the old input, when cursor up is pressed.

The old input is stored in a list. The class is derived from TextFieldAction.

See also:
TextFieldAction

Definition at line 20 of file HistoryTextField.java.


Constructor & Destructor Documentation

Definition at line 27 of file HistoryTextField.java.

       {      super(l,name);
           H=new ListClass();
              H.append(new ListElement(""));
              addKeyListener(this);
       }

Here is the call graph for this function:

Here is the caller graph for this function:

rene.gui.HistoryTextField.HistoryTextField ( DoActionListener  l,
String  name,
int  s 
) [inline]

Definition at line 34 of file HistoryTextField.java.

       {      super(l,name,s);
           H=new ListClass();
              H.append(new ListElement(""));
              addKeyListener(this);
       }

Here is the call graph for this function:


Member Function Documentation

void rene.gui.HistoryTextField.deleteFromHistory ( String  s) [inline]

Definition at line 82 of file HistoryTextField.java.

       {      ListElement e=H.first();
              while (e!=null)
              {      String t=(String)e.content();
                     ListElement next=e.next();
                     if (t.equals(s))
                     {      H.remove(e);
                            if (H.first()==null) H.append(new ListElement(""));
                     }
                     e=next;
              }
       }

Here is the call graph for this function:

Here is the caller graph for this function:

void rene.gui.HistoryTextField.doAction ( String  o) [inline]

Implements rene.gui.DoActionListener.

Definition at line 135 of file HistoryTextField.java.

       {      if (!o.equals(""))
              {      setText(o);
                     if (Trigger) triggerAction();
              }
       }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 125 of file HistoryTextField.java.

       {      return true;
       }

Here is the caller graph for this function:

void rene.gui.TextFieldAction.focusGained ( FocusEvent  e) [inline, inherited]

Definition at line 52 of file TextFieldAction.java.

       {      setSelectionStart(0);
       }

Here is the caller graph for this function:

void rene.gui.TextFieldAction.focusLost ( FocusEvent  e) [inline, inherited]

Definition at line 55 of file TextFieldAction.java.

       {      setSelectionStart(0);
              setSelectionEnd(0);
       }

Definition at line 129 of file HistoryTextField.java.

{ return H; }

Here is the caller graph for this function:

String rene.gui.TextFieldAction.getOldText ( ) [inline, inherited]

Definition at line 63 of file TextFieldAction.java.

       {      return S;
       }

Definition at line 66 of file TextFieldAction.java.

       {      return !S.equals(getText());
       }

Here is the caller graph for this function:

void rene.gui.HistoryTextField.itemAction ( String  o,
boolean  flag 
) [inline]

Implements rene.gui.DoActionListener.

Definition at line 141 of file HistoryTextField.java.

       {
       }
void rene.gui.HistoryTextField.keyPressed ( KeyEvent  ev) [inline]

Definition at line 41 of file HistoryTextField.java.

       {      switch (ev.getKeyCode())
              {      case KeyEvent.VK_UP :
                     case KeyEvent.VK_DOWN : 
                            if (M==null)
                            {      M=new PopupMenu();
                                   ListElement e=H.last();
                                   int i=0,n=Global.getParameter("history.length",10);
                                   while (e!=null && i<n)
                                   {      String t=(String)e.content();
                                          if (!t.equals(""))
                                          {      MenuItem item=new MenuItemAction(this,
                                                        FileName.chop(t,MaxLength),t);
                                                 M.add(item);
                                          }
                                          e=e.previous();
                                          i++;
                                   }
                                   add(M);
                            }
                            M.show(this,10,10);
                            break;
                     default : return;
              }
       }

Here is the call graph for this function:

void rene.gui.HistoryTextField.keyReleased ( KeyEvent  e) [inline]

Definition at line 67 of file HistoryTextField.java.

{}
void rene.gui.HistoryTextField.keyTyped ( KeyEvent  e) [inline]

Definition at line 69 of file HistoryTextField.java.

{}
void rene.gui.HistoryTextField.loadHistory ( String  name) [inline]

Definition at line 113 of file HistoryTextField.java.

       {      int i=1;
           H=new ListClass();
              H.append(new ListElement(""));
              while (Global.haveParameter("history."+name+"."+i))
              {      String s=Global.getParameter("history."+name+"."+i,"");
                     if (!s.equals("") && filterHistory(s)) 
                            H.prepend(new ListElement(s));
                     i++;
              }
       }

Here is the call graph for this function:

Here is the caller graph for this function:

static void rene.gui.HistoryTextField.main ( String  args[]) [inline, static]

Definition at line 145 of file HistoryTextField.java.

       {      CloseFrame f=new CloseFrame("test");
              HistoryTextField t=new HistoryTextField(f,"Test",30);
              t.remember("AAAA");
              t.remember("BBBB");
              t.remember("CCCC");
              t.remember("DDDD");
              f.setLayout(new BorderLayout());
              f.add("Center",t);
              f.add("South",new HistoryTextFieldChoice(t));
              f.pack();
              f.setVisible(true);
       }

Here is the call graph for this function:

void rene.gui.HistoryTextField.remember ( String  s) [inline]

Definition at line 73 of file HistoryTextField.java.

       {      if (s.equals(Last)) return;
              deleteFromHistory(s);
              Last=s;
              H.last().content(s);
              H.append(new ListElement(""));
              M=null;
       }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 95 of file HistoryTextField.java.

       {      remember(getText());
       }

Here is the call graph for this function:

Here is the caller graph for this function:

void rene.gui.HistoryTextField.saveHistory ( String  name) [inline]

Definition at line 99 of file HistoryTextField.java.

       {      int i,n=Global.getParameter("history.length",10);
              Global.removeAllParameters("history."+name);
              ListElement e=H.last();
              if (e==null) return;
              for (i=0; i<n && e!=null; e=e.previous())
              {      String s=(String)e.content();
                     if (!s.equals(""))
                     {      i++;
                            Global.setParameter("history."+name+"."+i,s);
                     }
              }
       }

Here is the call graph for this function:

Here is the caller graph for this function:

void rene.gui.TextFieldAction.setText ( String  s) [inline, inherited]

Definition at line 59 of file TextFieldAction.java.

       {      super.setText(s);
              S=s;
       }

Here is the caller graph for this function:

Definition at line 131 of file HistoryTextField.java.

       {      Trigger=f;
       }

Here is the caller graph for this function:

void rene.gui.TextFieldAction.triggerAction ( ) [inline, inherited]

Definition at line 49 of file TextFieldAction.java.

       {      T.trigger();
       }

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 22 of file HistoryTextField.java.

String rene.gui.HistoryTextField.Last = "" [package]

Definition at line 71 of file HistoryTextField.java.

PopupMenu rene.gui.HistoryTextField.M = null [package]

Definition at line 23 of file HistoryTextField.java.

Definition at line 25 of file HistoryTextField.java.

String rene.gui.TextFieldAction.S [package, inherited]

Definition at line 15 of file TextFieldAction.java.

Definition at line 14 of file TextFieldAction.java.

Definition at line 24 of file HistoryTextField.java.


The documentation for this class was generated from the following file: