KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > pde > internal > ui > editor > feature > InfoFormPage


1 /*******************************************************************************
2  * Copyright (c) 2000, 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.feature;
12
13 import org.eclipse.pde.internal.ui.IHelpContextIds;
14 import org.eclipse.pde.internal.ui.IPDEUIConstants;
15 import org.eclipse.pde.internal.ui.PDEPlugin;
16 import org.eclipse.pde.internal.ui.PDEPluginImages;
17 import org.eclipse.pde.internal.ui.PDEUIMessages;
18 import org.eclipse.pde.internal.ui.editor.FormLayoutFactory;
19 import org.eclipse.pde.internal.ui.editor.PDEFormEditor;
20 import org.eclipse.pde.internal.ui.editor.PDEFormPage;
21 import org.eclipse.pde.internal.ui.editor.text.ColorManager;
22 import org.eclipse.pde.internal.ui.editor.text.IColorManager;
23 import org.eclipse.ui.PlatformUI;
24 import org.eclipse.ui.forms.IManagedForm;
25 import org.eclipse.ui.forms.widgets.ScrolledForm;
26
27 /**
28  *
29  *
30  */

31 public class InfoFormPage extends PDEFormPage {
32     public static final String JavaDoc PAGE_ID = "info"; //$NON-NLS-1$
33
private IColorManager colorManager = ColorManager.getDefault();
34     private InfoSection infoSection;
35 /**
36  *
37  * @param editor
38  * @param title
39  */

40     public InfoFormPage(PDEFormEditor editor, String JavaDoc 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 JavaDoc getHelpResource() {
48         return IPDEUIConstants.PLUGIN_DOC_ROOT + "guide/tools/editors/feature_editor/information.htm"; //$NON-NLS-1$
49
}
50     
51     protected void createFormContent(IManagedForm managedForm) {
52         super.createFormContent(managedForm);
53         ScrolledForm form = managedForm.getForm();
54         form.getBody().setLayout(FormLayoutFactory.createFormGridLayout(false, 1));
55         
56         // Set form header image
57
form.setImage(PDEPlugin.getDefault().getLabelProvider().get(PDEPluginImages.DESC_DOC_SECTION_OBJ));
58         
59         infoSection = new InfoSection(this, form.getBody(), colorManager);
60         managedForm.addPart(infoSection);
61         
62         PlatformUI.getWorkbench().getHelpSystem().setHelp(form.getBody(), IHelpContextIds.MANIFEST_FEATURE_INFO);
63         initialize();
64     }
65     public void dispose() {
66         colorManager.dispose();
67         super.dispose();
68     }
69     public void initialize() {
70         getManagedForm().getForm().setText(PDEUIMessages.FeatureEditor_InfoPage_heading);
71     }
72 }
73
Popular Tags