01: /*******************************************************************************
02: * Copyright (c) 2000, 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.jdt.ui.text.folding;
11:
12: import org.eclipse.jface.text.source.projection.ProjectionViewer;
13:
14: import org.eclipse.ui.texteditor.ITextEditor;
15:
16: /**
17: * Contributors to the
18: * <code>org.eclipse.jdt.ui.foldingStructureProvider</code> extension
19: * point must specify an implementation of this interface which will create and
20: * maintain {@link org.eclipse.jface.text.source.projection.ProjectionAnnotation} objects
21: * that define folded regions in the {@link org.eclipse.jface.text.source.projection.ProjectionViewer}.
22: * <p>
23: * Clients may implement this interface.
24: * </p>
25: * <p>
26: * In order to provide backward compatibility for clients of <code>IJavaFoldingStructureProvider</code>, extension
27: * interfaces are used to provide a means of evolution. The following extension interfaces exist:
28: * <ul>
29: * <li>{@link org.eclipse.jdt.ui.text.folding.IJavaFoldingStructureProviderExtension} since version 3.2 introducing
30: * the following functions:
31: * <ul>
32: * <li>collapsing of comments and members</li>
33: * <li>expanding and collapsing of certain java elements</li>
34: * </ul>
35: * </li>
36: * </ul>
37: * </p>
38: *
39: * @since 3.0
40: */
41: public interface IJavaFoldingStructureProvider {
42:
43: /**
44: * Installs this structure provider on the given editor and viewer.
45: * Implementations should listen to the projection events generated by
46: * <code>viewer</code> and enable / disable generation of projection
47: * structure accordingly.
48: *
49: * @param editor the editor that this provider works on
50: * @param viewer the projection viewer that displays the annotations created
51: * by this structure provider
52: */
53: public abstract void install(ITextEditor editor,
54: ProjectionViewer viewer);
55:
56: /**
57: * Uninstalls this structure provider. Any references to editors or viewers
58: * should be cleared.
59: */
60: public abstract void uninstall();
61:
62: /**
63: * (Re-)initializes the structure provided by the receiver.
64: */
65: public abstract void initialize();
66: }
|