org.eclipse.jface.text.source.IOverviewRuler Java Examples

The following examples show how to use org.eclipse.jface.text.source.IOverviewRuler. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TypeScriptMergeViewer.java    From typescript.java with MIT License 6 votes vote down vote up
@Override
protected ISourceViewer createTypeScriptSourceViewer(Composite parent, IVerticalRuler verticalRuler,
		IOverviewRuler overviewRuler, boolean isOverviewRulerVisible, int styles, IPreferenceStore store) {
	return new AdaptedSourceViewer(parent, verticalRuler, overviewRuler, isOverviewRulerVisible, styles,
			store) {
		@Override
		protected void handleDispose() {
			super.handleDispose();

			// dispose the compilation unit adapter
			dispose();

			fEditor.remove(this);
			if (fEditor.isEmpty()) {
				fEditor = null;
				fSite = null;
			}

			fSourceViewer.remove(this);
			if (fSourceViewer.isEmpty())
				fSourceViewer = null;

		}
	};
}
 
Example #2
Source File: BaseEditor.java    From Pydev with Eclipse Public License 1.0 6 votes vote down vote up
@Override
protected IOverviewRuler createOverviewRuler(ISharedTextColors sharedColors) {
    // Note: create the minimap overview ruler regardless of whether it should be shown or not
    // (the setting to show it will control what's drawn).
    if (MinimapOverviewRulerPreferencesPage.useMinimap()) {
        IOutlineModel outlineModel = (IOutlineModel) this.getAdapter(IOutlineModel.class);
        IOverviewRuler ruler = new MinimapOverviewRuler(getAnnotationAccess(), sharedColors, outlineModel);

        Iterator e = getAnnotationPreferences().getAnnotationPreferences().iterator();
        while (e.hasNext()) {
            AnnotationPreference preference = (AnnotationPreference) e.next();
            if (preference.contributesToHeader()) {
                ruler.addHeaderAnnotationType(preference.getAnnotationType());
            }
        }
        return ruler;
    } else {
        return super.createOverviewRuler(sharedColors);
    }
}
 
Example #3
Source File: XtextSourceViewer.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public XtextSourceViewer createSourceViewer(Composite parent, IVerticalRuler ruler,
		IOverviewRuler overviewRuler, boolean showsAnnotationOverview, int styles) {
	XtextSourceViewer result = new XtextSourceViewer(parent, ruler, overviewRuler, showsAnnotationOverview, styles);
	membersInjector.injectMembers(result);
	return result;
}
 
Example #4
Source File: RichStringAwareSourceViewer.java    From xtext-xtend with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public XtextSourceViewer createSourceViewer(Composite parent, IVerticalRuler ruler,
		IOverviewRuler overviewRuler, boolean showsAnnotationOverview, int styles) {
	RichStringAwareSourceViewer result = new RichStringAwareSourceViewer(parent, ruler, overviewRuler, showsAnnotationOverview, styles);
	result.merger = merger;
	return result;
}
 
Example #5
Source File: PySourceViewer.java    From Pydev with Eclipse Public License 1.0 5 votes vote down vote up
public PySourceViewer(Composite parent, IVerticalRuler ruler, IOverviewRuler overviewRuler,
        boolean showsAnnotationOverview, int styles, final PyEditProjection projection) {
    super(parent, ruler, overviewRuler, showsAnnotationOverview, styles,
            new PyAbstractIndentGuidePreferencesProvider() {

                @Override
                public int getTabWidth() {
                    return ((PyEdit) projection).getIndentPrefs().getTabWidth();
                }
            });
    this.projection = new WeakReference<PyEdit>((PyEdit) projection);
}
 
Example #6
Source File: PyEditProjection.java    From Pydev with Eclipse Public License 1.0 5 votes vote down vote up
@Override
protected ISourceViewer createSourceViewer(Composite parent, IVerticalRuler ruler, int styles) {
    IOverviewRuler overviewRuler = getOverviewRuler();
    PySourceViewer viewer = new PySourceViewer(parent, ruler, overviewRuler, isOverviewRulerVisible(), styles,
            this);

    //ensure decoration support has been created and configured.
    getSourceViewerDecorationSupport(viewer);

    return viewer;
}
 
Example #7
Source File: BaseSourceViewer.java    From Pydev with Eclipse Public License 1.0 5 votes vote down vote up
public BaseSourceViewer(Composite parent, IVerticalRuler verticalRuler, IOverviewRuler overviewRuler,
        boolean showAnnotationsOverview, int styles, IVerticalIndentGuidePreferencesProvider verticalIndentPrefs) {
    super(parent, verticalRuler, overviewRuler, showAnnotationsOverview, styles);

    verticalLinesPainter = new VerticalIndentGuidesPainter(
            getIndentGuide(verticalIndentPrefs));
    StyledText styledText = this.getTextWidget();
    verticalLinesPainter.setStyledText(styledText);
    styledText.addPaintListener(verticalLinesPainter);
    styledText.setLeftMargin(Math.max(styledText.getLeftMargin(), 2));
}
 
Example #8
Source File: SARLSourceViewer.java    From sarl with Apache License 2.0 5 votes vote down vote up
@Override
public XtextSourceViewer createSourceViewer(Composite parent, IVerticalRuler ruler,
		IOverviewRuler overviewRuler, boolean showsAnnotationOverview, int styles) {
	final SARLSourceViewer result = new SARLSourceViewer(parent, ruler, overviewRuler, showsAnnotationOverview, styles);
	try {
		final Field field = RichStringAwareSourceViewer.class.getDeclaredField("merger"); //$NON-NLS-1$
		field.setAccessible(true);
		field.set(result, this.merger);
	} catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException exception) {
		Exceptions.sneakyThrow(exception);
	}
	this.memberInjector.injectMembers(result);
	return result;
}
 
Example #9
Source File: XtextSourceViewer.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
XtextSourceViewer createSourceViewer(Composite parent, IVerticalRuler ruler, IOverviewRuler overviewRuler,
boolean showsAnnotationOverview, int styles);
 
Example #10
Source File: ReadOnlyStructuredTextEditor.java    From bonita-studio with GNU General Public License v2.0 4 votes vote down vote up
public ReadOnlyStructedTextViewer(Composite parent, IVerticalRuler verticalRuler, IOverviewRuler overviewRuler,
        boolean showAnnotationsOverview, int styles) {
    super(parent, verticalRuler, overviewRuler, showAnnotationsOverview, styles);
}
 
Example #11
Source File: ProjectionViewerExt.java    From goclipse with Eclipse Public License 1.0 4 votes vote down vote up
public ProjectionViewerExt(Composite parent, IVerticalRuler ruler, IOverviewRuler overviewRuler,
		boolean showsAnnotationOverview, int styles) {
	super(parent, ruler, overviewRuler, showsAnnotationOverview, styles);
}
 
Example #12
Source File: LangSourceViewer.java    From goclipse with Eclipse Public License 1.0 4 votes vote down vote up
public LangSourceViewer(Composite parent, IVerticalRuler verticalRuler, IOverviewRuler overviewRuler,
		boolean showAnnotationsOverview, int styles) {
	super(parent, verticalRuler, overviewRuler, showAnnotationsOverview, styles);
}
 
Example #13
Source File: JavaSourceViewer.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
public JavaSourceViewer(Composite parent, IVerticalRuler verticalRuler, IOverviewRuler overviewRuler, boolean showAnnotationsOverview, int styles, IPreferenceStore store) {
	super(parent, verticalRuler, overviewRuler, showAnnotationsOverview, styles);
	setPreferenceStore(store);
}
 
Example #14
Source File: CompilationUnitEditor.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
@Override
protected ISourceViewer createJavaSourceViewer(Composite parent, IVerticalRuler verticalRuler, IOverviewRuler overviewRuler, boolean isOverviewRulerVisible, int styles, IPreferenceStore store) {
	return new AdaptedSourceViewer(parent, verticalRuler, overviewRuler, isOverviewRulerVisible, styles, store);
}
 
Example #15
Source File: CompilationUnitEditor.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
public AdaptedSourceViewer(Composite parent, IVerticalRuler verticalRuler, IOverviewRuler overviewRuler, boolean showAnnotationsOverview, int styles, IPreferenceStore store) {
	super(parent, verticalRuler, overviewRuler, showAnnotationsOverview, styles, store);
}
 
Example #16
Source File: GamaSourceViewerFactory.java    From gama with GNU General Public License v3.0 4 votes vote down vote up
/**
 * @see org.eclipse.xtext.ui.editor.XtextSourceViewer.Factory#createSourceViewer(org.eclipse.swt.widgets.Composite,
 *      org.eclipse.jface.text.source.IVerticalRuler,
 *      org.eclipse.jface.text.source.IOverviewRuler, boolean, int)
 */
@Override
public XtextSourceViewer createSourceViewer(final Composite parent, final IVerticalRuler ruler,
		final IOverviewRuler overviewRuler, final boolean showsAnnotationOverview, final int styles) {
	return new GamaSourceViewer(parent, ruler, overviewRuler, showsAnnotationOverview, styles);
}
 
Example #17
Source File: JavaScriptLightWeightEditor.java    From typescript.java with MIT License 4 votes vote down vote up
protected ISourceViewer createTypeScriptSourceViewer(Composite parent, IVerticalRuler verticalRuler,
		IOverviewRuler overviewRuler, boolean isOverviewRulerVisible, int styles, IPreferenceStore store) {
	return new TypeScriptSourceViewer(parent, verticalRuler, getOverviewRuler(), isOverviewRulerVisible(), styles,
			store);
}
 
Example #18
Source File: TypeScriptSourceViewer.java    From typescript.java with MIT License 4 votes vote down vote up
public TypeScriptSourceViewer(Composite parent, IVerticalRuler verticalRuler, IOverviewRuler overviewRuler,
		boolean showAnnotationsOverview, int styles, IPreferenceStore store) {
	super(parent, verticalRuler, overviewRuler, showAnnotationsOverview, styles, store);
}
 
Example #19
Source File: TypeScriptEditor.java    From typescript.java with MIT License 4 votes vote down vote up
public AdaptedSourceViewer(Composite parent, IVerticalRuler verticalRuler, IOverviewRuler overviewRuler,
		boolean showAnnotationsOverview, int styles, IPreferenceStore store) {
	super(parent, verticalRuler, overviewRuler, showAnnotationsOverview, styles, store);
}
 
Example #20
Source File: FixedXtextSourceViewer.java    From dsl-devkit with Eclipse Public License 1.0 4 votes vote down vote up
/** {@inheritDoc} */
@Override
public XtextSourceViewer createSourceViewer(final Composite parent, final IVerticalRuler ruler, final IOverviewRuler overviewRuler, final boolean showsAnnotationOverview, final int styles) {
  return new FixedXtextSourceViewer(parent, ruler, overviewRuler, showsAnnotationOverview, styles);
}
 
Example #21
Source File: RichStringAwareSourceViewer.java    From xtext-xtend with Eclipse Public License 2.0 4 votes vote down vote up
public RichStringAwareSourceViewer(Composite parent, IVerticalRuler ruler, IOverviewRuler overviewRuler,
		boolean showsAnnotationOverview, int styles) {
	super(parent, ruler, overviewRuler, showsAnnotationOverview, styles);
}
 
Example #22
Source File: XtextSourceViewer.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public XtextSourceViewer(Composite parent, IVerticalRuler ruler, IOverviewRuler overviewRuler,
		boolean showsAnnotationOverview, int styles) {
	super(parent, ruler, overviewRuler, showsAnnotationOverview, styles);
}
 
Example #23
Source File: TMViewer.java    From tm4e with Eclipse Public License 1.0 4 votes vote down vote up
public TMViewer(Composite parent, IVerticalRuler verticalRuler, IOverviewRuler overviewRuler,
		boolean showAnnotationsOverview, int styles) {
	super(parent, verticalRuler, overviewRuler, showAnnotationsOverview, styles);
	init();
}
 
Example #24
Source File: AbstractFormatterPreferencePage.java    From APICloud-Studio with GNU General Public License v3.0 3 votes vote down vote up
/**
 * @param parent
 * @param verticalRuler
 * @param overviewRuler
 * @param showAnnotationsOverview
 * @param styles
 * @param store
 * @return
 */
private ProjectionViewer createPreviewViewer(Composite parent, IVerticalRuler verticalRuler,
		IOverviewRuler overviewRuler, boolean showAnnotationsOverview, int styles, IPreferenceStore store)
{
	ProjectionViewer viewer = new ProjectionViewer(parent, verticalRuler, overviewRuler,
			showAnnotationsOverview, styles);
	ThemePlugin.getDefault().getControlThemerFactory().apply(viewer);
	return viewer;
}
 
Example #25
Source File: CommonProjectionViewer.java    From APICloud-Studio with GNU General Public License v3.0 2 votes vote down vote up
/**
 * @param parent
 * @param ruler
 * @param overviewRuler
 * @param showsAnnotationOverview
 * @param styles
 */
public CommonProjectionViewer(Composite parent, IVerticalRuler ruler, IOverviewRuler overviewRuler,
		boolean showsAnnotationOverview, int styles)
{
	super(parent, ruler, overviewRuler, showsAnnotationOverview, styles);
}
 
Example #26
Source File: JavaEditor.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 2 votes vote down vote up
/**
 * Creates the Java source viewer to be used by this editor.
 * Subclasses may re-implement this method.
 *
 * @param parent the parent control
 * @param verticalRuler the vertical ruler
 * @param overviewRuler the overview ruler
 * @param isOverviewRulerVisible <code>true</code> if the overview ruler is visible
 * @param styles style bits, <code>SWT.WRAP</code> is currently not supported
 * @param store the preference store
 * @see AbstractTextEditor#createSourceViewer(Composite, IVerticalRuler, int)
 * @return the source viewer
 */
protected ISourceViewer createJavaSourceViewer(Composite parent, IVerticalRuler verticalRuler, IOverviewRuler overviewRuler, boolean isOverviewRulerVisible, int styles, IPreferenceStore store) {
	return new JavaSourceViewer(parent, verticalRuler, getOverviewRuler(), isOverviewRulerVisible(), styles, store);
}
 
Example #27
Source File: GamaSourceViewer.java    From gama with GNU General Public License v3.0 2 votes vote down vote up
/**
 * @param parent
 * @param ruler
 * @param overviewRuler
 * @param showsAnnotationOverview
 * @param styles
 */
public GamaSourceViewer(final Composite parent, final IVerticalRuler ruler, final IOverviewRuler overviewRuler,
		final boolean showsAnnotationOverview, final int styles) {
	super(parent, ruler, overviewRuler, showsAnnotationOverview, styles);
	isOverviewVisible = showsAnnotationOverview && overviewRuler != null;
}
 
Example #28
Source File: SARLSourceViewer.java    From sarl with Apache License 2.0 2 votes vote down vote up
/** Constructor.
 *
 * @param parent the container.
 * @param ruler the vertical ruler.
 * @param overviewRuler the overview ruler.
 * @param showsAnnotationOverview the annotation shower.
 * @param styles the styles.
 */
public SARLSourceViewer(Composite parent, IVerticalRuler ruler, IOverviewRuler overviewRuler,
		boolean showsAnnotationOverview, int styles) {
	super(parent, ruler, overviewRuler, showsAnnotationOverview, styles);
}
 
Example #29
Source File: FixedXtextSourceViewer.java    From dsl-devkit with Eclipse Public License 1.0 2 votes vote down vote up
/**
 * Creates a new instance of {@link FixedXtextSourceViewer}.
 *
 * @param parent
 *          the {@link Composite} parent
 * @param ruler
 *          the {@link IVerticalRuler}
 * @param overviewRuler
 *          the {@link IOverviewRuler}
 * @param showsAnnotationOverview
 *          boolean flag whether to show annotation overview
 * @param styles
 *          styles flags
 */
public FixedXtextSourceViewer(final Composite parent, final IVerticalRuler ruler, final IOverviewRuler overviewRuler, final boolean showsAnnotationOverview, final int styles) {
  super(parent, ruler, overviewRuler, showsAnnotationOverview, styles);
}