List of usage examples for org.eclipse.jface.resource JFaceResources getDialogFont
public static Font getDialogFont()
From source file:com.aptana.editor.common.hover.CustomAbstractInformationControl.java
License:Open Source License
private void createStatusLabel(final String statusFieldText, Color foreground, Color background) { fStatusLabel = new Label(fStatusComposite, SWT.RIGHT); fStatusLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); fStatusLabel.setText(statusFieldText); FontData[] fontDatas = JFaceResources.getDialogFont().getFontData(); for (int i = 0; i < fontDatas.length; i++) { fontDatas[i].setHeight(fontDatas[i].getHeight() * 9 / 10); }//from w w w . j a v a 2s . c om fStatusLabelFont = new Font(fStatusLabel.getDisplay(), fontDatas); fStatusLabel.setFont(fStatusLabelFont); // Appcelerator Mod updateStatusColors(foreground, background); }
From source file:com.aptana.editor.common.hover.CustomAbstractInformationControl.java
License:Open Source License
/** * Computes the size constraints based on the {@link JFaceResources#getDialogFont() dialog font}. Subclasses can * override or extend.//from ww w. j av a 2 s .c o m * * @see org.eclipse.jface.text.IInformationControlExtension5#computeSizeConstraints(int, int) */ public Point computeSizeConstraints(int widthInChars, int heightInChars) { GC gc = new GC(fContentComposite); gc.setFont(JFaceResources.getDialogFont()); int width = gc.getFontMetrics().getAverageCharWidth(); int height = gc.getFontMetrics().getHeight(); gc.dispose(); return new Point(widthInChars * width, heightInChars * height); }
From source file:com.aptana.editor.php.ui.preferences.OptionsConfigurationBlock.java
License:Open Source License
protected Button addCheckBox(Composite parent, String label, Key key, String[] values, int indent) { ControlData data = new ControlData(key, values); GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL); gd.horizontalSpan = 3;//from w w w.j a v a 2 s . c o m gd.horizontalIndent = indent; Button checkBox = new Button(parent, SWT.CHECK); checkBox.setFont(JFaceResources.getDialogFont()); checkBox.setText(label); checkBox.setData(data); checkBox.setLayoutData(gd); checkBox.addSelectionListener(getSelectionListener()); makeScrollableCompositeAware(checkBox); String currValue = getValue(key); checkBox.setSelection(data.getSelection(currValue) == 0); fCheckBoxes.add(checkBox); return checkBox; }
From source file:com.aptana.editor.php.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, true, false, 2, 1); gd.horizontalIndent = indent;/*from w w w . ja va2 s . com*/ 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:com.aptana.editor.php.ui.preferences.OptionsConfigurationBlock.java
License:Open Source License
protected Combo addComboBox(Composite parent, String label, Key key, String[] values, String[] valueLabels) { Label labelControl = new Label(parent, SWT.LEFT); labelControl.setFont(JFaceResources.getDialogFont()); labelControl.setText(label);/* ww w . jav a 2 s .c o m*/ Combo comboBox = newComboControl(parent, key, values, valueLabels); comboBox.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL)); fLabels.put(comboBox, labelControl); return comboBox; }
From source file:com.aptana.editor.php.ui.preferences.OptionsConfigurationBlock.java
License:Open Source License
protected Combo addInversedComboBox(Composite parent, String label, Key key, String[] values, String[] valueLabels, int indent) { GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING); gd.horizontalIndent = indent;/*from w w w . j av a 2s .c o m*/ gd.horizontalSpan = 3; Composite composite = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(); layout.marginHeight = 0; layout.marginWidth = 0; layout.numColumns = 2; composite.setLayout(layout); composite.setLayoutData(gd); Combo comboBox = newComboControl(composite, key, values, valueLabels); comboBox.setFont(JFaceResources.getDialogFont()); comboBox.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL)); Label labelControl = new Label(composite, SWT.LEFT | SWT.WRAP); labelControl.setText(label); labelControl.setLayoutData(new GridData()); fLabels.put(comboBox, labelControl); return comboBox; }
From source file:com.aptana.editor.php.ui.preferences.OptionsConfigurationBlock.java
License:Open Source License
protected Combo newComboControl(Composite composite, Key key, String[] values, String[] valueLabels) { ControlData data = new ControlData(key, values); Combo comboBox = new Combo(composite, SWT.READ_ONLY); comboBox.setItems(valueLabels);/*from w w w .j a va 2 s. c o m*/ comboBox.setData(data); comboBox.addSelectionListener(getSelectionListener()); comboBox.setFont(JFaceResources.getDialogFont()); makeScrollableCompositeAware(comboBox); String currValue = getValue(key); comboBox.select(data.getSelection(currValue)); fComboBoxes.add(comboBox); return comboBox; }
From source file:com.aptana.editor.php.ui.preferences.OptionsConfigurationBlock.java
License:Open Source License
protected Text addTextField(Composite parent, String label, Key key, int indent, int widthHint) { Label labelControl = new Label(parent, SWT.WRAP); labelControl.setText(label);/* ww w. j a va 2 s . c o m*/ labelControl.setFont(JFaceResources.getDialogFont()); labelControl.setLayoutData(new GridData()); Text textBox = new Text(parent, SWT.BORDER | SWT.SINGLE); textBox.setData(key); textBox.setLayoutData(new GridData()); makeScrollableCompositeAware(textBox); fLabels.put(textBox, labelControl); String currValue = getValue(key); if (currValue != null) { textBox.setText(currValue); } textBox.addModifyListener(getTextModifyListener()); GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL); if (widthHint != 0) { data.widthHint = widthHint; } data.horizontalIndent = indent; data.horizontalSpan = 2; textBox.setLayoutData(data); fTextBoxes.add(textBox); return textBox; }
From source file:com.aptana.ide.core.ui.preferences.ProjectNaturesPage.java
License:Open Source License
private static int getButtonWidthHint(Button button) { button.setFont(JFaceResources.getDialogFont()); PixelConverter converter = new PixelConverter(button); int widthHint = converter.convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH); return Math.max(widthHint, button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x); }
From source file:com.aptana.ide.installer.wizard.InstallerWizardDialog.java
License:Open Source License
/** * @see org.eclipse.jface.wizard.WizardDialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite) *//*from w w w. j a v a 2 s . co m*/ protected void createButtonsForButtonBar(Composite parent) { // adds the "Do not show again" checkbox GridLayout layout = (GridLayout) parent.getLayout(); // makes necessary adjustment to the layout // 1. increment the number of columns in the button bar layout.numColumns++; layout.numColumns++; // For Manage Plugins... button // 2. makes the columns unequal widths layout.makeColumnsEqualWidth = false; // adjusts the layout data GridData gridData = (GridData) parent.getLayoutData(); gridData.grabExcessHorizontalSpace = true; gridData.horizontalAlignment = GridData.FILL; Composite button = new Composite(parent, SWT.NONE); button.setLayout(new GridLayout()); gridData = new GridData(SWT.FILL, SWT.FILL, true, true); // calculates the minimum width the composite should have GC gc = new GC(button); gridData.widthHint = gc.stringExtent(Messages.InstallerWizardDialog_DoNotShowNote).x + 10; gc.dispose(); button.setLayoutData(gridData); fDoNotShowButton = new Button(button, SWT.CHECK); fDoNotShowButton.setText(Messages.InstallerWizardDialog_DoNotShowLabel); fDoNotShowButton.setFont(JFaceResources.getDialogFont()); boolean donotshow; IPreferenceStore prefs = Activator.getDefault().getPreferenceStore(); if (prefs.contains(IPreferenceConstants.WIZARD_DO_NOT_SHOW_AGAIN)) { donotshow = prefs.getBoolean(IPreferenceConstants.WIZARD_DO_NOT_SHOW_AGAIN); } else { donotshow = prefs.getBoolean(IPreferenceConstants.WIZARD_DO_NOT_SHOW_AGAIN_DEFAULT); } fDoNotShowButton.setSelection(donotshow); fDoNotShowButton.setLayoutData(new GridData(SWT.BEGINNING, SWT.FILL, true, true)); fDoNotShowButton.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { saveStates(); updateDoNotShowLayout(); } }); Button managePluginsButton = new Button(parent, SWT.PUSH); managePluginsButton.setText(Messages.InstallerWizardDialog_Manage_Plugins); managePluginsButton.addSelectionListener(new SelectionListener() { public void widgetDefaultSelected(SelectionEvent e) { widgetSelected(e); } public void widgetSelected(SelectionEvent e) { try { close(); CoreUIUtils.showView("com.aptana.ide.ui.ViewPlugins"); //$NON-NLS-1$ } catch (PartInitException e1) { // Do nothing, view didn't open } } }); super.createButtonsForButtonBar(parent); // changes the "Finish" text to "Install" and disables it by default getFinishButton().setText(INSTALL_LABEL); // changes the "Cancel" text to "Close" getButton(IDialogConstants.CANCEL_ID).setText(CLOSE_LABEL); }