List of usage examples for org.eclipse.jface.resource JFaceResources TEXT_FONT
String TEXT_FONT
To view the source code for org.eclipse.jface.resource JFaceResources TEXT_FONT.
Click Source Link
"org.eclipse.jface.textfont"
). From source file:org.eclipse.oomph.setup.ui.wizards.ProgressPage.java
License:Open Source License
@Override protected Control createUI(final Composite parent) { Composite mainComposite = new Composite(parent, SWT.NONE); mainComposite.setLayout(UIUtil.createGridLayout(1)); SashForm sashForm = new SashForm(mainComposite, SWT.SMOOTH | SWT.VERTICAL); sashForm.setLayoutData(new GridData(GridData.FILL_BOTH)); AccessUtil.setKey(sashForm, "sash"); treeViewer = new TreeViewer(sashForm, SWT.BORDER); Tree tree = treeViewer.getTree();// w ww. jav a 2s .c o m addHelpCallout(tree, 1); ILabelProvider labelProvider = createLabelProvider(); treeViewer.setLabelProvider(labelProvider); final AdapterFactoryContentProvider contentProvider = new OomphAdapterFactoryContentProvider( getAdapterFactory()); treeViewer.setContentProvider(contentProvider); treeViewer.addSelectionChangedListener(treeViewerSelectionChangedListener); new ColumnViewerInformationControlToolTipSupport(treeViewer, new LocationListener() { public void changing(LocationEvent event) { } public void changed(LocationEvent event) { } }); tree.setLayoutData(new GridData(GridData.FILL_BOTH)); tree.setBackground(getShell().getDisplay().getSystemColor(SWT.COLOR_WHITE)); TextViewer logTextViewer = new TextViewer(sashForm, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.CANCEL | SWT.MULTI); logTextViewer.setDocument(logDocument); logText = logTextViewer.getTextWidget(); logText.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND)); logText.setFont(JFaceResources.getFont(JFaceResources.TEXT_FONT)); logText.setEditable(false); logText.setLayoutData(new GridData(GridData.FILL_BOTH)); logText.getVerticalBar().addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent event) { if (event.detail == SWT.DRAG && !scrollLock) { scrollLockButton.setSelection(true); scrollLock = true; } } }); addHelpCallout(logText, 2); AccessUtil.setKey(logText, "log"); return mainComposite; }
From source file:org.eclipse.pde.internal.ui.preferences.SyntaxColorTab.java
License:Open Source License
private void createPreviewer(Composite parent) { Composite previewComp = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(); layout.marginHeight = layout.marginWidth = 0; previewComp.setLayout(layout);// ww w . ja va 2 s . c o m previewComp.setLayoutData(new GridData(GridData.FILL_BOTH)); Label label = new Label(previewComp, SWT.NONE); label.setText(PDEUIMessages.SyntaxColorTab_preview); label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); fPreviewViewer = new SourceViewer(previewComp, null, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL); fSourceViewerConfiguration = getSourceViewerConfiguration(); if (fSourceViewerConfiguration != null) fPreviewViewer.configure(fSourceViewerConfiguration); fPreviewViewer.setEditable(false); fPreviewViewer.getTextWidget().setFont(JFaceResources.getFont(JFaceResources.TEXT_FONT)); fPreviewViewer.setDocument(getDocument()); Control control = fPreviewViewer.getControl(); control.setLayoutData(new GridData(GridData.FILL_BOTH)); }
From source file:org.eclipse.photran.internal.ui.editor.AbstractFortranEditor.java
License:Open Source License
public AbstractFortranEditor() { super();/*from ww w. j av a 2 s .c o m*/ setSourceViewerConfiguration(createSourceViewerConfiguration()); setRangeIndicator(new DefaultRangeIndicator()); // We must use the CUIPlugin's document provider in order for the // working copy manager in setOutlinePageInput (below) to function correctly. setDocumentProvider(CUIPlugin.getDefault().getDocumentProvider()); // This has to be set to be notified of changes to preferences // Without this, the editor will not auto-update IPreferenceStore store = FortranUIPlugin.getDefault().getPreferenceStore(); IPreferenceStore generalTextStore = EditorsUI.getPreferenceStore(); fCombinedPreferenceStore = new ChainedPreferenceStore( new IPreferenceStore[] { store, generalTextStore, getPreferenceStore() }); setPreferenceStore(fCombinedPreferenceStore); // This enables any global changes to editor e.g. font type and size to take effect WorkbenchChainedTextFontFieldEditor.startPropagate(store, JFaceResources.TEXT_FONT); // JO: This gives you a "Toggle Breakpoint" action (and others) // when you right-click the Fortran editor's ruler setRulerContextMenuId("#CEditorRulerContext"); //$NON-NLS-1$ setEditorContextMenuId(CONTEXT_MENU_ID); }
From source file:org.eclipse.photran.internal.ui.editor.FortranEditor.java
License:Open Source License
public FortranEditor() { super();/*from ww w. java 2 s . c o m*/ setSourceViewerConfiguration(createSourceViewerConfiguration()); setRangeIndicator(new DefaultRangeIndicator()); useCDTDocumentProvider(); // This has to be set to be notified of changes to preferences // Without this, the editor will not auto-update IPreferenceStore store = FortranUIPlugin.getDefault().getPreferenceStore(); IPreferenceStore generalTextStore = EditorsUI.getPreferenceStore(); fCombinedPreferenceStore = new ChainedPreferenceStore( new IPreferenceStore[] { store, generalTextStore, getPreferenceStore() }); setPreferenceStore(fCombinedPreferenceStore); // This enables any global changes to editor e.g. font type and size to take effect WorkbenchChainedTextFontFieldEditor.startPropagate(store, JFaceResources.TEXT_FONT); useCDTRulerContextMenuID(); setEditorContextMenuId(CONTEXT_MENU_ID); FortranCorePlugin.getDefault().getPluginPreferences().addPropertyChangeListener(this); }
From source file:org.eclipse.php.internal.ui.compare.TextMergeViewer.java
License:Open Source License
private void updateFont() { Font f = JFaceResources.getFont(JFaceResources.TEXT_FONT); if (f != null) { if (fAncestor != null) fAncestor.setFont(f);// w w w. j a v a 2s . co m if (fLeft != null) fLeft.setFont(f); if (fRight != null) fRight.setFont(f); } }
From source file:org.eclipse.rcptt.ecl.popup.ui.internal.DialogRow.java
License:Open Source License
public DialogRow(Composite parent, String title) { super(parent, SWT.NONE); GridLayoutFactory.swtDefaults().numColumns(2).equalWidth(false).applyTo(this); getGridData().applyTo(this); Label titleLabel = new Label(this, SWT.NONE); titleLabel.setText(title);/*from w ww .j av a 2s . c o m*/ GridDataFactory.swtDefaults().grab(false, false).align(SWT.BEGINNING, SWT.BEGINNING).applyTo(titleLabel); titleLabel.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.TEXT_FONT)); GridDataFactory.swtDefaults().grab(true, true).align(SWT.FILL, SWT.FILL).applyTo(createContent()); }
From source file:org.eclipse.rcptt.ui.editors.ecl.EditorToolkit.java
License:Open Source License
public String getEditorTextFont() { return JFaceResources.TEXT_FONT; }
From source file:org.eclipse.tcf.internal.debug.ui.launch.TestErrorsDialog.java
License:Open Source License
@Override protected Control createDialogArea(Composite parent) { Composite composite = (Composite) super.createDialogArea(parent); composite.setSize(composite.computeSize(SWT.DEFAULT, SWT.DEFAULT)); Label label = new Label(composite, SWT.WRAP); label.setFont(JFaceResources.getFont(JFaceResources.BANNER_FONT)); label.setText("Connection diagnostics ended with errors:"); text = new Text(composite, SWT.MULTI | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL); text.setFont(JFaceResources.getFont(JFaceResources.TEXT_FONT)); text.setEditable(false);/*from w ww .jav a2s . c o m*/ text.setText(createText()); GridData data = new GridData(GridData.FILL_BOTH); data.widthHint = SIZING_TEXT_WIDTH; data.heightHint = SIZING_TEXT_HEIGHT; text.setLayoutData(data); return composite; }
From source file:org.eclipse.tcf.internal.debug.ui.model.TCFModelFonts.java
License:Open Source License
public static FontData getMonospacedFontData(String view_id) { FontData fd = fd_monospaced.get(view_id); if (fd == null) { FontData fn = getNormalFontData(view_id); FontData fm = JFaceResources.getFontDescriptor(JFaceResources.TEXT_FONT).getFontData()[0]; fd = new FontData(fm.getName(), fn.getHeight(), fn.getStyle()); fd_monospaced.put(view_id, fd);/*w ww . j a v a2s .com*/ } return fd; }
From source file:org.eclipse.tm.internal.tcf.debug.ui.launch.TestErrorsDialog.java
License:Open Source License
@Override protected Control createDialogArea(Composite parent) { Composite composite = (Composite) super.createDialogArea(parent); composite.setSize(composite.computeSize(SWT.DEFAULT, SWT.DEFAULT)); Label label = new Label(composite, SWT.WRAP); label.setFont(JFaceResources.getFontRegistry().get(JFaceResources.BANNER_FONT)); label.setText("Connection diagnostics ended with errors:"); text = new Text(composite, SWT.MULTI | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL); text.setFont(JFaceResources.getFontRegistry().get(JFaceResources.TEXT_FONT)); text.setEditable(false);/*from w ww .ja va 2s. com*/ text.setText(createText()); GridData data = new GridData(GridData.FILL_BOTH); data.widthHint = SIZING_TEXT_WIDTH; data.heightHint = SIZING_TEXT_HEIGHT; text.setLayoutData(data); return composite; }