01: /*******************************************************************************
02: * Copyright (c) 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.pde.internal.ui.templates.osgi;
11:
12: import org.eclipse.core.runtime.CoreException;
13: import org.eclipse.core.runtime.IProgressMonitor;
14: import org.eclipse.jface.wizard.Wizard;
15: import org.eclipse.jface.wizard.WizardPage;
16: import org.eclipse.pde.core.plugin.IPluginReference;
17: import org.eclipse.pde.internal.ui.templates.IHelpContextIds;
18: import org.eclipse.pde.internal.ui.templates.PDETemplateMessages;
19: import org.eclipse.pde.internal.ui.templates.PDETemplateSection;
20:
21: public class OSGiPreferencesServiceTemplate extends PDETemplateSection {
22:
23: public static final String COLOR = "color"; //$NON-NLS-1$
24:
25: public OSGiPreferencesServiceTemplate() {
26: setPageCount(1);
27: addOption(
28: COLOR,
29: PDETemplateMessages.OSGiPreferencesServiceTemplate_label,
30: PDETemplateMessages.OSGiPreferencesServiceTemplate_value,
31: 0);
32: }
33:
34: public void addPages(Wizard wizard) {
35: WizardPage page = createPage(0,
36: IHelpContextIds.TEMPLATE_RCP_MAIL);
37: page
38: .setTitle(PDETemplateMessages.OSGiPreferencesServiceTemplate_pageTitle);
39: page
40: .setDescription(PDETemplateMessages.OSGiPreferencesServiceTemplate_pageDescription);
41: wizard.addPage(page);
42: markPagesAdded();
43: }
44:
45: /*
46: * (non-Javadoc)
47: *
48: * @see org.eclipse.pde.ui.templates.OptionTemplateSection#getSectionId()
49: */
50: public String getSectionId() {
51: return "OSGiPreferencesService"; //$NON-NLS-1$
52: }
53:
54: /* (non-Javadoc)
55: * @see org.eclipse.pde.ui.templates.AbstractTemplateSection#updateModel(org.eclipse.core.runtime.IProgressMonitor)
56: */
57: protected void updateModel(IProgressMonitor monitor)
58: throws CoreException {
59:
60: }
61:
62: /* (non-Javadoc)
63: * @see org.eclipse.pde.ui.templates.ITemplateSection#getUsedExtensionPoint()
64: */
65: public String getUsedExtensionPoint() {
66: return null;
67: }
68:
69: /* (non-Javadoc)
70: * @see org.eclipse.pde.ui.templates.BaseOptionTemplateSection#isDependentOnParentWizard()
71: */
72: public boolean isDependentOnParentWizard() {
73: return true;
74: }
75:
76: /* (non-Javadoc)
77: * @see org.eclipse.pde.ui.templates.AbstractTemplateSection#getNumberOfWorkUnits()
78: */
79: public int getNumberOfWorkUnits() {
80: return super .getNumberOfWorkUnits() + 1;
81: }
82:
83: public IPluginReference[] getDependencies(String schemaVersion) {
84: return new IPluginReference[0];
85: }
86: }
|