本文整理汇总了Java中org.eclipse.ui.forms.widgets.FormToolkit.createText方法的典型用法代码示例。如果您正苦于以下问题:Java FormToolkit.createText方法的具体用法?Java FormToolkit.createText怎么用?Java FormToolkit.createText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.ui.forms.widgets.FormToolkit
的用法示例。
在下文中一共展示了FormToolkit.createText方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createContent
import org.eclipse.ui.forms.widgets.FormToolkit; //导入方法依赖的package包/类
@Override
protected void createContent() {
FormToolkit toolkit = getToolkit();
_Text = toolkit.createText(this, "", SWT.BORDER | SWT.SINGLE);
_Text.setFont(JFaceResources.getTextFont());
FormData formData = new FormData();
formData.top = new FormAttachment(0, 0);
formData.left = new FormAttachment(0, 0);
formData.right = new FormAttachment(100, 0);
_Text.setLayoutData(formData);
_Text.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
setDirtyInternal(true);
}
});
}
示例2: createControl
import org.eclipse.ui.forms.widgets.FormToolkit; //导入方法依赖的package包/类
@Override
public void createControl(Composite parent, FormToolkit toolkit, AvroAttribute<T> element, AvroContext context) {
initialize(element, context);
label = toolkit.createLabel(parent, "", SWT.NONE);
int textStyle = SWT.BORDER;
if (hasConfiguration(AttributeControlConfigurations.TEXT_STYLE)) {
int textStyleConfig = getConfiguration(AttributeControlConfigurations.TEXT_STYLE, Integer.class);
textStyle = textStyle | textStyleConfig;
}
text = toolkit.createText(parent, "", textStyle);
update();
IInputValidator validator = null;
if (hasConfiguration(AttributeControlConfigurations.INPUT_VALIDATOR)) {
InputValidatorProvider inputValidatorProvider =
getConfiguration(AttributeControlConfigurations.INPUT_VALIDATOR, InputValidatorProvider.class);
validator = inputValidatorProvider.getInputValidator(getAttribute().getHolder(), context);
}
if (validator == null) {
validator = new DefaultInputValidtor();
}
IValueChangeListener valueChangeListener = new IValueChangeListener() {
@Override
public void onValueChange(String oldValue, String newValue) {
changeAttribute(parseValue(oldValue), parseValue(newValue));
}
};
new TextValidator(text, SWT.TOP | SWT.LEFT, validator, valueChangeListener);
}