KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > ui > text > folding > IJavaFoldingStructureProvider


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.jdt.ui.text.folding;
12
13 import org.eclipse.jface.text.source.projection.ProjectionViewer;
14
15 import org.eclipse.ui.texteditor.ITextEditor;
16
17
18 /**
19  * Contributors to the
20  * <code>org.eclipse.jdt.ui.foldingStructureProvider</code> extension
21  * point must specify an implementation of this interface which will create and
22  * maintain {@link org.eclipse.jface.text.source.projection.ProjectionAnnotation} objects
23  * that define folded regions in the {@link org.eclipse.jface.text.source.projection.ProjectionViewer}.
24  * <p>
25  * Clients may implement this interface.
26  * </p>
27  * <p>
28  * In order to provide backward compatibility for clients of <code>IJavaFoldingStructureProvider</code>, extension
29  * interfaces are used to provide a means of evolution. The following extension interfaces exist:
30  * <ul>
31  * <li>{@link org.eclipse.jdt.ui.text.folding.IJavaFoldingStructureProviderExtension} since version 3.2 introducing
32  * the following functions:
33  * <ul>
34  * <li>collapsing of comments and members</li>
35  * <li>expanding and collapsing of certain java elements</li>
36  * </ul>
37  * </li>
38  * </ul>
39  * </p>
40  *
41  * @since 3.0
42  */

43 public interface IJavaFoldingStructureProvider {
44
45     /**
46      * Installs this structure provider on the given editor and viewer.
47      * Implementations should listen to the projection events generated by
48      * <code>viewer</code> and enable / disable generation of projection
49      * structure accordingly.
50      *
51      * @param editor the editor that this provider works on
52      * @param viewer the projection viewer that displays the annotations created
53      * by this structure provider
54      */

55     public abstract void install(ITextEditor editor, ProjectionViewer viewer);
56
57     /**
58      * Uninstalls this structure provider. Any references to editors or viewers
59      * should be cleared.
60      */

61     public abstract void uninstall();
62
63     /**
64      * (Re-)initializes the structure provided by the receiver.
65      */

66     public abstract void initialize();
67 }
68
Popular Tags