Search in sources :

Example 21 with ITextViewerExtension

use of org.eclipse.jface.text.ITextViewerExtension in project eclipse.platform.text by eclipse.

the class LineNumberRulerColumn method layout.

/**
 * Layouts the enclosing viewer to adapt the layout to changes of the
 * size of the individual components.
 *
 * @param redraw <code>true</code> if this column can be redrawn
 */
protected void layout(boolean redraw) {
    if (!redraw) {
        fRelayoutRequired = true;
        return;
    }
    fRelayoutRequired = false;
    if (fCachedTextViewer instanceof ITextViewerExtension) {
        ITextViewerExtension extension = (ITextViewerExtension) fCachedTextViewer;
        Control control = extension.getControl();
        if (control instanceof Composite && !control.isDisposed()) {
            Composite composite = (Composite) control;
            composite.layout(true);
        }
    }
}
Also used : ITextViewerExtension(org.eclipse.jface.text.ITextViewerExtension) Control(org.eclipse.swt.widgets.Control) Composite(org.eclipse.swt.widgets.Composite)

Aggregations

ITextViewerExtension (org.eclipse.jface.text.ITextViewerExtension)21 StyledText (org.eclipse.swt.custom.StyledText)10 Point (org.eclipse.swt.graphics.Point)8 Control (org.eclipse.swt.widgets.Control)5 IDocument (org.eclipse.jface.text.IDocument)4 IRewriteTarget (org.eclipse.jface.text.IRewriteTarget)4 ISelectionProvider (org.eclipse.jface.viewers.ISelectionProvider)4 Composite (org.eclipse.swt.widgets.Composite)4 IEditingSupportRegistry (org.eclipse.jface.text.IEditingSupportRegistry)2 IRegion (org.eclipse.jface.text.IRegion)2 ITextViewer (org.eclipse.jface.text.ITextViewer)2 ISourceViewer (org.eclipse.jface.text.source.ISourceViewer)2 VerifyKeyListener (org.eclipse.swt.custom.VerifyKeyListener)2 ICommandService (org.eclipse.ui.commands.ICommandService)2 ArrayList (java.util.ArrayList)1 IStatusLineManager (org.eclipse.jface.action.IStatusLineManager)1 IContentAssistSubjectControl (org.eclipse.jface.contentassist.IContentAssistSubjectControl)1 BadLocationException (org.eclipse.jface.text.BadLocationException)1 BadPositionCategoryException (org.eclipse.jface.text.BadPositionCategoryException)1 DocumentEvent (org.eclipse.jface.text.DocumentEvent)1