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