📄 controlbinding.java
字号:
package rcpdev.common.ui.databinding;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Listener;
public abstract class ControlBinding implements IBinding, Listener {
private Control control;
private String attribute;
protected Object value;
private PropertyChangeSupport delegate;
public ControlBinding() {
super();
delegate = new PropertyChangeSupport(this);
}
public void addPropertyChangeListener(PropertyChangeListener listener) {
delegate.addPropertyChangeListener(listener);
}
public void firePropertyChange(PropertyChangeEvent evt) {
delegate.firePropertyChange(evt);
}
public void removePropertyChangeListener(PropertyChangeListener listener) {
delegate.removePropertyChangeListener(listener);
}
public Control getControl() {
return control;
}
/**
* Subclasses should override this class to implements listener
* registratinon on control.
*
* @param control
*/
public void setControl(Control control) {
this.control = control;
}
public String getAttribute() {
return attribute;
}
public void setAttribute(String attribute) {
this.attribute = attribute;
}
public Object getValue() {
return value;
}
public void setValue(Object value) {
this.value = value;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -