KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*******************************************************************************
2  * Copyright (c) 2005, 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 HelloOSGiTemplate extends PDETemplateSection {
24     
25     public static final String JavaDoc KEY_START_MESSAGE = "startMessage"; //$NON-NLS-1$
26
public static final String JavaDoc KEY_STOP_MESSAGE = "stopMessage"; //$NON-NLS-1$
27
public static final String JavaDoc KEY_APPLICATION_CLASS = "applicationClass"; //$NON-NLS-1$
28

29     public HelloOSGiTemplate() {
30         setPageCount(1);
31         addOption(KEY_START_MESSAGE, PDETemplateMessages.HelloOSGiTemplate_startMessage, PDETemplateMessages.HelloOSGiTemplate_hello, 0);
32         addOption(KEY_STOP_MESSAGE, PDETemplateMessages.HelloOSGiTemplate_stopMessage, PDETemplateMessages.HelloOSGiTemplate_goodbye, 0);
33     }
34     
35     public void addPages(Wizard wizard) {
36         WizardPage page = createPage(0, IHelpContextIds.TEMPLATE_RCP_MAIL);
37         page.setTitle(PDETemplateMessages.HelloOSGiTemplate_pageTitle);
38         page.setDescription(PDETemplateMessages.HelloOSGiTemplate_pageDescription);
39         wizard.addPage(page);
40         markPagesAdded();
41     }
42     
43     /*
44      * (non-Javadoc)
45      *
46      * @see org.eclipse.pde.ui.templates.OptionTemplateSection#getSectionId()
47      */

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

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

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

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

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