|
|
|
@ -53,7 +53,10 @@ import cn.net.connor.std.processedit.util.TwoColumnRenderer;
|
|
|
|
|
|
|
|
|
|
|
|
public class PrefComponent {
|
|
|
|
public class PrefComponent {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static final int INPUT_FIELD_WIDTH = 200; // 像素
|
|
|
|
|
|
|
|
private static final int INPUT_FIELD_HEIGHT = 30;
|
|
|
|
|
|
|
|
private static final int TEXT_AREA_ROWS = 8;
|
|
|
|
|
|
|
|
private static final int TEXT_AREA_COLS = 38; // 约等于 300px 宽度
|
|
|
|
public boolean isLovParent = false;
|
|
|
|
public boolean isLovParent = false;
|
|
|
|
public boolean isLovChild = false;
|
|
|
|
public boolean isLovChild = false;
|
|
|
|
|
|
|
|
|
|
|
|
@ -517,7 +520,8 @@ public class PrefComponent {
|
|
|
|
comboBox.insertItemAt(null, 0);
|
|
|
|
comboBox.insertItemAt(null, 0);
|
|
|
|
comboBox.setSelectedIndex(0);
|
|
|
|
comboBox.setSelectedIndex(0);
|
|
|
|
comboBox.setEditable(true);
|
|
|
|
comboBox.setEditable(true);
|
|
|
|
|
|
|
|
comboBox.setPreferredSize(new Dimension(INPUT_FIELD_WIDTH, INPUT_FIELD_HEIGHT));
|
|
|
|
|
|
|
|
comboBox.setMaximumSize(new Dimension(INPUT_FIELD_WIDTH, INPUT_FIELD_HEIGHT * 2)); // 防止过高
|
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < len; i++) {
|
|
|
|
for (int i = 0; i < len; i++) {
|
|
|
|
OptionItem optionItem = new OptionItem(displayLov[i], descriptions[i]);
|
|
|
|
OptionItem optionItem = new OptionItem(displayLov[i], descriptions[i]);
|
|
|
|
@ -527,6 +531,8 @@ public class PrefComponent {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
this.bigJtf = ((JTextField)this.comboBox.getEditor().getEditorComponent());
|
|
|
|
this.bigJtf = ((JTextField)this.comboBox.getEditor().getEditorComponent());
|
|
|
|
|
|
|
|
bigJtf.setPreferredSize(new Dimension(INPUT_FIELD_WIDTH - 20,
|
|
|
|
|
|
|
|
INPUT_FIELD_HEIGHT - 4));
|
|
|
|
this.bigJtf.addKeyListener(new KeyListener()
|
|
|
|
this.bigJtf.addKeyListener(new KeyListener()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
public void keyTyped(KeyEvent e) {}
|
|
|
|
public void keyTyped(KeyEvent e) {}
|
|
|
|
@ -587,10 +593,15 @@ public class PrefComponent {
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
if (isTextArea) {
|
|
|
|
if (isTextArea) {
|
|
|
|
textArea = new iTextArea(8, 18);
|
|
|
|
textArea = new iTextArea(TEXT_AREA_ROWS, TEXT_AREA_COLS);
|
|
|
|
textArea.setBorder(BorderFactory.createLineBorder(Color.BLACK));
|
|
|
|
textArea.setBorder(BorderFactory.createLineBorder(Color.GRAY));
|
|
|
|
textArea.setLineWrap(true);
|
|
|
|
textArea.setLineWrap(true);
|
|
|
|
textArea.setWrapStyleWord(true);
|
|
|
|
textArea.setWrapStyleWord(true);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
textArea.setPreferredSize(new Dimension(INPUT_FIELD_WIDTH,
|
|
|
|
|
|
|
|
TEXT_AREA_ROWS * INPUT_FIELD_HEIGHT + 10)); // 留点边距
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
textArea.addFocusListener(new FocusAdapter() {
|
|
|
|
textArea.addFocusListener(new FocusAdapter() {
|
|
|
|
public void focusGained(FocusEvent e) {
|
|
|
|
public void focusGained(FocusEvent e) {
|
|
|
|
SwingTextContextActivator.instance().activateContext();
|
|
|
|
SwingTextContextActivator.instance().activateContext();
|
|
|
|
@ -605,6 +616,7 @@ public class PrefComponent {
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
textField = new iTextField(textLength > 0 ? textLength : 12);
|
|
|
|
textField = new iTextField(textLength > 0 ? textLength : 12);
|
|
|
|
|
|
|
|
textField.setPreferredSize(new Dimension(INPUT_FIELD_WIDTH, INPUT_FIELD_HEIGHT));
|
|
|
|
KUtil.addCol(panel, textField, gbc, 1, 1);
|
|
|
|
KUtil.addCol(panel, textField, gbc, 1, 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|