KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > pde > internal > ui > editor > plugin > RuntimePage


1 /*******************************************************************************
2  * Copyright (c) 2000, 2007 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.editor.plugin;
12
13 import org.eclipse.pde.core.plugin.IPluginModelBase;
14 import org.eclipse.pde.internal.ui.IHelpContextIds;
15 import org.eclipse.pde.internal.ui.IPDEUIConstants;
16 import org.eclipse.pde.internal.ui.PDEPlugin;
17 import org.eclipse.pde.internal.ui.PDEPluginImages;
18 import org.eclipse.pde.internal.ui.PDEUIMessages;
19 import org.eclipse.pde.internal.ui.editor.FormLayoutFactory;
20 import org.eclipse.pde.internal.ui.editor.PDEFormPage;
21 import org.eclipse.ui.PlatformUI;
22 import org.eclipse.ui.forms.IManagedForm;
23 import org.eclipse.ui.forms.editor.FormEditor;
24 import org.eclipse.ui.forms.widgets.ScrolledForm;
25
26 public class RuntimePage extends PDEFormPage {
27     public static final String JavaDoc PAGE_ID="runtime"; //$NON-NLS-1$
28

29     public RuntimePage(FormEditor editor) {
30         super(editor, PAGE_ID, PDEUIMessages.RuntimePage_tabName);
31     }
32     
33     /* (non-Javadoc)
34      * @see org.eclipse.pde.internal.ui.editor.PDEFormPage#getHelpResource()
35      */

36     protected String JavaDoc getHelpResource() {
37         return IPDEUIConstants.PLUGIN_DOC_ROOT + "guide/tools/editors/manifest_editor/runtime.htm"; //$NON-NLS-1$
38
}
39     
40     protected void createFormContent(IManagedForm mform) {
41         super.createFormContent(mform);
42         ScrolledForm form = mform.getForm();
43         form.setImage(PDEPlugin.getDefault().getLabelProvider().get(PDEPluginImages.DESC_JAVA_LIB_OBJ));
44         form.setText(PDEUIMessages.ManifestEditor_RuntimeForm_title);
45         form.getBody().setLayout(FormLayoutFactory.createFormGridLayout(false, 2));
46         
47         if (isBundle()) {
48             mform.addPart(new ExportPackageSection(this, form.getBody()));
49             if (((ManifestEditor)getEditor()).isEquinox())
50                 mform.addPart(new ExportPackageVisibilitySection(this, form.getBody()));
51             mform.addPart(new LibrarySection(this, form.getBody()));
52         } else {
53             // No MANIFEST.MF (not a Bundle)
54
// Create a new plug-in project targeted for 3.0 using the hello
55
// world template to see this section (no MANIFEST.MF is created)
56
mform.addPart(new LibrarySection(this, form.getBody()));
57             mform.addPart(new LibraryVisibilitySection(this, form.getBody()));
58         }
59         
60         if (((IPluginModelBase)getPDEEditor().getAggregateModel()).isFragmentModel())
61             PlatformUI.getWorkbench().getHelpSystem().setHelp(form.getBody(), IHelpContextIds.MANIFEST_FRAGMENT_RUNTIME);
62         else
63             PlatformUI.getWorkbench().getHelpSystem().setHelp(form.getBody(), IHelpContextIds.MANIFEST_PLUGIN_RUNTIME);
64     }
65     
66     private boolean isBundle() {
67         return getPDEEditor().getContextManager().findContext(BundleInputContext.CONTEXT_ID) != null;
68     }
69
70
71 }
72
Popular Tags