KickJava   Java API By Example, From Geeks To Geeks.

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


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 FeatureReferencePage extends PDEFormPage {
32     public static final String JavaDoc PAGE_ID = "reference"; //$NON-NLS-1$
33

34     private PluginSection fPluginSection;
35
36     private PluginDetailsSection fPluginDetailsSection;
37
38     private PluginPortabilitySection fPluginPortabilitySection;
39
40     /**
41      *
42      * @param editor
43      * @param title
44      */

45     public FeatureReferencePage(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/plugins.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_PLUGINS_FRAGMENTS));
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         fPluginSection = new PluginSection(this, left);
77
78         fPluginDetailsSection = new PluginDetailsSection(this, right);
79         
80         // Align the master and details section headers (misalignment caused
81
// by section toolbar icons)
82
alignSectionHeaders(fPluginSection.getSection(),
83                 fPluginDetailsSection.getSection());
84
85         fPluginPortabilitySection = new PluginPortabilitySection(this, right);
86         gd = new GridData(GridData.FILL_HORIZONTAL
87                 | GridData.VERTICAL_ALIGN_BEGINNING);
88         fPluginPortabilitySection.getSection().setLayoutData(gd);
89
90         managedForm.addPart(fPluginSection);
91         managedForm.addPart(fPluginDetailsSection);
92         managedForm.addPart(fPluginPortabilitySection);
93
94         form.setText(PDEUIMessages.FeatureEditor_ReferencePage_heading);
95         // WorkbenchHelp.setHelp(form.getBody(),
96
// IHelpContextIds.MANIFEST_FEATURE_CONTENT);
97
PlatformUI.getWorkbench().getHelpSystem().setHelp(form.getBody(), IHelpContextIds.MANIFEST_FEATURE_CONTENT);
98         fPluginSection.fireSelection();
99         super.createFormContent(managedForm);
100     }
101     
102     public void setFocus() {
103         fPluginSection.setFocus();
104     }
105 }
106
Popular Tags