01: /*******************************************************************************
02: * Copyright (c) 2000, 2007 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.pde.internal.ui.editor.feature;
11:
12: import org.eclipse.pde.internal.ui.IHelpContextIds;
13: import org.eclipse.pde.internal.ui.IPDEUIConstants;
14: import org.eclipse.pde.internal.ui.PDEPlugin;
15: import org.eclipse.pde.internal.ui.PDEPluginImages;
16: import org.eclipse.pde.internal.ui.PDEUIMessages;
17: import org.eclipse.pde.internal.ui.editor.FormLayoutFactory;
18: import org.eclipse.pde.internal.ui.editor.PDEFormEditor;
19: import org.eclipse.pde.internal.ui.editor.PDEFormPage;
20: import org.eclipse.swt.layout.GridData;
21: import org.eclipse.swt.widgets.Composite;
22: import org.eclipse.ui.PlatformUI;
23: import org.eclipse.ui.forms.IManagedForm;
24: import org.eclipse.ui.forms.widgets.FormToolkit;
25: import org.eclipse.ui.forms.widgets.ScrolledForm;
26:
27: public class FeatureAdvancedPage extends PDEFormPage {
28: public static final String PAGE_ID = "advanced"; //$NON-NLS-1$
29:
30: private InstallSection fInstallSection;
31:
32: private HandlerSection fHandlerSection;
33:
34: private DataSection fDataSection;
35:
36: private DataDetailsSection fDataDetailsSection;
37:
38: private DataPortabilitySection fDataPortabilitySection;
39:
40: public FeatureAdvancedPage(PDEFormEditor editor, String title) {
41: super (editor, PAGE_ID, title);
42: }
43:
44: /* (non-Javadoc)
45: * @see org.eclipse.pde.internal.ui.editor.PDEFormPage#getHelpResource()
46: */
47: protected String getHelpResource() {
48: return IPDEUIConstants.PLUGIN_DOC_ROOT
49: + "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(
59: PDEPluginImages.DESC_OPERATING_SYSTEM_OBJ));
60:
61: Composite body = form.getBody();
62: body.setLayout(FormLayoutFactory.createFormGridLayout(true, 2));
63:
64: Composite left = toolkit.createComposite(body);
65: left.setLayout(FormLayoutFactory.createFormPaneGridLayout(
66: false, 1));
67: left.setLayoutData(new GridData(GridData.FILL_BOTH));
68:
69: fInstallSection = new InstallSection(this , left);
70: fDataSection = new DataSection(this , left);
71: fDataPortabilitySection = new DataPortabilitySection(this , left);
72:
73: Composite right = toolkit.createComposite(body);
74: right.setLayout(FormLayoutFactory.createFormPaneGridLayout(
75: false, 1));
76: right.setLayoutData(new GridData(GridData.FILL_BOTH));
77:
78: fHandlerSection = new HandlerSection(this , right);
79: fDataDetailsSection = new DataDetailsSection(this, right);
80:
81: managedForm.addPart(fInstallSection);
82: managedForm.addPart(fHandlerSection);
83: managedForm.addPart(fDataSection);
84: managedForm.addPart(fDataDetailsSection);
85: managedForm.addPart(fDataPortabilitySection);
86:
87: PlatformUI.getWorkbench().getHelpSystem().setHelp(
88: form.getBody(),
89: IHelpContextIds.MANIFEST_FEATURE_INSTALLATION);
90:
91: form.setText(PDEUIMessages.FeatureEditor_AdvancedPage_heading);
92: fDataSection.fireSelection();
93: }
94: }
|