Netbeans自定义mode
生活随笔
收集整理的這篇文章主要介紹了
Netbeans自定义mode
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
1 在模塊根目錄下編輯mode文件,例如chatEditor.wsmode
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mode PUBLIC
????????? "-//NetBeans//DTD Mode Properties 2.1//EN"
????????? "http://www.netbeans.org/dtds/mode-properties2_1.dtd">
<mode version="2.1">
??? <name unique="chatEditor" />
??? <kind type="editor" />
??? <state type="separated" />
??? <bounds x="50" y="50" width="536" height="436" />
??? <constraints>
??? </constraints>
??? <empty-behavior permanent="true" />
</mode>
2 在layer.xml中注冊
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE filesystem PUBLIC "-//NetBeans//DTD Filesystem 1.2//EN" "http://www.netbeans.org/dtds/filesystem-1_2.dtd">
<filesystem>
??? <folder name="Windows2">
??????? <folder name="Modes">
??????????? <file name="chatEditor.wsmode" url="chatEditor.wsmode"/>
??????? </folder>
??? </folder>
</filesystem>
3 調(diào)用
Mode mode = TCManager.getChatEditorMode();
if(mode != null) {
??? mode.dockInto(win);
}
win.setName(name);?? // 必須在EDT線程調(diào)用
if (!win.isOpened()) {
??? win.open();
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mode PUBLIC
????????? "-//NetBeans//DTD Mode Properties 2.1//EN"
????????? "http://www.netbeans.org/dtds/mode-properties2_1.dtd">
<mode version="2.1">
??? <name unique="chatEditor" />
??? <kind type="editor" />
??? <state type="separated" />
??? <bounds x="50" y="50" width="536" height="436" />
??? <constraints>
??? </constraints>
??? <empty-behavior permanent="true" />
</mode>
2 在layer.xml中注冊
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE filesystem PUBLIC "-//NetBeans//DTD Filesystem 1.2//EN" "http://www.netbeans.org/dtds/filesystem-1_2.dtd">
<filesystem>
??? <folder name="Windows2">
??????? <folder name="Modes">
??????????? <file name="chatEditor.wsmode" url="chatEditor.wsmode"/>
??????? </folder>
??? </folder>
</filesystem>
3 調(diào)用
Mode mode = TCManager.getChatEditorMode();
if(mode != null) {
??? mode.dockInto(win);
}
win.setName(name);?? // 必須在EDT線程調(diào)用
if (!win.isOpened()) {
??? win.open();
}
總結(jié)
以上是生活随笔為你收集整理的Netbeans自定义mode的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Android开发学习笔记(10):ND
- 下一篇: find-s 算法