KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > internal > intro > impl > model > IntroContentProvider


1 /*******************************************************************************
2  * Copyright (c) 2004, 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
12 package org.eclipse.ui.internal.intro.impl.model;
13
14 import org.osgi.framework.Bundle;
15 import org.w3c.dom.Element JavaDoc;
16
17 /**
18  * An intro content provider element. This element allows intro page to
19  * dynamically pull data from various sources (e.g., the web, eclipse, etc) and
20  * provide content based on this dynamic data. The element's class must
21  * implement the IIntroContentProvider interface. The pluginId attribute can be
22  * used if the class doesn't come from the plugin that defined the markup. The
23  * text content should be used only if we fail to load the class. <br>
24  *
25  * INTRO: model class has access to style-id attribute but it is not used in the
26  * schema.
27  */

28 public class IntroContentProvider extends AbstractTextElement {
29     public static final String JavaDoc TAG_CONTENT_PROVIDER = "contentProvider"; //$NON-NLS-1$
30

31     private static final String JavaDoc ATT_PLUGIN_ID = "pluginId"; //$NON-NLS-1$
32
private static final String JavaDoc ATT_CLASS = "class"; //$NON-NLS-1$
33

34     private String JavaDoc contentProvider;
35     private String JavaDoc pluginId;
36
37
38     public IntroContentProvider(Element JavaDoc element, Bundle bundle) {
39         super(element, bundle);
40         contentProvider = getAttribute(element, ATT_CLASS);
41         pluginId = getAttribute(element, ATT_PLUGIN_ID);
42     }
43
44     /**
45      * Returns the content provider, which should implement
46      * IIntroContentProvider
47      *
48      * @return Returns the contentProvider.
49      */

50     public String JavaDoc getClassName() {
51         return contentProvider;
52     }
53
54     /**
55      * Returns the id of the plugin that contains the content provider class
56      *
57      * @return Returns the pluginId.
58      */

59     public String JavaDoc getPluginId() {
60         return pluginId;
61     }
62
63     /*
64      * (non-Javadoc)
65      *
66      * @see org.eclipse.ui.internal.intro.impl.model.AbstractIntroElement#getType()
67      */

68     public int getType() {
69         return AbstractIntroElement.CONTENT_PROVIDER;
70     }
71 }
72
Popular Tags