当前位置: 首页>>代码示例>>Java>>正文


Java FormToolkit.createLabel方法代码示例

本文整理汇总了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);

}
 
开发者ID:baloise,项目名称:eZooKeeper,代码行数:39,代码来源:BaseZnodeModelFormPage.java

示例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);
	
}
 
开发者ID:Talend,项目名称:avro-schema-editor,代码行数:40,代码来源:TextAttributeControl.java

示例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);
	}				
	
}
 
开发者ID:Talend,项目名称:avro-schema-editor,代码行数:16,代码来源:MultiChoiceAttributeControl.java


注:本文中的org.eclipse.ui.forms.widgets.FormToolkit.createLabel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。