Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: a721231d8eb4f6a37ed709001344c7feb063f630 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
/*******************************************************************************
 * Copyright (c) 2000, 2006 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.debug.ui;

import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.debug.core.model.IBreakpoint;
import org.eclipse.debug.internal.ui.DebugUIPlugin;
import org.eclipse.jface.util.IPropertyChangeListener;

/**
 * A breakpoint organizer is used to categorize breakpoints and provides
 * change notification when categorization has changed. Categories are represented
 * as arbitrary adaptable objects. For example, projects could be used to
 * categorize breakpoints. Images and labels for categories are generated
 * via workbench adapters.
 * <p>
 * Organizers may optionally support breakpoint recategorization.
 * </p>
 * <p>
 * Following is example plug-in XML for contributing a breakpoint organizer.
 * <pre>
 * &lt;extension point="org.eclipse.debug.ui.breakpointOrganizers"&gt;
 * 	&lt;breakpointOrganizer
 * 		class="com.example.BreakpointOrganizer"
 *      id="com.example.BreakpointOrganizer"
 *      label="Example Organizer"
 *      icon="icons/full/obj16/example_org.png"/&gt;
 * &lt;/extension&gt;
 * </pre>
 * The attributes are specified as follows:
 * <ul>
 * <li><code>class</code> Fully qualified name of a Java class that implements
 * {@link IBreakpointOrganizerDelegate}.</li>
 * <li><code>id</code> Unique identifier for this breakpoint organizer.</li>
 * <li><code>label</code> Label for this organizer which is suitable for
 * presentation to the user.</li>
 * <li><code>icon</code> Optional path to an icon which can be shown for this
 * organizer</li>
 * </ul>
 * </p>
 * <p>
 * Clients contributing a breakpoint organizer are intended to implement
 * this interface.
 * </p>
 * @since 3.1
 */
public interface IBreakpointOrganizerDelegate {

    /**
     * Change event id when a category's breakpoints have changed.
     * The <code>oldValue</code> of the <code>PropertyChangeEvent</code> will be the
     * category that has changed, and the source of the event will the the
     * breakpoint organizer. Breakpoints in the category will be
     * recategorized when this event is fired.
     *
     * @see IPropertyChangeListener
     */
    String P_CATEGORY_CHANGED = DebugUIPlugin.getUniqueIdentifier() + ".P_CATEGORY_CHANGED"; //$NON-NLS-1$

    /**
     * Returns objects representing the categories of the specified
     * breakpoint or <code>null</code> if this organizer cannot classify
     * the breakpoint. Categories must return <code>true</code> when sent
     * the message <code>equals(Object)</code> with an equivalent category
     * as an argument.
     *
     * @param breakpoint breakpoint to classify
     * @return categories of the given breakpoint or <code>null</code>
     */
    IAdaptable[] getCategories(IBreakpoint breakpoint);

    /**
     * Adds the specified listener. Has no effect if an identical listener is
     * already registered.
     *
     * @param listener listener to add
     */
    void addPropertyChangeListener(IPropertyChangeListener listener);

    /**
     * Removes the specified listener. Has no effect if an identical listener
     * is not already registered.
     *
     * @param listener listener to remove
     */
    void removePropertyChangeListener(IPropertyChangeListener listener);

    /**
     * Adds the specified breakpoint to the given category. Only called
     * if <code>canAdd(...)</code> returns <code>true</code> for the given
     * breakpoint and category.
     *
     * @param breakpoint breakpoint to recategorize
     * @param category the breakpoint's new category
     */
    void addBreakpoint(IBreakpoint breakpoint, IAdaptable category);

    /**
     * Removes the specified breakpoint from the given category. Only
     * called if <code>canRemove(...)</code> returns <code>true</code> for
     * the given breakpoint and category.
     *
     * @param breakpoint breakpoint to recategorize
     * @param category the category the breakpoint is remove from
     */
    void removeBreakpoint(IBreakpoint breakpoint, IAdaptable category);

    /**
     * Returns whether the given breakpoint can be categorized in the
     * specified category.
     *
     * @param breakpoint breakpoint to recatogorize
     * @param category the category to add the breakpoint to
     * @return whether the given breakpoint can be categorized in the
     * specified category
     */
    boolean canAdd(IBreakpoint breakpoint, IAdaptable category);

    /**
     * Returns whether the given breakpoint can be removed from the given
     * category.
     *
     * @param breakpoint breakpoint to recategorize
     * @param category the category to remove the breakpoint from
     * @return whether the given breakpoint can be removed from the given
     * category
     */
    boolean canRemove(IBreakpoint breakpoint, IAdaptable category);

    /**
     * Returns all categories managed by this organizer, or <code>null</code>.
     * When <code>null</code> is returned, the breakpoints view only displays
     * categories that contain breakpoints. When a collection of categories
     * is returned the breakpoints will display all of the categories, some of
     * which may be empty.
     *
     * @return all categories managed by this organizer, or <code>null</code>
     */
    IAdaptable[] getCategories();

    /**
     * Disposes this breakpoint organizer.
     */
    void dispose();

}

Back to the top