KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > pde > internal > ui > editor > product > LauncherPage


1 /*******************************************************************************
2  * Copyright (c) 2005, 2006 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.product;
12
13 import org.eclipse.pde.internal.ui.IHelpContextIds;
14 import org.eclipse.pde.internal.ui.PDEUIMessages;
15 import org.eclipse.pde.internal.ui.editor.PDEFormPage;
16 import org.eclipse.swt.layout.GridLayout;
17 import org.eclipse.swt.widgets.Composite;
18 import org.eclipse.ui.PlatformUI;
19 import org.eclipse.ui.forms.IManagedForm;
20 import org.eclipse.ui.forms.editor.FormEditor;
21 import org.eclipse.ui.forms.widgets.FormToolkit;
22 import org.eclipse.ui.forms.widgets.ScrolledForm;
23
24
25 public class LauncherPage extends PDEFormPage {
26     
27     public static final String JavaDoc PAGE_ID = "launcher"; //$NON-NLS-1$
28

29     public LauncherPage(FormEditor editor) {
30         super(editor, PAGE_ID, PDEUIMessages.LauncherPage_title);
31     }
32     
33     /* (non-Javadoc)
34      * @see org.eclipse.pde.internal.ui.editor.PDEFormPage#createFormContent(org.eclipse.ui.forms.IManagedForm)
35      */

36     protected void createFormContent(IManagedForm managedForm) {
37         super.createFormContent(managedForm);
38         ScrolledForm form = managedForm.getForm();
39         FormToolkit toolkit = managedForm.getToolkit();
40         form.setText(PDEUIMessages.LauncherPage_title);
41         fillBody(managedForm, toolkit);
42         PlatformUI.getWorkbench().getHelpSystem().setHelp(form.getBody(), IHelpContextIds.BRANDING_PAGE);
43     }
44     
45     private void fillBody(IManagedForm managedForm, FormToolkit toolkit) {
46         Composite body = managedForm.getForm().getBody();
47         GridLayout layout = new GridLayout();
48         layout.numColumns = 2;
49         layout.marginWidth = 10;
50         layout.verticalSpacing = 15;
51         layout.horizontalSpacing = 10;
52         body.setLayout(layout);
53
54         // sections
55
managedForm.addPart(new LauncherSection(this, body));
56         managedForm.addPart(new ArgumentsSection(this, body));
57     }
58
59
60 }
61
Popular Tags