01: /*******************************************************************************
02: * Copyright (c) 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.product;
11:
12: import org.eclipse.pde.internal.ui.IHelpContextIds;
13: import org.eclipse.pde.internal.ui.IPDEUIConstants;
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.pde.internal.ui.editor.PDEFormPage;
19: import org.eclipse.swt.widgets.Composite;
20: import org.eclipse.ui.PlatformUI;
21: import org.eclipse.ui.forms.IManagedForm;
22: import org.eclipse.ui.forms.editor.FormEditor;
23: import org.eclipse.ui.forms.widgets.FormToolkit;
24: import org.eclipse.ui.forms.widgets.ScrolledForm;
25:
26: /**
27: * SplashPage
28: *
29: */
30: public class SplashPage extends PDEFormPage {
31:
32: public static final String PAGE_ID = "splash"; //$NON-NLS-1$
33:
34: /**
35: * @param editor
36: */
37: public SplashPage(FormEditor editor) {
38: super (editor, PAGE_ID, PDEUIMessages.SplashPage_splashName);
39: }
40:
41: /* (non-Javadoc)
42: * @see org.eclipse.pde.internal.ui.editor.PDEFormPage#getHelpResource()
43: */
44: protected String getHelpResource() {
45: // TODO: MP: SPLASH: Update help document reference in header
46: return IPDEUIConstants.PLUGIN_DOC_ROOT
47: + "guide/tools/editors/product_editor/splash.htm"; //$NON-NLS-1$
48: }
49:
50: /* (non-Javadoc)
51: * @see org.eclipse.pde.internal.ui.editor.PDEFormPage#createFormContent(org.eclipse.ui.forms.IManagedForm)
52: */
53: protected void createFormContent(IManagedForm managedForm) {
54: super .createFormContent(managedForm);
55: ScrolledForm form = managedForm.getForm();
56: FormToolkit toolkit = managedForm.getToolkit();
57: form.setImage(PDEPlugin.getDefault().getLabelProvider().get(
58: PDEPluginImages.DESC_IMAGE_APPLICATION));
59: form.setText(PDEUIMessages.SplashPage_splashName);
60: fillBody(managedForm, toolkit);
61: // TODO: MP: SPLASH: Update help context ID
62: PlatformUI.getWorkbench().getHelpSystem().setHelp(
63: form.getBody(), IHelpContextIds.SPLASH_PAGE);
64: }
65:
66: /**
67: * @param managedForm
68: * @param toolkit
69: */
70: private void fillBody(IManagedForm managedForm, FormToolkit toolkit) {
71: Composite body = managedForm.getForm().getBody();
72: body
73: .setLayout(FormLayoutFactory.createFormGridLayout(
74: false, 1));
75: // Sections
76: managedForm.addPart(new SplashLocationSection(this , body));
77: managedForm.addPart(new SplashConfigurationSection(this, body));
78: }
79:
80: }
|