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 HelloOSGiServiceTemplate extends PDETemplateSection {
22:
23: public static final String GREETING = "greeting"; //$NON-NLS-1$
24: public static final String KEY_APPLICATION_CLASS = "applicationClass"; //$NON-NLS-1$
25:
26: public HelloOSGiServiceTemplate() {
27: setPageCount(1);
28: addOption(GREETING,
29: PDETemplateMessages.HelloOSGiServiceTemplate_greeting,
30: PDETemplateMessages.HelloOSGiServiceTemplate_howdy, 0);
31: }
32:
33: public void addPages(Wizard wizard) {
34: WizardPage page = createPage(0,
35: IHelpContextIds.TEMPLATE_RCP_MAIL);
36: page
37: .setTitle(PDETemplateMessages.HelloOSGiServiceTemplate_pageTitle);
38: page
39: .setDescription(PDETemplateMessages.HelloOSGiServiceTemplate_pageDescription);
40: wizard.addPage(page);
41: markPagesAdded();
42: }
43:
44: /*
45: * (non-Javadoc)
46: *
47: * @see org.eclipse.pde.ui.templates.OptionTemplateSection#getSectionId()
48: */
49: public String getSectionId() {
50: return "helloOSGiService"; //$NON-NLS-1$
51: }
52:
53: /* (non-Javadoc)
54: * @see org.eclipse.pde.ui.templates.AbstractTemplateSection#updateModel(org.eclipse.core.runtime.IProgressMonitor)
55: */
56: protected void updateModel(IProgressMonitor monitor)
57: throws CoreException {
58:
59: }
60:
61: /* (non-Javadoc)
62: * @see org.eclipse.pde.ui.templates.ITemplateSection#getUsedExtensionPoint()
63: */
64: public String getUsedExtensionPoint() {
65: return null;
66: }
67:
68: /* (non-Javadoc)
69: * @see org.eclipse.pde.ui.templates.BaseOptionTemplateSection#isDependentOnParentWizard()
70: */
71: public boolean isDependentOnParentWizard() {
72: return true;
73: }
74:
75: /* (non-Javadoc)
76: * @see org.eclipse.pde.ui.templates.AbstractTemplateSection#getNumberOfWorkUnits()
77: */
78: public int getNumberOfWorkUnits() {
79: return super .getNumberOfWorkUnits() + 1;
80: }
81:
82: public IPluginReference[] getDependencies(String schemaVersion) {
83: return new IPluginReference[0];
84: }
85: }
|