01: /*******************************************************************************
02: * Copyright (c) 2005, 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.target;
11:
12: import org.eclipse.pde.internal.ui.IHelpContextIds;
13: import org.eclipse.pde.internal.ui.PDEPlugin;
14: import org.eclipse.pde.internal.ui.PDEPluginImages;
15: import org.eclipse.pde.internal.ui.PDEUIMessages;
16: import org.eclipse.pde.internal.ui.editor.FormLayoutFactory;
17: import org.eclipse.pde.internal.ui.editor.PDEFormPage;
18: import org.eclipse.swt.widgets.Composite;
19: import org.eclipse.ui.PlatformUI;
20: import org.eclipse.ui.forms.IManagedForm;
21: import org.eclipse.ui.forms.editor.FormEditor;
22: import org.eclipse.ui.forms.widgets.FormToolkit;
23: import org.eclipse.ui.forms.widgets.ScrolledForm;
24:
25: public class EnvironmentPage extends PDEFormPage {
26:
27: private EnvironmentSection fEnvSection;
28:
29: public static final String PAGE_ID = "environment"; //$NON-NLS-1$
30:
31: public EnvironmentPage(FormEditor editor) {
32: super (editor, PAGE_ID, PDEUIMessages.EnvironmentPage_title);
33: }
34:
35: protected void createFormContent(IManagedForm managedForm) {
36: super .createFormContent(managedForm);
37: ScrolledForm form = managedForm.getForm();
38: form.setText(PDEUIMessages.EnvironmentPage_title);
39: form.setImage(PDEPlugin.getDefault().getLabelProvider().get(
40: PDEPluginImages.DESC_TARGET_ENVIRONMENT));
41: FormToolkit toolkit = managedForm.getToolkit();
42: fillBody(managedForm, toolkit);
43:
44: PlatformUI.getWorkbench().getHelpSystem().setHelp(
45: form.getBody(), IHelpContextIds.ENVIRONMENT_PAGE);
46: }
47:
48: private void fillBody(IManagedForm managedForm, FormToolkit toolkit) {
49: Composite body = managedForm.getForm().getBody();
50: body
51: .setLayout(FormLayoutFactory.createFormGridLayout(
52: false, 2));
53:
54: managedForm.addPart(fEnvSection = new EnvironmentSection(this ,
55: body));
56: managedForm.addPart(new JRESection(this , body));
57: managedForm.addPart(new ArgumentsSection(this , body));
58: managedForm
59: .addPart(new ImplicitDependenciesSection(this , body));
60: }
61:
62: protected void updateChoices() {
63: fEnvSection.updateChoices();
64: }
65:
66: protected String getHelpResource() {
67: return "/org.eclipse.pde.doc.user/guide/tools/editors/target_definition_editor/environment.htm"; //$NON-NLS-1$
68: }
69:
70: }
|