List of usage examples for org.eclipse.jface.resource JFaceResources DIALOG_FONT
String DIALOG_FONT
To view the source code for org.eclipse.jface.resource JFaceResources DIALOG_FONT.
Click Source Link
"org.eclipse.jface.dialogfont"
). From source file:com.aptana.internal.ui.text.spelling.OptionsConfigurationBlock.java
License:Open Source License
protected ExpandableComposite createStyleSection(Composite parent, String label, int nColumns) { final ExpandableComposite excomposite = new ExpandableComposite(parent, SWT.NONE, ExpandableComposite.TWISTIE | ExpandableComposite.CLIENT_INDENT); excomposite.setText(label);/* w w w. ja v a 2 s . c o m*/ excomposite.setExpanded(false); excomposite.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT)); excomposite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, nColumns, 1)); excomposite.addExpansionListener(new ExpansionAdapter() { public void expansionStateChanged(ExpansionEvent e) { OptionsConfigurationBlock.this.expandedStateChanged((ExpandableComposite) e.getSource()); } }); this.fExpandedComposites.add(excomposite); this.makeScrollableCompositeAware(excomposite); return excomposite; }
From source file:com.aptana.ui.properties.NaturesLabelProvider.java
License:Open Source License
public Font getFont(Object element) { // make the primary nature bold return isPrimary(element.toString()) ? JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT) : null;/*from w w w. j ava2 s . c om*/ }
From source file:com.archimatetool.editor.ui.components.ColorChooser.java
License:Open Source License
/** * Compute the size of the image to be displayed. * //from ww w . j a v a 2 s.c o m * @param window - * the window used to calculate * @return <code>Point</code> */ protected Point computeImageSize(Control window) { GC gc = new GC(window); Font f = JFaceResources.getFontRegistry().get(JFaceResources.DIALOG_FONT); gc.setFont(f); int height = gc.getFontMetrics().getHeight(); gc.dispose(); Point p = new Point(height * 3 - 6, height); return p; }
From source file:com.architexa.org.eclipse.gef.ui.palette.DefaultPaletteViewerPreferences.java
License:Open Source License
/** * Constructor//from www . j av a 2 s . c o m * * @param store The IPreferenceStore where the settings are to be saved. */ public DefaultPaletteViewerPreferences(final IPreferenceStore store) { this.store = store; store.setDefault(PREFERENCE_DETAILS_ICON_SIZE, false); store.setDefault(PREFERENCE_COLUMNS_ICON_SIZE, true); store.setDefault(PREFERENCE_ICONS_ICON_SIZE, true); store.setDefault(PREFERENCE_LIST_ICON_SIZE, false); store.setDefault(PREFERENCE_LAYOUT, LAYOUT_LIST); store.setDefault(PREFERENCE_AUTO_COLLAPSE, COLLAPSE_AS_NEEDED); store.setDefault(PREFERENCE_FONT, DEFAULT_FONT); listener = new PreferenceStoreListener(); store.addPropertyChangeListener(listener); fontListener = new IPropertyChangeListener() { public void propertyChange(PropertyChangeEvent event) { if (JFaceResources.DIALOG_FONT.equals(event.getProperty())) { if (getPreferenceStore().getString(PREFERENCE_FONT).equals(DEFAULT_FONT)) { setFontData(JFaceResources.getDialogFont().getFontData()[0]); handlePreferenceStorePropertyChanged(PREFERENCE_FONT); } } } }; JFaceResources.getFontRegistry().addListener(fontListener); }
From source file:com.astra.ses.spell.gui.dialogs.PropertiesDialog.java
License:Open Source License
/*************************************************************************** * Add a generic property/* w w w . j av a 2s . c o m*/ **************************************************************************/ protected void addGeneric(String title, ProcProperties tag, boolean multi) { Font boldFont = JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT); Label label = new Label(m_tabGenerics, SWT.NONE); label.setText(title + ":"); label.setFont(boldFont); Text text = null; if (multi) { text = new Text(m_tabGenerics, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL); } else { text = new Text(m_tabGenerics, SWT.BORDER); } String value = m_properties.get(tag); if (value == null) value = "(?)"; text.setText(value); text.setEditable(false); text.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); }
From source file:com.astra.ses.spell.gui.model.FontInfo.java
License:Open Source License
/*************************************************************************** * Constructor/* ww w . j av a 2s .co m*/ * * @param xmlElement The XML config file element for a font definition * **************************************************************************/ public FontInfo(Element xmlElement) { if (xmlElement.getNodeType() == Node.ELEMENT_NODE) { m_id = xmlElement.getAttribute("id"); m_face = xmlElement.getAttribute("face"); String fontSize = xmlElement.getAttribute("size"); m_size = Integer.parseInt(fontSize); String fontStyle = xmlElement.getAttribute("style"); if (fontStyle.equals("bold")) { m_style = SWT.BOLD; } else if (fontStyle.equals("italic")) { m_style = SWT.ITALIC; } else { m_style = SWT.NORMAL; } if (m_face.equals("header")) { m_font = JFaceResources.getHeaderFont(); } else if (m_face.equals("dialog")) { if (m_style == SWT.BOLD) { m_font = JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT); } else if (m_style == SWT.ITALIC) { m_font = JFaceResources.getFontRegistry().getItalic(JFaceResources.DIALOG_FONT); } else { m_font = JFaceResources.getFontRegistry().get(JFaceResources.DIALOG_FONT); } } else { m_font = new Font(Display.getCurrent(), new FontData[] { new FontData(m_face, m_size, m_style) }); } } }
From source file:com.cisco.yangide.editor.preferences.AbstractConfigurationBlock.java
License:Open Source License
protected void updateSectionStyle(ExpandableComposite excomposite) { excomposite.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT)); }
From source file:com.foosbar.mailsnag.views.MessageLabelProvider.java
License:Open Source License
public Font getFont(Message message) { if (message.isUnread()) { return JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT); } else {// w w w. j a va 2 s . com return null; } }
From source file:com.google.gdt.eclipse.suite.preferences.ui.ErrorsWarningsPage.java
License:Open Source License
private Composite createProblemCategory(Composite parent, String label) { // Expandable panel for each category of problems ExpandableComposite expandPanel = new ExpandableComposite(parent, SWT.NONE, ExpandableComposite.TWISTIE | ExpandableComposite.CLIENT_INDENT); expandPanel.setText(label);/* w w w. j a va2s . c o m*/ expandPanel.setExpanded(false); expandPanel.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT)); expandPanel.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false)); expandPanel.addExpansionListener(new ExpansionAdapter() { @Override public void expansionStateChanged(ExpansionEvent e) { topPanel.layout(true, true); scrollPanel.setMinSize(topPanel.computeSize(SWT.DEFAULT, SWT.DEFAULT)); } }); // Create panel to store the actual problems Composite categoryPanel = new Composite(expandPanel, SWT.NONE); categoryPanel.setLayout(new GridLayout(2, false)); expandPanel.setClient(categoryPanel); return categoryPanel; }
From source file:com.google.gwt.eclipse.core.compile.ui.GWTCompileDialog.java
License:Open Source License
private void createAdvancedOptions(Composite parent) { IPixelConverter converter = PixelConverterFactory.createPixelConverter(JFaceResources.getDialogFont()); // Expandable panel for advanced options final ExpandableComposite expandPanel = new ExpandableComposite(parent, SWT.NONE, ExpandableComposite.TWISTIE | ExpandableComposite.CLIENT_INDENT); expandPanel.setText("Advanced"); expandPanel.setExpanded(false);//from w w w.j ava2 s . c o m expandPanel.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT)); GridData expandPanelGridData = new GridData(GridData.FILL, GridData.FILL, true, false, 3, 1); expandPanelGridData.verticalIndent = converter.convertHeightInCharsToPixels(1); expandPanel.setLayoutData(expandPanelGridData); expandPanel.addExpansionListener(new ExpansionAdapter() { @Override public void expansionStateChanged(ExpansionEvent e) { Shell shell = getShell(); shell.setLayoutDeferred(true); // Suppress redraw flickering Point size = shell.getSize(); int shellHeightDeltaOnExpand = advancedContainer.computeSize(SWT.DEFAULT, SWT.DEFAULT).y; if (expandPanel.isExpanded()) { shell.setSize(size.x, size.y + shellHeightDeltaOnExpand); } else { shell.setSize(size.x, size.y - shellHeightDeltaOnExpand); } shell.layout(true, true); shell.setLayoutDeferred(false); } }); advancedContainer = new Composite(expandPanel, SWT.NONE); advancedContainer.setLayoutData(new GridData()); advancedContainer.setFont(parent.getFont()); advancedContainer.setLayout(new GridLayout(1, false)); expandPanel.setClient(advancedContainer); // Additional compiler parameters field SWTFactory.createLabel(advancedContainer, "Additional compiler arguments:", 1); extraArgsText = SWTUtilities.createMultilineTextbox(advancedContainer, SWT.BORDER, false); GridData extraArgsGridData = new GridData(GridData.FILL_HORIZONTAL); extraArgsGridData.heightHint = converter.convertHeightInCharsToPixels(5); extraArgsText.setLayoutData(extraArgsGridData); // Additional VM args field SWTFactory.createLabel(advancedContainer, "VM arguments:", 1); vmArgsText = SWTUtilities.createMultilineTextbox(advancedContainer, SWT.BORDER, false); GridData vmArgsGridData = new GridData(GridData.FILL_HORIZONTAL); vmArgsGridData.heightHint = converter.convertHeightInCharsToPixels(5); vmArgsText.setLayoutData(vmArgsGridData); }