Example usage for org.eclipse.jface.dialogs Dialog applyDialogFont

List of usage examples for org.eclipse.jface.dialogs Dialog applyDialogFont

Introduction

In this page you can find the example usage for org.eclipse.jface.dialogs Dialog applyDialogFont.

Prototype

public static void applyDialogFont(Control control) 

Source Link

Document

Applies the dialog font to all controls that currently have the default font.

Usage

From source file:ext.org.eclipse.jdt.internal.ui.refactoring.nls.NLSAccessorConfigurationDialog.java

License:Open Source License

@Override
protected Control createDialogArea(Composite ancestor) {
    Composite parent = (Composite) super.createDialogArea(ancestor);

    final int nOfColumns = 4;

    initializeDialogUnits(ancestor);//from w w  w .  j  a  v  a2s. co  m

    GridLayout layout = (GridLayout) parent.getLayout();
    layout.numColumns = nOfColumns;
    parent.setLayout(layout);

    createAccessorPart(parent, nOfColumns, convertWidthInCharsToPixels(40));

    Separator s = new Separator(SWT.SEPARATOR | SWT.HORIZONTAL);
    s.doFillIntoGrid(parent, nOfColumns);

    createPropertyPart(parent, nOfColumns, convertWidthInCharsToPixels(40));

    Dialog.applyDialogFont(parent);
    PlatformUI.getWorkbench().getHelpSystem().setHelp(parent,
            IJavaHelpContextIds.EXTERNALIZE_WIZARD_PROPERTIES_FILE_PAGE);
    validateAll();
    return parent;
}

From source file:ext.org.eclipse.jdt.internal.ui.refactoring.PullUpMemberPage.java

License:Open Source License

public void createControl(final Composite parent) {
    final Composite composite = new Composite(parent, SWT.NONE);
    final GridLayout layout = new GridLayout();
    layout.numColumns = 2;//from ww w.  ja  v  a  2  s.  c  o m
    composite.setLayout(layout);

    createSuperTypeControl(composite);
    createSpacer(composite);
    createSuperTypeCheckbox(composite);
    createInstanceOfCheckbox(composite, layout.marginWidth);
    createStubCheckbox(composite);
    createSpacer(composite);
    createMemberTableLabel(composite);
    createMemberTableComposite(composite);
    createStatusLine(composite);

    setControl(composite);
    Dialog.applyDialogFont(composite);
    initializeEnablement();
    initializeCheckboxes();
    PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IJavaHelpContextIds.PULL_UP_WIZARD_PAGE);
}

From source file:ext.org.eclipse.jdt.internal.ui.refactoring.PullUpMethodPage.java

License:Open Source License

public void createControl(final Composite parent) {
    final Composite composite = new Composite(parent, SWT.NONE);
    composite.setLayout(new GridLayout());

    createTreeAndSourceViewer(composite);
    createButtonComposite(composite);/*  www .j ava 2s  . co m*/
    setControl(composite);

    Dialog.applyDialogFont(composite);
    PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IJavaHelpContextIds.PULL_UP_WIZARD_PAGE);
}

From source file:ext.org.eclipse.jdt.internal.ui.refactoring.ReferencesInBinaryStatusContextViewer.java

License:Open Source License

/**
 * {@inheritDoc}/* ww w. j a v  a 2s.  co m*/
 */
public void createControl(Composite parent) {
    fForm = new ViewForm(parent, SWT.BORDER | SWT.FLAT);
    fForm.marginWidth = 0;
    fForm.marginHeight = 0;

    fLabel = new CLabel(fForm, SWT.NONE);
    fLabel.setText(RefactoringMessages.ReferencesInBinaryStatusContextViewer_title);
    fForm.setTopLeft(fLabel);

    Composite composite = new Composite(fForm, SWT.NONE);
    composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    GridLayout layout = new GridLayout(1, false);
    layout.marginWidth = 0;
    layout.marginHeight = 0;
    composite.setLayout(layout);

    fTreeViewer = new TreeViewer(composite, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
    final AppearanceAwareLabelProvider labelProvider = new AppearanceAwareLabelProvider();
    fTreeViewer.setLabelProvider(new DelegatingStyledCellLabelProvider(labelProvider));
    fTreeViewer.setComparator(new ViewerComparator() {
        private Collator fCollator = Collator.getInstance();

        @Override
        public int compare(Viewer viewer, Object e1, Object e2) {
            String l1 = labelProvider.getText(e1);
            String l2 = labelProvider.getText(e2);
            return fCollator.compare(l1, l2);
        }
    });
    fTreeViewer.getTree().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

    fButton = new Button(composite, SWT.PUSH);
    fButton.setText(RefactoringMessages.ReferencesInBinaryStatusContextViewer_show_as_search_button);
    GridData layoutData = new GridData(SWT.BEGINNING, SWT.CENTER, false, false);
    layoutData.widthHint = SWTUtil.getButtonWidthHint(fButton);
    fButton.setLayoutData(layoutData);
    fButton.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            fillInSearchView();
        }
    });
    fButton.setEnabled(false);

    fForm.setContent(composite);

    Dialog.applyDialogFont(parent);
}

From source file:ext.org.eclipse.jdt.internal.ui.refactoring.reorg.RenameInputWizardPage.java

License:Open Source License

public void createControl(Composite parent) {
    Composite superComposite = new Composite(parent, SWT.NONE);
    setControl(superComposite);/*www.  j  a  va 2 s .co  m*/
    initializeDialogUnits(superComposite);
    superComposite.setLayout(new GridLayout());
    Composite composite = new Composite(superComposite, SWT.NONE);
    composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    GridLayout layout = new GridLayout();
    layout.numColumns = 2;
    layout.marginHeight = 0;
    layout.marginWidth = 0;

    composite.setLayout(layout);
    RowLayouter layouter = new RowLayouter(2);

    Label label = new Label(composite, SWT.NONE);
    label.setText(getLabelText());

    Text text = createTextInputField(composite);
    text.selectAll();
    GridData gd = new GridData(GridData.FILL_HORIZONTAL);
    gd.widthHint = convertWidthInCharsToPixels(25);
    text.setLayoutData(gd);

    layouter.perform(label, text, 1);

    Label separator = new Label(composite, SWT.NONE);
    GridData gridData = new GridData(SWT.FILL, SWT.FILL, false, false);
    gridData.heightHint = 2;
    separator.setLayoutData(gridData);

    int indent = convertWidthInCharsToPixels(2);

    addOptionalUpdateReferencesCheckbox(composite, layouter);
    addAdditionalOptions(composite, layouter);
    addOptionalUpdateTextualMatches(composite, layouter);
    addOptionalUpdateQualifiedNameComponent(composite, layouter, indent);
    addOptionalLeaveDelegateCheckbox(composite, layouter);
    addOptionalDeprecateDelegateCheckbox(composite, layouter, indent);
    updateForcePreview();

    Dialog.applyDialogFont(superComposite);
    PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), fHelpContextID);
}

From source file:ext.org.eclipse.jdt.internal.ui.refactoring.reorg.RenameTypeWizardSimilarElementsPage.java

License:Open Source License

public void createControl(Composite parent) {

    ViewForm viewForm = new ViewForm(parent, SWT.BORDER | SWT.FLAT);

    Composite inner = new Composite(viewForm, SWT.NULL);
    GridLayout layout = new GridLayout();
    inner.setLayout(layout);//from w  w  w.j  av a 2 s .com

    createTreeAndSourceViewer(inner);
    createButtonComposite(inner);
    viewForm.setContent(inner);

    setControl(viewForm);

    Dialog.applyDialogFont(viewForm);
    PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(),
            IJavaHelpContextIds.RENAME_TYPE_WIZARD_PAGE);
}

From source file:ext.org.eclipse.jdt.internal.ui.refactoring.sef.SelfEncapsulateFieldInputPage.java

License:Open Source License

public void createControl(Composite parent) {
    fRefactoring = (SelfEncapsulateFieldRefactoring) getRefactoring();

    fEnablements = new ArrayList<Control>();
    loadSettings();/*from  www  .ja  v  a 2  s  .  com*/

    Composite result = new Composite(parent, SWT.NONE);
    setControl(result);
    initializeDialogUnits(result);

    result.setLayout(new GridLayout(3, false));

    Composite nameComposite = new Composite(result, SWT.NONE);
    nameComposite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 3, 1));

    GridLayout gridLayout = new GridLayout(3, false);
    gridLayout.marginHeight = 0;
    gridLayout.marginWidth = 0;

    nameComposite.setLayout(gridLayout);

    Label label = new Label(nameComposite, SWT.LEAD);
    label.setText(RefactoringMessages.SelfEncapsulateFieldInputPage_getter_name);

    fGetterName = new Text(nameComposite, SWT.BORDER);
    fGetterName.setText(fRefactoring.getGetterName());
    TextFieldNavigationHandler.install(fGetterName);
    fGetterName.addModifyListener(new ModifyListener() {
        public void modifyText(ModifyEvent e) {
            doGetterModified();
        }
    });

    GridData gd = new GridData(GridData.FILL_HORIZONTAL);
    gd.widthHint = convertWidthInCharsToPixels(25);
    fGetterName.setLayoutData(gd);

    fGetterInfo = new Label(nameComposite, SWT.LEAD);
    fGetterInfo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    updateUseGetter();

    if (needsSetter()) {
        label = new Label(nameComposite, SWT.LEAD);
        label.setText(RefactoringMessages.SelfEncapsulateFieldInputPage_setter_name);

        fSetterName = new Text(nameComposite, SWT.BORDER);
        fSetterName.setText(fRefactoring.getSetterName());
        fSetterName.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
        fSetterName.addModifyListener(new ModifyListener() {
            public void modifyText(ModifyEvent e) {
                doSetterModified();
            }
        });
        TextFieldNavigationHandler.install(fSetterName);

        fSetterInfo = new Label(nameComposite, SWT.LEAD);
        fSetterInfo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
        updateUseSetter();
    }

    Link link = new Link(nameComposite, SWT.NONE);
    link.setText(RefactoringMessages.SelfEncapsulateFieldInputPage_configure_link);
    link.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            doOpenPreference();
        }
    });
    link.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 3, 1));

    Label separator = new Label(result, SWT.NONE);
    separator.setText(""); //$NON-NLS-1$
    separator.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 3, 1));

    // createSeparator(result, layouter);
    createFieldAccessBlock(result);

    label = new Label(result, SWT.LEFT);
    label.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
    label.setText(RefactoringMessages.SelfEncapsulateFieldInputPage_insert_after);
    fEnablements.add(label);

    final Combo combo = new Combo(result, SWT.READ_ONLY);
    SWTUtil.setDefaultVisibleItemCount(combo);
    fillWithPossibleInsertPositions(combo, fRefactoring.getField());
    combo.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent event) {
            fRefactoring.setInsertionIndex(combo.getSelectionIndex() - 1);
        }
    });
    combo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 2, 1));
    fEnablements.add(combo);

    createAccessModifier(result);

    Button checkBox = new Button(result, SWT.CHECK);
    checkBox.setText(RefactoringMessages.SelfEncapsulateFieldInputPage_generateJavadocComment);
    checkBox.setSelection(fRefactoring.getGenerateJavadoc());
    checkBox.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            setGenerateJavadoc(((Button) e.widget).getSelection());
        }
    });
    checkBox.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 3, 1));

    fEnablements.add(checkBox);

    updateEnablements();

    processValidation();

    fGetterName.setFocus();

    Dialog.applyDialogFont(result);
    PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IJavaHelpContextIds.SEF_WIZARD_PAGE);
}

From source file:ext.org.eclipse.jdt.internal.ui.search.JavaSearchPage.java

License:Open Source License

public void createControl(Composite parent) {
    initializeDialogUnits(parent);//from  www .  j av a  2s  .  c  o  m
    readConfiguration();

    Composite result = new Composite(parent, SWT.NONE);

    GridLayout layout = new GridLayout(2, true);
    layout.horizontalSpacing = 10;
    result.setLayout(layout);

    Control expressionComposite = createExpression(result);
    expressionComposite.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, 2, 1));

    Label separator = new Label(result, SWT.NONE);
    separator.setVisible(false);
    GridData data = new GridData(GridData.FILL, GridData.FILL, false, false, 2, 1);
    data.heightHint = convertHeightInCharsToPixels(1) / 3;
    separator.setLayoutData(data);

    Control searchFor = createSearchFor(result);
    searchFor.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, 1, 1));

    Control limitTo = createLimitTo(result);
    limitTo.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, 1, 1));

    Control includeMask = createIncludeMask(result);
    includeMask.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, 2, 1));

    //createParticipants(result);

    SelectionAdapter javaElementInitializer = new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent event) {
            if (getSearchFor() == fInitialData.getSearchFor())
                fJavaElement = fInitialData.getJavaElement();
            else
                fJavaElement = null;
            setLimitTo(getSearchFor(), getLimitTo());
            setIncludeMask(getIncludeMask());
            doPatternModified();
        }
    };

    for (int i = 0; i < fSearchFor.length; i++) {
        fSearchFor[i].addSelectionListener(javaElementInitializer);
    }

    setControl(result);

    Dialog.applyDialogFont(result);
    PlatformUI.getWorkbench().getHelpSystem().setHelp(result, IJavaHelpContextIds.JAVA_SEARCH_PAGE);
}

From source file:ext.org.eclipse.jdt.internal.ui.search.JavaSearchPage.java

License:Open Source License

private void fillLimitToGroup(int searchFor, int limitTo) {
    Control[] children = fLimitToGroup.getChildren();
    for (int i = 0; i < children.length; i++) {
        children[i].dispose();/*from  www  .jav a  2  s  .  com*/
    }
    fMatchLocationsLink = null;

    ArrayList<Button> buttons = new ArrayList<Button>();
    buttons.add(createButton(fLimitToGroup, SWT.RADIO, SearchMessages.SearchPage_limitTo_allOccurrences,
            ALL_OCCURRENCES, limitTo == ALL_OCCURRENCES));
    buttons.add(createButton(fLimitToGroup, SWT.RADIO, SearchMessages.SearchPage_limitTo_declarations,
            DECLARATIONS, limitTo == DECLARATIONS));

    buttons.add(createButton(fLimitToGroup, SWT.RADIO, SearchMessages.SearchPage_limitTo_references, REFERENCES,
            limitTo == REFERENCES));
    if (searchFor == TYPE) {
        buttons.add(createButton(fLimitToGroup, SWT.RADIO, SearchMessages.SearchPage_limitTo_implementors,
                IMPLEMENTORS, limitTo == IMPLEMENTORS));

        buttons.add(createMethodLocationRadio(limitTo == SPECIFIC_REFERENCES));
    }

    if (searchFor == FIELD) {
        buttons.add(createButton(fLimitToGroup, SWT.RADIO, SearchMessages.SearchPage_limitTo_readReferences,
                READ_ACCESSES, limitTo == READ_ACCESSES));
        buttons.add(createButton(fLimitToGroup, SWT.RADIO, SearchMessages.SearchPage_limitTo_writeReferences,
                WRITE_ACCESSES, limitTo == WRITE_ACCESSES));

        //         buttons.add(createMethodLocationRadio(limitTo == SPECIFIC_REFERENCES));
    }

    if (searchFor == METHOD) {
        buttons.add(createMethodLocationRadio(limitTo == SPECIFIC_REFERENCES));
    }

    fLimitTo = buttons.toArray(new Button[buttons.size()]);

    SelectionAdapter listener = new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            performLimitToSelectionChanged((Button) e.widget);
        }
    };
    for (int i = 0; i < fLimitTo.length; i++) {
        fLimitTo[i].addSelectionListener(listener);
    }
    Dialog.applyDialogFont(fLimitToGroup); // re-apply font as we disposed the previous widgets

    fLimitToGroup.layout();
    //      // searchFor == FIELD needs one more row than the others
    //      fLimitToGroup.getShell().layout(new Control[] { fLimitToGroup.getChildren()[0] });
}

From source file:ext.org.eclipse.jdt.internal.ui.text.AbstractInformationControl.java

License:Open Source License

protected Text createFilterText(Composite parent) {
    fFilterText = new Text(parent, SWT.NONE);
    Dialog.applyDialogFont(fFilterText);

    GridData data = new GridData(GridData.FILL_HORIZONTAL);
    data.horizontalAlignment = GridData.FILL;
    data.verticalAlignment = GridData.CENTER;
    fFilterText.setLayoutData(data);//  w  w w.j a v  a 2 s.c om

    fFilterText.addKeyListener(new KeyListener() {
        public void keyPressed(KeyEvent e) {
            if (e.keyCode == 0x0D) // return
                gotoSelectedElement();
            if (e.keyCode == SWT.ARROW_DOWN)
                fTreeViewer.getTree().setFocus();
            if (e.keyCode == SWT.ARROW_UP)
                fTreeViewer.getTree().setFocus();
            if (e.character == 0x1B) // ESC
                dispose();
        }

        public void keyReleased(KeyEvent e) {
            // do nothing
        }
    });

    return fFilterText;
}