KickJava   Java API By Example, From Geeks To Geeks.

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


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.ui.IMemento;
15 import org.eclipse.ui.internal.navigator.NavigatorContentService;
16 import org.eclipse.ui.navigator.ICommonContentExtensionSite;
17 import org.eclipse.ui.navigator.INavigatorContentExtension;
18 import org.eclipse.ui.navigator.INavigatorContentService;
19
20 /**
21  * @since 3.2
22  *
23  */

24 public class CommonContentExtensionSite extends CommonExtensionSite implements
25         ICommonContentExtensionSite {
26
27     private NavigatorContentExtension extension;
28
29     private IMemento memento;
30
31     private NavigatorContentService contentService;
32
33     /**
34      * Create a config element for the initialization of Content Extensions.
35      *
36      * @param anExtensionId
37      * The unique identifier of the associated content extension or
38      * the top-level action provider. <b>May NOT be null.</b>
39      * @param aContentService
40      * The associated content service to allow coordination with
41      * content extensions via the IExtensionStateModel. Clients may
42      * access the content providers and label providers as necessary
43      * also to render labels or images in their UI. <b>May NOT be
44      * null.</b>
45      * @param aMemento
46      * The memento associated with the parent viewer.
47      */

48     public CommonContentExtensionSite(String JavaDoc anExtensionId,
49             NavigatorContentService aContentService, IMemento aMemento) {
50         super(aContentService, anExtensionId);
51
52         NavigatorContentDescriptor contentDescriptor = NavigatorContentDescriptorManager
53                 .getInstance().getContentDescriptor(anExtensionId);
54
55         extension = aContentService.getExtension(contentDescriptor);
56         memento = aMemento;
57         contentService = aContentService;
58     }
59
60     /*
61      * (non-Javadoc)
62      *
63      * @see org.eclipse.ui.navigator.ICommonContentExtensionSite#getMemento()
64      */

65     public IMemento getMemento() {
66         return memento;
67     }
68
69     /*
70      * (non-Javadoc)
71      *
72      * @see org.eclipse.ui.navigator.ICommonContentExtensionSite#getExtension()
73      */

74     public INavigatorContentExtension getExtension() {
75         return extension;
76     }
77
78     /* (non-Javadoc)
79      * @see org.eclipse.ui.navigator.ICommonContentExtensionSite#getService()
80      */

81     public INavigatorContentService getService() {
82         return contentService;
83     }
84
85 }
86
Popular Tags