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