1 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 PAGE_ID="runtime"; 29 public RuntimePage(FormEditor editor) { 30 super(editor, PAGE_ID, PDEUIMessages.RuntimePage_tabName); 31 } 32 33 36 protected String getHelpResource() { 37 return IPDEUIConstants.PLUGIN_DOC_ROOT + "guide/tools/editors/manifest_editor/runtime.htm"; } 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 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 |