org.eclipse.swt.widgets.Composite#getFont ( )源码实例Demo

下面列出了org.eclipse.swt.widgets.Composite#getFont ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: xds-ide   文件: LauncherTabArguments.java
@Override
public void createControl(Composite parent) {
	Font font = parent.getFont();
	Composite comp = new Composite(parent, SWT.NONE);
	GridLayout layout = new GridLayout(1, true);
	comp.setLayout(layout);
	comp.setFont(font);
	
	GridData gd = new GridData(GridData.FILL_BOTH);
	comp.setLayoutData(gd);
	setControl(comp);

               argsCmdline = new ArgumentsBlock(Messages.LauncherTabArguments_ProgramArgs+':');
	
	argsCmdline.createControl(comp);
	
	fWorkingDirectoryBlock.createControl(comp);		
}
 
源代码2 项目: tracecompass   文件: NewExperimentDialog.java
private void createExperimentNameGroup(Composite parent) {
    Font font = parent.getFont();
    Composite folderGroup = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.numColumns = 2;
    folderGroup.setLayout(layout);
    folderGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    // New experiment label
    Label experimentLabel = new Label(folderGroup, SWT.NONE);
    experimentLabel.setFont(font);
    experimentLabel.setText(Messages.NewExperimentDialog_ExperimentName);

    // New experiment name entry field
    fExperimentName = new Text(folderGroup, SWT.BORDER);
    GridData data = new GridData(GridData.FILL_HORIZONTAL);
    data.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH;
    fExperimentName.setLayoutData(data);
    fExperimentName.setFont(font);
    fExperimentName.addListener(SWT.Modify, event -> validateNewExperimentName());
}
 
源代码3 项目: Pydev   文件: AppEngineConfigWizardPage.java
@Override
public void createControl(Composite parent) {

    Font font = parent.getFont();

    Composite composite = new Composite(parent, SWT.NONE);
    composite.setLayout(new GridLayout());
    composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    composite.setFont(font);

    // App Engine specification group
    Composite appEngineGroup = new Composite(composite, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.numColumns = 3;
    appEngineGroup.setLayout(layout);
    appEngineGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    appEngineGroup.setFont(font);

    createUserSpecifiedGoogleAppEngineLocationGroup(appEngineGroup);

    tree = new Tree(composite, SWT.SINGLE | SWT.BORDER);
    tree.setLayoutData(new GridData(GridData.FILL_BOTH));
    tree.setFont(font);

    setControl(composite);
}
 
源代码4 项目: EasyShell   文件: CommandDataDialog.java
private void createVariablesOverview(Composite parent) {
    Font font = parent.getFont();
    Group pageGroup2 = new Group(parent, SWT.SHADOW_ETCHED_IN);
    pageGroup2.setText(Activator.getResourceString("easyshell.command.editor.dialog.title.group2"));
    pageGroup2.setToolTipText(Activator.getResourceString("easyshell.command.editor.dialog.tooltip.group2"));
    GridLayout layout2 = new GridLayout();
    layout2.numColumns = 2;
    layout2.makeColumnsEqualWidth = false;
    layout2.marginWidth = 5;
    layout2.marginHeight = 4;
    pageGroup2.setLayout(layout2);
    GridData data2 = new GridData(GridData.FILL_HORIZONTAL);
    pageGroup2.setLayoutData(data2);
    pageGroup2.setFont(font);
    // create variable labels
    for(int i=Variable.getFirstIndex();i<Variable.values().length;i++) {
        Variable var = Variable.values()[i];
        if (var.isVisible()) {
            createVariableLabel(pageGroup2, var.getFullVariableName(), ": " + var.getDescription());
        }
    }
}
 
源代码5 项目: EasyShell   文件: CommandDataDialog.java
private void createConvertersOverview(Composite parent) {
    Font font = parent.getFont();
    Group pageGroup3 = new Group(parent, SWT.SHADOW_ETCHED_IN);
    pageGroup3.setText(Activator.getResourceString("easyshell.command.editor.dialog.title.group3"));
    pageGroup3.setToolTipText(Activator.getResourceString("easyshell.command.editor.dialog.tooltip.group3"));
    GridLayout layout3 = new GridLayout();
    layout3.numColumns = 2;
    layout3.makeColumnsEqualWidth = false;
    layout3.marginWidth = 5;
    layout3.marginHeight = 4;
    pageGroup3.setLayout(layout3);
    GridData data3 = new GridData(GridData.FILL_HORIZONTAL);
    pageGroup3.setLayoutData(data3);
    pageGroup3.setFont(font);
    // create converters labels
    for(int i=Converter.getFirstIndex();i<Converter.values().length;i++) {
        Converter conv = Converter.values()[i];
        if (conv.isVisible()) {
            createVariableLabel(pageGroup3, conv.getName(), ": " + conv.getDescription());
        }
    }
}
 
源代码6 项目: EasyShell   文件: MenuPage.java
private void createButtons(Composite pageComponent) {
    Font font = pageComponent.getFont();
    // button pageComponent
    Composite groupComponent = new Composite(pageComponent, SWT.NULL);
    GridLayout groupLayout = new GridLayout();
    groupLayout.marginWidth = 0;
    groupLayout.marginHeight = 0;
    groupComponent.setLayout(groupLayout);
    GridData gridData = new GridData();
    gridData.verticalAlignment = GridData.FILL;
    gridData.horizontalAlignment = GridData.FILL;
    groupComponent.setLayoutData(gridData);
    groupComponent.setFont(font);

    // buttons
    createNewButton(font, gridData, groupComponent);
    createEditButton(font, gridData, groupComponent);
    createCopyButton(font, gridData, groupComponent);
    createRemoveButton(font, gridData, groupComponent);
    createUpButton(font, gridData, groupComponent);
    createDownButton(font, gridData, groupComponent);
}
 
源代码7 项目: EasyShell   文件: CommandPage.java
private void createButtons(Composite pageComponent) {
    Font font = pageComponent.getFont();
    // button pageComponent
    Composite groupComponent = new Composite(pageComponent, SWT.NULL);
    GridLayout groupLayout = new GridLayout();
    groupLayout.marginWidth = 0;
    groupLayout.marginHeight = 0;
    groupComponent.setLayout(groupLayout);
    GridData gridData = new GridData();
    gridData.verticalAlignment = GridData.FILL;
    gridData.horizontalAlignment = GridData.FILL;
    groupComponent.setLayoutData(gridData);
    groupComponent.setFont(font);

    // buttons
    createNewButton(font, gridData, groupComponent);
    createEditButton(font, gridData, groupComponent);
    createCopyButton(font, gridData, groupComponent);
    createRemoveButton(font, gridData, groupComponent);
}
 
源代码8 项目: n4js   文件: LaunchConfigurationMainTab.java
/**
 * @see org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(org.eclipse.swt.widgets.Composite)
 **/
@Override
public void createControl(Composite parent) {
	Font font = parent.getFont();
	Composite comp = createComposite(parent, font, 1, 1, GridData.FILL_BOTH);
	createFileGroup(comp);
	setControl(comp);

}
 
源代码9 项目: n4js   文件: AbstractLaunchConfigurationMainTab.java
/**
 * @see org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(org.eclipse.swt.widgets.Composite)
 */
@Override
public void createControl(Composite parent) {
	Font font = parent.getFont();
	Composite comp = createComposite(parent, font, 1, 1, GridData.FILL_BOTH);
	createResourceGroup(comp);
	createImplementationIdGroup(comp);
	setControl(comp);
}
 
源代码10 项目: Pydev   文件: WorkingDirectoryBlock.java
@Override
public void createControl(Composite parent) {
    Font font = parent.getFont();
    Group group = createGroup(parent, "Working directory:", 2, 1, GridData.FILL_HORIZONTAL);
    setControl(group);
    // PlatformUI.getWorkbench().getHelpSystem().setHelp(group, IJavaDebugHelpContextIds.WORKING_DIRECTORY_BLOCK);
    //default choice
    Composite comp = createComposite(group, font, 2, 2, GridData.FILL_BOTH, 0, 0);
    fUseDefaultDirButton = createRadioButton(comp, "Default:");
    fUseDefaultDirButton.addSelectionListener(fListener);
    fWorkingDirText = createSingleText(comp, 1);
    fWorkingDirText.addModifyListener(fListener);
    fWorkingDirText.setEditable(false);
    //user enter choice
    fUseOtherDirButton = createRadioButton(comp, "Other:");
    fUseOtherDirButton.addSelectionListener(fListener);
    fOtherWorkingText = createSingleText(comp, 1);
    fOtherWorkingText.addModifyListener(fListener);
    //buttons
    Composite buttonComp = createComposite(comp, font, 3, 2, GridData.HORIZONTAL_ALIGN_END);
    GridLayout ld = (GridLayout) buttonComp.getLayout();
    ld.marginHeight = 1;
    ld.marginWidth = 0;
    fWorkspaceButton = createPushButton(buttonComp, "Workspace...", null);
    fWorkspaceButton.addSelectionListener(fListener);
    fFileSystemButton = createPushButton(buttonComp, "File System...", null);
    fFileSystemButton.addSelectionListener(fListener);
    fVariablesButton = createPushButton(buttonComp, "Variables...", null);
    fVariablesButton.addSelectionListener(fListener);
}
 
/**
 * Creates the project location specification controls.
 *
 * @param projectGroup the parent composite
 * @param enabled the initial enabled state of the widgets created
 */
private void createUserSpecifiedProjectLocationGroup(Composite projectGroup, boolean enabled) {
    Font font = projectGroup.getFont();
    // location label
    locationLabel = new Label(projectGroup, SWT.NONE);
    locationLabel.setFont(font);
    locationLabel.setText("Director&y");
    locationLabel.setEnabled(enabled);

    // project location entry field
    locationPathField = new Text(projectGroup, SWT.BORDER);
    GridData data = new GridData(GridData.FILL_HORIZONTAL);
    data.widthHint = SIZING_TEXT_FIELD_WIDTH;
    locationPathField.setLayoutData(data);
    locationPathField.setFont(font);
    locationPathField.setEnabled(enabled);

    // browse button
    browseButton = new Button(projectGroup, SWT.PUSH);
    browseButton.setFont(font);
    browseButton.setText("B&rowse");
    browseButton.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent event) {
            handleLocationBrowseButtonPressed();
        }
    });

    browseButton.setEnabled(enabled);

    // Set the initial value first before listener
    // to avoid handling an event during the creation.
    if (initialLocationFieldValue != null) {
        locationPathField.setText(initialLocationFieldValue.toOSString());
    }
    locationPathField.addListener(SWT.Modify, locationModifyListener);
}
 
/**
 * Create the export destination specification widgets
 * @param parent
 *            org.eclipse.swt.widgets.Composite
 */
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(getDestinationLabel());
	destinationLabel.setFont(font);

	// destination name entry field
	destinationNameField = new Text(destinationSelectionGroup, 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(DataTransferMessages.DataTransfer_browse);
	destinationBrowseButton.addListener(SWT.Selection, this);
	destinationBrowseButton.setFont(font);
	setButtonLayoutData(destinationBrowseButton);

	new Label(parent, SWT.NONE); // vertical spacer
}
 
源代码13 项目: EasyShell   文件: MenuDataDialog.java
private void createCopyButton(Composite parent) {
    Font font = parent.getFont();
    addCopyButton = new Button(parent, SWT.PUSH);
    addCopyButton.setText(Activator.getResourceString("easyshell.menu.editor.dialog.button.text.copy"));
    addCopyButton.setToolTipText(Activator.getResourceString("easyshell.menu.editor.dialog.button.tooltip.copy"));
    addCopyButton.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent event) {
            addCopyDialog();
        }
    });
    addCopyButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    addCopyButton.setFont(font);
    setButtonLayoutData(addCopyButton);
}
 
@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);

    destinationLabel = new Label(destinationSelectionGroup, SWT.NONE);
    destinationLabel.setText(getDestinationLabel());
    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, "file"); //$NON-NLS-1$

    // 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
}
 
源代码15 项目: tracecompass   文件: TrimTraceDialog.java
private void createNewTraceNameGroup(Composite parent) {
    setStatusLineAboveButtons(true);
    Font font = parent.getFont();
    Composite folderGroup = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.numColumns = 2;
    folderGroup.setLayout(layout);
    folderGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    String name = fElement.getName();

    // New trace name label
    Label newTaceLabel = new Label(folderGroup, SWT.NONE);
    newTaceLabel.setFont(font);
    newTaceLabel.setText(Messages.RenameTraceDialog_TraceNewName);

    // New trace name entry field

    GridData data = new GridData(GridData.FILL_HORIZONTAL);
    data.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH;
    Text newElementName = new Text(folderGroup, SWT.BORDER);
    newElementName.setLayoutData(data);
    newElementName.setFont(font);
    newElementName.setFocus();
    newElementName.setText(name);
    newElementName.setSelection(0, name.length());
    newElementName.addListener(SWT.Modify, event -> validateNewTraceName());
    fNewElementName = newElementName;
    validateNewTraceName();
}
 
源代码16 项目: tracecompass   文件: Histogram.java
private static Font adjustFont(final Composite composite) {
    // Reduce font size for a more pleasing rendering
    final int fontSizeAdjustment = -2;
    final Font font = composite.getFont();
    final FontData fontData = font.getFontData()[0];
    return new Font(font.getDevice(), fontData.getName(), fontData.getHeight() + fontSizeAdjustment, fontData.getStyle());
}
 
源代码17 项目: EasyShell   文件: MenuDataDialog.java
public Composite createPageComponent(Composite parent) {
    Font font = parent.getFont();
    Composite pageComponent = new Composite(parent,SWT.NULL);
    GridLayout layoutComponent = new GridLayout();
    layoutComponent.numColumns = 1;
    layoutComponent.makeColumnsEqualWidth = false;
    layoutComponent.marginWidth = 5;
    layoutComponent.marginHeight = 4;
    pageComponent.setLayout(layoutComponent);
    GridData gridDataComponent = new GridData(GridData.FILL_HORIZONTAL);
    gridDataComponent.widthHint = 640;
    pageComponent.setLayoutData(gridDataComponent);
    pageComponent.setFont(font);
    return pageComponent;
}
 
源代码18 项目: birt   文件: NewReportPageSupport.java
/**
 * Creates the project location specification controls.
 * 
 * @param group
 *            the parent composite
 * @param enabled
 *            the initial enabled state of the widgets created
 */
private void createUserSpecifiedProjectLocationGroup( Composite group,
		boolean enabled )
{
	Font font = group.getFont( );

	// location label
	locationLabel = new Label( group, SWT.NONE );
	locationLabel.setText( LABEL_DIRECTORY );
	locationLabel.setEnabled( enabled );
	locationLabel.setFont( font );

	// file location entry field
	locationPathField = new Text( group, SWT.BORDER );
	GridData data = new GridData( GridData.FILL_HORIZONTAL );
	data.widthHint = 250;
	locationPathField.setLayoutData( data );
	locationPathField.setEnabled( enabled );
	locationPathField.setFont( font );

	// browse button
	browseButton = new Button( group, SWT.PUSH );
	browseButton.setText( LABEL_BROWSE );
	browseButton.addSelectionListener( new SelectionAdapter( ) {

		public void widgetSelected( SelectionEvent event )
		{
			handleLocationBrowseButtonPressed( );
		}
	} );

	browseButton.setEnabled( enabled );
	browseButton.setFont( font );
	setButtonLayoutData( browseButton );

	if ( defaultFileLocation != null )
	{
		locationPathField.setText( defaultFileLocation );
	}
	else
	{
		locationPathField.setText( "" );//$NON-NLS-1$
	}
}
 
源代码19 项目: birt   文件: FolderSelectionGroup.java
/**
 * Create group
 * 
 * @param parent
 */
public void create( Composite parent )
{
	// get font
	Font font = parent.getFont( );

	// label control
	Label label = new Label( parent, SWT.LEFT );
	label.setFont( font );
	label.setText( this.labelText );

	Composite composite = new Composite( parent, SWT.NULL );
	GridLayout layout = new GridLayout( );
	layout.marginWidth = 0;
	layout.marginHeight = 0;
	layout.numColumns = 2;
	composite.setLayout( layout );

	GridData data = new GridData( GridData.FILL_HORIZONTAL );
	composite.setLayoutData( data );

	// text control
	text = new Text( composite, SWT.BORDER );
	text.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
	text.setFont( font );
	text.setText( this.textValue );
	text.addVerifyListener( new VerifyListener( ) {

		public void verifyText( VerifyEvent e )
		{
			e.doit = e.text.indexOf( DELIMITER ) < 0;
		}
	} );

	// directory selection button
	button = new Button( composite, SWT.PUSH );
	button.setFont( font );
	button.setText( this.buttonText );
	button.addSelectionListener( new SelectionAdapter( ) {

		public void widgetSelected( SelectionEvent event )
		{
			dialog = new DirectoryDialog( PlatformUI.getWorkbench( )
					.getDisplay( ).getActiveShell( ) );

			dialog.setText( dialogTitle );
			dialog.setMessage( dialogMessage );
			dialog.setFilterPath( dialogFilterPath );
			String folderName = dialog.open( );
			if ( folderName == null )
			{
				return;
			}
			text.setText( folderName );
		}
	} );
}
 
源代码20 项目: translationstudio8   文件: NewFolderDialogOfHs.java
/**
		 * Creates the folder name specification controls.
		 *
		 * @param parent the parent composite
		 */
		private void createFolderNameGroup(Composite parent) {
			Font font = parent.getFont();
			// project specification group
			Composite folderGroup = new Composite(parent, SWT.NONE);
			GridLayout layout = new GridLayout();
			layout.numColumns = 2;
			folderGroup.setLayout(layout);
			folderGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

			// new folder label
			Label folderLabel = new Label(folderGroup, SWT.NONE);
			folderLabel.setFont(font);
			folderLabel.setText(IDEWorkbenchMessages.NewFolderDialog_nameLabel);

			// new folder name entry field
			folderNameField = new Text(folderGroup, SWT.BORDER);
			GridData data = new GridData(GridData.FILL_HORIZONTAL);
			data.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH;
			folderNameField.setLayoutData(data);
			folderNameField.setFont(font);
			folderNameField.addListener(SWT.Modify, new Listener() {
				public void handleEvent(Event event) {
					validateLinkedResource();
				}
			});
		}