Search in sources :

Example 1 with AbstractQuickOutlineConfiguration

use of org.eclipse.wst.sse.ui.quickoutline.AbstractQuickOutlineConfiguration in project webtools.sourceediting by eclipse.

the class StructuredTextEditor method configureOutlinePresenter.

private IInformationPresenter configureOutlinePresenter(ISourceViewer sourceViewer, SourceViewerConfiguration config) {
    InformationPresenter presenter = null;
    // Get the quick outline configuration
    AbstractQuickOutlineConfiguration cfg = null;
    ExtendedConfigurationBuilder builder = ExtendedConfigurationBuilder.getInstance();
    String[] ids = getConfigurationPoints();
    for (int i = 0; cfg == null && i < ids.length; i++) {
        cfg = (AbstractQuickOutlineConfiguration) builder.getConfiguration(ExtendedConfigurationBuilder.QUICKOUTLINECONFIGURATION, ids[i]);
    }
    if (cfg != null) {
        presenter = new InformationPresenter(getOutlinePresenterControlCreator(cfg));
        presenter.setDocumentPartitioning(config.getConfiguredDocumentPartitioning(sourceViewer));
        presenter.setAnchor(AbstractInformationControlManager.ANCHOR_GLOBAL);
        IInformationProvider provider = new SourceInfoProvider(this);
        String[] contentTypes = config.getConfiguredContentTypes(sourceViewer);
        for (int i = 0; i < contentTypes.length; i++) {
            presenter.setInformationProvider(provider, contentTypes[i]);
        }
        presenter.setSizeConstraints(50, 20, true, false);
    }
    return presenter;
}
Also used : AbstractQuickOutlineConfiguration(org.eclipse.wst.sse.ui.quickoutline.AbstractQuickOutlineConfiguration) IInformationProvider(org.eclipse.jface.text.information.IInformationProvider) IInformationPresenter(org.eclipse.jface.text.information.IInformationPresenter) InformationPresenter(org.eclipse.jface.text.information.InformationPresenter) Point(org.eclipse.swt.graphics.Point) SourceInfoProvider(org.eclipse.wst.sse.ui.internal.text.SourceInfoProvider) ExtendedConfigurationBuilder(org.eclipse.wst.sse.ui.internal.ExtendedConfigurationBuilder)

Aggregations

IInformationPresenter (org.eclipse.jface.text.information.IInformationPresenter)1 IInformationProvider (org.eclipse.jface.text.information.IInformationProvider)1 InformationPresenter (org.eclipse.jface.text.information.InformationPresenter)1 Point (org.eclipse.swt.graphics.Point)1 ExtendedConfigurationBuilder (org.eclipse.wst.sse.ui.internal.ExtendedConfigurationBuilder)1 SourceInfoProvider (org.eclipse.wst.sse.ui.internal.text.SourceInfoProvider)1 AbstractQuickOutlineConfiguration (org.eclipse.wst.sse.ui.quickoutline.AbstractQuickOutlineConfiguration)1