control.setFont( font );
/** * Update for a change in the dialog font. * @param newFont */ private void updateForDialogFontChange(Font newFont) { Iterator iterator = dialogFontWidgets.iterator(); while (iterator.hasNext()) { ((Control) iterator.next()).setFont(newFont); } //recalculate the fonts for the tree labelProvider.clearFontCacheAndUpdate(); }
/** * Sets the fonts of all the custom controls in the expandable. */ @Override public void setFont(Font font) { super.setFont(font); if (textLabel != null) textLabel.setFont(font); if (toggle != null) toggle.setFont(font); }
/** * Applies the given font to this status line. */ @Override public void setFont(Font font) { super.setFont(font); Control[] children = getChildren(); for (int i = 0; i < children.length; i++) { children[i].setFont(font); } }
/** * Update the tree to use the specified <code>Font</code>. * * @param dialogFont * the <code>Font</code> to use. * @since 1.0 */ protected void updateTreeFont(Font dialogFont) { getTreeViewer().getControl().setFont(dialogFont); }
/** * Sets the fonts of all the custom controls in the expandable. */ @Override public void setFont(Font font) { super.setFont(font); if (textLabel != null) textLabel.setFont(font); if (toggle != null) toggle.setFont(font); }
/** * Sets the font of the form. This font will be used to render the title * text. It will not affect the body. */ @Override public void setFont(Font font) { super.setFont(font); if (getContent() != null) getContent().setFont(font); }
/** Helper function to avoid setting fonts unnecessarily */ public static void setFont(Control control, Font font) { if (!equals(control.getFont(), font)) { storeDefaultFont(control); control.setFont(font); } }
/** * Sets the font of the form. This font will be used to render the title * text. It will not affect the body. */ @Override public void setFont(Font font) { super.setFont(font); if (getContent() != null) getContent().setFont(font); }
/** * Overrides 'super' to pass the proper colors and font */ @Override public void setContent(Control content) { super.setContent(content); if (content != null) { content.setForeground(getForeground()); content.setBackground(getBackground()); content.setFont(getFont()); } }
public static void restoreDefaultFont(Control control) { Font defaultFont = (Font) control.getData(DEFAULT_FONT); if (defaultFont != null) { if (defaultFont.isDisposed()) { defaultFont = control.getDisplay().getSystemFont(); } if (!equals(defaultFont, control.getFont())) { control.setFont(defaultFont); } } }
/** * Overrides 'super' to pass the proper colors and font */ @Override public void setContent(Control content) { super.setContent(content); if (content != null) { content.setForeground(getForeground()); content.setBackground(getBackground()); content.setFont(getFont()); } }
/** * {@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()); }
private void changeFont(Control control, boolean italic) { Display.getCurrent().asyncExec(() -> { FontData fd= control.getFont().getFontData()[0]; int style= italic ? (fd.getStyle() | SWT.ITALIC) : (fd.getStyle() & ~SWT.ITALIC); control.setFont(new Font(control.getDisplay(), new FontData(fd.getName(), fd.getHeight(), style))); if (control instanceof Composite) ((Composite) control).layout(); }); }
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(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); }
@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)); }