KickJava   Java API By Example, From Geeks To Geeks.

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


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 ContentPage extends AbstractTargetPage {
26     
27     public static final String JavaDoc PAGE_ID = "content"; //$NON-NLS-1$
28

29     public ContentPage(FormEditor editor) {
30         super(editor, PAGE_ID, PDEUIMessages.TargetContentPage_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.TargetContentPage_title);
41         form.setImage(PDEPlugin.getDefault().getLabelProvider().get(PDEPluginImages.DESC_FEATURE_OBJ));
42         fillBody(managedForm, toolkit);
43         PlatformUI.getWorkbench().getHelpSystem().setHelp(form.getBody(), IHelpContextIds.TARGET_OVERVIEW_PAGE);
44
45     }
46
47     private void fillBody(IManagedForm managedForm, FormToolkit toolkit) {
48         Composite body = managedForm.getForm().getBody();
49         body.setLayout(FormLayoutFactory.createFormGridLayout(false, 1));
50         
51         managedForm.addPart(new ContentSection(this, body));
52     }
53
54     protected String JavaDoc getHelpResource() {
55         return "/org.eclipse.pde.doc.user/guide/tools/editors/target_definition_editor/content.htm"; //$NON-NLS-1$
56
}
57
58 }
59
Popular Tags