/** * Returns the default text font. * * @return the default text font */ private Font getDefaultFont() { return JFaceResources.getFont(JFaceResources.TEXT_FONT); }
@Override public void propertyChange(PropertyChangeEvent event) { if (event.getProperty().equals(PreferenceConstants.EDITOR_TEXT_FONT)) { Font font= JFaceResources.getFont(PreferenceConstants.EDITOR_TEXT_FONT); viewer.getTextWidget().setFont(font); } } };
@Override public void propertyChange(PropertyChangeEvent event) { if (event.getProperty().equals(PreferenceConstants.PROPERTIES_FILE_EDITOR_TEXT_FONT)) { Font font= JFaceResources.getFont(PreferenceConstants.PROPERTIES_FILE_EDITOR_TEXT_FONT); viewer.getTextWidget().setFont(font); } } };
private void updateFont() { Font f= JFaceResources.getFont(fSymbolicFontName); if (f != null) { if (fAncestor != null) fAncestor.setFont(f); if (fLeft != null) fLeft.setFont(f); if (fRight != null) fRight.setFont(f); } }
/** * Constructor */ public JavaStackTraceConsole() { super(ConsoleMessages.JavaStackTraceConsoleFactory_0, CONSOLE_TYPE, null, true); Font font = JFaceResources.getFont(IDebugUIConstants.PREF_CONSOLE_FONT); setFont(font); partitioner.connect(getDocument()); }
/** * Initialize the font to the Java editor font. * * @since 3.2 */ private void initializeFont() { fTextFont= JFaceResources.getFont(PreferenceConstants.EDITOR_TEXT_FONT); StyledText styledText= getViewer().getTextWidget(); styledText.setFont(fTextFont); }
@Override protected void configureTextViewer(TextViewer textViewer) { if (textViewer instanceof SourceViewer) { if (fColorManager == null) fColorManager = ColorManager.getDefault(); ((SourceViewer) textViewer).configure(new ManifestConfiguration(fColorManager, null, getDocumentPartitioning())); Font font = JFaceResources.getFont(ManifestContentMergeViewer.class.getName()); if (font != null) ((SourceViewer) textViewer).getTextWidget().setFont(font); } }
@Override public Point computeSizeConstraints(int widthInChars, int heightInChars) { if (fSymbolicFontName == null) return null; GC gc= new GC(fBrowser); Font font= JFaceResources.getFont(fSymbolicFontName); gc.setFont(font); double width= gc.getFontMetrics().getAverageCharacterWidth(); int height= gc.getFontMetrics().getHeight(); gc.dispose(); return new Point((int) (widthInChars * width), heightInChars * height); }
private SourceViewer createViewer(Composite parent) { SourceViewer viewer = new SourceViewer(parent, null, SWT.NONE); SourceViewerConfiguration configuration = new AntSourceViewerConfiguration(); viewer.configure(configuration); viewer.setEditable(false); Font font = JFaceResources.getFont(JFaceResources.TEXT_FONT); viewer.getTextWidget().setFont(font); return viewer; }
JavaTextViewer(Composite parent) { fSourceViewer= new SourceViewer(parent, null, SWT.LEFT_TO_RIGHT | SWT.H_SCROLL | SWT.V_SCROLL); JavaTextTools tools= JavaCompareUtilities.getJavaTextTools(); if (tools != null) { IPreferenceStore store= JavaPlugin.getDefault().getCombinedPreferenceStore(); fSourceViewer.configure(new JavaSourceViewerConfiguration(tools.getColorManager(), store, null, IJavaPartitions.JAVA_PARTITIONING)); } fSourceViewer.setEditable(false); String symbolicFontName= JavaMergeViewer.class.getName(); Font font= JFaceResources.getFont(symbolicFontName); if (font != null) fSourceViewer.getTextWidget().setFont(font); }
/** * {@inheritDoc} */ public void createControl(Composite parent) { fPane= new CreateTextFilePreviewer(parent, SWT.BORDER | SWT.FLAT); Dialog.applyDialogFont(fPane); fSourceViewer= new SourceViewer(fPane, null, SWT.V_SCROLL | SWT.H_SCROLL | SWT.MULTI | SWT.FULL_SELECTION); fSourceViewer.setEditable(false); fSourceViewer.getControl().setFont(JFaceResources.getFont(PreferenceConstants.EDITOR_TEXT_FONT)); fPane.setContent(fSourceViewer.getControl()); }
SourceViewer doCreateViewer(Composite parent, SourceViewerConfiguration viewerConfiguration) { SourceViewer viewer = null; String contentTypeID = ContentTypeIdForXML.ContentTypeID_XML; viewer = new StructuredTextViewer(parent, null, null, false, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL); ((StructuredTextViewer) viewer).getTextWidget().setFont(JFaceResources.getFont("org.eclipse.wst.sse.ui.textfont")); //$NON-NLS-1$ IStructuredModel scratchModel = StructuredModelManager.getModelManager().createUnManagedStructuredModelFor(contentTypeID); IDocument document = scratchModel.getStructuredDocument(); viewer.configure(viewerConfiguration); viewer.setDocument(document); return viewer; }
@Override public void createControl(Composite parent) { fPane= new CreateTextFilePreviewer(parent, SWT.BORDER | SWT.FLAT); Dialog.applyDialogFont(fPane); fSourceViewer= new SourceViewer(fPane, null, SWT.V_SCROLL | SWT.H_SCROLL | SWT.MULTI | SWT.FULL_SELECTION); fSourceViewer.setEditable(false); fSourceViewer.getControl().setFont(JFaceResources.getFont(PreferenceConstants.EDITOR_TEXT_FONT)); fPane.setContent(fSourceViewer.getControl()); }
private void createSourceViewer(final Composite c) { final IPreferenceStore store= JavaPlugin.getDefault().getCombinedPreferenceStore(); fSourceViewer= new JavaSourceViewer(c, null, null, false, SWT.V_SCROLL | SWT.H_SCROLL | SWT.MULTI | SWT.BORDER | SWT.FULL_SELECTION, store); fSourceViewer.configure(new JavaSourceViewerConfiguration(JavaPlugin.getDefault().getJavaTextTools().getColorManager(), store, null, null)); fSourceViewer.setEditable(false); fSourceViewer.getControl().setLayoutData(new GridData(GridData.FILL_BOTH)); fSourceViewer.getControl().setFont(JFaceResources.getFont(PreferenceConstants.EDITOR_TEXT_FONT)); }
private void createSourceViewer(Composite c) { IPreferenceStore store= JavaPlugin.getDefault().getCombinedPreferenceStore(); fSourceViewer= new JavaSourceViewer(c, null, null, false, SWT.V_SCROLL | SWT.H_SCROLL | SWT.MULTI | SWT.BORDER | SWT.FULL_SELECTION, store); fSourceViewer.configure(new JavaSourceViewerConfiguration(getJavaTextTools().getColorManager(), store, null, null)); fSourceViewer.setEditable(false); fSourceViewer.getControl().setLayoutData(new GridData(GridData.FILL_BOTH)); fSourceViewer.getControl().setFont(JFaceResources.getFont(PreferenceConstants.EDITOR_TEXT_FONT)); Document document= new Document(); getJavaTextTools().setupJavaDocumentPartitioner(document); fSourceViewer.setDocument(document); }
private void createSourceViewer(Composite c) { IPreferenceStore store= JavaPlugin.getDefault().getCombinedPreferenceStore(); fSourceViewer= new JavaSourceViewer(c, null, null, false, SWT.V_SCROLL | SWT.H_SCROLL | SWT.MULTI | SWT.BORDER | SWT.FULL_SELECTION, store); fSourceViewer.configure(new JavaSourceViewerConfiguration(getJavaTextTools().getColorManager(), store, null, null)); fSourceViewer.setEditable(false); fSourceViewer.getControl().setLayoutData(new GridData(GridData.FILL_BOTH)); fSourceViewer.getControl().setFont(JFaceResources.getFont(PreferenceConstants.EDITOR_TEXT_FONT)); Document document= new Document(); getJavaTextTools().setupJavaDocumentPartitioner(document); fSourceViewer.setDocument(document); }
private void createSourceViewer(Composite c) { IPreferenceStore store= JavaPlugin.getDefault().getCombinedPreferenceStore(); fSourceViewer= new JavaSourceViewer(c, null, null, false, SWT.V_SCROLL | SWT.H_SCROLL | SWT.MULTI | SWT.BORDER | SWT.FULL_SELECTION, store); fSourceViewer.configure(new JavaSourceViewerConfiguration(getJavaTextTools().getColorManager(), store, null, null)); fSourceViewer.setEditable(false); fSourceViewer.getControl().setLayoutData(new GridData(GridData.FILL_BOTH)); fSourceViewer.getControl().setFont(JFaceResources.getFont(PreferenceConstants.EDITOR_TEXT_FONT)); Document document= new Document(); getJavaTextTools().setupJavaDocumentPartitioner(document); fSourceViewer.setDocument(document); }
@Override public void createControl(Composite parent) { super.createControl(parent); final SourceViewer viewer= getSourceViewer(); viewer.unconfigure(); IPreferenceStore store= JavaPlugin.getDefault().getCombinedPreferenceStore(); viewer.configure(new JavaSourceViewerConfiguration(JavaPlugin.getDefault().getJavaTextTools().getColorManager(), store, null, null)); viewer.getControl().setFont(JFaceResources.getFont(PreferenceConstants.EDITOR_TEXT_FONT)); }
public void createControl(Composite parent) { super.createControl(parent); final SourceViewer viewer= getSourceViewer(); viewer.unconfigure(); IPreferenceStore store= JavaPlugin.getDefault().getCombinedPreferenceStore(); viewer.configure(new JavaSourceViewerConfiguration(JavaPlugin.getDefault().getJavaTextTools().getColorManager(), store, null, null)); viewer.getControl().setFont(JFaceResources.getFont(PreferenceConstants.EDITOR_TEXT_FONT)); }
@Override public void createControl(Composite parent) { super.createControl(parent); final SourceViewer viewer= getSourceViewer(); viewer.unconfigure(); IPreferenceStore store= JavaPlugin.getDefault().getCombinedPreferenceStore(); viewer.configure(new JavaSourceViewerConfiguration(JavaPlugin.getDefault().getJavaTextTools().getColorManager(), store, null, null)); viewer.getControl().setFont(JFaceResources.getFont(PreferenceConstants.EDITOR_TEXT_FONT)); }