KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > pde > internal > ui > editor > feature > FeatureIncludesPage


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.feature;
12
13 import org.eclipse.pde.internal.ui.IHelpContextIds;
14 import org.eclipse.pde.internal.ui.IPDEUIConstants;
15 import org.eclipse.pde.internal.ui.PDEPlugin;
16 import org.eclipse.pde.internal.ui.PDEPluginImages;
17 import org.eclipse.pde.internal.ui.PDEUIMessages;
18 import org.eclipse.pde.internal.ui.editor.FormLayoutFactory;
19 import org.eclipse.pde.internal.ui.editor.PDEFormEditor;
20 import org.eclipse.pde.internal.ui.editor.PDEFormPage;
21 import org.eclipse.swt.layout.GridData;
22 import org.eclipse.swt.widgets.Composite;
23 import org.eclipse.ui.PlatformUI;
24 import org.eclipse.ui.forms.IManagedForm;
25 import org.eclipse.ui.forms.widgets.FormToolkit;
26 import org.eclipse.ui.forms.widgets.ScrolledForm;
27
28 /**
29  *
30  */

31 public class FeatureIncludesPage extends PDEFormPage {
32     public static final String JavaDoc PAGE_ID = "includes"; //$NON-NLS-1$
33

34     private IncludedFeaturesSection fIncludedSection;
35
36     private IncludedFeaturesDetailsSection fIncludedDetailsSection;
37
38     private IncludedFeaturesPortabilitySection fIncludedPortabilitySection;
39
40     /**
41      *
42      * @param editor
43      * @param title
44      */

45     public FeatureIncludesPage(PDEFormEditor editor, String JavaDoc title) {
46         super(editor, PAGE_ID, title);
47     }
48
49     /* (non-Javadoc)
50      * @see org.eclipse.pde.internal.ui.editor.PDEFormPage#getHelpResource()
51      */

52     protected String JavaDoc getHelpResource() {
53         return IPDEUIConstants.PLUGIN_DOC_ROOT + "guide/tools/editors/feature_editor/included_features.htm"; //$NON-NLS-1$
54
}
55     
56     protected void createFormContent(IManagedForm managedForm) {
57         ScrolledForm form = managedForm.getForm();
58         FormToolkit toolkit = managedForm.getToolkit();
59         form.getBody().setLayout(FormLayoutFactory.createFormGridLayout(true, 2));
60         
61         // Set form header image
62
form.setImage(PDEPlugin.getDefault().getLabelProvider().get(PDEPluginImages.DESC_FEATURE_OBJ));
63
64         GridData gd;
65
66         Composite left = toolkit.createComposite(form.getBody());
67         left.setLayout(FormLayoutFactory.createFormPaneGridLayout(false, 1));
68         gd = new GridData(GridData.FILL_BOTH);
69         left.setLayoutData(gd);
70
71         Composite right = toolkit.createComposite(form.getBody());
72         right.setLayout(FormLayoutFactory.createFormPaneGridLayout(false, 1));
73         gd = new GridData(GridData.FILL_BOTH);
74         right.setLayoutData(gd);
75
76         fIncludedSection = new IncludedFeaturesSection(this, left);
77         fIncludedDetailsSection = new IncludedFeaturesDetailsSection(this,
78                 right);
79
80         // Align the master and details section headers (misalignment caused
81
// by section toolbar icons)
82
alignSectionHeaders(fIncludedSection.getSection(),
83                 fIncludedDetailsSection.getSection());
84         
85         fIncludedPortabilitySection = new IncludedFeaturesPortabilitySection(
86                 this, right);
87
88         managedForm.addPart(fIncludedSection);
89         managedForm.addPart(fIncludedDetailsSection);
90         managedForm.addPart(fIncludedPortabilitySection);
91         form.setText(PDEUIMessages.FeatureEditor_IncludesPage_heading);
92         PlatformUI.getWorkbench().getHelpSystem().setHelp(form.getBody(), IHelpContextIds.MANIFEST_FEATURE_ADVANCED);
93         // WorkbenchHelp.setHelp(form.getBody(),
94
// IHelpContextIds.MANIFEST_FEATURE_CONTENT);
95
fIncludedSection.fireSelection();
96         super.createFormContent(managedForm);
97     }
98 }
99
Popular Tags