001: /*******************************************************************************
002: * Copyright (c) 2000, 2006 IBM Corporation and others.
003: * All rights reserved. This program and the accompanying materials
004: * are made available under the terms of the Eclipse Public License v1.0
005: * which accompanies this distribution, and is available at
006: * http://www.eclipse.org/legal/epl-v10.html
007: *
008: * Contributors:
009: * IBM Corporation - initial API and implementation
010: *******************************************************************************/package org.eclipse.pde.internal.ui.preferences;
011:
012: import org.eclipse.core.runtime.Platform;
013: import org.eclipse.jface.preference.IPreferenceNode;
014: import org.eclipse.jface.preference.IPreferencePage;
015: import org.eclipse.pde.internal.ui.PDEPlugin;
016: import org.eclipse.swt.graphics.Image;
017:
018: public class TargetPlatformPreferenceNode implements IPreferenceNode {
019: protected TargetPlatformPreferencePage fPage;
020:
021: /**
022: * @see org.eclipse.jface.preference.IPreferenceNode#add(org.eclipse.jface.preference.IPreferenceNode)
023: */
024: public void add(IPreferenceNode node) {
025: }
026:
027: /**
028: * @see org.eclipse.jface.preference.IPreferenceNode#createPage()
029: */
030: public void createPage() {
031: fPage = new TargetPlatformPreferencePage(getIndex());
032: }
033:
034: protected int getIndex() {
035: return TargetPlatformPreferencePage.PLUGINS_INDEX;
036: }
037:
038: /**
039: * @see org.eclipse.jface.preference.IPreferenceNode#disposeResources()
040: */
041: public void disposeResources() {
042: if (fPage != null)
043: fPage.dispose();
044: fPage = null;
045: }
046:
047: /**
048: * @see org.eclipse.jface.preference.IPreferenceNode#findSubNode(java.lang.String)
049: */
050: public IPreferenceNode findSubNode(String id) {
051: return null;
052: }
053:
054: /**
055: * @see org.eclipse.jface.preference.IPreferenceNode#getId()
056: */
057: public String getId() {
058: return "org.eclipse.pde.ui.TargetPlatformPreferencePage"; //$NON-NLS-1$
059: }
060:
061: /**
062: * @see org.eclipse.jface.preference.IPreferenceNode#getLabelImage()
063: */
064: public Image getLabelImage() {
065: return null;
066: }
067:
068: /**
069: * @see org.eclipse.jface.preference.IPreferenceNode#getLabelText()
070: */
071: public String getLabelText() {
072: return Platform.getResourceString(PDEPlugin.getDefault()
073: .getBundle(), "%preferences.target.name"); //$NON-NLS-1$
074: }
075:
076: /**
077: * @see org.eclipse.jface.preference.IPreferenceNode#getPage()
078: */
079: public IPreferencePage getPage() {
080: return fPage;
081: }
082:
083: /**
084: * @see org.eclipse.jface.preference.IPreferenceNode#getSubNodes()
085: */
086: public IPreferenceNode[] getSubNodes() {
087: return new IPreferenceNode[0];
088: }
089:
090: /**
091: * @see org.eclipse.jface.preference.IPreferenceNode#remove(java.lang.String)
092: */
093: public IPreferenceNode remove(String id) {
094: return null;
095: }
096:
097: /**
098: * @see org.eclipse.jface.preference.IPreferenceNode#remove(org.eclipse.jface.preference.IPreferenceNode)
099: */
100: public boolean remove(IPreferenceNode node) {
101: return false;
102: }
103: }
|