KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > pde > internal > ui > templates > osgi > OSGiSimpleLogServiceTemplate


1 /*******************************************************************************
2  * Copyright (c) 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.pde.internal.ui.templates.osgi;
12
13 import org.eclipse.core.runtime.CoreException;
14 import org.eclipse.core.runtime.IProgressMonitor;
15 import org.eclipse.jface.wizard.Wizard;
16 import org.eclipse.jface.wizard.WizardPage;
17 import org.eclipse.pde.core.plugin.IPluginReference;
18 import org.eclipse.pde.internal.ui.templates.IHelpContextIds;
19 import org.eclipse.pde.internal.ui.templates.PDETemplateMessages;
20 import org.eclipse.pde.internal.ui.templates.PDETemplateSection;
21
22 public class OSGiSimpleLogServiceTemplate extends PDETemplateSection {
23     
24     public static final String JavaDoc START_LOG_MESSAGE = "startLogMessage"; //$NON-NLS-1$
25
public static final String JavaDoc STOP_LOG_MESSAGE = "stopLogMessage"; //$NON-NLS-1$
26

27     public OSGiSimpleLogServiceTemplate() {
28         setPageCount(1);
29         addOption(START_LOG_MESSAGE,
30                 PDETemplateMessages.OSGiSimpleLogServiceTemplate_startLogMessage,
31                 PDETemplateMessages.OSGiSimpleLogServiceTemplate_logMessage,
32                 0);
33         addOption(STOP_LOG_MESSAGE,
34                 PDETemplateMessages.OSGiSimpleLogServiceTemplate_stopLogMessage,
35                 PDETemplateMessages.OSGiSimpleLogServiceTemplate_logMessage,
36                 0);
37     }
38     
39     public void addPages(Wizard wizard) {
40         WizardPage page = createPage(0, IHelpContextIds.TEMPLATE_RCP_MAIL);
41         page.setTitle(PDETemplateMessages.OSGiSimpleLogServiceTemplate_pageTitle);
42         page.setDescription(PDETemplateMessages.OSGiSimpleLogServiceTemplate_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 JavaDoc getSectionId() {
53         return "OSGiSimpleLogService"; //$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) throws CoreException {
60         
61     }
62     
63     /* (non-Javadoc)
64      * @see org.eclipse.pde.ui.templates.ITemplateSection#getUsedExtensionPoint()
65      */

66     public String JavaDoc getUsedExtensionPoint() {
67         return null;
68     }
69     
70     /* (non-Javadoc)
71      * @see org.eclipse.pde.ui.templates.BaseOptionTemplateSection#isDependentOnParentWizard()
72      */

73     public boolean isDependentOnParentWizard() {
74         return true;
75     }
76     
77     /* (non-Javadoc)
78      * @see org.eclipse.pde.ui.templates.AbstractTemplateSection#getNumberOfWorkUnits()
79      */

80     public int getNumberOfWorkUnits() {
81         return super.getNumberOfWorkUnits() + 1;
82     }
83     
84     public IPluginReference[] getDependencies(String JavaDoc schemaVersion) {
85         return new IPluginReference[0];
86     }
87     
88 }
89
Popular Tags