📄 textpreferencepage.java
字号:
package examples.ch18.perledit.preferences;
import org.eclipse.jface.preference.BooleanFieldEditor;
import org.eclipse.jface.preference.FieldEditorPreferencePage;
import org.eclipse.jface.preference.FontFieldEditor;
import examples.ch18.perledit.Constants;
/**
* This preference page shows preferences for the text
*/
public class TextPreferencePage extends FieldEditorPreferencePage {
private FontFieldEditor fontFieldEditor;
private BooleanFieldEditor wrapFieldEditor;
/**
* TextPreferencePage constructor
*/
public TextPreferencePage() {
super(GRID);
}
/**
* Creates the field editors
*/
protected void createFieldEditors() {
// Add the field for the font
fontFieldEditor = new FontFieldEditor(Constants.FONT, "Font:", "Font",
getFieldEditorParent());
addField(fontFieldEditor);
// Add the field for word wrap
wrapFieldEditor = new BooleanFieldEditor(Constants.WRAP, "Word Wrap",
getFieldEditorParent());
addField(wrapFieldEditor);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -