|
From: Christopher W. <caw...@us...> - 2006-02-10 20:14:52
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19365/src/org/rubypeople/rdt/internal/ui/text Modified Files: RubyCommentScanner.java RubyTextTools.java IRubyPartitions.java Added Files: SimpleRubySourceViewerConfiguration.java Removed Files: RubyReconcilingStrategy.java Log Message: --- RubyReconcilingStrategy.java DELETED --- Index: RubyTextTools.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/RubyTextTools.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** RubyTextTools.java 1 Apr 2005 02:11:42 -0000 1.10 --- RubyTextTools.java 10 Feb 2006 20:14:43 -0000 1.11 *************** *** 20,254 **** import org.rubypeople.rdt.internal.ui.text.ruby.RubyCodeScanner; import org.rubypeople.rdt.internal.ui.text.ruby.SingleTokenRubyCodeScanner; public class RubyTextTools { ! /** ! * This tools' preference listener. ! */ ! private class PreferenceListener implements IPropertyChangeListener, Preferences.IPropertyChangeListener { ! public void propertyChange(PropertyChangeEvent event) { ! adaptToPreferenceChange(event); ! } ! public void propertyChange(Preferences.PropertyChangeEvent event) { ! adaptToPreferenceChange(new PropertyChangeEvent(event.getSource(), event.getProperty(), event.getOldValue(), event.getNewValue())); ! } ! } ! protected static String[] keywords; ! protected RubyColorManager fColorManager; ! protected RubyPartitionScanner partitionScanner; ! protected AbstractRubyScanner fCodeScanner; ! protected AbstractRubyScanner fMultilineCommentScanner, fSinglelineCommentScanner, stringScanner; ! private IPreferenceStore fPreferenceStore; ! private Preferences fCorePreferenceStore; ! /** The preference change listener */ ! private PreferenceListener fPreferenceListener = new PreferenceListener(); ! private SingleTokenRubyCodeScanner fRegexpScanner; ! private SingleTokenRubyCodeScanner fCommandScanner; ! /** ! * Creates a new Ruby text tools collection. ! * ! * @param store ! * the preference store to initialize the text tools. The text ! * tool instance installs a listener on the passed preference ! * store to adapt itself to changes in the preference store. In ! * general <code>PreferenceConstants. ! * getPreferenceStore()</code> ! * should be used to initialize the text tools. ! * @param coreStore ! * optional preference store to initialize the text tools. The ! * text tool instance installs a listener on the passed ! * preference store to adapt itself to changes in the preference ! * store. ! * @see org.rubypeople.rdt.ui.PreferenceConstants#getPreferenceStore() ! * @since 2.1 ! */ ! public RubyTextTools(IPreferenceStore store, Preferences coreStore) { ! this(store, coreStore, true); ! } ! /** ! * Creates a new Ruby text tools collection. ! * ! * @param store ! * the preference store to initialize the text tools. The text ! * tool instance installs a listener on the passed preference ! * store to adapt itself to changes in the preference store. In ! * general <code>PreferenceConstants. ! * getPreferenceStore()</code> ! * should be used to initialize the text tools. ! * @param coreStore ! * optional preference store to initialize the text tools. The ! * text tool instance installs a listener on the passed ! * preference store to adapt itself to changes in the preference ! * store. ! * @param autoDisposeOnDisplayDispose ! * if <code>true</code> the color manager automatically ! * disposes all managed colors when the current display gets ! * disposed and all calls to ! * {@link org.eclipse.jface.text.source.ISharedTextColors#dispose()} ! * are ignored. ! * @see org.rubypeople.rdt.ui.PreferenceConstants#getPreferenceStore() ! * @since 2.1 ! */ ! public RubyTextTools(IPreferenceStore store, Preferences coreStore, boolean autoDisposeOnDisplayDispose) { ! super(); ! fColorManager = new RubyColorManager(autoDisposeOnDisplayDispose); ! partitionScanner = new RubyPartitionScanner(); ! fCodeScanner = new RubyCodeScanner(fColorManager, store); ! fMultilineCommentScanner = new RubyCommentScanner(fColorManager, store, coreStore, IRubyColorConstants.RUBY_MULTI_LINE_COMMENT); ! fSinglelineCommentScanner = new RubyCommentScanner(fColorManager, store, coreStore, IRubyColorConstants.RUBY_SINGLE_LINE_COMMENT); ! stringScanner = new SingleTokenRubyCodeScanner(fColorManager, store, IRubyColorConstants.RUBY_STRING); ! fRegexpScanner = new SingleTokenRubyCodeScanner(fColorManager, store, IRubyColorConstants.RUBY_REGEXP); ! fCommandScanner = new SingleTokenRubyCodeScanner(fColorManager, store, IRubyColorConstants.RUBY_COMMAND); ! ! fPreferenceStore = store; ! fPreferenceStore.addPropertyChangeListener(fPreferenceListener); ! fCorePreferenceStore = coreStore; ! if (fCorePreferenceStore != null) fCorePreferenceStore.addPropertyChangeListener(fPreferenceListener); ! // fJavaDocScanner= new JavaDocScanner(fColorManager, store, coreStore); ! // fPartitionScanner= new FastJavaPartitionScanner(); ! } ! /** ! * Adapts the behavior of the contained components to the change encoded in ! * the given event. ! * ! * @param event ! * the event to which to adapt ! * @since 2.0 ! * @deprecated As of 3.0, no replacement ! */ ! protected void adaptToPreferenceChange(PropertyChangeEvent event) { ! if (fCodeScanner.affectsBehavior(event)) fCodeScanner.adaptToPreferenceChange(event); ! if (fMultilineCommentScanner.affectsBehavior(event)) fMultilineCommentScanner.adaptToPreferenceChange(event); ! if (fSinglelineCommentScanner.affectsBehavior(event)) fSinglelineCommentScanner.adaptToPreferenceChange(event); ! if (stringScanner.affectsBehavior(event)) stringScanner.adaptToPreferenceChange(event); ! if (fRegexpScanner.affectsBehavior(event)) fRegexpScanner.adaptToPreferenceChange(event); ! if (fCommandScanner.affectsBehavior(event)) fCommandScanner.adaptToPreferenceChange(event); ! // if (fJavaDocScanner.affectsBehavior(event)) ! // fJavaDocScanner.adaptToPreferenceChange(event); ! } ! public IDocumentPartitioner createDocumentPartitioner() { ! return new DefaultPartitioner(getPartitionScanner(), RubyPartitionScanner.LEGAL_CONTENT_TYPES); ! } ! protected IPartitionTokenScanner getPartitionScanner() { ! return partitionScanner; ! } ! public AbstractRubyScanner getCodeScanner() { ! return fCodeScanner; ! } ! protected ITokenScanner getMultilineCommentScanner() { ! return fMultilineCommentScanner; ! } ! protected ITokenScanner getSinglelineCommentScanner() { ! return fSinglelineCommentScanner; ! } ! protected ITokenScanner getStringScanner() { ! return stringScanner; ! } ! public IPreferenceStore getPreferenceStore() { ! return RubyPlugin.getDefault().getPreferenceStore(); ! } ! public static String[] getKeyWords() { ! if (keywords == null) { ! String csvKeywords = RubyEditorPreferences.getString("keywords"); ! List keywordList = new ArrayList(); ! StringTokenizer tokenizer = new StringTokenizer(csvKeywords, ","); ! while (tokenizer.hasMoreTokens()) ! keywordList.add(tokenizer.nextToken()); ! keywords = new String[keywordList.size()]; ! keywordList.toArray(keywords); ! } ! return keywords; ! } ! public boolean affectsTextPresentation(PropertyChangeEvent event) { ! return fCodeScanner.affectsBehavior(event) ! || fMultilineCommentScanner.affectsBehavior(event) ! || fSinglelineCommentScanner.affectsBehavior(event) ! || stringScanner.affectsBehavior(event) ! || fRegexpScanner.affectsBehavior(event) ! || fCommandScanner.affectsBehavior(event); ! } ! /** ! * Sets up the Ruby document partitioner for the given document for the ! * given partitioning. ! * ! * @param document ! * the document to be set up ! * @param partitioning ! * the document partitioning ! * @since 3.0 ! */ ! public void setupRubyDocumentPartitioner(IDocument document, String partitioning) { ! IDocumentPartitioner partitioner = createDocumentPartitioner(); ! if (document instanceof IDocumentExtension3) { ! IDocumentExtension3 extension3 = (IDocumentExtension3) document; ! extension3.setDocumentPartitioner(partitioning, partitioner); ! } else { ! document.setDocumentPartitioner(partitioner); ! } ! partitioner.connect(document); ! } ! /** ! * Disposes all the individual tools of this tools collection. ! */ ! public void dispose() { ! fCodeScanner = null; ! fMultilineCommentScanner = null; ! fSinglelineCommentScanner = null; ! stringScanner = null; ! fRegexpScanner = null; ! fCommandScanner = null; ! // fJavaDocScanner= null; ! partitionScanner = null; ! if (fColorManager != null) { ! fColorManager.dispose(); ! fColorManager = null; ! } ! if (fPreferenceStore != null) { ! fPreferenceStore.removePropertyChangeListener(fPreferenceListener); ! fPreferenceStore = null; ! if (fCorePreferenceStore != null) { ! fCorePreferenceStore.removePropertyChangeListener(fPreferenceListener); ! fCorePreferenceStore = null; ! } ! fPreferenceListener = null; ! } ! } ! public ITokenScanner getRegexpScanner() { ! return fRegexpScanner; ! } ! public ITokenScanner getCommandScanner() { ! return fCommandScanner; ! } } --- 20,329 ---- import org.rubypeople.rdt.internal.ui.text.ruby.RubyCodeScanner; import org.rubypeople.rdt.internal.ui.text.ruby.SingleTokenRubyCodeScanner; + import org.rubypeople.rdt.ui.text.IColorManager; + import org.rubypeople.rdt.ui.text.RubySourceViewerConfiguration; public class RubyTextTools { ! /** ! * This tools' preference listener. ! */ ! private class PreferenceListener implements IPropertyChangeListener, ! Preferences.IPropertyChangeListener { ! public void propertyChange(PropertyChangeEvent event) { ! adaptToPreferenceChange(event); ! } ! public void propertyChange(Preferences.PropertyChangeEvent event) { ! adaptToPreferenceChange(new PropertyChangeEvent(event.getSource(), event.getProperty(), ! event.getOldValue(), event.getNewValue())); ! } ! } ! protected static String[] keywords; ! protected RubyColorManager fColorManager; ! protected RubyPartitionScanner partitionScanner; ! protected AbstractRubyScanner fCodeScanner; ! protected AbstractRubyScanner fMultilineCommentScanner, fSinglelineCommentScanner, ! stringScanner; ! private IPreferenceStore fPreferenceStore; ! private Preferences fCorePreferenceStore; ! /** The preference change listener */ ! private PreferenceListener fPreferenceListener = new PreferenceListener(); ! private SingleTokenRubyCodeScanner fRegexpScanner; ! private SingleTokenRubyCodeScanner fCommandScanner; ! /** ! * Creates a new Ruby text tools collection. ! * ! * @param store ! * the preference store to initialize the text tools. The text ! * tool instance installs a listener on the passed preference ! * store to adapt itself to changes in the preference store. In ! * general <code>PreferenceConstants. ! * getPreferenceStore()</code> ! * should be used to initialize the text tools. ! * @param coreStore ! * optional preference store to initialize the text tools. The ! * text tool instance installs a listener on the passed ! * preference store to adapt itself to changes in the preference ! * store. ! * @see org.rubypeople.rdt.ui.PreferenceConstants#getPreferenceStore() ! * @since 2.1 ! */ ! public RubyTextTools(IPreferenceStore store, Preferences coreStore) { ! this(store, coreStore, true); ! } ! /** ! * Creates a new Ruby text tools collection. ! * ! * @param store ! * the preference store to initialize the text tools. The text ! * tool instance installs a listener on the passed preference ! * store to adapt itself to changes in the preference store. In ! * general <code>PreferenceConstants. ! * getPreferenceStore()</code> ! * should be used to initialize the text tools. ! * @param coreStore ! * optional preference store to initialize the text tools. The ! * text tool instance installs a listener on the passed ! * preference store to adapt itself to changes in the preference ! * store. ! * @param autoDisposeOnDisplayDispose ! * if <code>true</code> the color manager automatically ! * disposes all managed colors when the current display gets ! * disposed and all calls to ! * {@link org.eclipse.jface.text.source.ISharedTextColors#dispose()} ! * are ignored. ! * @see org.rubypeople.rdt.ui.PreferenceConstants#getPreferenceStore() ! * @since 2.1 ! */ ! public RubyTextTools(IPreferenceStore store, Preferences coreStore, ! boolean autoDisposeOnDisplayDispose) { ! super(); ! fColorManager = new RubyColorManager(autoDisposeOnDisplayDispose); ! partitionScanner = new RubyPartitionScanner(); ! fCodeScanner = new RubyCodeScanner(fColorManager, store); ! fMultilineCommentScanner = new RubyCommentScanner(fColorManager, store, coreStore, ! IRubyColorConstants.RUBY_MULTI_LINE_COMMENT); ! fSinglelineCommentScanner = new RubyCommentScanner(fColorManager, store, coreStore, ! IRubyColorConstants.RUBY_SINGLE_LINE_COMMENT); ! stringScanner = new SingleTokenRubyCodeScanner(fColorManager, store, ! IRubyColorConstants.RUBY_STRING); ! fRegexpScanner = new SingleTokenRubyCodeScanner(fColorManager, store, ! IRubyColorConstants.RUBY_REGEXP); ! fCommandScanner = new SingleTokenRubyCodeScanner(fColorManager, store, ! IRubyColorConstants.RUBY_COMMAND); ! fPreferenceStore = store; ! fPreferenceStore.addPropertyChangeListener(fPreferenceListener); ! fCorePreferenceStore = coreStore; ! if (fCorePreferenceStore != null) ! fCorePreferenceStore.addPropertyChangeListener(fPreferenceListener); ! // fJavaDocScanner= new JavaDocScanner(fColorManager, store, coreStore); ! // fPartitionScanner= new FastJavaPartitionScanner(); ! } ! /** ! * Adapts the behavior of the contained components to the change encoded in ! * the given event. ! * ! * @param event ! * the event to which to adapt ! * @since 2.0 ! * @deprecated As of 3.0, no replacement ! */ ! protected void adaptToPreferenceChange(PropertyChangeEvent event) { ! if (fCodeScanner.affectsBehavior(event)) fCodeScanner.adaptToPreferenceChange(event); ! if (fMultilineCommentScanner.affectsBehavior(event)) ! fMultilineCommentScanner.adaptToPreferenceChange(event); ! if (fSinglelineCommentScanner.affectsBehavior(event)) ! fSinglelineCommentScanner.adaptToPreferenceChange(event); ! if (stringScanner.affectsBehavior(event)) stringScanner.adaptToPreferenceChange(event); ! if (fRegexpScanner.affectsBehavior(event)) fRegexpScanner.adaptToPreferenceChange(event); ! if (fCommandScanner.affectsBehavior(event)) fCommandScanner.adaptToPreferenceChange(event); ! // if (fJavaDocScanner.affectsBehavior(event)) ! // fJavaDocScanner.adaptToPreferenceChange(event); ! } ! public IDocumentPartitioner createDocumentPartitioner() { ! return new DefaultPartitioner(getPartitionScanner(), ! RubyPartitionScanner.LEGAL_CONTENT_TYPES); ! } ! protected IPartitionTokenScanner getPartitionScanner() { ! return partitionScanner; ! } ! /** ! * @deprecated As of 0.8.0, replaced by ! * {@link RubySourceViewerConfiguration#getCodeScanner()} ! */ ! public AbstractRubyScanner getCodeScanner() { ! return fCodeScanner; ! } ! /** ! * @deprecated As of 0.8.0, replaced by ! * {@link RubySourceViewerConfiguration#getMultilineCommentScanner()} ! */ ! public ITokenScanner getMultilineCommentScanner() { ! return fMultilineCommentScanner; ! } ! /** ! * @deprecated As of 0.8.0, replaced by ! * {@link RubySourceViewerConfiguration#getSingleineCommentScanner()} ! */ ! public ITokenScanner getSinglelineCommentScanner() { ! return fSinglelineCommentScanner; ! } ! /** ! * @deprecated As of 0.8.0, replaced by ! * {@link RubySourceViewerConfiguration#getStringScanner()} ! */ ! public ITokenScanner getStringScanner() { ! return stringScanner; ! } ! public IPreferenceStore getPreferenceStore() { ! return RubyPlugin.getDefault().getPreferenceStore(); ! } ! public static String[] getKeyWords() { ! if (keywords == null) { ! String csvKeywords = RubyEditorPreferences.getString("keywords"); ! List keywordList = new ArrayList(); ! StringTokenizer tokenizer = new StringTokenizer(csvKeywords, ","); ! while (tokenizer.hasMoreTokens()) ! keywordList.add(tokenizer.nextToken()); ! keywords = new String[keywordList.size()]; ! keywordList.toArray(keywords); ! } ! return keywords; ! } ! public boolean affectsTextPresentation(PropertyChangeEvent event) { ! return fCodeScanner.affectsBehavior(event) ! || fMultilineCommentScanner.affectsBehavior(event) ! || fSinglelineCommentScanner.affectsBehavior(event) ! || stringScanner.affectsBehavior(event) || fRegexpScanner.affectsBehavior(event) ! || fCommandScanner.affectsBehavior(event); ! } ! /** ! * Sets up the Ruby document partitioner for the given document for the ! * given partitioning. ! * ! * @param document ! * the document to be set up ! * @param partitioning ! * the document partitioning ! * @since 3.0 ! */ ! public void setupRubyDocumentPartitioner(IDocument document, String partitioning) { ! IDocumentPartitioner partitioner = createDocumentPartitioner(); ! if (document instanceof IDocumentExtension3) { ! IDocumentExtension3 extension3 = (IDocumentExtension3) document; ! extension3.setDocumentPartitioner(partitioning, partitioner); ! } else { ! document.setDocumentPartitioner(partitioner); ! } ! partitioner.connect(document); ! } ! /** ! * Disposes all the individual tools of this tools collection. ! */ ! public void dispose() { ! fCodeScanner = null; ! fMultilineCommentScanner = null; ! fSinglelineCommentScanner = null; ! stringScanner = null; ! fRegexpScanner = null; ! fCommandScanner = null; ! // fJavaDocScanner= null; ! partitionScanner = null; ! if (fColorManager != null) { ! fColorManager.dispose(); ! fColorManager = null; ! } ! if (fPreferenceStore != null) { ! fPreferenceStore.removePropertyChangeListener(fPreferenceListener); ! fPreferenceStore = null; ! if (fCorePreferenceStore != null) { ! fCorePreferenceStore.removePropertyChangeListener(fPreferenceListener); ! fCorePreferenceStore = null; ! } ! fPreferenceListener = null; ! } ! } ! /** ! * @deprecated As of 0.8.0, replaced by ! * {@link RubySourceViewerConfiguration#getRegexpScanner()} ! */ ! public ITokenScanner getRegexpScanner() { ! return fRegexpScanner; ! } ! ! /** ! * @deprecated As of 0.8.0, replaced by ! * {@link RubySourceViewerConfiguration#getCommandScanner()} ! */ ! public ITokenScanner getCommandScanner() { ! return fCommandScanner; ! } ! ! /** ! * Returns the color manager which is used to manage any Ruby-specific ! * colors needed for such things like syntax highlighting. ! * <p> ! * Clients which are only interested in the color manager of the Ruby UI ! * plug-in should use {@link org.rubypeople.rdt.ui.RubyUI#getColorManager()}. ! * </p> ! * ! * @return the color manager to be used for Ruby text viewers ! * @see org.rubypeople.rdt.ui.RubyUI#getColorManager() ! */ ! public IColorManager getColorManager() { ! return fColorManager; ! } ! ! /** ! * Returns this text tool's core preference store. ! * ! * @return the core preference store ! * @since 0.8.0 ! */ ! public Preferences getCorePreferenceStore() { ! return fCorePreferenceStore; ! } ! ! /** ! * Sets up the Ruby document partitioner for the given document for the ! * default partitioning. ! * ! * @param document ! * the document to be set up ! * @since 0.8.0 ! */ ! public void setupRubyDocumentPartitioner(IDocument document) { ! setupRubyDocumentPartitioner(document, IDocumentExtension3.DEFAULT_PARTITIONING); ! } } Index: RubyCommentScanner.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/RubyCommentScanner.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** RubyCommentScanner.java 2 Mar 2005 00:56:49 -0000 1.2 --- RubyCommentScanner.java 10 Feb 2006 20:14:43 -0000 1.3 *************** *** 179,182 **** --- 179,195 ---- initialize(); } + + /** + * Initialize with the given arguments. + * + * @param manager Color manager + * @param store Preference store + * @param defaultTokenProperty Default token property + * + * @since 0.8.0 + */ + public RubyCommentScanner(IColorManager manager, IPreferenceStore store, String defaultTokenProperty) { + this(manager, store, null, defaultTokenProperty, new String[] { defaultTokenProperty, TASK_TAG }); + } public boolean affectsBehavior(PropertyChangeEvent event) { Index: IRubyPartitions.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/IRubyPartitions.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** IRubyPartitions.java 2 Mar 2005 00:56:49 -0000 1.2 --- IRubyPartitions.java 10 Feb 2006 20:14:43 -0000 1.3 *************** *** 14,20 **** /** * The name of the Ruby partitioning. ! * @since 3.0 */ public final static String RUBY_PARTITIONING= "___ruby_partitioning"; //$NON-NLS-1$ } --- 14,45 ---- /** * The name of the Ruby partitioning. ! * @since 0.7.0 */ public final static String RUBY_PARTITIONING= "___ruby_partitioning"; //$NON-NLS-1$ + + /** + * The identifier of the single-line end comment partition content type. + */ + String RUBY_SINGLE_LINE_COMMENT= "__ruby_singleline_comment"; //$NON-NLS-1$ + + /** + * The identifier multi-line comment partition content type. + */ + String RUBY_MULTI_LINE_COMMENT= "__ruby_multiline_comment"; //$NON-NLS-1$ + + /** + * The identifier of the Rdoc (JLS2: DocumentationComment) partition content type. + */ + String RUBY_DOC= "__ruby_rdoc"; //$NON-NLS-1$ + + /** + * The identifier of the Ruby string partition content type. + */ + String RUBY_STRING= "__ruby_string"; //$NON-NLS-1$ + + /** + * The identifier of the Ruby character partition content type. + */ + String RUBY_CHARACTER= "__ruby_character"; //$NON-NLS-1$ } --- NEW FILE: SimpleRubySourceViewerConfiguration.java --- /******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.rubypeople.rdt.internal.ui.text; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.text.IAutoEditStrategy; import org.eclipse.jface.text.IInformationControlCreator; import org.eclipse.jface.text.ITextHover; import org.eclipse.jface.text.formatter.IContentFormatter; import org.eclipse.jface.text.hyperlink.IHyperlinkDetector; import org.eclipse.jface.text.information.IInformationPresenter; import org.eclipse.jface.text.source.IAnnotationHover; import org.eclipse.jface.text.source.ISourceViewer; import org.eclipse.ui.texteditor.ITextEditor; import org.rubypeople.rdt.ui.text.IColorManager; import org.rubypeople.rdt.ui.text.RubySourceViewerConfiguration; /** * A simple * {@linkplain org.eclipse.jdt.ui.text.RubySourceViewerConfiguration Ruby source viewer configuration}. * <p> * This simple source viewer configuration basically provides syntax coloring * and disables all other features like code assist, quick outlines, * hyperlinking, etc. * </p> * * @since 3.1 */ public class SimpleRubySourceViewerConfiguration extends RubySourceViewerConfiguration { private boolean fConfigureFormatter; /** * Creates a new Ruby source viewer configuration for viewers in the given * editor using the given preference store, the color manager and the * specified document partitioning. * * @param colorManager * the color manager * @param preferenceStore * the preference store, can be read-only * @param editor * the editor in which the configured viewer(s) will reside, or * <code>null</code> if none * @param partitioning * the document partitioning for this configuration, or * <code>null</code> for the default partitioning * @param configureFormatter * <code>true</code> if a content formatter should be * configured */ public SimpleRubySourceViewerConfiguration(IColorManager colorManager, IPreferenceStore preferenceStore, ITextEditor editor, String partitioning, boolean configureFormatter) { super(colorManager, preferenceStore, editor, partitioning); fConfigureFormatter = configureFormatter; } /* * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getAutoEditStrategies(org.eclipse.jface.text.source.ISourceViewer, * java.lang.String) */ public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) { return null; } /* * @see SourceViewerConfiguration#getAnnotationHover(ISourceViewer) */ public IAnnotationHover getAnnotationHover(ISourceViewer sourceViewer) { return null; } /* * @see SourceViewerConfiguration#getOverviewRulerAnnotationHover(ISourceViewer) */ public IAnnotationHover getOverviewRulerAnnotationHover(ISourceViewer sourceViewer) { return null; } /* * @see SourceViewerConfiguration#getConfiguredTextHoverStateMasks(ISourceViewer, * String) */ public int[] getConfiguredTextHoverStateMasks(ISourceViewer sourceViewer, String contentType) { return null; } /* * @see SourceViewerConfiguration#getTextHover(ISourceViewer, String, int) */ public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType, int stateMask) { return null; } /* * @see SourceViewerConfiguration#getTextHover(ISourceViewer, String) */ public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType) { return null; } /* * @see SourceViewerConfiguration#getContentFormatter(ISourceViewer) */ public IContentFormatter getContentFormatter(ISourceViewer sourceViewer) { if (fConfigureFormatter) return super.getContentFormatter(sourceViewer); else return null; } /* * @see SourceViewerConfiguration#getInformationControlCreator(ISourceViewer) */ public IInformationControlCreator getInformationControlCreator(ISourceViewer sourceViewer) { return null; } /* * @see SourceViewerConfiguration#getInformationPresenter(ISourceViewer) */ public IInformationPresenter getInformationPresenter(ISourceViewer sourceViewer) { return null; } /* * @see org.eclipse.jdt.ui.text.RubySourceViewerConfiguration#getOutlinePresenter(org.eclipse.jface.text.source.ISourceViewer, * boolean) */ public IInformationPresenter getOutlinePresenter(ISourceViewer sourceViewer, boolean doCodeResolve) { return null; } /* * @see org.eclipse.jdt.ui.text.RubySourceViewerConfiguration#getHierarchyPresenter(org.eclipse.jface.text.source.ISourceViewer, * boolean) */ public IInformationPresenter getHierarchyPresenter(ISourceViewer sourceViewer, boolean doCodeResolve) { return null; } /* * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getHyperlinkDetectors(org.eclipse.jface.text.source.ISourceViewer) */ public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer) { return null; } } |