KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > debug > ui > actions > RetargettableActionAdapterFactory


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 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.internal.debug.ui.actions;
12
13 import org.eclipse.core.runtime.IAdapterFactory;
14 import org.eclipse.debug.ui.actions.IRunToLineTarget;
15 import org.eclipse.debug.ui.actions.IToggleBreakpointsTarget;
16
17 /**
18  * Creates adapters for retargettable actions in debug platform.
19  * Contributed via <code>org.eclipse.core.runtime.adapters</code>
20  * extension point.
21  *
22  * @since 3.0
23  */

24 public class RetargettableActionAdapterFactory implements IAdapterFactory {
25     /* (non-Javadoc)
26      * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
27      */

28     public Object JavaDoc getAdapter(Object JavaDoc adaptableObject, Class JavaDoc adapterType) {
29         if (adapterType == IRunToLineTarget.class) {
30             return new RunToLineAdapter();
31         }
32         if (adapterType == IToggleBreakpointsTarget.class) {
33             return new ToggleBreakpointAdapter();
34         }
35         return null;
36     }
37     /* (non-Javadoc)
38      * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
39      */

40     public Class JavaDoc[] getAdapterList() {
41         return new Class JavaDoc[]{IRunToLineTarget.class, IToggleBreakpointsTarget.class};
42     }
43 }
44
Popular Tags