KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > pde > internal > ui > preferences > TargetPlatformPreferenceNode


1 /*******************************************************************************
2  * Copyright (c) 2000, 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.pde.internal.ui.preferences;
12
13 import org.eclipse.core.runtime.Platform;
14 import org.eclipse.jface.preference.IPreferenceNode;
15 import org.eclipse.jface.preference.IPreferencePage;
16 import org.eclipse.pde.internal.ui.PDEPlugin;
17 import org.eclipse.swt.graphics.Image;
18
19 public class TargetPlatformPreferenceNode implements IPreferenceNode {
20     protected TargetPlatformPreferencePage fPage;
21
22     /**
23      * @see org.eclipse.jface.preference.IPreferenceNode#add(org.eclipse.jface.preference.IPreferenceNode)
24      */

25     public void add(IPreferenceNode node) {
26     }
27
28     /**
29      * @see org.eclipse.jface.preference.IPreferenceNode#createPage()
30      */

31     public void createPage() {
32         fPage = new TargetPlatformPreferencePage(getIndex());
33     }
34     
35     protected int getIndex() {
36         return TargetPlatformPreferencePage.PLUGINS_INDEX;
37     }
38
39     /**
40      * @see org.eclipse.jface.preference.IPreferenceNode#disposeResources()
41      */

42     public void disposeResources() {
43         if (fPage!=null) fPage.dispose();
44         fPage = null;
45     }
46
47     /**
48      * @see org.eclipse.jface.preference.IPreferenceNode#findSubNode(java.lang.String)
49      */

50     public IPreferenceNode findSubNode(String JavaDoc id) {
51         return null;
52     }
53
54     /**
55      * @see org.eclipse.jface.preference.IPreferenceNode#getId()
56      */

57     public String JavaDoc getId() {
58         return "org.eclipse.pde.ui.TargetPlatformPreferencePage"; //$NON-NLS-1$
59
}
60
61     /**
62      * @see org.eclipse.jface.preference.IPreferenceNode#getLabelImage()
63      */

64     public Image getLabelImage() {
65         return null;
66     }
67
68     /**
69      * @see org.eclipse.jface.preference.IPreferenceNode#getLabelText()
70      */

71     public String JavaDoc getLabelText() {
72         return Platform.getResourceString(PDEPlugin.getDefault().getBundle(), "%preferences.target.name"); //$NON-NLS-1$
73
}
74
75     /**
76      * @see org.eclipse.jface.preference.IPreferenceNode#getPage()
77      */

78     public IPreferencePage getPage() {
79         return fPage;
80     }
81
82     /**
83      * @see org.eclipse.jface.preference.IPreferenceNode#getSubNodes()
84      */

85     public IPreferenceNode[] getSubNodes() {
86         return new IPreferenceNode [0];
87     }
88
89     /**
90      * @see org.eclipse.jface.preference.IPreferenceNode#remove(java.lang.String)
91      */

92     public IPreferenceNode remove(String JavaDoc id) {
93         return null;
94     }
95
96     /**
97      * @see org.eclipse.jface.preference.IPreferenceNode#remove(org.eclipse.jface.preference.IPreferenceNode)
98      */

99     public boolean remove(IPreferenceNode node) {
100         return false;
101     }
102 }
103
Popular Tags