當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。