Java Code Examples for org.eclipse.jface.layout.PixelConverter#convertHeightInCharsToPixels()

The following examples show how to use org.eclipse.jface.layout.PixelConverter#convertHeightInCharsToPixels() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JavaEditorCodeMiningConfigurationBlock.java    From jdt-codemining with Eclipse Public License 1.0 6 votes vote down vote up
@Override
protected Control createContents(Composite parent) {
	fPixelConverter = new PixelConverter(parent);
	setShell(parent.getShell());

	Composite mainComp = new Composite(parent, SWT.NONE);
	mainComp.setFont(parent.getFont());
	GridLayout layout = new GridLayout();
	layout.marginHeight = 0;
	layout.marginWidth = 0;
	mainComp.setLayout(layout);

	createIgnoreOptionalProblemsLink(mainComp);

	Composite spacer = new Composite(mainComp, SWT.NONE);
	spacer.setLayoutData(new GridData(0, 0));

	Composite commonComposite = createStyleTabContent(mainComp);
	GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
	gridData.heightHint = fPixelConverter.convertHeightInCharsToPixels(30);
	commonComposite.setLayoutData(gridData);

	validateSettings(null, null, null);

	return mainComp;
}
 
Example 2
Source File: ProblemSeveritiesConfigurationBlock.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
@Override
protected Control createContents(Composite parent) {
	fPixelConverter= new PixelConverter(parent);
	setShell(parent.getShell());

	Composite mainComp= new Composite(parent, SWT.NONE);
	mainComp.setFont(parent.getFont());
	GridLayout layout= new GridLayout();
	layout.marginHeight= 0;
	layout.marginWidth= 0;
	mainComp.setLayout(layout);

	createIgnoreOptionalProblemsLink(mainComp);
	
	Composite spacer= new Composite(mainComp, SWT.NONE);
	spacer.setLayoutData(new GridData(0, 0));
	
	Composite commonComposite= createStyleTabContent(mainComp);
	GridData gridData= new GridData(SWT.FILL, SWT.FILL, true, true);
	gridData.heightHint= fPixelConverter.convertHeightInCharsToPixels(30);
	commonComposite.setLayoutData(gridData);

	validateSettings(null, null, null);

	return mainComp;
}
 
Example 3
Source File: JavaBuildConfigurationBlock.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
@Override
protected Control createContents(Composite parent) {
	fPixelConverter= new PixelConverter(parent);
	setShell(parent.getShell());

	Composite mainComp= new Composite(parent, SWT.NONE);
	mainComp.setFont(parent.getFont());
	GridLayout layout= new GridLayout();
	layout.marginHeight= 0;
	layout.marginWidth= 0;
	mainComp.setLayout(layout);

	Composite othersComposite= createBuildPathTabContent(mainComp);
	GridData gridData= new GridData(GridData.FILL, GridData.FILL, true, true);
	gridData.heightHint= fPixelConverter.convertHeightInCharsToPixels(20);
	othersComposite.setLayoutData(gridData);

	validateSettings(null, null, null);

	return mainComp;
}
 
Example 4
Source File: HintTextGroup.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
public Composite createControl(Composite parent) {
    fTopComposite= new Composite(parent, SWT.NONE);
    fTopComposite.setFont(parent.getFont());

    GridData gridData= new GridData(GridData.FILL_BOTH);
    PixelConverter converter= new PixelConverter(parent);
    gridData.heightHint= converter.convertHeightInCharsToPixels(12);
    gridData.widthHint= converter.convertWidthInCharsToPixels(25);
    GridLayout gridLayout= new GridLayout();
    gridLayout.marginWidth= 0;//-converter.convertWidthInCharsToPixels(2);
    gridLayout.marginHeight= 0;//= -4;
    fTopComposite.setLayout(gridLayout);
    fTopComposite.setLayoutData(gridData);
    fTopComposite.setData(null);
    fTopComposite.addDisposeListener(new DisposeListener() {
        public void widgetDisposed(DisposeEvent e) {
            Collection<Image> collection= fImageMap.values();
            Iterator<Image> iterator= collection.iterator();
            while(iterator.hasNext()) {
                Image image= iterator.next();
                image.dispose();
            }
        }
    });
    return fTopComposite;
}
 
Example 5
Source File: AbstractGeneratorConfigurationBlock.java    From sarl with Apache License 2.0 6 votes vote down vote up
@Override
protected Control doCreateContents(Composite parent) {
	final PixelConverter pixelConverter = new PixelConverter(parent);
	setShell(parent.getShell());
	final Composite mainComp = new Composite(parent, SWT.NONE);
	mainComp.setFont(parent.getFont());
	final GridLayout layout = new GridLayout();
	layout.marginHeight = 0;
	layout.marginWidth = 0;
	mainComp.setLayout(layout);
	final Composite othersComposite = createGeneratorContent(mainComp);
	final GridData gridData = new GridData(GridData.FILL, GridData.FILL, true, true);
	gridData.heightHint = pixelConverter.convertHeightInCharsToPixels(HEIGHT);
	othersComposite.setLayoutData(gridData);
	validateSettings(null, null, null);
	return mainComp;
}
 
Example 6
Source File: ExpandWithConstructorsConfigurationBlock.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Create a list dialog field.
 *
 * @param parent the composite
 */
private void createPreferenceList(Composite parent) {
	String[] buttonLabels= new String[] {
			CallHierarchyMessages.ExpandWithConstructorsConfigurationBlock_newType_button,
			CallHierarchyMessages.ExpandWithConstructorsConfigurationBlock_newMember_button,
			CallHierarchyMessages.ExpandWithConstructorsConfigurationBlock_edit_button,
			CallHierarchyMessages.ExpandWithConstructorsConfigurationBlock_remove_button,
			CallHierarchyMessages.ExpandWithConstructorsConfigurationBlock_restoreDefaults_button
	};

	ListAdapter adapter= new ListAdapter();

	fList= new ListDialogField<String>(adapter, buttonLabels, new ListLabelProvider());
	fList.setDialogFieldListener(adapter);
	fList.setLabelText(CallHierarchyMessages.ExpandWithConstructorsConfigurationBlock_description);
	fList.setRemoveButtonIndex(IDX_REMOVE);
	fList.enableButton(IDX_EDIT, false);
	fList.setViewerComparator(new ViewerComparator());

	PixelConverter pixelConverter= new PixelConverter(parent);

	fList.doFillIntoGrid(parent, 3);
	LayoutUtil.setHorizontalSpan(fList.getLabelControl(null), 2);
	LayoutUtil.setWidthHint(fList.getLabelControl(null), pixelConverter.convertWidthInCharsToPixels(60));
	LayoutUtil.setHorizontalGrabbing(fList.getListControl(null));

	Control listControl= fList.getListControl(null);
	GridData gd= (GridData)listControl.getLayoutData();
	gd.verticalAlignment= GridData.FILL;
	gd.grabExcessVerticalSpace= true;
	gd.heightHint= pixelConverter.convertHeightInCharsToPixels(10);
}
 
Example 7
Source File: SmartTypingConfigurationBlock.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Adds the Smart Insert Mode note to the preference page.
 * 
 * @param parent the parent composite
 * @since 3.7
 */
private void addSmartInsertModeMessage(Composite parent) {
	Label label= new Label(parent, SWT.LEAD | SWT.WRAP);
	label.setText(PreferencesMessages.JavaEditorPreferencePage_smartInsertMode_message);

	PixelConverter pixelConverter= new PixelConverter(parent);
	Label fillerLabel= new Label(parent, SWT.LEFT);
	GridData gridData= new GridData(GridData.HORIZONTAL_ALIGN_FILL);
	gridData.horizontalSpan= 2;
	gridData.heightHint= pixelConverter.convertHeightInCharsToPixels(1) / 2;
	fillerLabel.setLayoutData(gridData);
}
 
Example 8
Source File: PropertiesFileEditorPreferencePage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
private void addFiller(Composite composite) {
	PixelConverter pixelConverter= new PixelConverter(composite);

	Label filler= new Label(composite, SWT.LEFT );
	GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL);
	gd.horizontalSpan= 2;
	gd.heightHint= pixelConverter.convertHeightInCharsToPixels(1) / 2;
	filler.setLayoutData(gd);
}
 
Example 9
Source File: JavaEditorAppearanceConfigurationBlock.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
private void addFiller(Composite composite) {
	PixelConverter pixelConverter= new PixelConverter(composite);

	Label filler= new Label(composite, SWT.LEFT );
	GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL);
	gd.horizontalSpan= 2;
	gd.heightHint= pixelConverter.convertHeightInCharsToPixels(1) / 2;
	filler.setLayoutData(gd);
}
 
Example 10
Source File: JavaEditorHoverConfigurationBlock.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
private void addFiller(Composite composite) {
	PixelConverter pixelConverter= new PixelConverter(composite);
	Label filler= new Label(composite, SWT.LEFT );
	GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL);
	gd.horizontalSpan= 2;
	gd.heightHint= pixelConverter.convertHeightInCharsToPixels(1) / 2;
	filler.setLayoutData(gd);
}
 
Example 11
Source File: MarkOccurrencesConfigurationBlock.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
private void addFiller(Composite composite) {
	PixelConverter pixelConverter= new PixelConverter(composite);

	Label filler= new Label(composite, SWT.LEFT );
	GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL);
	gd.horizontalSpan= 2;
	gd.heightHint= pixelConverter.convertHeightInCharsToPixels(1) / 2;
	filler.setLayoutData(gd);
}
 
Example 12
Source File: JavaEditorColoringConfigurationBlock.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
private void addFiller(Composite composite, int horizontalSpan) {
	PixelConverter pixelConverter= new PixelConverter(composite);
	Label filler= new Label(composite, SWT.LEFT );
	GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL);
	gd.horizontalSpan= horizontalSpan;
	gd.heightHint= pixelConverter.convertHeightInCharsToPixels(1) / 2;
	filler.setLayoutData(gd);
}
 
Example 13
Source File: SyntaxColoringPreferencePage.java    From editorconfig-eclipse with Apache License 2.0 5 votes vote down vote up
private void addFiller(Composite composite) {
	PixelConverter pixelConverter = new PixelConverter(composite);

	Label filler = new Label(composite, SWT.LEFT);
	GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
	gd.horizontalSpan = 2;
	gd.heightHint = pixelConverter.convertHeightInCharsToPixels(1) / 2;
	filler.setLayoutData(gd);
}
 
Example 14
Source File: PyEditorHoverConfigurationBlock.java    From Pydev with Eclipse Public License 1.0 5 votes vote down vote up
private void addFiller(Composite composite) {
    PixelConverter pixelConverter = new PixelConverter(composite);
    Label filler = new Label(composite, SWT.LEFT);
    GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
    gd.horizontalSpan = 2;
    gd.heightHint = pixelConverter.convertHeightInCharsToPixels(1) / 2;
    filler.setLayoutData(gd);
}