KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > internal > navigator > extensions > CommonDragAssistantDescriptor


1 /*******************************************************************************
2  * Copyright (c) 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
12 package org.eclipse.ui.internal.navigator.extensions;
13
14 import org.eclipse.core.runtime.CoreException;
15 import org.eclipse.core.runtime.IConfigurationElement;
16 import org.eclipse.ui.internal.navigator.NavigatorPlugin;
17 import org.eclipse.ui.navigator.CommonDragAdapterAssistant;
18
19 /**
20  *
21  * Drag assistants allow clients to provide new TransferTypes to a particular
22  * viewer.
23  *
24  * @since 3.2
25  *
26  */

27 public final class CommonDragAssistantDescriptor implements IViewerExtPtConstants {
28
29     private IConfigurationElement element;
30
31     
32     /* package */ CommonDragAssistantDescriptor(IConfigurationElement aConfigElement) {
33         element = aConfigElement;
34     }
35
36     /**
37      * Create an instance of the {@link CommonDragAdapterAssistant} defined by
38      * this descriptor.
39      *
40      * @return an instance of the {@link CommonDragAdapterAssistant} or
41      * {@link SkeletonCommonDragAssistant} if a problem occurs with the
42      * instantiation.
43      */

44     public CommonDragAdapterAssistant createDragAssistant() {
45
46         try {
47             return (CommonDragAdapterAssistant) element
48                     .createExecutableExtension(ATT_CLASS);
49         } catch (CoreException e) {
50             NavigatorPlugin.logError(0, e.getMessage(), e);
51         } catch (RuntimeException JavaDoc re) {
52             NavigatorPlugin.logError(0, re.getMessage(), re);
53         }
54         return SkeletonCommonDragAssistant.INSTANCE;
55
56     }
57
58 }
59
Popular Tags