KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > pde > internal > ui > editor > target > EnvironmentPage


1 /*******************************************************************************
2  * Copyright (c) 2005, 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.target;
12
13 import org.eclipse.pde.internal.ui.IHelpContextIds;
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.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 AbstractTargetPage {
26     
27     private EnvironmentSection fEnvSection;
28     
29     public static final String JavaDoc 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(PDEPluginImages.DESC_TARGET_ENVIRONMENT));
40         FormToolkit toolkit = managedForm.getToolkit();
41         fillBody(managedForm, toolkit);
42         
43         PlatformUI.getWorkbench().getHelpSystem().setHelp(form.getBody(), IHelpContextIds.ENVIRONMENT_PAGE);
44     }
45     
46     private void fillBody(IManagedForm managedForm, FormToolkit toolkit) {
47         Composite body = managedForm.getForm().getBody();
48         body.setLayout(FormLayoutFactory.createFormGridLayout(false, 2));
49         
50         managedForm.addPart(fEnvSection = new EnvironmentSection(this, body));
51         managedForm.addPart(new JRESection(this, body));
52         managedForm.addPart(new ArgumentsSection(this, body));
53         managedForm.addPart(new ImplicitDependenciesSection(this, body));
54     }
55     
56     protected void updateChoices() {
57         fEnvSection.updateChoices();
58     }
59
60     protected String JavaDoc getHelpResource() {
61         return "/org.eclipse.pde.doc.user/guide/tools/editors/target_definition_editor/environment.htm"; //$NON-NLS-1$
62
}
63     
64 }
65
Popular Tags