⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 preferenceset.java

📁 用jxse开发的一个p2p通讯软件 有聊天 文件共享 视频3大功能
💻 JAVA
字号:
/* * PreferenceSet.java * * Created on December 31, 2005, 4:12 PM * * To change this template, choose Tools | Template Manager * and open the template in the editor. */package net.jxta.myjxta.util.preferences;import java.awt.Container;import net.jxta.myjxta.MyJXTA;import java.util.logging.Logger;/** * * @author polo */public abstract class PreferenceSet {    private static final Logger LOG = Logger.getLogger(PreferenceSet.class.getName());        /** the root part of the fully qualified path */    private String rootPath = null;        private static final String SEP = MyPreferenceManager.SEP;        private static final String PREFERENCE = MyPreferenceManager.PREFERENCE;    protected static MyPreferenceManager prefMan =  null;    protected static MyJXTA myjxta = null;        public static final String ATTRIBUTE_NAME = MyPreferenceManager.ATTRIBUTE_NAME;    public static final String ATTRIBUTE_DESCRIPTION = MyPreferenceManager.ATTRIBUTE_DESCRIPTION;    public static final String ATTRIBUTE_VISIBLE = MyPreferenceManager.ATTRIBUTE_VISIBLE;    public static final String ATTRIBUTE_LABEL = MyPreferenceManager.ATTRIBUTE_LABEL;    public static final String ATTRIBUTE_VALUE = MyPreferenceManager.ATTRIBUTE_VALUE;    public static final String ATTRIBUTE_ENABLE = MyPreferenceManager.ATTRIBUTE_ENABLE;    public static final String ATTRIBUTE_ICON = MyPreferenceManager.ATTRIBUTE_ICON;    public static final String ATTRIBUTE_TOOLTIP = MyPreferenceManager.ATTRIBUTE_TOOLTIP;    public static final String ATTRIBUTE_CLASS = MyPreferenceManager.ATTRIBUTE_CLASS;            /** Creates a new instance of PreferenceSet */    protected PreferenceSet() {                prefMan = MyPreferenceManager.getInstance();        myjxta = prefMan.getMyJxta();    }        public abstract void destroy();    public abstract Container getUI();        public abstract void init();        public final String getRootPath() {        return rootPath;    }        public final void setRootPath(String rootPath) {        this.rootPath = rootPath;    }            public final void setPreferece(String prefName, String value) {                MyPreferenceManager.getInstance().setPreference(rootPath+SEP+PREFERENCE+"[@name=\""+prefName+"\"]", value);    }        public final void setPreferece(String prefName, String attrName, String value) {                MyPreferenceManager.getInstance().setPreference(rootPath+SEP+PREFERENCE+"[@name=\""+prefName+"\"]"+SEP+"@"+attrName, value);    }        public final String getPreference(String prefName) {                        String path = rootPath+SEP+PREFERENCE+"[@name=\""+prefName+"\"]";        String value = MyPreferenceManager.getInstance().getPreference(path);                return value;    }        public final String getAttribute(String attr) {                return MyPreferenceManager.getInstance().getAttribute(rootPath,attr);    }        public final String getPreferenceAttribute(String prefName, String attr) {                return MyPreferenceManager.getInstance().getAttribute(rootPath+SEP+PREFERENCE+"[@name=\""+prefName+"\"]",attr);    }        public final boolean preferenceExists(String preferenceName) {        boolean ret = false;                String name = getPreferenceAttribute(preferenceName, ATTRIBUTE_NAME);                if(name != null) {            ret = true;        }                return ret;    }                }

⌨️ 快捷键说明

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