📄 combobooleanfield.java
字号:
package ExampleViewer.form;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Control;
import ExampleViewer.data.IExampleContentProvider;
public class ComboBooleanField extends Field {
/**
* @param control
* @param id
*/
public ComboBooleanField(Control control, int id) {
super(control, id);
}
/* (non-Javadoc)
* @see com.ibm.eworkplaces.pim.ui.docedit.form.IField#getData()
*/
public void readFromContent(IExampleContentProvider content) {
Boolean bool = (Boolean )content.getElement(getId());
((Combo )_control).select(bool.booleanValue() ? 1 : 0);
}
/* (non-Javadoc)
* @see com.ibm.eworkplaces.pim.ui.docedit.form.IField#setData(java.lang.Object)
*/
public void writeToContent(IExampleContentProvider content) {
int iSel = ((Combo )_control).getSelectionIndex();
content.setElement(getId(), new Boolean((iSel > 0) ? true : false));
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -