private void createFoldingSupport(ProjectionViewer projectionViewer) { fProjectionSupport = new ProjectionSupport(projectionViewer, getAnnotationAccess(), getSharedColors()); fProjectionSupport.install(); ((ProjectionViewer) getSourceViewer()).addProjectionListener(this); }
/** * This method is used to notify the LDIF Editor that the Outline Page has been closed. */ public void outlinePageClosed() { projectionSupport.dispose(); outlinePage = null; }
@SuppressWarnings("unchecked") @Override public <T> T getAdapter(Class<T> key) { if (fProjectionSupport != null) { Object adapter = fProjectionSupport.getAdapter(getSourceViewer(), key); if (adapter != null) { return (T) adapter; } } return super.getAdapter(key); }
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; }
/** * Creates, configures, and returns a <code>ProjectionSupport</code> * object for this editor. * * @return the <code>ProjectSupport</code> object to use with this editor */ protected ProjectionSupport createProjectionSupport() { ProjectionViewer viewer = (ProjectionViewer) getSourceViewer(); ProjectionSupport projSupport = new ProjectionSupport( viewer, getAnnotationAccess(), getSharedColors() ); projSupport.addSummarizableAnnotationType( "org.eclipse.ui.workbench.texteditor.error" ); //$NON-NLS-1$ projSupport.addSummarizableAnnotationType( "org.eclipse.ui.workbench.texteditor.warning" ); //$NON-NLS-1$ projSupport.install(); return projSupport; }
private void createFoldingSupport(ProjectionViewer projectionViewer) { fProjectionSupport = new ProjectionSupport(projectionViewer, getAnnotationAccess(), getSharedColors()); fProjectionSupport.setHoverControlCreator(new IInformationControlCreator() { @Override public IInformationControl createInformationControl(Shell shell) { return new AntSourceViewerInformationControl(shell); } }); fProjectionSupport.install(); ((ProjectionViewer) getViewer()).addProjectionListener(this); }
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 shell) { return new SourceViewerInformationControl(shell, SWT.TOOL | SWT.NO_TRIM | getOrientation(), SWT.NONE, EditorsUI.getTooltipAffordanceString()); fProjectionSupport.setInformationPresenterControlCreator(new IInformationControlCreator() { public IInformationControl createInformationControl(Shell shell) { int shellStyle= SWT.RESIZE | SWT.TOOL | getOrientation(); fProjectionSupport.install();
fProjectionSupport= new ProjectionSupport((ProjectionViewer)sourceViewer, getAnnotationAccess(), getSharedColors()); MarkerAnnotationPreferences markerAnnotationPreferences= getAdapter(MarkerAnnotationPreferences.class); if (markerAnnotationPreferences != null) { Object annotationType= annotationPreference.getAnnotationType(); if (annotationType instanceof String) fProjectionSupport.addSummarizableAnnotationType((String)annotationType); 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() { @Override public IInformationControl createInformationControl(Shell shell) { fProjectionSupport.setInformationPresenterControlCreator(new IInformationControlCreator() { @Override public IInformationControl createInformationControl(Shell shell) { fProjectionSupport.install();
fProjectionSupport= new ProjectionSupport((ProjectionViewer)sourceViewer, getAnnotationAccess(), getSharedColors()); MarkerAnnotationPreferences markerAnnotationPreferences= getAdapter(MarkerAnnotationPreferences.class); if (markerAnnotationPreferences != null) { Object annotationType= annotationPreference.getAnnotationType(); if (annotationType instanceof String) fProjectionSupport.addSummarizableAnnotationType((String)annotationType); 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() { @Override public IInformationControl createInformationControl(Shell shell) { fProjectionSupport.setInformationPresenterControlCreator(new IInformationControlCreator() { @Override public IInformationControl createInformationControl(Shell shell) { fProjectionSupport.install();
@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); } }
@Override public void dispose() { ((ProjectionViewer) getSourceViewer()).removeProjectionListener(this); if (fProjectionSupport != null) { fProjectionSupport.dispose(); fProjectionSupport = null; } fColorManager.dispose(); if (fConfiguration != null) fConfiguration.dispose(); super.dispose(); }
@SuppressWarnings("unchecked") @Override public <T> T getAdapter(Class<T> key) { if (key.equals(IContentOutlinePage.class)) { return (T) getOutlinePage(); } if (fProjectionSupport != null) { T adapter = fProjectionSupport.getAdapter(getSourceViewer(), key); if (adapter != null) { return adapter; } } if (key == IShowInTargetList.class) { return (T) new IShowInTargetList() { @Override public String[] getShowInTargetIds() { return new String[] { JavaUI.ID_PACKAGES, IPageLayout.ID_PROJECT_EXPLORER }; } }; } if (key == IToggleBreakpointsTarget.class) { return (T) new ToggleLineBreakpointAction(); } if (key == IRunToLineTarget.class) { return (T) new RunToLineAdapter(); } return super.getAdapter(key); }
@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); }
@Override public void dispose() { callback.beforeDispose(this); actioncontributor.editorDisposed(this); super.dispose(); if (projectionSupport != null) { projectionSupport.dispose(); } if (outlinePage != null) { outlinePage = null; } uninstallFoldingSupport(); uninstallHighlightingHelper(); uninstallSelectionChangedListener(); }
ProjectionSupport projSupport = getProjectionSupport(); if (projSupport != null) { adapter = projSupport.getAdapter( getSourceViewer(), classForWhichAdapterNeeded );
projectionSupport = new ProjectionSupport( projectionViewer, getAnnotationAccess(), getSharedColors() ); projectionSupport.install(); projectionViewer.doOperation( ProjectionViewer.TOGGLE );
@Override public void dispose() { if (fEditorSelectionChangedListener != null) { fEditorSelectionChangedListener.uninstall(getSelectionProvider()); fEditorSelectionChangedListener = null; } ((ProjectionViewer) getViewer()).removeProjectionListener(this); if (fProjectionSupport != null) { fProjectionSupport.dispose(); fProjectionSupport = null; } uninstallOccurrencesFinder(); if (fActivationListener != null) { Shell shell = getEditorSite().getShell(); if (shell != null && !shell.isDisposed()) { shell.removeShellListener(fActivationListener); } fActivationListener = null; } AntModelCore.getDefault().removeAntModelListener(fAntModelListener); fAntModel = null; super.dispose(); }
Object adapter= fProjectionSupport.getAdapter(getSourceViewer(), required); if (adapter != null) return adapter;
@Override public void createPartControl(Composite parent) { super.createPartControl(parent); ProjectionViewer viewer = (ProjectionViewer) getSourceViewer(); // fix bug 267553: font problems can occur if the default font of the text widget doesn't match the // default font returned by the token scanner if (sourceViewerConfiguration.getDefaultFont() != null) { viewer.getTextWidget().setFont(sourceViewerConfiguration.getDefaultFont()); } projectionSupport = new ProjectionSupport(viewer, getAnnotationAccess(), getSharedColors()); projectionSupport.install(); syncProjectionModeWithPreferences(); viewer.addProjectionListener(new IProjectionListener() { public void projectionDisabled() { projectionAnnotationById = null; saveProjectionPreferences(); } public void projectionEnabled() { saveProjectionPreferences(); updateProjectionAnnotations(); } }); if (!outlineDirty && isFoldingEnabled()) { updateProjectionAnnotations(); } JFaceResources.getFontRegistry().addListener(preferencesListener); }
fProjectionSupport.dispose(); fProjectionSupport= null;