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:descent.ui.wizards.NewModuleWizardPage.java

License:Open Source License

public void createControl(Composite parent) {
    initializeDialogUnits(parent);//from  w  w w.j  av  a  2 s . c  om

    Composite composite = new Composite(parent, SWT.NONE);
    composite.setFont(parent.getFont());

    int nColumns = 4;

    GridLayout layout = new GridLayout();
    layout.numColumns = nColumns;
    composite.setLayout(layout);

    // pick & choose the wanted UI components

    createContainerControls(composite, nColumns);
    createPackageControls(composite, nColumns);

    createSeparator(composite, nColumns);

    createTypeNameControls(composite, nColumns);
    //createMethodStubSelectionControls(composite, nColumns);

    createSeparator(composite, nColumns);

    createCommentControls(composite, nColumns);
    enableCommentControl(true);

    setControl(composite);

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

From source file:descent.ui.wizards.NewPackageWizardPage.java

License:Open Source License

public void createControl(Composite parent) {
    initializeDialogUnits(parent);/*w w w  . j a v a2  s.com*/

    Composite composite = new Composite(parent, SWT.NONE);
    composite.setFont(parent.getFont());
    int nColumns = 3;

    GridLayout layout = new GridLayout();
    layout.numColumns = 3;
    composite.setLayout(layout);

    Label label = new Label(composite, SWT.WRAP);
    label.setText(NewWizardMessages.NewPackageWizardPage_info);
    GridData gd = new GridData();
    gd.widthHint = convertWidthInCharsToPixels(60);
    gd.horizontalSpan = 3;
    label.setLayoutData(gd);

    createContainerControls(composite, nColumns);
    createPackageControls(composite, nColumns);

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

From source file:e4.handler.E4TemplatePreferencePage.java

License:Open Source License

@Override
protected Control createContents(Composite ancestor) {
    Composite parent = new Composite(ancestor, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.numColumns = 2;/*  ww w.j  a  va 2s . c om*/
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    parent.setLayout(layout);

    Composite innerParent = new Composite(parent, SWT.NONE);
    GridLayout innerLayout = new GridLayout();
    innerLayout.numColumns = 2;
    innerLayout.marginHeight = 0;
    innerLayout.marginWidth = 0;
    innerParent.setLayout(innerLayout);
    GridData gd = new GridData(GridData.FILL_BOTH);
    gd.horizontalSpan = 2;
    innerParent.setLayoutData(gd);

    Composite tableComposite = new Composite(innerParent, SWT.NONE);
    GridData data = new GridData(GridData.FILL_BOTH);
    data.widthHint = 360;
    data.heightHint = convertHeightInCharsToPixels(10);
    tableComposite.setLayoutData(data);

    ColumnLayout columnLayout = new ColumnLayout();
    tableComposite.setLayout(columnLayout);
    Table table = new Table(tableComposite,
            SWT.CHECK | SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL);

    table.setHeaderVisible(true);
    table.setLinesVisible(true);

    GC gc = new GC(getShell());
    gc.setFont(JFaceResources.getDialogFont());

    TableColumn column1 = new TableColumn(table, SWT.NONE);
    column1.setText(TemplatesMessages.TemplatePreferencePage_column_name);
    int minWidth = computeMinimumColumnWidth(gc, TemplatesMessages.TemplatePreferencePage_column_name);
    columnLayout.addColumnData(new ColumnWeightData(2, minWidth, true));

    TableColumn column2 = new TableColumn(table, SWT.NONE);
    column2.setText(TemplatesMessages.TemplatePreferencePage_column_context);
    minWidth = computeMinimumContextColumnWidth(gc);
    columnLayout.addColumnData(new ColumnWeightData(1, minWidth, true));

    TableColumn column3 = new TableColumn(table, SWT.NONE);
    column3.setText(TemplatesMessages.TemplatePreferencePage_column_description);
    minWidth = computeMinimumColumnWidth(gc, TemplatesMessages.TemplatePreferencePage_column_description);
    columnLayout.addColumnData(new ColumnWeightData(3, minWidth, true));

    TableColumn column4 = new TableColumn(table, SWT.NONE);
    column4.setAlignment(SWT.CENTER);
    column4.setText(TemplatesMessages.TemplatePreferencePage_column_autoinsert);
    minWidth = computeMinimumColumnWidth(gc, TemplatesMessages.TemplatePreferencePage_column_autoinsert);
    minWidth = Math.max(minWidth, computeMinimumColumnWidth(gc, TemplatesMessages.TemplatePreferencePage_on));
    columnLayout.addColumnData(new ColumnPixelData(minWidth, false, false));

    gc.dispose();

    fTableViewer = new CheckboxTableViewer(table);
    fTableViewer.setLabelProvider(new TemplateLabelProvider());
    fTableViewer.setContentProvider(new TemplateContentProvider());

    fTableViewer.setComparator(new ViewerComparator() {
        @Override
        public int compare(Viewer viewer, Object object1, Object object2) {
            if ((object1 instanceof TemplatePersistenceData) && (object2 instanceof TemplatePersistenceData)) {
                Template left = ((TemplatePersistenceData) object1).getTemplate();
                Template right = ((TemplatePersistenceData) object2).getTemplate();
                int result = Collator.getInstance().compare(left.getName(), right.getName());
                if (result != 0)
                    return result;
                return Collator.getInstance().compare(left.getDescription(), right.getDescription());
            }
            return super.compare(viewer, object1, object2);
        }

        @Override
        public boolean isSorterProperty(Object element, String property) {
            return true;
        }
    });

    fTableViewer.addDoubleClickListener(new IDoubleClickListener() {
        public void doubleClick(DoubleClickEvent e) {
            edit();
        }
    });

    fTableViewer.addSelectionChangedListener(new ISelectionChangedListener() {
        public void selectionChanged(SelectionChangedEvent e) {
            selectionChanged1();
        }
    });

    fTableViewer.addCheckStateListener(new ICheckStateListener() {
        public void checkStateChanged(CheckStateChangedEvent event) {
            TemplatePersistenceData d = (TemplatePersistenceData) event.getElement();
            d.setEnabled(event.getChecked());
        }
    });

    BidiUtils.applyTextDirection(fTableViewer.getControl(), BidiUtils.BTD_DEFAULT);

    Composite buttons = new Composite(innerParent, SWT.NONE);
    buttons.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING));
    layout = new GridLayout();
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    buttons.setLayout(layout);

    fAddButton = new Button(buttons, SWT.PUSH);
    fAddButton.setText(TemplatesMessages.TemplatePreferencePage_new);
    fAddButton.setLayoutData(getButtonGridData(fAddButton));
    fAddButton.addListener(SWT.Selection, new Listener() {
        public void handleEvent(Event e) {
            add();
        }
    });

    fEditButton = new Button(buttons, SWT.PUSH);
    fEditButton.setText(TemplatesMessages.TemplatePreferencePage_edit);
    fEditButton.setLayoutData(getButtonGridData(fEditButton));
    fEditButton.addListener(SWT.Selection, new Listener() {
        public void handleEvent(Event e) {
            edit();
        }
    });

    fRemoveButton = new Button(buttons, SWT.PUSH);
    fRemoveButton.setText(TemplatesMessages.TemplatePreferencePage_remove);
    fRemoveButton.setLayoutData(getButtonGridData(fRemoveButton));
    fRemoveButton.addListener(SWT.Selection, new Listener() {
        public void handleEvent(Event e) {
            remove();
        }
    });

    createSeparator(buttons);

    fRestoreButton = new Button(buttons, SWT.PUSH);
    fRestoreButton.setText(TemplatesMessages.TemplatePreferencePage_restore);
    fRestoreButton.setLayoutData(getButtonGridData(fRestoreButton));
    fRestoreButton.addListener(SWT.Selection, new Listener() {
        public void handleEvent(Event e) {
            restoreDeleted();
        }
    });

    fRevertButton = new Button(buttons, SWT.PUSH);
    fRevertButton.setText(TemplatesMessages.TemplatePreferencePage_revert);
    fRevertButton.setLayoutData(getButtonGridData(fRevertButton));
    fRevertButton.addListener(SWT.Selection, new Listener() {
        public void handleEvent(Event e) {
            revert();
        }
    });

    createSeparator(buttons);

    fImportButton = new Button(buttons, SWT.PUSH);
    fImportButton.setText(TemplatesMessages.TemplatePreferencePage_import);
    fImportButton.setLayoutData(getButtonGridData(fImportButton));
    fImportButton.addListener(SWT.Selection, new Listener() {
        public void handleEvent(Event e) {
            import_();
        }
    });

    fExportButton = new Button(buttons, SWT.PUSH);
    fExportButton.setText(TemplatesMessages.TemplatePreferencePage_export);
    fExportButton.setLayoutData(getButtonGridData(fExportButton));
    fExportButton.addListener(SWT.Selection, new Listener() {
        public void handleEvent(Event e) {
            export();
        }
    });

    fPatternViewer = doCreateViewer(parent);

    if (isShowFormatterSetting()) {
        fFormatButton = new Button(parent, SWT.CHECK);
        fFormatButton.setText(TemplatesMessages.TemplatePreferencePage_use_code_formatter);
        GridData gd1 = new GridData();
        gd1.horizontalSpan = 2;
        fFormatButton.setLayoutData(gd1);
        fFormatButton.setSelection(getPreferenceStore().getBoolean(getFormatterPreferenceKey()));
    }

    fTableViewer.setInput(fTemplateStore);
    fTableViewer.setAllChecked(false);
    fTableViewer.setCheckedElements(getEnabledTemplates());

    updateButtons();
    Dialog.applyDialogFont(parent);
    innerParent.layout();

    return parent;
}

From source file:edu.buffalo.cse.green.dialogs.NewElementWizard.java

License:Open Source License

/**
 * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
 *//*from  w w  w  .j  a  v a2s .  c  om*/
public void createControl(Composite parent) {
    initializeDialogUnits(parent);

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

    int columns = 4;

    GridLayout layout = new GridLayout();
    layout.numColumns = columns;
    group.setLayout(layout);

    // pick & choose the wanted UI components
    createNameControls(group, columns);
    createModifierControls(group, columns);
    populateTypeGroup(group, columns);

    setControl(group);

    Dialog.applyDialogFont(group);
    PlugIn.getWorkbenchHelp().setHelp(group, JavaUI.ID_PLUGIN + "." + "new_class_wizard_page_context");

    _typeNameText.setText("String");

    if (allowVoidType()) {
        _typeVoid.setSelection(true);
    }
}

From source file:egovframework.hdev.imp.ide.pages.DeviceAPIBaseProjectCreationPage.java

License:Apache License

/**
 * UI  ?//from  w  w w .  j  a va  2  s .  c  o  m
 */
@Override
public void createControl(Composite parent) {

    Composite composite = new Composite(parent, SWT.NULL);
    composite.setLayout(new GridLayout());
    composite.setLayoutData(new GridData(GridData.FILL_BOTH));
    composite.layout(true);

    initializeDialogUnits(parent);

    PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, IIDEHelpContextIds.NEW_PROJECT_WIZARD_PAGE);

    createProjectNameGroup(composite);

    createProjectLocationGroup(composite);

    createControls(composite);

    setErrorMessage(null);
    setMessage(null);
    setControl(composite);
    Dialog.applyDialogFont(composite);
}

From source file:es.bsc.servicess.ide.wizards.ServiceSsCommonWizardPage.java

License:Apache License

public void createControl(Composite parent) {
    initializeDialogUnits(parent);//from w w w .  j a v  a  2 s.c  om

    root = new Composite(parent, SWT.NONE);
    root.setFont(parent.getFont());
    GridLayout layout = new GridLayout();
    layout.numColumns = 1;
    root.setLayout(layout);
    int nColumnsLocation = 4;

    Group location = new Group(root, SWT.NONE);
    GridLayout layoutLocation = new GridLayout();
    layoutLocation.numColumns = nColumnsLocation;
    location.setLayout(layoutLocation);
    location.setText("Element Location");

    group = new Group(root, SWT.NONE);
    group.setLayout(new GridLayout(2, false));
    group.setText("Element description");
    GridData rd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
    rd.grabExcessHorizontalSpace = true;
    group.setLayoutData(rd);

    // pick & choose the wanted UI components

    createContainerControls(location, nColumnsLocation);
    createPackageControls(location, nColumnsLocation);
    createClassControls(location, nColumnsLocation);
    createExtraControls(group);
    addExtraListeners();
    setControl(root);
    Dialog.applyDialogFont(root);

}

From source file:es.bsc.servicess.ide.wizards.ServiceSsNewElementWizardPage.java

License:Apache License

public void createControl(Composite parent) {
    initializeDialogUnits(parent);/*from  w  w w.  j ava 2s. c o  m*/

    Composite root = new Composite(parent, SWT.NONE);
    root.setFont(parent.getFont());
    GridLayout layout = new GridLayout();
    layout.numColumns = 1;
    root.setLayout(layout);
    int nColumnsLocation = 4;

    Group location = new Group(root, SWT.NONE);
    GridLayout layoutLocation = new GridLayout();
    layoutLocation.numColumns = nColumnsLocation;
    location.setLayout(layoutLocation);
    location.setText("Element Location");

    Group group = new Group(root, SWT.NONE);
    group.setLayout(new GridLayout(2, false));
    group.setText("Element description");
    GridData rd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
    rd.grabExcessHorizontalSpace = true;
    group.setLayoutData(rd);

    // pick & choose the wanted UI components

    createContainerControls(location, nColumnsLocation);
    createPackageControls(location, nColumnsLocation);
    createClassControls(location, nColumnsLocation);
    createCommonControls(group);
    createElementTypeSpecificControls(group);
    if (element != null) {
        setPrintElementData();
    } else if (elementName != null) {
        oeNameText.setText(elementName);
    }
    pageCreated = true;
    addListeners();
    setControl(root);
    Dialog.applyDialogFont(root);

}

From source file:es.bsc.servicess.ide.wizards.ServiceSsNewServiceClassPage.java

License:Apache License

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

    Composite composite = new Composite(parent, SWT.NONE);
    composite.setFont(parent.getFont());

    int nColumns = 4;

    GridLayout layout = new GridLayout();
    layout.numColumns = nColumns;
    composite.setLayout(layout);

    // pick & choose the wanted UI components

    createContainerControls(composite, nColumns);
    createPackageControls(composite, nColumns);
    createTypeNameControls(composite, nColumns);

    setControl(composite);
    Dialog.applyDialogFont(composite);

}

From source file:es.bsc.servicess.ide.wizards.ServiceSsOrchestrationElementWizardPage.java

License:Apache License

public void createControl(Composite parent) {
    initializeDialogUnits(parent);/*from   w  ww  . ja v  a 2s.  co  m*/

    Composite root = new Composite(parent, SWT.NONE);
    root.setFont(parent.getFont());
    GridLayout layout = new GridLayout();
    layout.numColumns = 1;
    root.setLayout(layout);
    int nColumnsLocation = 4;

    Group location = new Group(root, SWT.NONE);
    GridLayout layoutLocation = new GridLayout();
    layoutLocation.numColumns = nColumnsLocation;
    location.setLayout(layoutLocation);
    location.setText("Orchestration Element Location");

    Group group = new Group(root, SWT.NONE);
    group.setLayout(new GridLayout(2, false));
    group.setText("Orchestration Element description");
    GridData rd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
    rd.grabExcessHorizontalSpace = true;
    group.setLayoutData(rd);

    // pick & choose the wanted UI components

    createContainerControls(location, nColumnsLocation);
    createPackageControls(location, nColumnsLocation);
    createClassControls(location, nColumnsLocation);
    createOEControls(group);

    setControl(root);
    Dialog.applyDialogFont(root);

}

From source file:es.cv.gvcase.mdt.common.part.DiagramElementsSelectionPage.java

License:Open Source License

public void createControl(Composite parent) {
    initializeDialogUnits(parent);//from  w w w. ja v a  2 s  .com

    Composite composite = new Composite(parent, SWT.NONE);
    composite.setLayout(new GridLayout());
    composite.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
    setControl(composite);

    createDialogArea(composite);

    Dialog.applyDialogFont(composite);
}