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


Java GridDataFactory.applyTo方法代码示例

本文整理汇总了Java中org.eclipse.jface.layout.GridDataFactory.applyTo方法的典型用法代码示例。如果您正苦于以下问题:Java GridDataFactory.applyTo方法的具体用法?Java GridDataFactory.applyTo怎么用?Java GridDataFactory.applyTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.jface.layout.GridDataFactory的用法示例。


在下文中一共展示了GridDataFactory.applyTo方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: UI

import org.eclipse.jface.layout.GridDataFactory; //导入方法依赖的package包/类
UI(Composite parent) {
	super(parent, SWT.NONE);

	GridLayoutFactory.swtDefaults().numColumns(2).applyTo(this);

	new Label(this, SWT.NONE).setText("First Name:");
	new Label(this, SWT.NONE).setText("Last Name");

	GridDataFactory gdf = GridDataFactory.swtDefaults().align(SWT.FILL,
			SWT.FILL).grab(true, false);
	firstName = new Text(this, SWT.BORDER);
	gdf.applyTo(firstName);

	lastName = new Text(this, SWT.BORDER);
	gdf.applyTo(lastName);

	gdf = GridDataFactory.swtDefaults().span(2, 1).grab(true, false)
			.align(SWT.FILL, SWT.BEGINNING);
	Label label = new Label(this, SWT.NONE);
	label.setText("Formatted Name:");
	gdf.applyTo(label);

	formattedName = new Text(this, SWT.BORDER);
	formattedName.setEditable(false);
	gdf.applyTo(formattedName);
}
 
开发者ID:cplutte,项目名称:bts,代码行数:27,代码来源:Snippet008ComputedValue.java

示例2: createUIColorSelector

import org.eclipse.jface.layout.GridDataFactory; //导入方法依赖的package包/类
private ColorSelector createUIColorSelector(final Composite parent,
											final IPropertyChangeListener colorListener,
											final GridDataFactory gd) {

	final ColorSelector colorSelector = new ColorSelector(parent);

	colorSelector.addListener(colorListener);
	gd.applyTo(colorSelector.getButton());

	return colorSelector;
}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:12,代码来源:DialogMPProfile.java

示例3: createPreferenceComposite

import org.eclipse.jface.layout.GridDataFactory; //导入方法依赖的package包/类
public Composite createPreferenceComposite(Composite parent, final IBuildParticipantWorkingCopy participant)
{
	Composite master = new Composite(parent, SWT.NONE);
	master.setLayout(GridLayoutFactory.fillDefaults().create());

	GridDataFactory fillHoriz = GridDataFactory.fillDefaults().grab(true, false);

	// Options
	Group group = new Group(master, SWT.BORDER);
	group.setText(Messages.JSParserValidatorPreferenceCompositeFactory_OptionsGroup);
	group.setLayout(new GridLayout());
	group.setLayoutData(fillHoriz.create());

	Composite pairs = new Composite(group, SWT.NONE);
	pairs.setLayout(GridLayoutFactory.fillDefaults().numColumns(2).create());

	Label label = new Label(pairs, SWT.WRAP);
	label.setText(Messages.JSParserValidatorPreferenceCompositeFactory_MissingSemicolons);

	Combo combo = new Combo(pairs, SWT.READ_ONLY | SWT.SINGLE);
	for (IProblem.Severity severity : IProblem.Severity.values())
	{
		combo.add(severity.label());
		combo.setData(severity.label(), severity);
	}
	String severityValue = participant.getPreferenceString(IPreferenceConstants.PREF_MISSING_SEMICOLON_SEVERITY);
	combo.setText(IProblem.Severity.create(severityValue).label());

	combo.addSelectionListener(new SelectionAdapter()
	{
		@Override
		public void widgetSelected(SelectionEvent e)
		{
			Combo c = ((Combo) e.widget);
			int index = c.getSelectionIndex();
			String text = c.getItem(index);
			IProblem.Severity s = (Severity) c.getData(text);
			participant.setPreference(IPreferenceConstants.PREF_MISSING_SEMICOLON_SEVERITY, s.id());
		}
	});
	fillHoriz.applyTo(pairs);

	// Filters
	Composite filtersGroup = new ValidatorFiltersPreferenceComposite(master, participant);
	filtersGroup.setLayoutData(fillHoriz.grab(true, true).hint(SWT.DEFAULT, 150).create());

	return master;
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:49,代码来源:JSParserValidatorPreferenceCompositeFactory.java

示例4: createPreferenceComposite

import org.eclipse.jface.layout.GridDataFactory; //导入方法依赖的package包/类
public Composite createPreferenceComposite(Composite parent, final IBuildParticipantWorkingCopy participant)
{
	Composite master = new Composite(parent, SWT.NONE);
	master.setLayout(GridLayoutFactory.fillDefaults().create());

	GridDataFactory fillHoriz = GridDataFactory.fillDefaults().grab(true, false);

	// JSON Options
	Group group = new Group(master, SWT.BORDER);
	group.setText(Messages.JSLintValidatorPreferenceCompositeFactory_OptionsTitle);
	group.setLayout(new GridLayout());
	group.setLayoutData(fillHoriz.create());

	Label label = new Label(group, SWT.WRAP);
	label.setText(Messages.JSLintValidatorPreferenceCompositeFactory_OptionsMsg);
	fillHoriz.applyTo(label);

	final Text text = new Text(group, SWT.MULTI | SWT.V_SCROLL);

	final ControlDecoration decoration = new ControlDecoration(text, SWT.LEFT | SWT.TOP);
	decoration.setDescriptionText(Messages.JSLintValidatorPreferenceCompositeFactory_OptionsParseError);
	decoration.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_DEC_FIELD_ERROR));
	decoration.hide();

	text.setText(participant.getPreferenceString(IPreferenceConstants.JS_LINT_OPTIONS));
	fillHoriz.hint(SWT.DEFAULT, 100).applyTo(text);
	text.addModifyListener(new ModifyListener()
	{
		public void modifyText(ModifyEvent e)
		{
			decoration.hide();
			try
			{
				String optionsAsJSON = text.getText();
				JSON.parse(optionsAsJSON);
				participant.setPreference(IPreferenceConstants.JS_LINT_OPTIONS, text.getText());
			}
			catch (IllegalStateException e1)
			{
				decoration.show();
			}
		}
	});

	// Filters
	Composite filtersGroup = new ValidatorFiltersPreferenceComposite(master, participant);
	filtersGroup.setLayoutData(fillHoriz.grab(true, true).hint(SWT.DEFAULT, 150).create());

	return master;
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:51,代码来源:JSLintValidatorPreferenceCompositeFactory.java


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