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 FeatureIncludesPage extends PDEFormPage {
031: public static final String PAGE_ID = "includes"; //$NON-NLS-1$
032:
033: private IncludedFeaturesSection fIncludedSection;
034:
035: private IncludedFeaturesDetailsSection fIncludedDetailsSection;
036:
037: private IncludedFeaturesPortabilitySection fIncludedPortabilitySection;
038:
039: /**
040: *
041: * @param editor
042: * @param title
043: */
044: public FeatureIncludesPage(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/included_features.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_FEATURE_OBJ));
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: fIncludedSection = new IncludedFeaturesSection(this , left);
081: fIncludedDetailsSection = new IncludedFeaturesDetailsSection(
082: this , right);
083:
084: // Align the master and details section headers (misalignment caused
085: // by section toolbar icons)
086: alignSectionHeaders(fIncludedSection.getSection(),
087: fIncludedDetailsSection.getSection());
088:
089: fIncludedPortabilitySection = new IncludedFeaturesPortabilitySection(
090: this , right);
091:
092: managedForm.addPart(fIncludedSection);
093: managedForm.addPart(fIncludedDetailsSection);
094: managedForm.addPart(fIncludedPortabilitySection);
095: form.setText(PDEUIMessages.FeatureEditor_IncludesPage_heading);
096: PlatformUI.getWorkbench().getHelpSystem().setHelp(
097: form.getBody(),
098: IHelpContextIds.MANIFEST_FEATURE_ADVANCED);
099: // WorkbenchHelp.setHelp(form.getBody(),
100: // IHelpContextIds.MANIFEST_FEATURE_CONTENT);
101: fIncludedSection.fireSelection();
102: super.createFormContent(managedForm);
103: }
104: }
|