类org.eclipse.jface.text.source.projection.ProjectionSupport源码实例Demo

下面列出了怎么用org.eclipse.jface.text.source.projection.ProjectionSupport的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: texlipse   文件: BibEditor.java
public void createPartControl(Composite parent) {
    super.createPartControl(parent);
    ProjectionViewer projectionViewer = (ProjectionViewer) getSourceViewer();
    
    fProjectionSupport = new ProjectionSupport(projectionViewer,
            getAnnotationAccess(), getSharedColors());
    fProjectionSupport
    .addSummarizableAnnotationType("org.eclipse.ui.workbench.texteditor.error");
    fProjectionSupport
    .addSummarizableAnnotationType("org.eclipse.ui.workbench.texteditor.warning");
    fProjectionSupport.install();
    
    if (TexlipsePlugin.getDefault().getPreferenceStore().getBoolean(TexlipseProperties.BIB_CODE_FOLDING)) {
        projectionViewer.doOperation(ProjectionViewer.TOGGLE);
    }
    
    this.documentModel.update();
}
 
/**
 * Install everything necessary to get document folding working and enable
 * document folding
 * 
 * @param sourceViewer
 */
private void installProjectionSupport() {

	ProjectionViewer projectionViewer = (ProjectionViewer) getSourceViewer();
	fProjectionSupport = new ProjectionSupport(projectionViewer, getAnnotationAccess(), getSharedColors());
	fProjectionSupport.addSummarizableAnnotationType("org.eclipse.ui.workbench.texteditor.error"); //$NON-NLS-1$
	fProjectionSupport.addSummarizableAnnotationType("org.eclipse.ui.workbench.texteditor.warning"); //$NON-NLS-1$
	fProjectionSupport.setHoverControlCreator(new IInformationControlCreator() {
		public IInformationControl createInformationControl(Shell parent) {
			return new DefaultInformationControl(parent);
		}
	});
	fProjectionSupport.install();

	if (isFoldingEnabled()) {
		projectionViewer.doOperation(ProjectionViewer.TOGGLE);
	}
}
 
源代码3 项目: birt   文件: DecoratedScriptEditor.java
protected ISourceViewer createSourceViewer( Composite parent,
		IVerticalRuler ruler, int styles )
{
	fAnnotationAccess = getAnnotationAccess( );
	fOverviewRuler = createOverviewRuler( getSharedColors( ) );

	ProjectionViewer viewer = new ProjectionViewer( parent,
			ruler,
			getOverviewRuler( ),
			isOverviewRulerVisible( ),
			styles );

	ProjectionSupport fProjectionSupport = new ProjectionSupport( viewer,
			getAnnotationAccess( ),
			getSharedColors( ) );
	fProjectionSupport.addSummarizableAnnotationType( "org.eclipse.ui.workbench.texteditor.error" ); //$NON-NLS-1$
	fProjectionSupport.addSummarizableAnnotationType( "org.eclipse.ui.workbench.texteditor.warning" ); //$NON-NLS-1$
	fProjectionSupport.install( );

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

	return viewer;
}
 
源代码4 项目: Pydev   文件: PyEditProjection.java
@Override
public void createPartControl(Composite parent) {
    super.createPartControl(parent);
    try {
        ProjectionViewer projectionViewer = (ProjectionViewer) getSourceViewer();

        fProjectionSupport = new ProjectionSupport(projectionViewer, getAnnotationAccess(), getSharedColors());
        fProjectionSupport.addSummarizableAnnotationType("org.eclipse.ui.workbench.texteditor.error");
        fProjectionSupport.addSummarizableAnnotationType("org.eclipse.ui.workbench.texteditor.warning");
        fProjectionSupport.setHoverControlCreator(new IInformationControlCreator() {
            @Override
            public IInformationControl createInformationControl(Shell shell) {
                return new DefaultInformationControl(shell);
            }
        });
        fProjectionSupport.install();

        if (isFoldingEnabled()) {
            projectionViewer.doOperation(ProjectionViewer.TOGGLE);
        }
    } catch (Exception e) {
        Log.log(e);
    }
}
 
源代码5 项目: xtext-eclipse   文件: XtextEditor.java
protected ProjectionSupport installProjectionSupport(ProjectionViewer projectionViewer) {
	ProjectionSupport projectionSupport = new ProjectionSupport(projectionViewer, getAnnotationAccess(),
			getSharedColors());
	projectionSupport.addSummarizableAnnotationType(INFO_ANNOTATION_TYPE);
	projectionSupport.addSummarizableAnnotationType(WARNING_ANNOTATION_TYPE);
	projectionSupport.addSummarizableAnnotationType(ERROR_ANNOTATION_TYPE);
	projectionSupport.setAnnotationPainterDrawingStrategy(projectionAnnotationDrawingStrategy);
	projectionSupport.install();
	return projectionSupport;
}
 
源代码6 项目: texlipse   文件: TexEditor.java
/** 
 * Create the part control.
 * 
 * @see org.eclipse.ui.IWorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
 */
public void createPartControl(Composite parent) {
    super.createPartControl(parent);
    // enable projection support (for code folder)
    ProjectionViewer projectionViewer = (ProjectionViewer) getSourceViewer();
    fProjectionSupport = new ProjectionSupport(projectionViewer,
            getAnnotationAccess(), getSharedColors());
    fProjectionSupport.addSummarizableAnnotationType("org.eclipse.ui.workbench.texteditor.error");
    fProjectionSupport.addSummarizableAnnotationType("org.eclipse.ui.workbench.texteditor.warning");
    fProjectionSupport.install();

    if (TexlipsePlugin.getDefault().getPreferenceStore().getBoolean(TexlipseProperties.CODE_FOLDING)) {
    	projectionViewer.doOperation(ProjectionViewer.TOGGLE);
    }
    
    fAnnotationUpdater = new TexlipseAnnotationUpdater(this);
    
    ((IPostSelectionProvider) getSelectionProvider()).addPostSelectionChangedListener(
            new ISelectionChangedListener(){
                public void selectionChanged(SelectionChangedEvent event) {
                    //Delete all StatuslineErrors after selection changes
                    documentModel.removeStatusLineErrorMessage();
                }
            });

    // register documentModel as documentListener
    // in initializeEditor this would cause NPE
    this.getDocumentProvider().getDocument(getEditorInput()).addDocumentListener(this.documentModel);
    this.documentModel.initializeModel();
    this.documentModel.updateNow();

    ISourceViewer sourceViewer = getSourceViewer();
    if (sourceViewer instanceof ITextViewerExtension) {
        if (fBracketInserter == null)
            fBracketInserter = new BracketInserter(getSourceViewer(), this);
        ((ITextViewerExtension) sourceViewer).prependVerifyKeyListener(fBracketInserter);
    }
}
 
源代码7 项目: tlaplus   文件: TLAEditor.java
@Override
  public void createPartControl(final Composite parent)
  {
      super.createPartControl(parent);
      /*
       * Add projection support (i.e. for folding) 
       */
      final ProjectionViewer viewer = (ProjectionViewer) getSourceViewer();
      projectionSupport = new ProjectionSupport(viewer, getAnnotationAccess(), getSharedColors());
      projectionSupport.addSummarizableAnnotationType("org.eclipse.ui.workbench.texteditor.error"); //$NON-NLS-1$
      projectionSupport.addSummarizableAnnotationType("org.eclipse.ui.workbench.texteditor.warning"); //$NON-NLS-1$
      projectionSupport.install();
      
if (viewer.canDoOperation(ProjectionViewer.TOGGLE)) {
	viewer.doOperation(ProjectionViewer.TOGGLE);
}

      // model for adding projections (folds)
      annotationModel = viewer.getProjectionAnnotationModel();

      // this must be instantiated after annotationModel so that it does
      // not call methods that use annotation model when the model is still null
      proofStructureProvider = new TLAProofFoldingStructureProvider(this);
      
      // refresh the editor in case it should be
      // read only
      refresh();

      // tlapmColoring = new TLAPMColoringOutputListener(this);
      
      service = this.getSite().getService(IEventBroker.class);
  }
 
源代码8 项目: KaiZen-OpenAPI-Editor   文件: JsonEditor.java
@Override
public void createPartControl(Composite parent) {
    super.createPartControl(parent);

    ProjectionViewer viewer = getProjectionViewer();

    projectionSupport = new ProjectionSupport(viewer, getAnnotationAccess(), getSharedColors());
    projectionSupport.install();

    // turn projection mode on
    viewer.doOperation(ProjectionViewer.TOGGLE);

    annotationModel = viewer.getProjectionAnnotationModel();
    getPreferenceStore().addPropertyChangeListener(preferenceChangeListener);
}
 
源代码9 项目: APICloud-Studio   文件: AbstractFoldingEditor.java
public void createPartControl(Composite parent)
{
	super.createPartControl(parent);

	ProjectionViewer viewer = (ProjectionViewer) getSourceViewer();
	ProjectionSupport projectionSupport = new ProjectionSupport(viewer, getAnnotationAccess(), getSharedColors());
	projectionSupport.addSummarizableAnnotationType("org.eclipse.ui.workbench.texteditor.error"); //$NON-NLS-1$
	projectionSupport.addSummarizableAnnotationType("org.eclipse.ui.workbench.texteditor.warning"); //$NON-NLS-1$
	projectionSupport.install();

	viewer.doOperation(ProjectionViewer.TOGGLE);
}
 
 类所在包
 同包方法