KickJava   Java API By Example, From Geeks To Geeks.

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


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
23 public class HelloOSGiServiceTemplate extends PDETemplateSection {
24     
25     public static final String JavaDoc GREETING = "greeting"; //$NON-NLS-1$
26
public static final String JavaDoc KEY_APPLICATION_CLASS = "applicationClass"; //$NON-NLS-1$
27

28     public HelloOSGiServiceTemplate() {
29         setPageCount(1);
30         addOption(GREETING, PDETemplateMessages.HelloOSGiServiceTemplate_greeting, PDETemplateMessages.HelloOSGiServiceTemplate_howdy, 0);
31     }
32     
33     public void addPages(Wizard wizard) {
34         WizardPage page = createPage(0, IHelpContextIds.TEMPLATE_RCP_MAIL);
35         page.setTitle(PDETemplateMessages.HelloOSGiServiceTemplate_pageTitle);
36         page.setDescription(PDETemplateMessages.HelloOSGiServiceTemplate_pageDescription);
37         wizard.addPage(page);
38         markPagesAdded();
39     }
40     
41     /*
42      * (non-Javadoc)
43      *
44      * @see org.eclipse.pde.ui.templates.OptionTemplateSection#getSectionId()
45      */

46     public String JavaDoc getSectionId() {
47         return "helloOSGiService"; //$NON-NLS-1$
48
}
49
50     /* (non-Javadoc)
51      * @see org.eclipse.pde.ui.templates.AbstractTemplateSection#updateModel(org.eclipse.core.runtime.IProgressMonitor)
52      */

53     protected void updateModel(IProgressMonitor monitor) throws CoreException {
54         
55     }
56     
57     /* (non-Javadoc)
58      * @see org.eclipse.pde.ui.templates.ITemplateSection#getUsedExtensionPoint()
59      */

60     public String JavaDoc getUsedExtensionPoint() {
61         return null;
62     }
63     
64     /* (non-Javadoc)
65      * @see org.eclipse.pde.ui.templates.BaseOptionTemplateSection#isDependentOnParentWizard()
66      */

67     public boolean isDependentOnParentWizard() {
68         return true;
69     }
70     
71     /* (non-Javadoc)
72      * @see org.eclipse.pde.ui.templates.AbstractTemplateSection#getNumberOfWorkUnits()
73      */

74     public int getNumberOfWorkUnits() {
75         return super.getNumberOfWorkUnits() + 1;
76     }
77     
78     public IPluginReference[] getDependencies(String JavaDoc schemaVersion) {
79         return new IPluginReference[0];
80     }
81 }
82
Popular Tags