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