📄 filefield.java
字号:
// FileField.java// $Id: FileField.java,v 1.4 2000/08/16 21:37:49 ylafon Exp $// (c) COPYRIGHT MIT and INRIA, 1996.// Please first read the full copyright statement in file COPYRIGHT.htmlpackage org.w3c.tools.forms ;import java.io.File;public class FileField extends StringField { /** * Get this field's value in its native type. * @return An instance of File, or <strong>null</strong>. */ public Object getValue() { return new File(value) ; } /** * Get this field's value as a File instance. * @return An instance of FIle, or <strong>null</strong>. */ public File getFileValue() { return new File(value) ; } /** * Set this field's value using the native type. * @param value The new File value for the field. * @param update Should we update the editor's view ? * @exception IllegalFieldValueException If the value isn't accepted. */ public void setValue(Object object, boolean notify, boolean update) throws IllegalFieldValueException { if ( ! (object instanceof File) ) throw new IllegalFieldValueException (object) ; setValue((File) object, notify, update) ; } /** * Set this field's value. * @param file The new File value for the field. * @param update Update the editor's view ? * @exception IllegalFieldValueException If the value isn't accepted. */ public void setValue(File value, boolean notify, boolean update) throws IllegalFieldValueException { super.setValue(value.getAbsolutePath(), notify, update) ; } public FileField(FormManager manager , String name, String title , File value) { super(manager, name, title, ((value != null) ? value.getAbsolutePath() : null)) ; } public FileField(FormManager manager, String name, String title) { this(manager, name, title, null) ; } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -