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 ContentPage extends PDEFormPage {
26:
27: public static final String 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(
42: PDEPluginImages.DESC_FEATURE_OBJ));
43: fillBody(managedForm, toolkit);
44: PlatformUI.getWorkbench().getHelpSystem().setHelp(
45: form.getBody(), IHelpContextIds.TARGET_OVERVIEW_PAGE);
46:
47: }
48:
49: private void fillBody(IManagedForm managedForm, FormToolkit toolkit) {
50: Composite body = managedForm.getForm().getBody();
51: body
52: .setLayout(FormLayoutFactory.createFormGridLayout(
53: false, 1));
54:
55: managedForm.addPart(new ContentSection(this , body));
56: }
57:
58: protected String getHelpResource() {
59: return "/org.eclipse.pde.doc.user/guide/tools/editors/target_definition_editor/content.htm"; //$NON-NLS-1$
60: }
61:
62: }
|