Bug 112586 [api] add support for toggling folding for IJavaElement's
For tools that want to use the IJavaFoldingStructureProviderExtension, but want finer-grained control of what to collapse, it would be useful to have the following methods: - collapseElements(List<IJavaElement> elements) - expandElements(List<IJavaElement> elements) My use case is Mylar, which currently needs to set it's own folding structure provider, but with this could simply use the default one and drive the folding based on selections. Note that for selections this would only be getting called with a single element, but when a file is opened it would need to be called with a list, hance the suggest to take lists (or arrays if JDT is not moving to Java 5).
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/text/folding/IJavaFoldingStructureProvider.java
/*******************************************************************************
 * Copyright (c) 2000, 2005 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.jdt.ui.text.folding;
import org.eclipse.jface.text.source.projection.ProjectionViewer;
import org.eclipse.ui.texteditor.ITextEditor;
/**
 * Contributors to the
 * <code>org.eclipse.jdt.ui.foldingStructureProvider</code> extension
 * point must specify an implementation of this interface which will create and
 * maintain {@link org.eclipse.jface.text.source.projection.ProjectionAnnotation} objects
 * that define folded regions in the the {@link org.eclipse.jface.text.source.projection.ProjectionViewer}.
 * <p>
 * Clients may implement this interface.
 * </p>
 * <p>
 * In order to provide backward compatibility for clients of <code>IJavaFoldingStructureProvider</code>, extension
 * interfaces are used to provide a means of evolution. The following extension interfaces exist:
 * <ul>
 * <li>{@link org.eclipse.jdt.ui.text.folding.IJavaFoldingStructureProviderExtension} since version 3.2 introducing
 *		the following functions:
 *			<ul>
 *            <li>collapsing of comments and members</li>