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:arche.modifChangeImpact.ModifChangeImpactRFView.java
License:Open Source License
/** * Called by Eclipse to create the view and initialize it. */// ww w . j av a 2s. c om public void createPartControl(Composite parent) { Composite composite = new Composite(parent, SWT.NULL); GridLayout layout = new GridLayout(); layout.marginHeight = 0; layout.marginWidth = 0; composite.setLayout(layout); composite.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_FILL | GridData.HORIZONTAL_ALIGN_FILL)); consoleText = new Text(composite, SWT.V_SCROLL | SWT.H_SCROLL); consoleText.setLayoutData(new GridData(GridData.FILL_BOTH)); consoleText.setEditable(false); consoleText.setText("RF> Welcome to the Modifiability (Change Impact) Reasoning Framework!!!\n"); consoleText.setFont(JFaceResources.getFont(JFaceResources.TEXT_FONT)); consoleText.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE)); consoleColor = new Color(Display.getDefault(), new RGB(0, 0, 0)); consoleText.setForeground(consoleColor); Composite bottomLine = new Composite(composite, SWT.NULL); GridLayout layout2 = new GridLayout(); layout2.marginHeight = 0; layout2.marginWidth = 0; layout2.numColumns = 4; bottomLine.setLayout(layout2); bottomLine.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL)); startButton = new Button(bottomLine, SWT.PUSH); startButton.setText("Start"); startButton.setEnabled(true); startButton.addSelectionListener(new SelectionListener() { public void widgetSelected(SelectionEvent se) { consoleText.setText("RF> Service started\n"); startButton.setEnabled(false); stopButton.setEnabled(true); startReasoningFramework(); } public void widgetDefaultSelected(SelectionEvent se) { } }); stopButton = new Button(bottomLine, SWT.PUSH); stopButton.setText("Stop"); stopButton.setEnabled(false); stopButton.addSelectionListener(new SelectionListener() { public void widgetSelected(SelectionEvent se) { consoleText.setText("RF> Service stopped\n"); startButton.setEnabled(true); stopButton.setEnabled(false); stopReasoningFramework(); } public void widgetDefaultSelected(SelectionEvent se) { } }); clearButton = new Button(bottomLine, SWT.PUSH); clearButton.setText("Clear"); clearButton.addSelectionListener(new SelectionListener() { public void widgetSelected(SelectionEvent se) { consoleText.setText(""); } public void widgetDefaultSelected(SelectionEvent se) { } }); // jessButton = new Button(bottomLine, SWT.PUSH); // jessButton.setText("JessEngine"); // jessButton.addSelectionListener(new SelectionListener() { // // public void widgetSelected(SelectionEvent se) { // // if (watchWindow == null) { // Rete engine = null; //JessDataProvider.getDefaultJessEngine(); // watchWindow = new JessEngineWatchWindow(null,"Jess Watch --> ",rf.getID(),engine); // } // watchWindow.open(); // } // // public void widgetDefaultSelected(SelectionEvent se) { // } // }); hookUpToReasoningFramework(); }
From source file:ca.mcgill.cs.swevo.qualyzer.editors.RTFEditor.java
License:Open Source License
/** * Constructor.//from w w w . jav a 2 s . c o m * Initialises the actions. */ public RTFEditor() { super(); setSourceViewerConfiguration(new RTFSourceViewerConfiguration(getTextColorer())); setDocumentProvider(new RTFDocumentProvider2()); fIsDirty = false; fRegistry = QualyzerActivator.getDefault().getImageRegistry(); getPreferenceStore().setValue(AbstractDecoratedTextEditorPreferenceConstants.QUICK_DIFF_ALWAYS_ON, false); QualyzerActivator.getDefault().getPreferenceStore().addPropertyChangeListener(this); FontData font = PreferenceConverter.getFontData(QualyzerActivator.getDefault().getPreferenceStore(), IQualyzerPreferenceConstants.FONT); PreferenceConverter.setValue(getPreferenceStore(), JFaceResources.TEXT_FONT, font); }
From source file:ca.mcgill.cs.swevo.qualyzer.editors.RTFEditor.java
License:Open Source License
/** * Propagates a change in the font preference to the editor preference store. *///from www .j a v a 2 s .c o m @Override public void propertyChange(PropertyChangeEvent e) { if (e == null || e.getProperty().equals(IQualyzerPreferenceConstants.FONT)) { IPreferenceStore pref = getPreferenceStore(); FontData oldFont = PreferenceConverter.getFontData(pref, JFaceResources.TEXT_FONT); FontData font = PreferenceConverter.getFontData(QualyzerActivator.getDefault().getPreferenceStore(), IQualyzerPreferenceConstants.FONT); PreferenceConverter.setValue(pref, JFaceResources.TEXT_FONT, font); pref.firePropertyChangeEvent(JFaceResources.TEXT_FONT, oldFont, font); } else { super.propertyChange(e); } }
From source file:ca.mcgill.cs.swevo.qualyzer.QualyzerPreferenceInitializer.java
License:Open Source License
@Override public void initializeDefaultPreferences() { IEclipsePreferences node = new DefaultScope().getNode(QualyzerActivator.PLUGIN_ID); node.put(IQualyzerPreferenceConstants.DEFAULT_INVESTIGATOR, System.getProperty("user.name")); //$NON-NLS-1$ node.put(IQualyzerPreferenceConstants.FRAGMENT_COLOR, DEFAULT_COLOR); node.putInt(IQualyzerPreferenceConstants.SEEK_TIME, DEFAULT_SEEK_TIME); String value = EditorsPlugin.getDefault().getPreferenceStore().getDefaultString(JFaceResources.TEXT_FONT); node.put(IQualyzerPreferenceConstants.FONT, value); }
From source file:cc.warlock.rcp.ui.WarlockText.java
License:Open Source License
private void loadSettings() { if (settingListener != null) settingListener.remove();//from www . j a va 2s . c o m if (textWidget.isDisposed()) return; IClientSettings settings = null; if (client != null) settings = client.getClientSettings(); if (settings == null) settings = ClientSettings.getGlobalClientSettings(); WindowConfigurationProvider provider = WindowConfigurationProvider.getProvider(settings); settingListener = new WindowSettingsListener(provider); // Set to defaults first, then try window settings later Color background = ColorUtil.warlockColorToColor(provider.getWindowBackground(streamName)); Color foreground = ColorUtil.warlockColorToColor(provider.getWindowForeground(streamName)); IWarlockFont font = provider.getWindowFont(streamName); textWidget.setBackground(background); textWidget.setForeground(foreground); if (font.isDefaultFont()) { String defaultFontFace = GameViewConfiguration.getProvider(settings).getDefaultFontFace(); int defaultFontSize = GameViewConfiguration.getProvider(settings).getDefaultFontSize(); textWidget.setFont(new Font(Display.getDefault(), defaultFontFace, defaultFontSize, SWT.NORMAL)); } else { textWidget.setFont(FontUtil.warlockFontToFont(font)); } IWarlockFont columnFont = provider.getWindowMonoFont(streamName); if (columnFont == null || columnFont.isDefaultFont()) { this.monoFont = JFaceResources.getFont(JFaceResources.TEXT_FONT); } else { String fontFace = columnFont.getFamilyName(); int fontSize = columnFont.getSize(); this.monoFont = new Font(getTextWidget().getDisplay(), fontFace, fontSize, SWT.NORMAL); } }
From source file:ch.netcetera.eclipse.workspaceconfig.ui.dialog.WorkspacePrefercensRecorderResultDialog.java
License:Open Source License
/** {@inheritDoc} */ @Override// w w w . java 2 s .c om protected Control createDialogArea(Composite parent) { Composite composite = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(); layout.marginHeight = 10; layout.marginWidth = 15; layout.numColumns = 2; composite.setLayout(layout); composite.setLayoutData(new GridData(GridData.FILL_BOTH)); composite.setFont(parent.getFont()); Text resultText = new Text(composite, SWT.BORDER | SWT.MULTI | SWT.WRAP | SWT.V_SCROLL); GridData nameTextGridData = new GridData(GridData.FILL_BOTH); nameTextGridData.minimumWidth = 300; nameTextGridData.minimumHeight = 200; nameTextGridData.heightHint = 300; resultText.setLayoutData(nameTextGridData); resultText.setText(result); resultText.setFont(JFaceResources.getFont(JFaceResources.TEXT_FONT)); resultText.setText(this.result); return composite; }
From source file:com.amalto.workbench.widgets.composites.ElementFKInfoFormatViewer.java
License:Open Source License
protected void configureSourceViewerDecorationSupport(SourceViewerDecorationSupport support) { Iterator e = getAnnotationPreferences().getAnnotationPreferences().iterator(); while (e.hasNext()) { support.setAnnotationPreference((AnnotationPreference) e.next()); }/*from w ww .j a v a2s. c om*/ support.setCursorLinePainterPreferenceKeys(CURRENT_LINE, CURRENT_LINE_COLOR); support.setMarginPainterPreferenceKeys(PRINT_MARGIN, PRINT_MARGIN_COLOR, PRINT_MARGIN_COLUMN); support.setSymbolicFontName(JFaceResources.TEXT_FONT); support.setCharacterPairMatcher(new TagPairMatcher()); support.install(getPreferenceStore()); }
From source file:com.amalto.workbench.widgets.xmlviewer.XMLSourceViewer.java
License:Open Source License
/** * DOC hbhong Comment method "updateFont". */ private void updateFont() { getTextWidget().setFont(JFaceResources.getFont(JFaceResources.TEXT_FONT)); }
From source file:com.amalto.workbench.widgets.xmlviewer.XMLSourceViewer.java
License:Open Source License
protected final String getFontPropertyPreferenceKey() { String symbolicFontName = getSymbolicFontName(); if (symbolicFontName != null) { return symbolicFontName; }//ww w .j ava 2 s .c o m return JFaceResources.TEXT_FONT; }
From source file:com.aptana.formatter.ui.preferences.ScriptSourcePreviewerUpdater.java
License:Open Source License
/** * Creates a script source preview updater for the given viewer, configuration and preference store. * // w w w.j a v a2 s . c o m * @param viewer * the viewer * @param configuration * the configuration * @param preferenceStore * the preference store */ public ScriptSourcePreviewerUpdater(final SourceViewer viewer, final SourceViewerConfiguration configuration, final IPreferenceStore preferenceStore) { Assert.isNotNull(viewer); Assert.isNotNull(configuration); Assert.isNotNull(preferenceStore); final IPropertyChangeListener fontChangeListener = new IPropertyChangeListener() { public void propertyChange(PropertyChangeEvent event) { final String fontKey = JFaceResources.TEXT_FONT; if (fontKey.equals(event.getProperty())) { final Font font = JFaceResources.getFont(fontKey); viewer.getTextWidget().setFont(font); } } }; final IPreferenceChangeListener themeListener = new IPreferenceChangeListener() { public void preferenceChange(PreferenceChangeEvent event) { if (event.getKey().equals(IThemeManager.THEME_CHANGED)) { ColorManager colorManager = ThemePlugin.getDefault().getColorManager(); IThemeManager themeManager = ThemePlugin.getDefault().getThemeManager(); Color color = colorManager.getColor(themeManager.getCurrentTheme().getBackground()); StyledText styledText = viewer.getTextWidget(); styledText.setBackground(color); } } }; // Listen to theme changes final IPropertyChangeListener propertyChangeListener = new IPropertyChangeListener() { public void propertyChange(PropertyChangeEvent event) { // if (configuration.affectsTextPresentation(event)) { // configuration.handlePropertyChangeEvent(event); viewer.invalidateTextPresentation(); // } } }; viewer.getTextWidget().addDisposeListener(new DisposeListener() { public void widgetDisposed(DisposeEvent e) { preferenceStore.removePropertyChangeListener(propertyChangeListener); JFaceResources.getFontRegistry().removeListener(fontChangeListener); if (themeListener != null) { EclipseUtil.instanceScope().getNode(ThemePlugin.PLUGIN_ID) .removePreferenceChangeListener(themeListener); } } }); JFaceResources.getFontRegistry().addListener(fontChangeListener); preferenceStore.addPropertyChangeListener(propertyChangeListener); EclipseUtil.instanceScope().getNode(ThemePlugin.PLUGIN_ID).addPreferenceChangeListener(themeListener); }