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:com.amazonaws.eclipse.identitymanagement.role.EditTrustRelationshipDialog.java

License:Apache License

@Override
protected Control createDialogArea(Composite parent) {
    Composite composite = (Composite) super.createDialogArea(parent);
    composite.setLayout(new GridLayout());
    policyText = new Text(composite, SWT.MULTI | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
    policyText.setLayoutData(new GridData(GridData.FILL_BOTH));
    try {// w  w w .j  a  v  a 2  s  . c  om
        policyText.setText(getAssumeRolePolicy());
    } catch (Exception e) {
        setErrorMessage(e.getMessage());
    }
    Dialog.applyDialogFont(parent);
    return composite;
}

From source file:com.amazonaws.eclipse.identitymanagement.role.ShowRolePolicyDialog.java

License:Apache License

@Override
protected Control createDialogArea(Composite parent) {
    Composite composite = (Composite) super.createDialogArea(parent);
    composite.setLayout(new GridLayout());
    policyText = new Text(composite, SWT.MULTI | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
    try {//  w w w  . ja  v  a2  s. c o m
        policyText.setText(getPolicy(policyName));
    } catch (Exception e) {
        setErrorMessage(e.getMessage());
    }

    policyText.setLayoutData(new GridData(GridData.FILL_BOTH));
    if (!edittable) {
        policyText.setEditable(false);
    }
    Dialog.applyDialogFont(parent);
    return composite;
}

From source file:com.amazonaws.eclipse.identitymanagement.user.ShowUserPolicyDialog.java

License:Apache License

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

    composite.setLayout(new GridLayout());
    policyText = new Text(composite, SWT.MULTI | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);

    try {// w w  w . j  a  va2 s .com
        policyText.setText(getPolicy(policyName));
    } catch (Exception e) {
        setErrorMessage(e.getMessage());
    }

    policyText.setLayoutData(new GridData(GridData.FILL_BOTH));
    if (!edittable) {
        policyText.setEditable(false);
    }
    Dialog.applyDialogFont(parent);

    return composite;

}

From source file:com.android.ide.eclipse.adt.internal.launch.junit.AndroidJUnitLaunchConfigurationTab.java

License:Open Source License

@Override
public void createControl(Composite parent) {
    mProjectChooserHelper = new ProjectChooserHelper(parent.getShell(), null /*filter*/);

    Composite comp = new Composite(parent, SWT.NONE);
    setControl(comp);/*  www.ja  va  2 s  .  c o m*/

    GridLayout topLayout = new GridLayout();
    topLayout.numColumns = 3;
    comp.setLayout(topLayout);

    createSingleTestSection(comp);
    createTestContainerSelectionGroup(comp);

    createSpacer(comp);

    createInstrumentationGroup(comp);
    createSizeSelector(comp);

    Dialog.applyDialogFont(comp);
    // TODO: add help link here when available
    //PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(),
    //      IJUnitHelpContextIds.LAUNCH_CONFIGURATION_DIALOG_JUNIT_MAIN_TAB);
    validatePage();
}

From source file:com.android.ide.eclipse.adt.internal.refactorings.core.RenameResourcePage.java

License:Open Source License

@SuppressWarnings("unused") // SWT constructors aren't really unused, they have side effects
@Override/*from w  ww.j a  va2 s. c om*/
public void createControl(Composite parent) {
    Composite container = new Composite(parent, SWT.NULL);
    setControl(container);
    initializeDialogUnits(container);
    container.setLayout(new GridLayout(2, false));
    Label nameLabel = new Label(container, SWT.NONE);
    nameLabel.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
    nameLabel.setText("New Name:");
    Text text = super.createTextInputField(container);
    text.selectAll();
    text.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    Label xmlLabel = new Label(container, SWT.NONE);
    xmlLabel.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
    xmlLabel.setText("XML:");
    mXmlLabel = new Label(container, SWT.NONE);
    mXmlLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
    Label javaLabel = new Label(container, SWT.NONE);
    javaLabel.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
    javaLabel.setText("Java:");
    mJavaLabel = new Label(container, SWT.NONE);
    mJavaLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
    new Label(container, SWT.NONE);
    new Label(container, SWT.NONE);
    mUpdateReferences = new Button(container, SWT.CHECK);
    mUpdateReferences.setSelection(true);
    mUpdateReferences.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1));
    mUpdateReferences.setText("Update References");
    mUpdateReferences.addSelectionListener(this);

    Dialog.applyDialogFont(container);
}

From source file:com.android.ide.eclipse.adt.internal.wizards.exportgradle.ConfirmationPage.java

License:Open Source License

@Override
public void createControl(Composite parent) {
    initializeDialogUnits(parent);/*from  ww  w.j a  v a 2 s  .co m*/
    GridData data;

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

    workArea.setLayout(new GridLayout());
    workArea.setLayoutData(
            new GridData(GridData.FILL_BOTH | GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL));

    Label title = new Label(workArea, SWT.NONE);
    title.setText("Please review the export options.");

    Group group = new Group(workArea, SWT.NONE);
    group.setText("Project root");
    group.setLayout(new GridLayout());
    group.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, false));

    mProjectRootLabel = new Label(group, SWT.NONE);
    mProjectRootLabel.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, false));

    mProjectRootWarning = new Label(group, SWT.NONE);
    mProjectRootWarning.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, false));

    Group group2 = new Group(workArea, SWT.NONE);
    group2.setText("Exported Modules");
    group2.setLayout(new GridLayout());
    group2.setLayoutData(data = new GridData(SWT.FILL, SWT.FILL, true, true));
    data.heightHint = 300;

    Table table = new Table(group2, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
    mTableViewer = new TableViewer(table);
    table.setLayout(new TableLayout());
    table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    mTableViewer.setContentProvider(new IStructuredContentProvider() {
        @Override
        public Object[] getElements(Object inputElement) {
            if (inputElement instanceof ProjectSetupBuilder) {
                ProjectSetupBuilder builder = (ProjectSetupBuilder) inputElement;
                Collection<GradleModule> modules = builder.getModules();
                Object[] array = new Object[modules.size()];
                int i = 0;
                for (GradleModule module : modules) {
                    array[i++] = module.getJavaProject();
                }

                return array;
            }

            return null;
        }

        @Override
        public void dispose() {
        }

        @Override
        public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
        }

    });
    mTableViewer.setLabelProvider(new WorkbenchLabelProvider() {
        @Override
        protected String decorateText(String input, Object element) {
            if (element instanceof IJavaProject) {
                IJavaProject javaProject = (IJavaProject) element;
                StringBuilder sb = new StringBuilder(input);
                if (!mBuilder.isOriginalProject(javaProject)) {
                    sb.append('*');
                }
                // TODO: decorate icon instead?
                if (mOverrideProjects.contains(javaProject)) {
                    sb.append(" (1 warning)");
                }

                return sb.toString();
            }

            return input;
        }
    });
    mTableViewer.addSelectionChangedListener(new ISelectionChangedListener() {
        @Override
        public void selectionChanged(SelectionChangedEvent event) {
            IStructuredSelection selection = (IStructuredSelection) event.getSelection();
            Object firstElement = selection.getFirstElement();
            if (firstElement instanceof IJavaProject) {
                GradleModule module = mBuilder.getModule((IJavaProject) firstElement);
                if (mBuilder.getOriginalModules().contains(module)) {
                    mModuleDescription1.setText("Exported because selected in previous page.");
                } else {
                    List<GradleModule> list = mBuilder.getShortestDependencyTo(module);
                    StringBuilder sb = new StringBuilder();
                    for (GradleModule m : list) {
                        if (sb.length() > 0) {
                            sb.append(" > ");
                        }
                        sb.append(m.getJavaProject().getProject().getName());
                    }
                    mModuleDescription1.setText("Dependency chain: " + sb);
                }
                mModuleDescription2.setText("Path: " + module.getPath());

                if (mOverrideProjects.contains(module.getJavaProject())) {
                    mModuleDescription3.setText("WARNING: build.gradle already exists for this project");
                } else {
                    mModuleDescription3.setText("");
                }
            } else {
                mModuleDescription1.setText("");
                mModuleDescription2.setText("");
                mModuleDescription3.setText("");
            }
        }
    });

    mModuleDescription1 = new Label(group2, SWT.NONE);
    mModuleDescription1.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, false));
    mModuleDescription2 = new Label(group2, SWT.NONE);
    mModuleDescription2.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, false));
    mModuleDescription3 = new Label(group2, SWT.NONE);
    mModuleDescription3.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, false));

    mForceOverride = new Button(workArea, SWT.CHECK);
    mForceOverride.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, false));
    mForceOverride.setText("Force overriding of existing files");
    mForceOverride.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            updateEnablement();
        }
    });

    setControl(workArea);
    Dialog.applyDialogFont(parent);
}

From source file:com.android.ide.eclipse.adt.internal.wizards.exportgradle.FinalPage.java

License:Open Source License

@Override
public void createControl(Composite parent) {
    initializeDialogUnits(parent);/*from www .j a  va  2 s  .  co m*/

    mText = new Text(parent, SWT.MULTI | SWT.READ_ONLY);
    mText.setLayoutData(new GridData(GridData.FILL_BOTH | GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL));

    setControl(mText);
    Dialog.applyDialogFont(parent);
}

From source file:com.android.ide.eclipse.adt.internal.wizards.exportgradle.ProjectSelectionPage.java

License:Open Source License

@Override
public void createControl(Composite parent) {
    initializeDialogUnits(parent);//  ww  w.ja v  a  2s . c om

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

    workArea.setLayout(new GridLayout());
    workArea.setLayoutData(
            new GridData(GridData.FILL_BOTH | GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL));

    Label title = new Label(workArea, SWT.NONE);
    title.setText(ExportMessages.SelectProjects);

    Composite listComposite = new Composite(workArea, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.numColumns = 2;
    layout.marginWidth = 0;
    layout.makeColumnsEqualWidth = false;
    listComposite.setLayout(layout);

    listComposite.setLayoutData(
            new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL | GridData.FILL_BOTH));

    Table table = new Table(listComposite, SWT.CHECK | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
    mTableViewer = new CheckboxTableViewer(table);
    table.setLayout(new TableLayout());
    GridData data = new GridData(SWT.FILL, SWT.FILL, true, true);
    data.heightHint = 300;
    table.setLayoutData(data);
    mTableViewer.setContentProvider(new WorkbenchContentProvider() {
        @Override
        public Object[] getElements(Object element) {
            if (element instanceof IJavaProject[]) {
                return (IJavaProject[]) element;
            }
            return null;
        }
    });
    mTableViewer.setLabelProvider(new WorkbenchLabelProvider());
    mTableViewer.addCheckStateListener(new ICheckStateListener() {
        @Override
        public void checkStateChanged(CheckStateChangedEvent event) {
            if (event.getChecked()) {
                mSelectedJavaProjects.add((IJavaProject) event.getElement());
            } else {
                mSelectedJavaProjects.remove(event.getElement());
            }
            updateEnablement();
        }
    });

    initializeProjects();
    createSelectionButtons(listComposite);
    setControl(workArea);
    updateEnablement();
    Dialog.applyDialogFont(parent);
}

From source file:com.android.ide.eclipse.adt.launch.junit.AndroidJUnitLaunchConfigurationTab.java

License:Open Source License

public void createControl(Composite parent) {
    mProjectChooserHelper = new ProjectChooserHelper(parent.getShell());

    Composite comp = new Composite(parent, SWT.NONE);
    setControl(comp);/*from  w ww.  java2 s. c  o  m*/

    GridLayout topLayout = new GridLayout();
    topLayout.numColumns = 3;
    comp.setLayout(topLayout);

    createSingleTestSection(comp);
    createTestContainerSelectionGroup(comp);

    createSpacer(comp);

    createInstrumentationGroup(comp);

    createSpacer(comp);

    Dialog.applyDialogFont(comp);
    // TODO: add help link here when available
    //PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), 
    //      IJUnitHelpContextIds.LAUNCH_CONFIGURATION_DIALOG_JUNIT_MAIN_TAB);
    validatePage();
}

From source file:com.annotatedsql.classlibrary.ClassPathContainerPage.java

License:Open Source License

public void createControl(Composite parent) {
    Composite composite = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.numColumns = 1;/*from   w  ww.j a  v  a2s .  c om*/
    composite.setLayout(layout);

    fEntryField.doFillIntoGrid(composite, 2);
    LayoutUtil.setHorizontalGrabbing(fEntryField.getTextControl(null));

    fEntryField.setFocus();

    setControl(composite);
    Dialog.applyDialogFont(composite);
    PlatformUI.getWorkbench().getHelpSystem().setHelp(composite,
            IJavaHelpContextIds.CLASSPATH_CONTAINER_DEFAULT_PAGE);
}