KickJava   Java API By Example, From Geeks To Geeks.

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


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 public class FeatureAdvancedPage extends PDEFormPage {
29     public static final String JavaDoc PAGE_ID = "advanced"; //$NON-NLS-1$
30

31     private InstallSection fInstallSection;
32
33     private HandlerSection fHandlerSection;
34
35     private DataSection fDataSection;
36
37     private DataDetailsSection fDataDetailsSection;
38
39     private DataPortabilitySection fDataPortabilitySection;
40
41     public FeatureAdvancedPage(PDEFormEditor editor, String JavaDoc title) {
42         super(editor, PAGE_ID, title);
43     }
44
45     /* (non-Javadoc)
46      * @see org.eclipse.pde.internal.ui.editor.PDEFormPage#getHelpResource()
47      */

48     protected String JavaDoc getHelpResource() {
49         return IPDEUIConstants.PLUGIN_DOC_ROOT + "guide/tools/editors/feature_editor/installation.htm"; //$NON-NLS-1$
50
}
51     
52     protected void createFormContent(IManagedForm managedForm) {
53         super.createFormContent(managedForm);
54         ScrolledForm form = managedForm.getForm();
55         FormToolkit toolkit = managedForm.getToolkit();
56
57         // Set form header image
58
form.setImage(PDEPlugin.getDefault().getLabelProvider().get(PDEPluginImages.DESC_OPERATING_SYSTEM_OBJ));
59         
60         Composite body = form.getBody();
61         body.setLayout(FormLayoutFactory.createFormGridLayout(true, 2));
62
63         Composite left = toolkit.createComposite(body);
64         left.setLayout(FormLayoutFactory.createFormPaneGridLayout(false, 1));
65         left.setLayoutData(new GridData(GridData.FILL_BOTH));
66         
67         fInstallSection = new InstallSection(this, left);
68         fDataSection = new DataSection(this, left);
69         fDataPortabilitySection = new DataPortabilitySection(this, left);
70
71         Composite right = toolkit.createComposite(body);
72         right.setLayout(FormLayoutFactory.createFormPaneGridLayout(false, 1));
73         right.setLayoutData(new GridData(GridData.FILL_BOTH));
74
75         fHandlerSection = new HandlerSection(this, right);
76         fDataDetailsSection = new DataDetailsSection(this, right);
77
78         managedForm.addPart(fInstallSection);
79         managedForm.addPart(fHandlerSection);
80         managedForm.addPart(fDataSection);
81         managedForm.addPart(fDataDetailsSection);
82         managedForm.addPart(fDataPortabilitySection);
83
84         PlatformUI.getWorkbench().getHelpSystem().setHelp(form.getBody(),IHelpContextIds.MANIFEST_FEATURE_INSTALLATION);
85
86         form.setText(PDEUIMessages.FeatureEditor_AdvancedPage_heading);
87         fDataSection.fireSelection();
88     }
89 }
90
Popular Tags