本文整理汇总了Java中org.eclipse.ui.forms.widgets.FormToolkit.createLabel方法的典型用法代码示例。如果您正苦于以下问题:Java FormToolkit.createLabel方法的具体用法?Java FormToolkit.createLabel怎么用?Java FormToolkit.createLabel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.ui.forms.widgets.FormToolkit
的用法示例。
在下文中一共展示了FormToolkit.createLabel方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: contributeToToolBar
import org.eclipse.ui.forms.widgets.FormToolkit; //导入方法依赖的package包/类
@Override
protected void contributeToToolBar(IToolBarManager toolBarManager) {
super.contributeToToolBar(toolBarManager);
ControlContribution toolBarCompositeContribution = new ControlContribution(getToolBarCompositeContributionId()) {
@Override
protected Control createControl(Composite parent) {
FormToolkit toolkit = getManagedForm().getToolkit();
Composite toolBarComposite = toolkit.createComposite(parent);
FormLayout toolBarCompositeLayout = new FormLayout();
toolBarCompositeLayout.marginTop = 0;
toolBarCompositeLayout.marginBottom = 0;
toolBarCompositeLayout.marginLeft = 4;
toolBarCompositeLayout.marginRight = 4;
toolBarCompositeLayout.spacing = 4;
toolBarComposite.setLayout(toolBarCompositeLayout);
_ToolBarLabel = toolkit.createLabel(toolBarComposite, "", SWT.RIGHT);
FormData toolBarLabelFormData = new FormData();
toolBarLabelFormData.top = new FormAttachment(0, 0);
toolBarLabelFormData.left = new FormAttachment(0, 0);
toolBarLabelFormData.right = new FormAttachment(100, 0);
// HACK: I really struggled to get this label to show up.
toolBarLabelFormData.width = 100;
_ToolBarLabel.setLayoutData(toolBarLabelFormData);
return toolBarComposite;
}
};
toolBarManager.add(toolBarCompositeContribution);
}
示例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);
}
示例3: createControl
import org.eclipse.ui.forms.widgets.FormToolkit; //导入方法依赖的package包/类
@Override
public void createControl(Composite parent, FormToolkit toolkit, AvroAttribute<MultiChoiceValue<T>> element,
AvroContext context) {
initialize(element, context);
label = toolkit.createLabel(parent, "", SWT.NONE);
if (useCombo()) {
createAsCombo(parent, toolkit);
} else {
createAsRadioButtons(parent, toolkit);
}
}