shortcut.java

来自「JavaExplorer是一个独立于平台的浏览器」· Java 代码 · 共 128 行

JAVA
128
字号
/**  * File and FTP Explorer  * Copyright 2002  * BOESCH Vincent  *  * This program is free software; you can redistribute it and/or  * modify it under the terms of the GNU General Public License  * as published by the Free Software Foundation; either version 2  * of the License, or (at your option) any later version.  *  * This program is distributed in the hope that it will be useful,  * but WITHOUT ANY WARRANTY; without even the implied warranty of  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the  * GNU General Public License for more details.  *  * You should have received a copy of the GNU General Public License  * along with this program; if not, write to the Free Software  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.  */package javaexplorer.util.shortcut;import objectxml.*;import java.io.Serializable;import javaexplorer.model.XFile;/** * Raccourci vers un XFichier *@author     BOESCH Vincent *@created    21 janvier 2002 *@version    3.3 */public class Shortcut implements Serializable, Xmlizable {    private XFile _file;    private String _title;    /**     *  Constructeur objet Shortcut     */    public Shortcut() {    }    /**     *  Gets the title attribute of the Shortcut     *  object     *     *@return    The title value     */    public String getTitle() {        return _title;    }    /**     *  Gets the xFile attribute of the Shortcut     *  object     *     *@return    The xFile value     */    public XFile getXFile() {        return _file;    }    /**     *  Sets the title attribute of the Shortcut     *  object     *     *@param  title  The new title value     */    public void setTitle(String title) {        _title = title;    }    /**     *  Sets the xFile attribute of the Shortcut     *  object     *     *@param  file  The new xFile value     */    public void setXFile(XFile file) {        _file = file;    }    public XMLContent writeXMLProperties() {        XMLContent root = new XMLContent("ClassName", getClass().getName());        //Pas de param鑤res constructeurs        //Propri閠閟        XMLContent content = new XMLContent("Properties");        content.add(new XMLContent("Title", _title));        if (_file != null) {            XMLContent xmlFile = new XMLContent("XFile");            xmlFile.add(_file.writeXMLProperties());            content.add(xmlFile);        }        root.add(content);        return root;    }    public void readXMLProperties(XMLContent content) {        ObjectXml ox = new ObjectXml();        if (content == null) {            return;        }        XMLContent prop = null;        prop = content.getChild("Title");        if (prop != null) {            this.setTitle(prop.getValue());        }        XMLContent xmlFile = content.getChild("XFile");        if (xmlFile != null) {            //Lecture du premier fils qui est l'xml du xfile            setXFile((XFile) (ox.xmlContentToXmlizable(                    (xmlFile.getChildren())[0])));        }    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?