booleancomparablesupport.java
来自「PIY(Program It Yourself)是一个基于Java的应用程序开发」· Java 代码 · 共 45 行
JAVA
45 行
package piy.support;
import piy.*;
import java.awt.event.*;
import java.awt.*;
import javax.swing.*;
/**
* Simple class that delegates responsibility to the BooleanExpressionEditor.
* @author David Vivash
* @version 1.0, 30/04/01
*/
public class BooleanComparableSupport extends ClassSupport implements ActionListener {
private JFrame editor = null;
public BooleanComparableSupport(Property property) {
super(property);
setLayout(new BorderLayout());
JButton button = new JButton("Edit");
button.addActionListener(this);
add(button, BorderLayout.CENTER);
BooleanComparable ex = (BooleanComparable)property.getValue();
if (ex == null) property.setValue(new NullComparator());
ex = (BooleanComparable)property.getValue();
editor = new BooleanExpressionEditor(ex, property);
}
public static Class getSupportedClass() { return BooleanComparable.class; }
public void actionPerformed(ActionEvent e) {
editor.show();
}
public Dimension getMinimumSize() { return new Dimension(10, 20); }
public Dimension getPreferredSize() { return new Dimension(100, 20); }
public Dimension getMaximumSize() { return new Dimension(10000, 20); }
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?