KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > debug > ui > IBreakpointOrganizerDelegate


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.debug.ui;
12
13 import org.eclipse.core.runtime.IAdaptable;
14 import org.eclipse.debug.core.model.IBreakpoint;
15 import org.eclipse.debug.internal.ui.DebugUIPlugin;
16 import org.eclipse.jface.util.IPropertyChangeListener;
17
18 /**
19  * A breakpoint organizer is used to categorize breakpoints and provides
20  * change notification when categorization has changed. Categories are represented
21  * as arbitrary adaptable objects. For example, projects could be used to
22  * categorize breakpoints. Images and labels for categories are generated
23  * via workbench adapters.
24  * <p>
25  * Organizers may optionally support breakpoint recategorization.
26  * </p>
27  * <p>
28  * Following is example plug-in XML for contributing a breakpoint organizer.
29  * <pre>
30  * &lt;extension point="org.eclipse.debug.ui.breakpointOrganizers"&gt;
31  * &lt;breakpointOrganizer
32  * class="com.example.BreakpointOrganizer"
33  * id="com.example.BreakpointOrganizer"
34  * label="Example Organizer"
35  * icon="icons/full/obj16/example_org.gif"/&gt;
36  * &lt;/extension&gt;
37  * </pre>
38  * The attributes are specified as follows:
39  * <ul>
40  * <li><code>class</code> Fully qualified name of a Java class that implements
41  * {@link IBreakpointOrganizerDelegate}.</li>
42  * <li><code>id</code> Unique identifier for this breakpoint organizer.</li>
43  * <li><code>label</code> Label for this organizer which is suitable for
44  * presentation to the user.</li>
45  * <li><code>icon</code> Optional path to an icon which can be shown for this
46  * organizer</li>
47  * </ul>
48  * </p>
49  * <p>
50  * Clients contributing a breakpoint organizer are intended to implement
51  * this interface.
52  * </p>
53  * @since 3.1
54  */

55 public interface IBreakpointOrganizerDelegate {
56     
57     /**
58      * Change event id when a category's breakpoints have changed.
59      * The <code>oldValue</code> of the <code>PropertyChangeEvent</code> will be the
60      * category that has changed, and the source of the event will the the
61      * breakpoint organizer. Breakpoints in the category will be
62      * recategorized when this event is fired.
63      *
64      * @see IPropertyChangeListener
65      */

66     public static final String JavaDoc P_CATEGORY_CHANGED = DebugUIPlugin.getUniqueIdentifier() + ".P_CATEGORY_CHANGED"; //$NON-NLS-1$
67

68     /**
69      * Returns objects representing the categories of the specified
70      * breakpoint or <code>null</code> if this organizer cannot classify
71      * the breakpoint. Categories must return <code>true</code> when sent
72      * the message <code>equals(Object)</code> with an equivalent category
73      * as an argument.
74      *
75      * @param breakpoint breakpoint to classify
76      * @return categories of the given breakpoint or <code>null</code>
77      */

78     public IAdaptable[] getCategories(IBreakpoint breakpoint);
79     
80     /**
81      * Adds the specified listener. Has no effect if an identical listener is
82      * already registered.
83      *
84      * @param listener listener to add
85      */

86     public void addPropertyChangeListener(IPropertyChangeListener listener);
87     
88     /**
89      * Removes the specified listener. Has no effect if an identical listener
90      * is not already registered.
91      *
92      * @param listener listener to remove
93      */

94     public void removePropertyChangeListener(IPropertyChangeListener listener);
95     
96     /**
97      * Adds the specified breakpoint to the given category. Only called
98      * if <code>canAdd(...)</code> returns <code>true</code> for the given
99      * breakpoint and category.
100      *
101      * @param breakpoint breakpoint to recategorize
102      * @param category the breakpoint's new category
103      */

104     public void addBreakpoint(IBreakpoint breakpoint, IAdaptable category);
105     
106     /**
107      * Removes the specified breakpoint from the given category. Only
108      * called if <code>canRemove(...)</code> returns <code>true</code> for
109      * the given breakpoint and category.
110      *
111      * @param breakpoint breakpoint to recategorize
112      * @param category the category the breakpoint is remove from
113      */

114     public void removeBreakpoint(IBreakpoint breakpoint, IAdaptable category);
115     
116     /**
117      * Returns whether the given breakpoint can be categorized in the
118      * specified category.
119      *
120      * @param breakpoint breakpoint to recatogorize
121      * @param category the category to add the breakpoint to
122      * @return whether the given breakpoint can be categorized in the
123      * specified category
124      */

125     public boolean canAdd(IBreakpoint breakpoint, IAdaptable category);
126     
127     /**
128      * Returns whether the given breakpoint can be removed from the given
129      * category.
130      *
131      * @param breakpoint breakpoint to recategorize
132      * @param category the category to remove the breakpoint from
133      * @return whether the given breakpoint can be removed from the given
134      * category
135      */

136     public boolean canRemove(IBreakpoint breakpoint, IAdaptable category);
137     
138     /**
139      * Returns all categories managed by this organizer, or <code>null</code>.
140      * When <code>null</code> is returned, the breakpoints view only displays
141      * categories that contain breakpoints. When a collection of categories
142      * is returned the breakpoints will display all of the categories, some of
143      * which may be empty.
144      *
145      * @return all categories managed by this organizer, or <code>null</code>
146      */

147     public IAdaptable[] getCategories();
148     
149     /**
150      * Disposes this breakpoint organizer.
151      */

152     public void dispose();
153     
154 }
155
Popular Tags