Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: a6535cc07355d0d0c1b76ad0b1c0ecc1cfc23edc (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
/*******************************************************************************
 * Copyright (c) 2008, 2011 IBM Corporation and others.
 *
 * This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License 2.0
 * which accompanies this distribution, and is available at
 * https://www.eclipse.org/legal/epl-2.0/
 *
 * SPDX-License-Identifier: EPL-2.0
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.debug.internal.core;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.debug.core.model.IBreakpointImportParticipant;

/**
 * Proxy to a breakpointImportParticipant extension.
 * Client can contribute participant through the <code>breakpointImportParticipant</code> extension point
 *
 * Example contribution:
 * <pre>
 * <extension
         point="org.eclipse.debug.core.breakpointImportParticipant">
      <ImportParticipant
            participant="x.y.z.BreakpointImportParticipant"
            type="org.eclipse.jdt.debug.javaLineBreakpointMarker">
      </ImportParticipant>
   </extension>
 * </pre>
 *
 * @noextend This class is not intended to be sub-classed by clients.
 * @noinstantiate This class is not intended to be instantiated by clients.
 *
 * @since 3.5
 */
public class BreakpointImportParticipantDelegate {

	/**
	 * The configuration element for this delegate
	 */
	private IConfigurationElement fElement = null;
	private IBreakpointImportParticipant fParticipant = null;

	/**
	 * Constructor
	 * @param element the element this proxy is created on
	 */
	public BreakpointImportParticipantDelegate(IConfigurationElement element) {
		fElement = element;
	}

	/**
	 * Returns the {@link IBreakpointImportParticipant} delegate or <code>null</code> of there was
	 * a problem loading the delegate
	 *
	 * @return the {@link IBreakpointImportParticipant} or <code>null</code>
	 * @throws CoreException if a problem is encountered
	 */
	public IBreakpointImportParticipant getDelegate() throws CoreException {
		if(fParticipant == null) {
			fParticipant = (IBreakpointImportParticipant) fElement.createExecutableExtension(IConfigurationElementConstants.PARTICIPANT);
		}
		return fParticipant;
	}

	/**
	 * Returns the marker type this participant is registered for.
	 *
	 * @return the marker type this participant is registered for
	 * @throws CoreException if a problem is encountered
	 */
	public String getType() throws CoreException {
		return fElement.getAttribute(IConfigurationElementConstants.TYPE);
	}
}

Back to the top