KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > debug > internal > ui > views > variables > details > DefaultDetailPaneFactory


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 package org.eclipse.debug.internal.ui.views.variables.details;
12
13 import java.util.HashSet JavaDoc;
14 import java.util.Set JavaDoc;
15
16 import org.eclipse.debug.ui.IDetailPane;
17 import org.eclipse.debug.ui.IDetailPaneFactory;
18 import org.eclipse.jface.viewers.IStructuredSelection;
19
20 /**
21  * The default detail pane factory is contributed to the <code>org.eclipse.debug.ui.detailPaneFactories</code>
22  * extension without an enablement expression so it is always loaded. For any given selection (even
23  * null or empty selections), the factory can produce a <code>SourceDetailsPane</code>
24  *
25  * @see SourceDetailPane
26  * @since 3.3
27  */

28 public class DefaultDetailPaneFactory implements IDetailPaneFactory {
29
30     public static final String JavaDoc DEFAULT_DETAIL_PANE_ID = DefaultDetailPane.ID;
31     
32     /* (non-Javadoc)
33      * @see org.eclipse.debug.internal.ui.views.variables.IDetailsFactory#createDetailsArea(java.lang.String)
34      */

35     public IDetailPane createDetailPane(String JavaDoc id) {
36         return new DefaultDetailPane();
37     }
38
39     /* (non-Javadoc)
40      * @see org.eclipse.debug.internal.ui.views.variables.IDetailsFactory#getDetailsTypes(org.eclipse.jface.viewers.IStructuredSelection)
41      */

42     public Set JavaDoc getDetailPaneTypes(IStructuredSelection selection) {
43         Set JavaDoc possibleIDs = new HashSet JavaDoc(1);
44         possibleIDs.add(DefaultDetailPane.ID);
45         return possibleIDs;
46     }
47     
48     /* (non-Javadoc)
49      * @see org.eclipse.debug.ui.IDetailPaneFactory#getDefaultDetailPane(java.util.Set, org.eclipse.jface.viewers.IStructuredSelection)
50      */

51     public String JavaDoc getDefaultDetailPane(IStructuredSelection selection) {
52         // Return null so that any contributed detail pane can override the default
53
return null;
54     }
55
56     /* (non-Javadoc)
57      * @see org.eclipse.debug.internal.ui.views.variables.IDetailsFactory#getName(java.lang.String)
58      */

59     public String JavaDoc getDetailPaneName(String JavaDoc id) {
60         if (id.equals(DefaultDetailPane.ID)){
61             return DefaultDetailPane.NAME;
62         }
63         return null;
64     }
65     
66
67     /* (non-Javadoc)
68      * @see org.eclipse.debug.internal.ui.views.variables.IDetailsFactory#getDescription(java.lang.String)
69      */

70     public String JavaDoc getDetailPaneDescription(String JavaDoc id) {
71         if (id.equals(DefaultDetailPane.ID)){
72             return DefaultDetailPane.DESCRIPTION;
73         }
74         return null;
75     }
76
77 }
78
Popular Tags