2004-07-21 Michael Koch <konqueror@gmx.de>
[official-gcc.git] / libjava / javax / swing / JFormattedTextField.java
blob8074799a7ab9c89215072fcffd844365cf1897a0
1 /* JFormattedTextField.java --
2 Copyright (C) 2003, 2004 Free Software Foundation, Inc.
4 This file is part of GNU Classpath.
6 GNU Classpath is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
11 GNU Classpath is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU Classpath; see the file COPYING. If not, write to the
18 Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
19 02111-1307 USA.
21 Linking this library statically or dynamically with other modules is
22 making a combined work based on this library. Thus, the terms and
23 conditions of the GNU General Public License cover the whole
24 combination.
26 As a special exception, the copyright holders of this library give you
27 permission to link this library with independent modules to produce an
28 executable, regardless of the license terms of these independent
29 modules, and to copy and distribute the resulting executable under
30 terms of your choice, provided that you also meet, for each linked
31 independent module, the terms and conditions of the license of that
32 module. An independent module is a module which is not derived from
33 or based on this library. If you modify this library, you may extend
34 this exception to your version of the library, but you are not
35 obligated to do so. If you do not wish to do so, delete this
36 exception statement from your version. */
39 package javax.swing;
41 import java.awt.event.FocusEvent;
42 import java.io.Serializable;
43 import java.text.Format;
44 import java.text.ParseException;
45 import javax.swing.text.Document;
46 import javax.swing.text.DocumentFilter;
47 import javax.swing.text.NavigationFilter;
49 /**
50 * @author Michael Koch
51 * @since 1.4
53 public class JFormattedTextField extends JTextField
55 private static final long serialVersionUID = 5464657870110180632L;
57 public abstract static class AbstractFormatter implements Serializable
59 private static final long serialVersionUID = -5193212041738979680L;
61 public AbstractFormatter ()
63 //Do nothing here.
66 protected Object clone ()
67 throws CloneNotSupportedException
69 throw new InternalError ("not implemented");
72 protected Action[] getActions ()
74 throw new InternalError ("not implemented");
77 protected DocumentFilter getDocumentFilter ()
79 throw new InternalError ("not implemented");
82 protected JFormattedTextField getFormattedTextField ()
84 throw new InternalError ("not implemented");
87 protected NavigationFilter getNavigationFilter ()
89 throw new InternalError ("not implemented");
92 public void install (JFormattedTextField ftf)
94 throw new InternalError ("not implemented");
97 public void uninstall ()
99 throw new InternalError ("not implemented");
102 protected void invalidEdit ()
104 throw new InternalError ("not implemented");
107 protected void setEditValid (boolean valid)
109 throw new InternalError ("not implemented");
112 public abstract Object stringToValue (String text)
113 throws ParseException;
115 public abstract String valueToString (Object value)
116 throws ParseException;
119 public abstract static class AbstractFormatterFactory
121 public AbstractFormatterFactory ()
123 // Do nothing here.
126 public abstract AbstractFormatter getFormatter (JFormattedTextField tf);
129 public static final int COMMIT = 0;
130 public static final int COMMIT_OR_REVERT = 1;
131 public static final int REVERT = 2;
132 public static final int PERSIST = 3;
134 private Object value;
136 public JFormattedTextField ()
138 this((AbstractFormatterFactory) null);
141 public JFormattedTextField (Format format)
143 throw new InternalError ("not implemented");
146 public JFormattedTextField (AbstractFormatter formatter)
148 throw new InternalError ("not implemented");
151 public JFormattedTextField (AbstractFormatterFactory factory)
153 this(factory, null);
156 public JFormattedTextField (AbstractFormatterFactory factory, Object value)
158 throw new InternalError ("not implemented");
161 public JFormattedTextField (Object value)
163 this.value = value;
166 public void commitEdit ()
167 throws ParseException
169 throw new InternalError ("not implemented");
172 public Action[] getActions ()
174 throw new InternalError ("not implemented");
177 public int getFocusLostBehaviour ()
179 throw new InternalError ("not implemented");
182 public AbstractFormatter getFormatter ()
184 throw new InternalError ("not implemented");
187 public AbstractFormatterFactory getFormatterFactory ()
189 throw new InternalError ("not implemented");
192 public String getUIClassID ()
194 return "FormattedTextFieldUI";
197 public Object getValue ()
199 return value;
202 protected void invalidEdit ()
204 throw new InternalError ("not implemented");
207 public boolean isEditValid ()
209 throw new InternalError ("not implemented");
212 protected void processFocusEvent (FocusEvent evt)
214 throw new InternalError ("not implemented");
217 public void setDocument(Document newdoc)
219 Document document = getDocument();
221 if (document == newdoc)
222 return;
224 setDocument(newdoc);
225 firePropertyChange("document", document, newdoc);
228 public void setLostFocusBehavior (int behavior)
230 throw new InternalError ("not implemented");
233 protected void setFormatter (AbstractFormatter formatter)
235 throw new InternalError ("not implemented");
238 public void setFormatterFactory (AbstractFormatterFactory factory)
240 throw new InternalError ("not implemented");
243 public void setValue (Object newValue)
245 value = newValue;