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

项目:DarwinSPL    文件:DwprofileEditor.java   
public void createPartControl(Composite parent) {
    super.createPartControl(parent);

    // Code Folding
    ProjectionViewer viewer = (ProjectionViewer) getSourceViewer();
    // Occurrence initiation, need ITextResource and ISourceViewer.
    highlighting = new de.darwinspl.preferences.resource.dwprofile.ui.DwprofileHighlighting(getResource(), viewer, colorManager, this);

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

    // turn projection mode on
    viewer.doOperation(ProjectionViewer.TOGGLE);
    codeFoldingManager = new de.darwinspl.preferences.resource.dwprofile.ui.DwprofileCodeFoldingManager(viewer, this);

    IContextService contextService = (IContextService) getSite().getService(IContextService.class);
    contextService.activateContext("de.darwinspl.preferences.resource.dwprofile.EditorScope");
}
项目:DarwinSPL    文件:HyexpressionEditor.java   
public void createPartControl(Composite parent) {
    super.createPartControl(parent);

    // Code Folding
    ProjectionViewer viewer = (ProjectionViewer) getSourceViewer();
    // Occurrence initiation, need ITextResource and ISourceViewer.
    highlighting = new eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionHighlighting(getResource(), viewer, colorManager, this);

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

    // turn projection mode on
    viewer.doOperation(ProjectionViewer.TOGGLE);
    codeFoldingManager = new eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionCodeFoldingManager(viewer, this);

    IContextService contextService = (IContextService) getSite().getService(IContextService.class);
    contextService.activateContext("eu.hyvar.feature.expression.resource.hyexpression.EditorScope");
}
项目:DarwinSPL    文件:HyvalidityformulaEditor.java   
public void createPartControl(Composite parent) {
    super.createPartControl(parent);

    // Code Folding
    ProjectionViewer viewer = (ProjectionViewer) getSourceViewer();
    // Occurrence initiation, need ITextResource and ISourceViewer.
    highlighting = new eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaHighlighting(getResource(), viewer, colorManager, this);

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

    // turn projection mode on
    viewer.doOperation(ProjectionViewer.TOGGLE);
    codeFoldingManager = new eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaCodeFoldingManager(viewer, this);

    IContextService contextService = (IContextService) getSite().getService(IContextService.class);
    contextService.activateContext("eu.hyvar.context.contextValidity.resource.hyvalidityformula.EditorScope");
}
项目:DarwinSPL    文件:HydatavalueEditor.java   
public void createPartControl(Composite parent) {
    super.createPartControl(parent);

    // Code Folding
    ProjectionViewer viewer = (ProjectionViewer) getSourceViewer();
    // Occurrence initiation, need ITextResource and ISourceViewer.
    highlighting = new eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueHighlighting(getResource(), viewer, colorManager, this);

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

    // turn projection mode on
    viewer.doOperation(ProjectionViewer.TOGGLE);
    codeFoldingManager = new eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueCodeFoldingManager(viewer, this);

    IContextService contextService = (IContextService) getSite().getService(IContextService.class);
    contextService.activateContext("eu.hyvar.dataValues.resource.hydatavalue.EditorScope");
}
项目:DarwinSPL    文件:HymappingEditor.java   
public void createPartControl(Composite parent) {
    super.createPartControl(parent);

    // Code Folding
    ProjectionViewer viewer = (ProjectionViewer) getSourceViewer();
    // Occurrence initiation, need ITextResource and ISourceViewer.
    highlighting = new eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingHighlighting(getResource(), viewer, colorManager, this);

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

    // turn projection mode on
    viewer.doOperation(ProjectionViewer.TOGGLE);
    codeFoldingManager = new eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingCodeFoldingManager(viewer, this);

    IContextService contextService = (IContextService) getSite().getService(IContextService.class);
    contextService.activateContext("eu.hyvar.feature.mapping.resource.hymapping.EditorScope");
}
项目:DarwinSPL    文件:HyconstraintsEditor.java   
public void createPartControl(Composite parent) {
    super.createPartControl(parent);

    // Code Folding
    ProjectionViewer viewer = (ProjectionViewer) getSourceViewer();
    // Occurrence initiation, need ITextResource and ISourceViewer.
    highlighting = new eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsHighlighting(getResource(), viewer, colorManager, this);

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

    // turn projection mode on
    viewer.doOperation(ProjectionViewer.TOGGLE);
    codeFoldingManager = new eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsCodeFoldingManager(viewer, this);

    IContextService contextService = (IContextService) getSite().getService(IContextService.class);
    contextService.activateContext("eu.hyvar.feature.constraint.resource.hyconstraints.EditorScope");
}
项目:DarwinSPL    文件:HymanifestEditor.java   
public void createPartControl(Composite parent) {
    super.createPartControl(parent);

    // Code Folding
    ProjectionViewer viewer = (ProjectionViewer) getSourceViewer();
    // Occurrence initiation, need ITextResource and ISourceViewer.
    highlighting = new eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestHighlighting(getResource(), viewer, colorManager, this);

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

    // turn projection mode on
    viewer.doOperation(ProjectionViewer.TOGGLE);
    codeFoldingManager = new eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestCodeFoldingManager(viewer, this);

    IContextService contextService = (IContextService) getSite().getService(IContextService.class);
    contextService.activateContext("eu.hyvar.mspl.manifest.resource.hymanifest.EditorScope");
}
项目: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();
}
项目:typescript.java    文件:JavaScriptLightWeightEditor.java   
/**
 * 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);
    }
}
项目:idecore    文件:ApexCodeEditor.java   
@Override
protected ISourceViewer createSourceViewer(Composite parent, IVerticalRuler ruler, int styles) {
    fAnnotationAccess = createAnnotationAccess();
    fOverviewRuler = createOverviewRuler(getSharedColors());
    ProjectionViewer viewer =
            new ProjectionViewer(parent, ruler, getOverviewRuler(), isOverviewRulerVisible(), styles);

    fProjectionSupport = new ProjectionSupport(viewer, getAnnotationAccess(), getSharedColors());
    fProjectionSupport.addSummarizableAnnotationType(ANNOTATION_TYPE_APEX_ERROR); //$NON-NLS-1$
    fProjectionSupport.addSummarizableAnnotationType(ANNOTATION_TYPE_APEX_WARNING); //$NON-NLS-1$
    fProjectionSupport.install();
    setTitleToolTip(EDITOR_NAME);

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

    fBracketInserter = new BracketInserter(this, viewer);
    return viewer;
}
项目: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;
}
项目:wt-studio    文件:JsonTextEditor.java   
@Override
public void createPartControl(Composite parent) {
    JsonPreferenceStore jsonPreferenceStore = JsonPreferenceStore.getJsonPreferenceStore();
    viewerConfiguration = new JsonSourceViewerConfiguration(this, jsonPreferenceStore);
    setSourceViewerConfiguration(viewerConfiguration);
    super.createPartControl(parent);

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

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

    annotationModel = viewer.getProjectionAnnotationModel();

    SourceViewerDecorationSupport support = getSourceViewerDecorationSupport(viewer);
    support.install(getPreferenceStore());


    IFile file = (IFile) getEditorInput().getAdapter(IFile.class);
    platformPreferenceListener = new PlatformPreferenceListener(viewerConfiguration, jsonPreferenceStore);
    platformPreferenceListener.setPreferenceChangeListener(file);
}
项目: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);
    }
}
项目: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);
    }
}
项目:tlaplus    文件:TLAEditor.java   
public void createPartControl(Composite parent)
{
    super.createPartControl(parent);
    /*
     * Add projection support (e.G. for folding) 
     */
    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();
    viewer.doOperation(ProjectionViewer.TOGGLE);

    // model for adding projections (folds)
    this.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
    this.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);
}
项目:ncl30-eclipse    文件:NCLEditor.java   
public void createPartControl(Composite parent) {
    super.createPartControl(parent);
    ProjectionViewer viewer = (ProjectionViewer) getSourceViewer();

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

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

    annotationModel = viewer.getProjectionAnnotationModel();

}
项目:bts    文件: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;
}
项目:velocity-edit    文件:VelocityEditor.java   
public void createPartControl(Composite parent)
{
    super.createPartControl(parent);
    ProjectionViewer projectionViewer = (ProjectionViewer) getSourceViewer();
    projectionSupport = new ProjectionSupport(projectionViewer, getAnnotationAccess(), getSharedColors());
    projectionSupport.install();
    projectionViewer.doOperation(ProjectionViewer.TOGGLE);
    // fOccurrencesUpdater= new RecipeOccurrencesUpdater(this);
}
项目: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();
    preferenceStore.addPropertyChangeListener(preferenceChangeListener);
}
项目: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);
}
项目:Eclipse-Markdown-Editor-Plugin    文件:MarkdownEditor.java   
@Override
public void createPartControl(Composite parent) {
    // Over-ride to add code-folding support 
    super.createPartControl(parent);
    if (getSourceViewer() instanceof ProjectionViewer) {
        ProjectionViewer viewer =(ProjectionViewer)getSourceViewer();
        projectionSupport = new ProjectionSupport(viewer,getAnnotationAccess(),getSharedColors());
        projectionSupport.install();
        //turn projection mode on
        viewer.doOperation(ProjectionViewer.TOGGLE);
    }
}
项目:myLOGO4Eclipse    文件:LogoScriptEditor.java   
@Override
public void createPartControl(Composite parent) {
    super.createPartControl(parent);

    final ProjectionViewer viewer = (ProjectionViewer) super.getSourceViewer();
    ProjectionSupport projectionSupport = new ProjectionSupport(viewer, getAnnotationAccess(), getSharedColors());
    projectionSupport.install();

    viewer.doOperation(ProjectionViewer.TOGGLE);
}
项目:dLabPro-Plugin    文件:AbstractEditor.java   
public void createPartControl(Composite parent)
{
  super.createPartControl(parent);

  ProjectionViewer projectionViewer = (ProjectionViewer)getSourceViewer();
  fProjectionSupport = new ProjectionSupport(projectionViewer, getAnnotationAccess(),
      getSharedColors());
  fProjectionSupport.install();
  projectionViewer.doOperation(ProjectionViewer.TOGGLE);
}
项目:fluentmark    文件:FluentMkEditor.java   
@Override
protected ISourceViewer createSourceViewer(Composite parent, IVerticalRuler ruler, int styles) {
    Composite composite = new Composite(parent, SWT.NONE);
    GridLayoutFactory.fillDefaults().spacing(0, 0).applyTo(composite);

    Composite editorComposite = new Composite(composite, SWT.NONE);
    GridDataFactory.fillDefaults().grab(true, true).applyTo(editorComposite);
    editorComposite.setLayout(new FillLayout(SWT.VERTICAL));

    viewer = new FluentMkSourceViewer(editorComposite, ruler, getOverviewRuler(), isOverviewRulerVisible(), styles,
            getPreferenceStore());
    if (isFoldingEnabled() && !getPreferenceStore().getBoolean(Prefs.EDITOR_SHOW_SEGMENTS)) {
        viewer.prepareDelayedProjection();
    }

    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.addSummarizableAnnotationType("org.eclipse.search.results"); // $NON-NLS-1$
    projectionSupport.setHoverControlCreator(new IInformationControlCreator() {

        @Override
        public IInformationControl createInformationControl(Shell shell) {
            String statusFieldText = EditorsUI.getTooltipAffordanceString();
            return new FluentMkSourceViewerInfoControl(shell, false, getOrientation(), statusFieldText);
        }
    });
    projectionSupport.install();

    projectionProvider = new FoldingStructureProvider();
    if (projectionProvider != null) {
        projectionProvider.install(this, viewer, getPreferenceStore());
    }

    if (isFoldingEnabled()) {
        viewer.doOperation(ProjectionViewer.TOGGLE);
    }

    getSourceViewerDecorationSupport(viewer);
    viewer.getTextWidget().setWordWrap(isWordWrap());
    return viewer;
}