本文整理匯總了Java中org.eclipse.swt.widgets.Composite.setFont方法的典型用法代碼示例。如果您正苦於以下問題:Java Composite.setFont方法的具體用法?Java Composite.setFont怎麽用?Java Composite.setFont使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.swt.widgets.Composite
的用法示例。
在下文中一共展示了Composite.setFont方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createContents
import org.eclipse.swt.widgets.Composite; //導入方法依賴的package包/類
@Override
protected Control createContents(Composite parent) {
Composite composite = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout();
layout.marginHeight = 0;
layout.marginWidth = 0;
composite.setLayout(layout);
composite.setFont(parent.getFont());
GridData data = new GridData(GridData.FILL, GridData.FILL, true, true);
configurationBlockControl = super.createContents(composite);
configurationBlockControl.setLayoutData(data);
if (isProjectPreferencePage()) {
boolean useProjectSpecificSettings = hasProjectSpecificOptions();
enableProjectSpecificSettings(useProjectSpecificSettings);
}
Dialog.applyDialogFont(composite);
return composite;
}
示例2: createButtonBar
import org.eclipse.swt.widgets.Composite; //導入方法依賴的package包/類
@Override
protected Control createButtonBar(Composite parent) {
final Composite buttonBar = new Composite(parent, SWT.NONE);
buttonBar.setBackground(backColor);
final GridLayout layout = new GridLayout();
layout.marginLeft = 10;
layout.numColumns = 2;
layout.makeColumnsEqualWidth = false;
layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
buttonBar.setLayout(layout);
final GridData data = new GridData(SWT.FILL, SWT.CENTER, true, false);
data.grabExcessHorizontalSpace = true;
data.grabExcessVerticalSpace = false;
buttonBar.setLayoutData(data);
buttonBar.setFont(parent.getFont());
// add the dialog's button bar to the right
buttonControl = super.createButtonBar(buttonBar);
buttonControl.setBackground(backColor);
buttonControl.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false));
return buttonBar;
}
示例3: createControl
import org.eclipse.swt.widgets.Composite; //導入方法依賴的package包/類
@Override
public void createControl(Composite parent)
{
initializeDialogUnits(parent);
final Composite composite = new Composite(parent, SWT.NULL);
composite.setFont(parent.getFont());
composite.setLayout(initGridLayout(new GridLayout(1, false), true));
composite.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
// create UI elements
Control nameControl = createNameControl(composite);
nameControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
Control locationControl = createLocationControl(composite);
locationControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
Control workingSetControl = createWorkingSetControl(composite);
workingSetControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
Control infoControl = createInfoControl(composite);
infoControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
setControl(composite);
}
示例4: createButtonBar
import org.eclipse.swt.widgets.Composite; //導入方法依賴的package包/類
@Override
protected Control createButtonBar(Composite parent) {
Composite composite = new Composite(parent, SWT.NONE);
// create a layout with spacing and margins appropriate for the font
// size.
GridLayout layout = new GridLayout();
layout.numColumns = 0; // this is incremented by createButton
layout.makeColumnsEqualWidth = true;
layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN );
layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN - 4);
layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING -2);
composite.setLayout(layout);
GridData data = new GridData(GridData.HORIZONTAL_ALIGN_END
| GridData.VERTICAL_ALIGN_CENTER);
composite.setLayoutData(data);
composite.setFont(parent.getFont());
// Add the buttons to the button bar.
createButtonsForButtonBar(composite);
return composite;
}
示例5: createControl
import org.eclipse.swt.widgets.Composite; //導入方法依賴的package包/類
@Override
public void createControl(Composite parent) {
initializeDialogUnits(parent);
final Composite composite= new Composite(parent, SWT.NULL);
composite.setFont(parent.getFont());
composite.setLayout(initGridLayout(new GridLayout(1, false), true));
composite.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
// create UI elements
Control nameControl= createNameControl(composite);
nameControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
Control locationControl= createLocationControl(composite);
locationControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
Control infoControl= createInfoControl(composite);
infoControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
setControl(composite);
}
示例6: createComposite
import org.eclipse.swt.widgets.Composite; //導入方法依賴的package包/類
@SuppressWarnings("javadoc")
public static Composite createComposite(Composite parent, Font font, int columns, int hspan, int fill) {
Composite g = new Composite(parent, SWT.NONE);
g.setLayout(new GridLayout(columns, false));
g.setFont(font);
GridData gd = new GridData(fill);
gd.horizontalSpan = hspan;
g.setLayoutData(gd);
return g;
}
示例7: createDestinationGroup
import org.eclipse.swt.widgets.Composite; //導入方法依賴的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
}
示例8: createControl
import org.eclipse.swt.widgets.Composite; //導入方法依賴的package包/類
/**
* (non-Javadoc) Method declared on IDialogPage.
*/
@Override
public void createControl(Composite parent) {
initializeDialogUnits(parent);
Composite composite = new Composite(parent, SWT.NULL);
composite.setLayout(new GridLayout());
composite.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_FILL
| GridData.HORIZONTAL_ALIGN_FILL));
composite.setFont(parent.getFont());
createExportGoups(composite);
restoreWidgetValues(); // ie.- subclass hook
if (initialResourceSelection != null) {
setupBasedOnInitialSelections();
}
updateWidgetEnablements();
setPageComplete(determinePageCompletion());
setErrorMessage(null); // should not initially have error message
setControl(composite);
giveFocusToDestination();
}
示例9: createControl
import org.eclipse.swt.widgets.Composite; //導入方法依賴的package包/類
/**
* (non-Javadoc) Method declared on IDialogPage.
*/
@Override
public void createControl(Composite parent) {
initializeDialogUnits(parent);
Composite composite = new Composite(parent, SWT.NULL);
composite.setLayout(new GridLayout());
composite.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_FILL
| GridData.HORIZONTAL_ALIGN_FILL));
composite.setFont(parent.getFont());
// createResourcesGroup(composite); // unwanted.
createChoiceListGroup(composite);
// createButtonsGroup(composite); // unwanted.
createDestinationGroup(composite);
createOptionsGroup(composite);
restoreResourceSpecificationWidgetValues();
restoreWidgetValues();
setupBasedOnInitialSelections();
createErrorGroup(composite);
setControl(composite);
updateWidgetEnablements();
updatePageCompletion();
}
示例10: createErrorGroup
import org.eclipse.swt.widgets.Composite; //導入方法依賴的package包/類
/**
* @param parent
* @param composite
*/
private void createErrorGroup(Composite parent) {
Composite errorGroup = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout();
layout.numColumns = 1;
errorGroup.setLayout(layout);
errorGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
errorGroup.setFont(parent.getFont());
errorText = new Text(errorGroup, SWT.READ_ONLY | SWT.WRAP | SWT.MULTI | SWT.BORDER);
errorText.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
errorText.setText("asldfjlasjflkj");
}
示例11: createErrorGroup
import org.eclipse.swt.widgets.Composite; //導入方法依賴的package包/類
private void createErrorGroup(Composite parent) {
Composite errorGroup = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout();
layout.numColumns = 1;
errorGroup.setLayout(layout);
errorGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
errorGroup.setFont(parent.getFont());
errorText = new StyledText(errorGroup, SWT.READ_ONLY | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL);
errorText.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
}
示例12: createComposite
import org.eclipse.swt.widgets.Composite; //導入方法依賴的package包/類
@SuppressWarnings("javadoc")
protected static Composite createComposite(Composite parent, Font font, int columns, int hspan, int fill) {
Composite g = new Composite(parent, SWT.NONE);
g.setLayout(new GridLayout(columns, false));
g.setFont(font);
GridData gd = new GridData(fill);
gd.horizontalSpan = hspan;
g.setLayoutData(gd);
return g;
}
示例13: createControl
import org.eclipse.swt.widgets.Composite; //導入方法依賴的package包/類
@Override
public void createControl(Composite parent)
{
initializeDialogUnits(parent);
final Composite composite = new Composite(parent, SWT.NULL);
composite.setFont(parent.getFont());
composite.setLayout(initGridLayout(new GridLayout(1, false), true));
composite.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
// create UI elements
Control nameControl = createNameControl(composite);
nameControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
Control locationControl = createLocationControl(composite);
locationControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
Control registryControl = registry.createContent(composite);
registryControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
Control equellaControl = equella.createContent(composite);
equellaControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
Control workingSetControl = createWorkingSetControl(composite);
workingSetControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
Control infoControl = createInfoControl(composite);
infoControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
setControl(composite);
}
示例14: createControl
import org.eclipse.swt.widgets.Composite; //導入方法依賴的package包/類
@Override
public void createControl(Composite parent) {
Composite comp = new Composite(parent, SWT.NONE);
setControl(comp);
PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), getHelpContextId());
comp.setLayout(new GridLayout(1, true));
comp.setFont(parent.getFont());
createVerticalSpacer(comp, 3);
createDebugAdapterComponent(comp);
createDebugJSonComponent(comp);
}
示例15: createControl
import org.eclipse.swt.widgets.Composite; //導入方法依賴的package包/類
/**
* (non-Javadoc) Method declared on IDialogPage.
*/
public void createControl(Composite parent) {
initializeDialogUnits(parent);
// top level group
Composite topLevel = new Composite(parent, SWT.NONE);
topLevel.setLayout(new GridLayout());
topLevel.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_FILL
| GridData.HORIZONTAL_ALIGN_FILL));
topLevel.setFont(parent.getFont());
PlatformUI.getWorkbench().getHelpSystem()
.setHelp(topLevel, IIDEHelpContextIds.NEW_FILE_WIZARD_PAGE);
// resource and container group
resourceGroup = new ResourceAndContainerGroup(topLevel, this,
getNewFileLabel(),
IDEWorkbenchMessages.WizardNewFileCreationPage_file, false,
SIZING_CONTAINER_GROUP_HEIGHT);
resourceGroup.setAllowExistingResources(initialAllowExistingResources);
initialPopulateContainerNameField();
createAdvancedControls(topLevel);
if (initialFileName != null) {
resourceGroup.setResource(initialFileName);
}
if (initialFileExtension != null) {
resourceGroup.setResourceExtension(initialFileExtension);
}
validatePage();
// Show description on opening
setErrorMessage(null);
setMessage(null);
setControl(topLevel);
}