001: /*******************************************************************************
002: * Copyright (c) 2000, 2007 IBM Corporation and others.
003: * All rights reserved. This program and the accompanying materials
004: * are made available under the terms of the Eclipse Public License v1.0
005: * which accompanies this distribution, and is available at
006: * http://www.eclipse.org/legal/epl-v10.html
007: *
008: * Contributors:
009: * IBM Corporation - initial API and implementation
010: *******************************************************************************/package org.eclipse.pde.internal.ui.editor.feature;
011:
012: import org.eclipse.pde.internal.ui.IHelpContextIds;
013: import org.eclipse.pde.internal.ui.IPDEUIConstants;
014: import org.eclipse.pde.internal.ui.PDEPlugin;
015: import org.eclipse.pde.internal.ui.PDEPluginImages;
016: import org.eclipse.pde.internal.ui.PDEUIMessages;
017: import org.eclipse.pde.internal.ui.editor.FormLayoutFactory;
018: import org.eclipse.pde.internal.ui.editor.PDEFormEditor;
019: import org.eclipse.pde.internal.ui.editor.PDEFormPage;
020: import org.eclipse.swt.layout.GridData;
021: import org.eclipse.swt.widgets.Composite;
022: import org.eclipse.ui.PlatformUI;
023: import org.eclipse.ui.forms.IManagedForm;
024: import org.eclipse.ui.forms.widgets.FormToolkit;
025: import org.eclipse.ui.forms.widgets.ScrolledForm;
026:
027: /**
028: *
029: */
030: public class FeatureReferencePage extends PDEFormPage {
031: public static final String PAGE_ID = "reference"; //$NON-NLS-1$
032:
033: private PluginSection fPluginSection;
034:
035: private PluginDetailsSection fPluginDetailsSection;
036:
037: private PluginPortabilitySection fPluginPortabilitySection;
038:
039: /**
040: *
041: * @param editor
042: * @param title
043: */
044: public FeatureReferencePage(PDEFormEditor editor, String title) {
045: super (editor, PAGE_ID, title);
046: }
047:
048: /* (non-Javadoc)
049: * @see org.eclipse.pde.internal.ui.editor.PDEFormPage#getHelpResource()
050: */
051: protected String getHelpResource() {
052: return IPDEUIConstants.PLUGIN_DOC_ROOT
053: + "guide/tools/editors/feature_editor/plugins.htm"; //$NON-NLS-1$
054: }
055:
056: protected void createFormContent(IManagedForm managedForm) {
057: ScrolledForm form = managedForm.getForm();
058: FormToolkit toolkit = managedForm.getToolkit();
059: form.getBody().setLayout(
060: FormLayoutFactory.createFormGridLayout(true, 2));
061:
062: // Set form header image
063: form.setImage(PDEPlugin.getDefault().getLabelProvider().get(
064: PDEPluginImages.DESC_PLUGINS_FRAGMENTS));
065:
066: GridData gd;
067:
068: Composite left = toolkit.createComposite(form.getBody());
069: left.setLayout(FormLayoutFactory.createFormPaneGridLayout(
070: false, 1));
071: gd = new GridData(GridData.FILL_BOTH);
072: left.setLayoutData(gd);
073:
074: Composite right = toolkit.createComposite(form.getBody());
075: right.setLayout(FormLayoutFactory.createFormPaneGridLayout(
076: false, 1));
077: gd = new GridData(GridData.FILL_BOTH);
078: right.setLayoutData(gd);
079:
080: fPluginSection = new PluginSection(this , left);
081:
082: fPluginDetailsSection = new PluginDetailsSection(this , right);
083:
084: // Align the master and details section headers (misalignment caused
085: // by section toolbar icons)
086: alignSectionHeaders(fPluginSection.getSection(),
087: fPluginDetailsSection.getSection());
088:
089: fPluginPortabilitySection = new PluginPortabilitySection(this ,
090: right);
091: gd = new GridData(GridData.FILL_HORIZONTAL
092: | GridData.VERTICAL_ALIGN_BEGINNING);
093: fPluginPortabilitySection.getSection().setLayoutData(gd);
094:
095: managedForm.addPart(fPluginSection);
096: managedForm.addPart(fPluginDetailsSection);
097: managedForm.addPart(fPluginPortabilitySection);
098:
099: form.setText(PDEUIMessages.FeatureEditor_ReferencePage_heading);
100: // WorkbenchHelp.setHelp(form.getBody(),
101: // IHelpContextIds.MANIFEST_FEATURE_CONTENT);
102: PlatformUI.getWorkbench().getHelpSystem().setHelp(
103: form.getBody(),
104: IHelpContextIds.MANIFEST_FEATURE_CONTENT);
105: fPluginSection.fireSelection();
106: super .createFormContent(managedForm);
107: }
108:
109: public void setFocus() {
110: fPluginSection.setFocus();
111: }
112: }
|