List of usage examples for org.eclipse.jface.resource JFaceResources getFontRegistry
public static FontRegistry getFontRegistry()
From source file:com.predic8.plugin.membrane.views.ProxyTableView.java
License:Apache License
private void createTitleLabel(Composite composite) { Label lb = new Label(composite, SWT.NONE); lb.setText("List of currently available Proxis"); lb.setFont(JFaceResources.getFontRegistry().get(JFaceResources.HEADER_FONT)); }
From source file:com.predic8.plugin.membrane.views.RuleTableView.java
License:Apache License
private void createTitleLabel(Composite dummyComposite) { Label titleLabel = new Label(dummyComposite, SWT.NONE); titleLabel.setText("List of currently available Rules"); titleLabel.setFont(JFaceResources.getFontRegistry().get(JFaceResources.HEADER_FONT)); }
From source file:com.redhat.ceylon.eclipse.code.hover.DocHover.java
License:Open Source License
/** * Returns the Javadoc hover style sheet with the current Javadoc font from the preferences. * @return the updated style sheet//from w w w . j a va2 s. c o m * @since 3.4 */ public static String getStyleSheet() { if (fgStyleSheet == null) fgStyleSheet = loadStyleSheet(); //Color c = CeylonTokenColorer.getCurrentThemeColor("docHover"); //String color = toHexString(c.getRed()) + toHexString(c.getGreen()) + toHexString(c.getBlue()); String css = fgStyleSheet;// + "body { background-color: #" + color+ " }"; if (css != null) { FontData fontData = JFaceResources.getFontRegistry() .getFontData(PreferenceConstants.APPEARANCE_JAVADOC_FONT)[0]; css = HTMLPrinter.convertTopLevelFont(css, fontData); } return css; }
From source file:com.rohanclan.afae.decoration.DecorationSupport.java
License:Open Source License
/** * Uninstalls this support from the preference store it has previously been * installed on. If there is no such preference store, this call is without * effect./*from w ww . j a va 2s . c o m*/ */ public void uninstall() { if (fPreferenceStore != null) { fPreferenceStore.removePropertyChangeListener(fPropertyChangeListener); fPropertyChangeListener = null; fPreferenceStore = null; } if (fFontPropertyChangeListener != null) { JFaceResources.getFontRegistry().removeListener(fFontPropertyChangeListener); fFontPropertyChangeListener = null; } }
From source file:com.rohanclan.afae.decoration.DecorationSupport.java
License:Open Source License
/** * Shows the margin./* www . j a v a 2 s . c o m*/ */ private void showMargin() { if (fMarginPainter == null) { if (fSourceViewer instanceof ITextViewerExtension2) { fMarginPainter = new MarginPainter(fSourceViewer); fMarginPainter.setMarginRulerColor(getColor(fMarginPainterColorKey)); if (fPreferenceStore != null) fMarginPainter.setMarginRulerColumn(fPreferenceStore.getInt(fMarginPainterColumnKey)); ITextViewerExtension2 extension = (ITextViewerExtension2) fSourceViewer; extension.addPainter(fMarginPainter); fFontPropertyChangeListener = new FontPropertyChangeListener(); JFaceResources.getFontRegistry().addListener(fFontPropertyChangeListener); } } }
From source file:com.rohanclan.afae.decoration.DecorationSupport.java
License:Open Source License
/** * Hides the margin./* www .jav a 2s.c om*/ */ private void hideMargin() { if (fMarginPainter != null) { if (fSourceViewer instanceof ITextViewerExtension2) { if (fFontPropertyChangeListener != null) { if (JFaceResources.getFontRegistry() != null) { JFaceResources.getFontRegistry().removeListener(fFontPropertyChangeListener); fFontPropertyChangeListener = null; ITextViewerExtension2 extension = (ITextViewerExtension2) fSourceViewer; if (extension != null && fMarginPainter != null) { extension.removePainter(fMarginPainter); fMarginPainter.deactivate(true); fMarginPainter.dispose(); fMarginPainter = null; } } } } } }
From source file:com.safi.workshop.sqlexplorer.plugin.editors.SQLTextEditor.java
License:Open Source License
@Override public void createPartControl(Composite parent) { super.createPartControl(parent); PlatformUI.getWorkbench().getHelpSystem().setHelp(getSourceViewer().getTextWidget(), SQLExplorerPlugin.PLUGIN_ID + ".SQLEditor"); Object adapter = getAdapter(org.eclipse.swt.widgets.Control.class); if (adapter instanceof StyledText) { StyledText text = (StyledText) adapter; text.setWordWrap(AsteriskDiagramEditorPlugin.getDefault().getPluginPreferences() .getBoolean(IConstants.WORD_WRAP)); FontData[] fData = PreferenceConverter.getFontDataArray(store, IConstants.FONT); if (fData.length > 0) { JFaceResources.getFontRegistry().put(fData[0].toString(), fData); text.setFont(JFaceResources.getFontRegistry().get(fData[0].toString())); }/*from w w w.j a v a 2 s . c o m*/ } }
From source file:com.safi.workshop.sqlexplorer.sqleditor.SQLTextViewer.java
License:Open Source License
void adaptToPreferenceChange(PropertyChangeEvent event) { if (event.getProperty().equals(IConstants.FONT)) { FontData[] fData = PreferenceConverter.getFontDataArray(store, IConstants.FONT); String des = store.getString(IConstants.FONT); JFaceResources.getFontRegistry().put(des, fData); Control ctrl = this.getControl(); if (ctrl != null) { getTextWidget().setFont(JFaceResources.getFontRegistry().get(des)); }/*from w w w . j a v a2 s . com*/ } }
From source file:com.siteview.mde.internal.ui.nls.ExternalizeStringsLabelProvider.java
License:Open Source License
public ExternalizeStringsLabelProvider() { fFontRegistry = JFaceResources.getFontRegistry(); }
From source file:com.siteview.mde.internal.ui.preferences.PDECompilersConfigurationBlock.java
License:Open Source License
/** * Creates an {@link ExpandableComposite} with a client composite and a default grid layout * @param parent/*from w ww . j a v a 2 s .c om*/ * @param title * @return a new expandable composite */ private Composite createExpansibleComposite(Composite parent, String title) { ExpandableComposite ecomp = SWTFactory.createExpandibleComposite(parent, title, 1, GridData.FILL_HORIZONTAL); ecomp.addExpansionListener(new ExpansionAdapter() { public void expansionStateChanged(ExpansionEvent e) { Object obj = e.getSource(); handleExpand(getScrollingParent(obj)); } }); ecomp.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT)); fExpComps.add(ecomp); Composite client = SWTFactory.createComposite(ecomp, 2, 1, GridData.FILL_BOTH); ecomp.setClient(client); return client; }