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


Java Button.setFont方法代码示例

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


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

示例1: createOverwriteExisting

import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
/**
 * Create the button for checking if we should ask if we are going to overwrite existing files.
 */
private void createOverwriteExisting(Group optionsGroup, Font font) {
	// overwrite... checkbox
	overwriteExistingFilesCheckbox = new Button(optionsGroup, SWT.CHECK | SWT.LEFT);
	overwriteExistingFilesCheckbox.setText(N4ExportMessages.ExportFile_overwriteExisting);
	overwriteExistingFilesCheckbox.setFont(font);
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:10,代码来源:AbstractExportToSingleFileWizardPage.java

示例2: createDestinationGroup

import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
/**
 * Create the export destination specification widgets
 */
protected void createDestinationGroup(Composite parent) {
	Font font = parent.getFont();
	// destination specification group
	Composite destinationSelectionGroup = new Composite(parent, SWT.NONE);
	GridLayout layout = new GridLayout();
	layout.numColumns = 3;
	destinationSelectionGroup.setLayout(layout);
	destinationSelectionGroup.setLayoutData(new GridData(
			GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL));
	destinationSelectionGroup.setFont(font);

	Label destinationLabel = new Label(destinationSelectionGroup, SWT.NONE);
	destinationLabel.setText(getTargetLabel());
	destinationLabel.setFont(font);

	// destination name entry field
	destinationNameField = new Combo(destinationSelectionGroup, SWT.SINGLE
			| SWT.BORDER);
	destinationNameField.addListener(SWT.Modify, this);
	destinationNameField.addListener(SWT.Selection, this);
	GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL
			| GridData.GRAB_HORIZONTAL);
	data.widthHint = SIZING_TEXT_FIELD_WIDTH;
	destinationNameField.setLayoutData(data);
	destinationNameField.setFont(font);

	// destination browse button
	destinationBrowseButton = new Button(destinationSelectionGroup,
			SWT.PUSH);
	destinationBrowseButton.setText(N4ExportMessages.DataTransfer_browse);
	destinationBrowseButton.addListener(SWT.Selection, this);
	destinationBrowseButton.setFont(font);
	setButtonLayoutData(destinationBrowseButton);

	// new Label(parent, SWT.NONE); // vertical spacer
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:40,代码来源:AbstractExportToSingleFileWizardPage.java

示例3: createOptionsGroupButtons

import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
@Override
protected void createOptionsGroupButtons(Group optionsGroup) {
	Font font = optionsGroup.getFont();
	optionsGroup.setLayout(new GridLayout(2, true));

	Composite left = new Composite(optionsGroup, SWT.NONE);
	left.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, true, false));
	left.setLayout(new GridLayout(1, true));

	// compress... checkbox
	compressContentsCheckbox = new Button(left, SWT.CHECK | SWT.LEFT);
	compressContentsCheckbox.setText(DataTransferMessages.ZipExport_compressContents);
	compressContentsCheckbox.setFont(font);

}
 
开发者ID:eclipse,项目名称:n4js,代码行数:16,代码来源:ExportSelectionPage.java

示例4: createControl

import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
@Override
public void createControl(Composite parent) {
	initializeDialogUnits(parent);
	Composite composite = new Composite(parent, SWT.NULL);
	composite.setLayout(new GridLayout());

	runNpmCheckbox = new Button(composite, SWT.CHECK | SWT.LEFT);
	runNpmCheckbox.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, true, false));
	runNpmCheckbox.setText("Run npm tool for each project");
	runNpmCheckbox.setFont(parent.getFont());
	runNpmCheckbox.addListener(SWT.Selection, this);

	Label label = createPlainLabel(composite, "npm");
	label.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, true, false));

	createOptionsGroup(composite);

	textProcessOut = new Text(composite, SWT.MULTI | SWT.READ_ONLY);
	textProcessOut.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

	restoreWidgetValues();

	setControl(composite);

	// sync the page completion
	updatePageCompletion();
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:28,代码来源:NpmToolRunnerPage.java

示例5: getButtonWidthHint

import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
/**
 * A helper method to size the button
 * 
 * @param button
 * @return
 */
public static int getButtonWidthHint(Button button) {
	button.setFont(JFaceResources.getDialogFont());
	PixelConverter converter = new PixelConverter(button);
	int widthHint = converter.convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
	return Math.max(widthHint, button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x);
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:13,代码来源:GW4ELaunchConfigurationTab.java

示例6: createDestinationGroup

import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
/**
 * Create the export destination specification widgets
 *
 * @param parent
 *            org.eclipse.swt.widgets.Composite
 */
@SuppressWarnings("unused")
@Override
protected void createDestinationGroup(Composite parent) {

	Font font = parent.getFont();
	// destination specification group
	Composite destinationSelectionGroup = new Composite(parent, SWT.NONE);
	GridLayout layout = new GridLayout();
	layout.numColumns = 3;
	destinationSelectionGroup.setLayout(layout);
	destinationSelectionGroup.setLayoutData(new GridData(
			GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL));
	destinationSelectionGroup.setFont(font);

	Label destinationLabel = new Label(destinationSelectionGroup, SWT.NONE);
	destinationLabel.setText("npm Target Folder");
	destinationLabel.setFont(font);

	// destination name entry field
	destinationNameField = new Combo(destinationSelectionGroup, SWT.SINGLE
			| SWT.BORDER);
	destinationNameField.addListener(SWT.Modify, this);
	destinationNameField.addListener(SWT.Selection, this);
	GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL
			| GridData.GRAB_HORIZONTAL);
	data.widthHint = SIZING_TEXT_FIELD_WIDTH;
	destinationNameField.setLayoutData(data);
	destinationNameField.setFont(font);
	BidiUtils.applyBidiProcessing(destinationNameField, StructuredTextTypeHandlerFactory.FILE);

	// destination browse button
	destinationBrowseButton = new Button(destinationSelectionGroup,
			SWT.PUSH);
	destinationBrowseButton.setText(DataTransferMessages.DataTransfer_browse);
	destinationBrowseButton.addListener(SWT.Selection, this);
	destinationBrowseButton.setFont(font);
	setButtonLayoutData(destinationBrowseButton);

	new Label(parent, SWT.NONE); // vertical spacer
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:47,代码来源:ExportSelectionPage.java

示例7: createAdvancedControls

import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
/**
 * Creates the widget for advanced options.
 * 
 * @param parent
 *            the parent composite
 */
protected void createAdvancedControls(Composite parent) {
	Preferences preferences = ResourcesPlugin.getPlugin()
			.getPluginPreferences();

	if (preferences.getBoolean(ResourcesPlugin.PREF_DISABLE_LINKING) == false) {
		linkedResourceParent = new Composite(parent, SWT.NONE);
		linkedResourceParent.setFont(parent.getFont());
		linkedResourceParent.setLayoutData(new GridData(
				GridData.FILL_HORIZONTAL));
		GridLayout layout = new GridLayout();
		layout.marginHeight = 0;
		layout.marginWidth = 0;
		linkedResourceParent.setLayout(layout);

		advancedButton = new Button(linkedResourceParent, SWT.PUSH);
		advancedButton.setFont(linkedResourceParent.getFont());
		advancedButton.setText(IDEWorkbenchMessages.showAdvanced);
		GridData data = setButtonLayoutData(advancedButton);
		data.horizontalAlignment = GridData.BEGINNING;
		advancedButton.setLayoutData(data);
		advancedButton.addSelectionListener(new SelectionAdapter() {
			public void widgetSelected(SelectionEvent e) {
				handleAdvancedButtonSelect();
			}
		});
	}
	linkedResourceGroup = new CreateLinkedResourceGroup(IResource.FILE,
			new Listener() {
				public void handleEvent(Event e) {
					setPageComplete(validatePage());
					firstLinkCheck = false;
				}
			}, new CreateLinkedResourceGroup.IStringValue() {
				public void setValue(String string) {
					resourceGroup.setResource(string);
				}

				public String getValue() {
					return resourceGroup.getResource();
				}

				public IResource getResource() {
					IPath path = resourceGroup.getContainerFullPath();
					IWorkspaceRoot root = ResourcesPlugin.getWorkspace()
							.getRoot();
					IResource resource = root.findMember(path);
					if (resource != null && resource instanceof IContainer) {
						String resourceName = resourceGroup.getResource();
						if (resourceName.length() > 0) {
							try {
								return ((IContainer) resource).getFile(Path
										.fromOSString(resourceName));
							} catch (IllegalArgumentException e) {
								// continue below.
							}
						}
						return resource;
					}
					return resource;
				}
			});
}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:69,代码来源:WizardNewFileCreationPage.java


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