List of usage examples for org.eclipse.jface.resource JFaceResources getDialogFont
public static Font getDialogFont()
From source file:org.eclipse.cdt.internal.ui.preferences.IncludeGroupStyleBlock.java
License:Open Source License
private Button addCheckBox(Composite parent, String label, int indent, BooleanDataSource dataSource) { GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL); gd.horizontalSpan = 3;/*from ww w .j ava 2s.co m*/ gd.horizontalIndent = indent; Button checkBox = new Button(parent, SWT.CHECK); checkBox.setFont(JFaceResources.getDialogFont()); checkBox.setText(label); checkBox.setData(dataSource); checkBox.setLayoutData(gd); checkBox.addSelectionListener(getSelectionListener()); makeScrollableCompositeAware(checkBox); checkBox.setSelection(dataSource.get()); checkBoxes.add(checkBox); return checkBox; }
From source file:org.eclipse.cdt.internal.ui.preferences.OptionsConfigurationBlock.java
License:Open Source License
protected Button addRadioButton(Composite parent, String label, Key key, String[] values, int indent) { ControlData data = new ControlData(key, values); GridData gd = new GridData(GridData.FILL_HORIZONTAL); gd.horizontalSpan = 3;/* w ww. j a v a2 s . co m*/ gd.horizontalIndent = indent; Button radioButton = new Button(parent, SWT.RADIO); radioButton.setFont(JFaceResources.getDialogFont()); radioButton.setText(label); radioButton.setData(data); radioButton.setLayoutData(gd); radioButton.addSelectionListener(getSelectionListener()); makeScrollableCompositeAware(radioButton); String currValue = getValue(key); radioButton.setSelection(data.getSelection(currValue) == 0); fCheckBoxes.add(radioButton); return radioButton; }
From source file:org.eclipse.cdt.internal.ui.preferences.OptionsConfigurationBlock.java
License:Open Source License
protected Combo addComboBox(Composite parent, String label, Key key, String[] values, String[] valueLabels, int indent) { GridData gd = new GridData(GridData.FILL, GridData.CENTER, false, false, 2, 1); gd.horizontalIndent = indent;// w ww .ja v a 2s . c o m Label labelControl = new Label(parent, SWT.LEFT); labelControl.setFont(JFaceResources.getDialogFont()); labelControl.setText(label); labelControl.setLayoutData(gd); Combo comboBox = newComboControl(parent, key, values, valueLabels); comboBox.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL)); fLabels.put(comboBox, labelControl); return comboBox; }
From source file:org.eclipse.cdt.internal.ui.preferences.OptionsConfigurationBlock.java
License:Open Source License
protected Text addTextField(Composite parent, String label, Key key, int indent, int widthHint, int extraStyle) { Label labelControl = new Label(parent, SWT.WRAP); labelControl.setText(label);/*from w w w . j a v a 2s.com*/ labelControl.setFont(JFaceResources.getDialogFont()); GridData data = new GridData(); data.horizontalIndent = indent; labelControl.setLayoutData(data); Text textBox = new Text(parent, SWT.BORDER | SWT.SINGLE | extraStyle); textBox.setData(key); makeScrollableCompositeAware(textBox); fLabels.put(textBox, labelControl); if (key != null) { String currValue = getValue(key); if (currValue != null) { textBox.setText(currValue); } textBox.addModifyListener(getTextModifyListener()); } data = new GridData(GridData.HORIZONTAL_ALIGN_FILL); if (widthHint != 0) { data.widthHint = widthHint; } data.horizontalSpan = 2; textBox.setLayoutData(data); fTextBoxes.add(textBox); return textBox; }
From source file:org.eclipse.cdt.internal.ui.preferences.ScalabilityPreferencePage.java
License:Open Source License
@Override protected Control createContents(Composite parent) { initializeDialogUnits(parent);/*w w w . j a va2 s. c o m*/ int nColumns = 1; Composite composite = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(); layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN); layout.marginWidth = 0; layout.numColumns = nColumns; composite.setLayout(layout); GridData data = new GridData(); data.verticalAlignment = GridData.FILL; data.horizontalAlignment = GridData.FILL; composite.setLayoutData(data); createDetectionSettings(composite); new Separator().doFillIntoGrid(composite, nColumns); createScalabilityModeSettings(composite); new Separator().doFillIntoGrid(composite, nColumns); String noteTitle = PreferencesMessages.ScalabilityPreferencePage_note; String noteMessage = PreferencesMessages.ScalabilityPreferencePage_preferenceOnlyForNewEditors; Composite noteControl = createNoteComposite(JFaceResources.getDialogFont(), composite, noteTitle, noteMessage); GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL); gd.horizontalSpan = 2; noteControl.setLayoutData(gd); initFields(); Dialog.applyDialogFont(composite); return composite; }
From source file:org.eclipse.cdt.internal.ui.search.CSearchPage.java
License:Open Source License
private void createNote(Composite result) { // Create a note that tells the user that this search only processes the active code (not grayed out in editor) GridData gd;//from www .ja v a2 s . c om String noteTitle = CSearchMessages.CSearchPage_label_note; String noteMessage = CSearchMessages.CSearchPage_label_activeCodeRemark; Composite noteControl = createNoteComposite(JFaceResources.getDialogFont(), result, noteTitle, noteMessage); gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL); gd.horizontalSpan = 2; noteControl.setLayoutData(gd); }
From source file:org.eclipse.cdt.internal.ui.text.AbstractCompareViewerInformationControl.java
License:Open Source License
private void createTitleLabel(Composite parent) { fTitleLabel = new Label(parent, SWT.LEFT); fTitleLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); Label separator = new Label(parent, SWT.SEPARATOR | SWT.HORIZONTAL); separator.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); fTitleLabel.setFont(JFaceResources.getDialogFont()); Display display = parent.getDisplay(); Color foreground = display.getSystemColor(SWT.COLOR_TITLE_FOREGROUND); Color background = display.getSystemColor(SWT.COLOR_TITLE_BACKGROUND); fTitleLabel.setForeground(foreground); fTitleLabel.setBackground(background); addMoveSupport(fTitleLabel);//from ww w. j a va2 s . c o m }
From source file:org.eclipse.cdt.internal.ui.text.AbstractSourceViewerInformationControl.java
License:Open Source License
private void createTitleLabel(Composite parent) { fTitleLabel = new Label(parent, SWT.LEFT); fTitleLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); Label separator = new Label(parent, SWT.SEPARATOR | SWT.HORIZONTAL); separator.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); fTitleLabel.setFont(JFaceResources.getDialogFont()); Display display = parent.getDisplay(); Color foreground = display.getSystemColor(SWT.COLOR_INFO_FOREGROUND); Color background = display.getSystemColor(SWT.COLOR_INFO_BACKGROUND); fTitleLabel.setForeground(foreground); fTitleLabel.setBackground(background); }
From source file:org.eclipse.cdt.make.ui.dialogs.SettingsBlock.java
License:Open Source License
protected void createWorkBenchBuildControls(Composite parent) { SelectionAdapter selectionAdapter = new SelectionAdapter() { @Override//from w w w .ja v a2 s . c o m public void widgetSelected(SelectionEvent e) { targetAuto.setEnabled(autoButton.getSelection()); autoVariableButton.setEnabled(autoButton.getSelection()); targetIncr.setEnabled(incrButton.getSelection()); incrVariableButton.setEnabled(incrButton.getSelection()); targetClean.setEnabled(cleanButton.getSelection()); cleanVariableButton.setEnabled(cleanButton.getSelection()); getContainer().updateContainer(); } }; Group group = ControlFactory.createGroup(parent, MakeUIPlugin.getResourceString(MAKE_WORKBENCH_BUILD_GROUP), 1); GridLayout layout = new GridLayout(); layout.numColumns = 3; layout.makeColumnsEqualWidth = false; group.setLayout(layout); group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); Label label = new Label(group, SWT.NONE); label.setText(MakeUIPlugin.getResourceString(MAKE_WORKBENCH_BUILD_TYPE)); label = new Label(group, SWT.NONE); label.setText(MakeUIPlugin.getResourceString(MAKE_WORKBENCH_BUILD_TARGET)); GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL); gd.horizontalSpan = 2; label.setLayoutData(gd); autoButton = ControlFactory.createCheckBox(group, MakeUIPlugin.getResourceString(MAKE_WORKBENCH_BUILD_AUTO)); autoButton.addSelectionListener(selectionAdapter); autoButton.setSelection(fBuildInfo.isAutoBuildEnable()); targetAuto = ControlFactory.createTextField(group, SWT.SINGLE | SWT.BORDER); targetAuto.setText(fBuildInfo.getBuildAttribute(IMakeBuilderInfo.BUILD_TARGET_AUTO, "")); //$NON-NLS-1$ ((GridData) (targetAuto.getLayoutData())).horizontalAlignment = GridData.FILL; ((GridData) (targetAuto.getLayoutData())).grabExcessHorizontalSpace = true; addControlAccessibleListener(targetAuto, MakeUIPlugin.getResourceString(MAKE_BUILD_AUTO_TARGET)); autoVariableButton = addVariablesButton(group, targetAuto); String noteTitle = MakeUIPlugin.getResourceString("SettingsBlock.makeWorkbench.note"); //$NON-NLS-1$ String noteMessage = MakeUIPlugin.getResourceString("SettingsBlock.makeWorkbench.autobuildMessage"); //$NON-NLS-1$ Composite noteControl = createNoteComposite(JFaceResources.getDialogFont(), group, noteTitle, noteMessage); gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL); gd.horizontalSpan = 3; noteControl.setLayoutData(gd); incrButton = ControlFactory.createCheckBox(group, MakeUIPlugin.getResourceString(MAKE_WORKBENCH_BUILD_INCR)); incrButton.addSelectionListener(selectionAdapter); incrButton.setSelection(fBuildInfo.isIncrementalBuildEnabled()); targetIncr = ControlFactory.createTextField(group, SWT.SINGLE | SWT.BORDER); targetIncr.setText(fBuildInfo.getBuildAttribute(IMakeBuilderInfo.BUILD_TARGET_INCREMENTAL, "")); //$NON-NLS-1$ ((GridData) (targetIncr.getLayoutData())).horizontalAlignment = GridData.FILL; ((GridData) (targetIncr.getLayoutData())).grabExcessHorizontalSpace = true; addControlAccessibleListener(targetIncr, MakeUIPlugin.getResourceString(MAKE_BUILD_INCREMENTAL_TARGET)); incrVariableButton = addVariablesButton(group, targetIncr); cleanButton = ControlFactory.createCheckBox(group, MakeUIPlugin.getResourceString(MAKE_WORKBENCH_BUILD_CLEAN)); cleanButton.addSelectionListener(selectionAdapter); cleanButton.setSelection(fBuildInfo.isCleanBuildEnabled()); targetClean = ControlFactory.createTextField(group, SWT.SINGLE | SWT.BORDER); targetClean.setText(fBuildInfo.getBuildAttribute(IMakeBuilderInfo.BUILD_TARGET_CLEAN, "")); //$NON-NLS-1$ ((GridData) (targetClean.getLayoutData())).horizontalAlignment = GridData.FILL; ((GridData) (targetClean.getLayoutData())).grabExcessHorizontalSpace = true; addControlAccessibleListener(targetClean, MakeUIPlugin.getResourceString(MAKE_BUILD_CLEAN_TARGET)); cleanVariableButton = addVariablesButton(group, targetClean); selectionAdapter.widgetSelected(null); }
From source file:org.eclipse.contribution.visualiser.internal.preference.VisualiserPreferencesDialog.java
License:Open Source License
/** * Update the message//from w w w . j ava2 s . c om * @see org.eclipse.jface.preference.IPreferencePageContainer#updateMessage() */ public void updateMessage() { String pageMessage = visPage.getMessage(); int pageMessageType = IMessageProvider.NONE; if (pageMessage != null) pageMessageType = ((IMessageProvider) visPage).getMessageType(); String pageErrorMessage = visPage.getErrorMessage(); // Adjust the font if (pageMessage == null && pageErrorMessage == null) messageLabel.setFont(JFaceResources.getBannerFont()); else messageLabel.setFont(JFaceResources.getDialogFont()); // Set the message and error message if (pageMessage == null) { setMessage(visPage.getTitle()); } else { setMessage(pageMessage, pageMessageType); } setErrorMessage(pageErrorMessage); }