openfire-Spark二次开发——修改设置窗口(二)其他的小细节

来源:互联网 发布:json转form 编辑:程序博客网 时间:2024/05/17 02:21

1、修改设置-登录下的xmpp端口让其不显示

/spark/src/java/org/jivesoftware/sparkimpl/settings/local/LocalPreferencePanel.java
中注释掉132,133行代码,也就是下面

//inputPanel.add(_portLabel,new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST,GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));//inputPanel.add(_portField,new GridBagConstraints(1, 0, 1, 1, 0.0,0.0,GridBagConstraints.NORTHWEST,GridBagConstraints.HORIZONTAL,new Insets(5, 5, 5, 5), 0, 0));

效果
这里写图片描述
没有显示修改xmpp端口了

2、顺便把上面那个英语(Automatic idle message)改成中文

/spark/src/resources/i18n/spark_i18n_zh_CN.properties
增加一项
label.time.till.idlemessage = 你自己要显示的文字(eclispe会自动转码)

3、修改显示样式->自定义

原版
这里写图片描述

需求。select look and feel删除,表情选择删除

修改后
这里写图片描述

方法:
/spark/src/java/org/jivesoftware/spark/ui/themes/ThemePanel.java

331行起

//注释掉相应代码  private void buildUI() {        // Add Viewer//        add(new JScrollPane(transcript), new GridBagConstraints(0, 0, 3, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(5, 5, 5, 5), 0, 0));        //add(emoticonscrollpane, new GridBagConstraints(0, 1, 3, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(5, 5, 5, 5), 0, 0));        //add(emoticonBox, new GridBagConstraints(1, 2, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0));        //add(addEmoticonButton, new GridBagConstraints(2, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));        add(emoticonCheckBox, new GridBagConstraints(0, 3, 3, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));        //add(_lookandfeelLabel, new GridBagConstraints(0, 4, 3, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 50, 0));        //add(_lookandfeel, new GridBagConstraints(1, 4, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 50, 0));        //add(_lookandfeelpreview, new GridBagConstraints(2, 4, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));

4、去除活动->语言选项

org.jivesoftware.sparkimpl.plugin.language.LanguagePlugin
注释掉init()方法体即可

1 0
原创粉丝点击