Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 94889 Details for
Bug 224892
Action to register a context help file
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Fix
224892RegisterContextHelp.patch (text/plain), 22.65 KB, created by
Curtis Windatt
on 2008-04-04 13:26:58 EDT
(
hide
)
Description:
Fix
Filename:
MIME Type:
Creator:
Curtis Windatt
Created:
2008-04-04 13:26:58 EDT
Size:
22.65 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.pde.ui >Index: src/org/eclipse/pde/internal/ui/pderesources.properties >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/pderesources.properties,v >retrieving revision 1.978 >diff -u -r1.978 pderesources.properties >--- src/org/eclipse/pde/internal/ui/pderesources.properties 3 Apr 2008 17:08:30 -0000 1.978 >+++ src/org/eclipse/pde/internal/ui/pderesources.properties 4 Apr 2008 17:25:38 -0000 >@@ -2079,6 +2079,11 @@ > RegisterCSOperation_modCSExtensionExistingPlugin=Modifying existing cheat sheet extension in existing plug-in manifest file... > RegisterCSOperation_modCSElementExistingPlugin=Modifying existing cheat sheet element in existing plug-in manifest file... > RegisterCSOperation_addNewCSExtensionNewPlugin=Adding new cheat sheet extension to new plug-in manifest file... >+RegisterCtxHelpWizard_0=Register Context Help File >+RegisterCtxHelpWizard_2=Context Help >+RegisterCtxHelpWizard_3=Enter any additional information and hit finish to register the file in plugin.xml >+RegisterCtxHelpWizard_4=&Plugin: >+RegisterCtxHelpWizard_5=You can optionally specify a plugin that this context help file extends. > RemoveRequireBundleResolution_description=Remove bundle ''{0}'' from the list > RemoveSeperatorBuildEntryResolution_label=Remove the trailing separator in {0} from the {1} entry. > RemoveImportPkgResolution_description=Remove the ''{0}'' package from list >@@ -2441,6 +2446,7 @@ > CtxHelpContextDetails_title=Title: > CtxHelpDescriptionDetails_description=Description: > CtxHelpDescriptionDetails_specifyDescription=Specify the context description that will be displayed to the user: >+CtxHelpEditor_0=Register this context help file > CtxHelpPage_contextHelp=Context Help > CtxHelpPage_errorParsing=An error occurred while parsing the context help xml file. > CtxHelpPage_failedToLoad=Failed to load context help contents >Index: src/org/eclipse/pde/internal/ui/PDEUIMessages.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/PDEUIMessages.java,v >retrieving revision 1.364 >diff -u -r1.364 PDEUIMessages.java >--- src/org/eclipse/pde/internal/ui/PDEUIMessages.java 26 Mar 2008 16:11:24 -0000 1.364 >+++ src/org/eclipse/pde/internal/ui/PDEUIMessages.java 4 Apr 2008 17:25:38 -0000 >@@ -622,6 +622,16 @@ > > public static String RegisterCSWizardPage_wizardPageDescription; > >+ public static String RegisterCtxHelpWizard_0; >+ >+ public static String RegisterCtxHelpWizard_2; >+ >+ public static String RegisterCtxHelpWizard_3; >+ >+ public static String RegisterCtxHelpWizard_4; >+ >+ public static String RegisterCtxHelpWizard_5; >+ > public static String RemoveUnknownExecEnvironments_label; > > public static String AddDefaultExecutionEnvironment_label; >@@ -2889,6 +2899,8 @@ > > public static String CtxHelpDescriptionDetails_specifyDescription; > >+ public static String CtxHelpEditor_0; >+ > public static String CtxHelpPage_contextHelp; > > public static String CtxHelpPage_errorParsing; >Index: src/org/eclipse/pde/internal/ui/editor/ctxhelp/CtxHelpEditor.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/ctxhelp/CtxHelpEditor.java,v >retrieving revision 1.1 >diff -u -r1.1 CtxHelpEditor.java >--- src/org/eclipse/pde/internal/ui/editor/ctxhelp/CtxHelpEditor.java 21 Jan 2008 17:38:13 -0000 1.1 >+++ src/org/eclipse/pde/internal/ui/editor/ctxhelp/CtxHelpEditor.java 4 Apr 2008 17:25:38 -0000 >@@ -16,15 +16,25 @@ > import org.eclipse.core.resources.*; > import org.eclipse.core.runtime.IPath; > import org.eclipse.jdt.ui.JavaUI; >+import org.eclipse.jface.action.ControlContribution; >+import org.eclipse.jface.action.IToolBarManager; > import org.eclipse.jface.viewers.*; >+import org.eclipse.jface.wizard.WizardDialog; >+import org.eclipse.pde.core.IModel; > import org.eclipse.pde.internal.core.text.ctxhelp.*; >-import org.eclipse.pde.internal.ui.IPDEUIConstants; >-import org.eclipse.pde.internal.ui.PDEPlugin; >+import org.eclipse.pde.internal.ui.*; > import org.eclipse.pde.internal.ui.editor.*; > import org.eclipse.pde.internal.ui.editor.context.InputContext; > import org.eclipse.pde.internal.ui.editor.context.InputContextManager; >+import org.eclipse.pde.internal.ui.wizards.ctxhelp.RegisterCtxHelpWizard; >+import org.eclipse.swt.SWT; >+import org.eclipse.swt.widgets.Composite; >+import org.eclipse.swt.widgets.Control; > import org.eclipse.ui.*; > import org.eclipse.ui.forms.editor.IFormPage; >+import org.eclipse.ui.forms.events.HyperlinkEvent; >+import org.eclipse.ui.forms.events.IHyperlinkListener; >+import org.eclipse.ui.forms.widgets.ImageHyperlink; > import org.eclipse.ui.part.*; > > /** >@@ -267,4 +277,47 @@ > return new CtxHelpSourcePage(editor, title, name); > } > >+ /* (non-Javadoc) >+ * @see org.eclipse.pde.internal.ui.editor.PDEFormEditor#contributeToToolbar(org.eclipse.jface.action.IToolBarManager) >+ */ >+ public void contributeToToolbar(IToolBarManager manager) { >+ if (getAggregateModel().isEditable()) { >+ manager.add(new ControlContribution("Register") { //$NON-NLS-1$ >+ protected Control createControl(Composite parent) { >+ ImageHyperlink fImageHyperlinkRegisterTOC = new ImageHyperlink(parent, SWT.NONE); >+ fImageHyperlinkRegisterTOC.setText(PDEUIMessages.CtxHelpEditor_0); >+ fImageHyperlinkRegisterTOC.setUnderlined(true); >+ fImageHyperlinkRegisterTOC.setForeground(getToolkit().getHyperlinkGroup().getForeground()); >+ fImageHyperlinkRegisterTOC.addHyperlinkListener(new IHyperlinkListener() { >+ public void linkActivated(HyperlinkEvent e) { >+ handleRegisterCtxHelpFile(); >+ } >+ >+ public void linkEntered(HyperlinkEvent e) { >+ ((ImageHyperlink) e.getSource()).setForeground(getToolkit().getHyperlinkGroup().getActiveForeground()); >+ getEditorSite().getActionBars().getStatusLineManager().setMessage(PDEUIMessages.CtxHelpEditor_0); >+ } >+ >+ public void linkExited(HyperlinkEvent e) { >+ ((ImageHyperlink) e.getSource()).setForeground(getToolkit().getHyperlinkGroup().getForeground()); >+ getEditorSite().getActionBars().getStatusLineManager().setMessage(null); >+ } >+ }); >+ return fImageHyperlinkRegisterTOC; >+ } >+ }); >+ } >+ } >+ >+ /** >+ * Opens the register context help wizard dialog. >+ */ >+ private void handleRegisterCtxHelpFile() { >+ RegisterCtxHelpWizard wizard = new RegisterCtxHelpWizard((IModel) getAggregateModel()); >+ WizardDialog dialog = new WizardDialog(PDEPlugin.getActiveWorkbenchShell(), wizard); >+ dialog.create(); >+ dialog.getShell().setSize(400, 250); >+ dialog.open(); >+ } >+ > } >Index: src/org/eclipse/pde/internal/ui/wizards/ctxhelp/RegisterCtxHelpOperation.java >=================================================================== >RCS file: src/org/eclipse/pde/internal/ui/wizards/ctxhelp/RegisterCtxHelpOperation.java >diff -N src/org/eclipse/pde/internal/ui/wizards/ctxhelp/RegisterCtxHelpOperation.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/pde/internal/ui/wizards/ctxhelp/RegisterCtxHelpOperation.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,282 @@ >+/******************************************************************************* >+ * Copyright (c) 2008 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ *******************************************************************************/ >+package org.eclipse.pde.internal.ui.wizards.ctxhelp; >+ >+import java.lang.reflect.InvocationTargetException; >+import org.eclipse.core.resources.IFile; >+import org.eclipse.core.resources.IProject; >+import org.eclipse.core.runtime.*; >+import org.eclipse.pde.core.IBaseModel; >+import org.eclipse.pde.core.IModel; >+import org.eclipse.pde.core.build.*; >+import org.eclipse.pde.core.plugin.*; >+import org.eclipse.pde.internal.core.*; >+import org.eclipse.pde.internal.core.build.BuildObject; >+import org.eclipse.pde.internal.core.build.WorkspaceBuildModel; >+import org.eclipse.pde.internal.core.ibundle.*; >+import org.eclipse.pde.internal.core.ictxhelp.ICtxHelpConstants; >+import org.eclipse.pde.internal.core.plugin.*; >+import org.eclipse.pde.internal.core.text.bundle.BundleSymbolicNameHeader; >+import org.eclipse.pde.internal.core.text.bundle.RequireBundleHeader; >+import org.eclipse.pde.internal.core.util.PDETextHelper; >+import org.eclipse.pde.internal.ui.*; >+import org.eclipse.pde.internal.ui.editor.ctxhelp.CtxHelpEditor; >+import org.eclipse.pde.internal.ui.util.ModelModification; >+import org.eclipse.pde.internal.ui.util.PDEModelUtility; >+import org.eclipse.swt.widgets.Shell; >+import org.eclipse.ui.actions.WorkspaceModifyOperation; >+import org.osgi.framework.Constants; >+ >+/** >+ * Register Context Help Operation, registers a context help xml file in the plugin.xml. >+ * Must be run in the UI thread. >+ * @since 3.4 >+ * @see RegisterCtxHelpOperation >+ * @see CtxHelpEditor >+ */ >+public class RegisterCtxHelpOperation extends WorkspaceModifyOperation { >+ >+ static final String CTX_HELP_EXTENSION_POINT_ID = "org.eclipse.help.contexts"; //$NON-NLS-1$ >+ static final String CTX_HELP_PLUGIN_ID = "org.eclipse.help"; //$NON-NLS-1$ >+ >+ public static final String CTX_HELP_ATTR_FILE = "file"; //$NON-NLS-1$ >+ public final static String CTX_HELP_ATTR_PLUGIN = "plugin"; //$NON-NLS-1$ >+ >+ private Shell fShell; >+ private String fPluginText; >+ private IProject fProject; >+ private String fResourceString; >+ >+ public RegisterCtxHelpOperation(Shell shell, IModel model, String pluginText) { >+ fPluginText = pluginText; >+ fProject = model.getUnderlyingResource().getProject(); >+ fResourceString = model.getUnderlyingResource().getProjectRelativePath().toPortableString(); >+ fShell = shell; >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.actions.WorkspaceModifyOperation#execute(org.eclipse.core.runtime.IProgressMonitor) >+ */ >+ protected void execute(IProgressMonitor monitor) throws CoreException, InvocationTargetException, InterruptedException { >+ try { >+ boolean fragment = PluginRegistry.findModel(fProject).isFragmentModel(); >+ IFile file = fProject.getFile(fragment ? ICoreConstants.FRAGMENT_PATH : ICoreConstants.PLUGIN_PATH); >+ // If the plug-in exists modify it accordingly; otherwise, create >+ // a new plug-in file >+ if (file.exists()) { >+ modifyExistingPluginFile(file, monitor); >+ } else { >+ createNewPluginFile(file, monitor); >+ } >+ } catch (CoreException e) { >+ throw new InvocationTargetException(e); >+ } >+ } >+ >+ private void modifyExistingPluginFile(IFile file, IProgressMonitor monitor) throws CoreException { >+ IStatus status = PDEPlugin.getWorkspace().validateEdit(new IFile[] {file}, fShell); >+ if (status.getSeverity() != IStatus.OK) { >+ throw new CoreException(new Status(IStatus.ERROR, IPDEUIConstants.PLUGIN_ID, IStatus.ERROR, PDEUIMessages.RegisterCSOperation_errorManifestReadOnly, null)); >+ } >+ // Perform the modification of the plugin manifest file >+ ModelModification mod = new ModelModification(fProject) { >+ protected void modifyModel(IBaseModel model, IProgressMonitor monitor) throws CoreException { >+ doModifyPluginModel(model, monitor); >+ doModifyManifestModel(model); >+ } >+ }; >+ PDEModelUtility.modifyModel(mod, monitor); >+ } >+ >+ private void doModifyPluginModel(IBaseModel model, IProgressMonitor monitor) throws CoreException { >+ if ((model instanceof IPluginModelBase) == false) { >+ return; >+ } >+ >+ IPluginModelBase modelBase = (IPluginModelBase) model; >+ IPluginExtension[] extensions = modelBase.getExtensions().getExtensions(); >+ IPluginExtension existingExtension = null; >+ for (int i = 0; i < extensions.length; i++) { >+ String point = extensions[i].getPoint(); >+ if (CTX_HELP_EXTENSION_POINT_ID.equals(point)) { >+ if (checkExistingExtensionElement(extensions[i])) { >+ // Exact match, no need to register anything >+ return; >+ } >+ existingExtension = extensions[i]; >+ } >+ } >+ >+ if (existingExtension != null) { >+ // No exact match, add a new entry to the existing extension >+ addElementToExtension(existingExtension); >+ } else { >+ // No existing extension found, create one >+ addExtensionToModel(modelBase); >+ } >+ } >+ >+ private void doModifyManifestModel(IBaseModel model) { >+ // Make sure we have a base model >+ if ((model instanceof IBundlePluginModelBase) == false) { >+ return; >+ } >+ IBundlePluginModelBase modelBase = (IBundlePluginModelBase) model; >+ IBundle bundle = modelBase.getBundleModel().getBundle(); >+ // Get the heading specifying the singleton declaration >+ IManifestHeader header = bundle.getManifestHeader(Constants.BUNDLE_SYMBOLICNAME); >+ if (header instanceof BundleSymbolicNameHeader) { >+ BundleSymbolicNameHeader symbolic = (BundleSymbolicNameHeader) header; >+ // If the singleton declaration is false, change it to true >+ // This is required because plug-ins that specify extensions >+ // must be singletons. >+ if (symbolic.isSingleton() == false) { >+ symbolic.setSingleton(true); >+ } >+ } >+ // Add the context help plug-in to the list of required bundles >+ header = bundle.getManifestHeader(Constants.REQUIRE_BUNDLE); >+ if (header instanceof RequireBundleHeader) { >+ RequireBundleHeader require = (RequireBundleHeader) header; >+ if (require.hasElement(CTX_HELP_PLUGIN_ID) == false) { >+ require.addBundle(CTX_HELP_PLUGIN_ID); >+ } >+ } >+ } >+ >+ private void createNewPluginFile(IFile file, IProgressMonitor monitor) throws CoreException { >+ monitor.beginTask(PDEUIMessages.RegisterCSOperation_addNewCSExtensionNewPlugin, 4); >+ >+ WorkspacePluginModelBase model; >+ if (file.getProjectRelativePath().equals(ICoreConstants.FRAGMENT_PATH)) { >+ model = new WorkspaceFragmentModel(file, false); >+ } else { >+ model = new WorkspacePluginModel(file, false); >+ } >+ monitor.worked(1); >+ >+ IPluginBase base = model.getPluginBase(); >+ double targetVersion = TargetPlatformHelper.getTargetVersion(); >+ String version = null; >+ if (targetVersion < 3.2) { >+ version = ICoreConstants.TARGET30; >+ } else { >+ version = ICoreConstants.TARGET32; >+ } >+ base.setSchemaVersion(version); >+ >+ addExtensionToModel(model); >+ monitor.worked(1); >+ >+ model.save(); >+ monitor.worked(1); >+ // Update the MANIFEST.MF file to ensure the singleton directive is set >+ // to true >+ modifyExistingManifestFile(file); >+ monitor.done(); >+ } >+ >+ /** >+ * @param model >+ */ >+ private void modifyExistingManifestFile(IFile file) throws CoreException { >+ // Validate the operation >+ // Note: This is not accurate, we are validating the plugin.xml file rather >+ // than the manifest file >+ IStatus status = PDEPlugin.getWorkspace().validateEdit(new IFile[] {file}, fShell); >+ if (status.getSeverity() != IStatus.OK) { >+ throw new CoreException(new Status(IStatus.ERROR, IPDEUIConstants.PLUGIN_ID, IStatus.ERROR, PDEUIMessages.RegisterCSOperation_errorManifestReadOnly, null)); >+ } >+ // Perform the modification of the manifest file >+ ModelModification mod = new ModelModification(fProject) { >+ protected void modifyModel(IBaseModel model, IProgressMonitor monitor) throws CoreException { >+ doModifyManifestModel(model); >+ doModifyBuildModel(model); >+ } >+ }; >+ PDEModelUtility.modifyModel(mod, null); >+ } >+ >+ private void doModifyBuildModel(IBaseModel model) throws CoreException { >+ // Make sure we have a base model >+ if ((model instanceof IPluginModelBase) == false) { >+ return; >+ } >+ IPluginModelBase modelBase = (IPluginModelBase) model; >+ IBuild build = ClasspathUtilCore.getBuild(modelBase); >+ // Make sure we have a plugin.properties file >+ if (build == null) { >+ return; >+ } >+ // Get the entry for bin.includes >+ IBuildEntry entry = build.getEntry(IBuildEntry.BIN_INCLUDES); >+ if (entry == null) { >+ // This should never happen since the manifest.mf file exists and >+ // it has to be in the bin.includes >+ return; >+ } >+ // Add the plugin.xml file to the bin.includes build entry if it does >+ // not exist >+ if (entry.contains(ICoreConstants.PLUGIN_FILENAME_DESCRIPTOR) == false) { >+ entry.addToken(ICoreConstants.PLUGIN_FILENAME_DESCRIPTOR); >+ } >+ // There does not seem to be any support in PDEModelUtility or the >+ // ModelModification framework to save build.properties modifications >+ // As a result, explicitly do that here >+ if (build instanceof BuildObject) { >+ IBuildModel buildModel = ((BuildObject) build).getModel(); >+ if (buildModel instanceof WorkspaceBuildModel) { >+ ((WorkspaceBuildModel) buildModel).save(); >+ } >+ } >+ } >+ >+ private boolean checkExistingExtensionElement(IPluginExtension extension) { >+ IPluginObject[] pluginObjects = extension.getChildren(); >+ for (int j = 0; j < pluginObjects.length; j++) { >+ if (pluginObjects[j] instanceof IPluginElement) { >+ IPluginElement element = (IPluginElement) pluginObjects[j]; >+ if (element.getName().equals(ICtxHelpConstants.ELEMENT_ROOT)) { >+ IPluginAttribute fileAttribute = element.getAttribute(CTX_HELP_ATTR_FILE); >+ if ((fileAttribute != null) && PDETextHelper.isDefined(fileAttribute.getValue()) && fResourceString.equals(fileAttribute.getValue())) { >+ IPluginAttribute pluginAttribute = element.getAttribute(CTX_HELP_ATTR_PLUGIN); >+ if (pluginAttribute == null || !PDETextHelper.isDefined(pluginAttribute.getValue())) { >+ if (fPluginText.length() == 0) { >+ return true; >+ } >+ } else if (fPluginText.equals(pluginAttribute.getValue())) { >+ return true; >+ } >+ } >+ } >+ } >+ } >+ return false; >+ } >+ >+ private void addExtensionToModel(IPluginModelBase model) throws CoreException { >+ IPluginExtension extension = model.getFactory().createExtension(); >+ extension.setPoint(CTX_HELP_EXTENSION_POINT_ID); >+ addElementToExtension(extension); >+ model.getPluginBase().add(extension); >+ } >+ >+ private void addElementToExtension(IPluginExtension extension) throws CoreException { >+ IPluginElement element = extension.getModel().getFactory().createElement(extension); >+ element.setName(ICtxHelpConstants.ELEMENT_ROOT); >+ element.setAttribute(CTX_HELP_ATTR_FILE, fResourceString); >+ if (fPluginText.length() > 0) { >+ element.setAttribute(CTX_HELP_ATTR_PLUGIN, fPluginText); >+ } >+ extension.add(element); >+ } >+ >+} >Index: src/org/eclipse/pde/internal/ui/wizards/ctxhelp/RegisterCtxHelpWizard.java >=================================================================== >RCS file: src/org/eclipse/pde/internal/ui/wizards/ctxhelp/RegisterCtxHelpWizard.java >diff -N src/org/eclipse/pde/internal/ui/wizards/ctxhelp/RegisterCtxHelpWizard.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/pde/internal/ui/wizards/ctxhelp/RegisterCtxHelpWizard.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,110 @@ >+/******************************************************************************* >+ * Copyright (c) 2008 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ *******************************************************************************/ >+package org.eclipse.pde.internal.ui.wizards.ctxhelp; >+ >+import java.lang.reflect.InvocationTargetException; >+import org.eclipse.jface.wizard.Wizard; >+import org.eclipse.jface.wizard.WizardPage; >+import org.eclipse.pde.core.IModel; >+import org.eclipse.pde.internal.ui.*; >+import org.eclipse.pde.internal.ui.editor.ctxhelp.CtxHelpEditor; >+import org.eclipse.swt.SWT; >+import org.eclipse.swt.layout.GridData; >+import org.eclipse.swt.layout.GridLayout; >+import org.eclipse.swt.widgets.*; >+ >+/** >+ * Wizard to register a context help file in plugin.xml >+ * @since 3.4 >+ * @see RegisterCtxHelpOperation >+ * @see CtxHelpEditor >+ */ >+public class RegisterCtxHelpWizard extends Wizard { >+ >+ private RegisterCtxHelpWizardPage fMainPage; >+ private IModel fWizModel; >+ >+ public RegisterCtxHelpWizard(IModel model) { >+ fWizModel = model; >+ setWindowTitle(PDEUIMessages.RegisterCtxHelpWizard_0); >+ setDefaultPageImageDescriptor(PDEPluginImages.DESC_CHEATSHEET_WIZ); >+ setNeedsProgressMonitor(true); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.jface.wizard.Wizard#addPages() >+ */ >+ public void addPages() { >+ fMainPage = new RegisterCtxHelpWizardPage(PDEUIMessages.RegisterCtxHelpWizard_0); >+ addPage(fMainPage); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.jface.wizard.Wizard#performFinish() >+ */ >+ public boolean performFinish() { >+ try { >+ getContainer().run(false, true, new RegisterCtxHelpOperation(getShell(), fWizModel, fMainPage.getPluginText())); >+ } catch (InvocationTargetException e) { >+ PDEPlugin.logException(e); >+ return false; >+ } catch (InterruptedException e) { >+ return false; >+ } >+ return true; >+ } >+ >+ /** >+ * Main page of the wizard >+ * @since 3.4 >+ */ >+ class RegisterCtxHelpWizardPage extends WizardPage { >+ >+ private Text fPluginText; >+ >+ protected RegisterCtxHelpWizardPage(String pageName) { >+ super(pageName); >+ setTitle(PDEUIMessages.RegisterCtxHelpWizard_2); >+ setMessage(PDEUIMessages.RegisterCtxHelpWizard_3); >+ } >+ >+ public void createControl(Composite parent) { >+ Composite composite = new Composite(parent, SWT.NONE); >+ composite.setLayout(new GridLayout(2, false)); >+ composite.setFont(parent.getFont()); >+ composite.setLayoutData(new GridData(GridData.FILL_BOTH)); >+ >+ Label label = new Label(composite, SWT.NONE); >+ label.setFont(composite.getFont()); >+ label.setLayoutData(new GridData()); >+ label.setText(PDEUIMessages.RegisterCtxHelpWizard_4); >+ >+ fPluginText = new Text(composite, SWT.SINGLE | SWT.BORDER); >+ fPluginText.setFont(composite.getFont()); >+ fPluginText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); >+ >+ Label label2 = new Label(composite, SWT.NONE); >+ label2.setFont(composite.getFont()); >+ GridData data = new GridData(); >+ data.horizontalSpan = 2; >+ label2.setLayoutData(data); >+ label2.setText(PDEUIMessages.RegisterCtxHelpWizard_5); >+ >+ setControl(composite); >+ } >+ >+ public String getPluginText() { >+ return fPluginText.getText().trim(); >+ } >+ >+ } >+ >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 224892
: 94889 |
94980