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 48519 Details for
Bug 154887
[Cheat Sheet Authoring] New cheat sheet file wizard
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]
Patch #1
patch_154887_2006-08-23_15-10.txt (text/plain), 21.29 KB, created by
Mike Pawlowski
on 2006-08-23 16:04:20 EDT
(
hide
)
Description:
Patch #1
Filename:
MIME Type:
Creator:
Mike Pawlowski
Created:
2006-08-23 16:04:20 EDT
Size:
21.29 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.pde.ui >Index: src/org/eclipse/pde/internal/ui/wizards/templates/MailTemplate.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/templates/MailTemplate.java,v >retrieving revision 1.18 >diff -u -r1.18 MailTemplate.java >--- src/org/eclipse/pde/internal/ui/wizards/templates/MailTemplate.java 23 Aug 2006 16:40:30 -0000 1.18 >+++ src/org/eclipse/pde/internal/ui/wizards/templates/MailTemplate.java 23 Aug 2006 19:09:44 -0000 >@@ -103,7 +103,7 @@ > createApplicationExtension(); > createPerspectiveExtension(); > createViewExtension(); >- if ("3.2".compareTo(model.getPluginBase().getSchemaVersion()) > 0) { >+ if ("3.2".compareTo(model.getPluginBase().getSchemaVersion()) > 0) { //$NON-NLS-1$ > createCommandExtension(false); > createBindingsExtension(); > } else { >Index: plugin.properties >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.ui/plugin.properties,v >retrieving revision 1.164 >diff -u -r1.164 plugin.properties >--- plugin.properties 21 Aug 2006 06:36:13 -0000 1.164 >+++ plugin.properties 23 Aug 2006 19:09:44 -0000 >@@ -45,6 +45,7 @@ > new.fragmentProject.description=Create a Plug-in Fragment Project > new.schemaFile.name = Extension Point Schema > new.schemaFile.description = Create an Extension Point Schema File >+new.cheat.sheet.description = Create a Cheat Sheet File > new.convert.name= Convert Projects to Plug-in Projects... > new.feature.name=Feature Project > new.feature.description=Create a Feature project >@@ -466,3 +467,5 @@ > While most users will not be doing any release engineering, the theme allows for a very logical \ > layout of the perspective elements and demonstrates how to access the various team and CVS \ > components from within a perspective. >+ >+new.cheat.sheet = Cheat Sheet >Index: plugin.xml >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.ui/plugin.xml,v >retrieving revision 1.358 >diff -u -r1.358 plugin.xml >--- plugin.xml 21 Aug 2006 06:36:13 -0000 1.358 >+++ plugin.xml 23 Aug 2006 19:09:44 -0000 >@@ -182,6 +182,16 @@ > %wizard.profile.name > </description> > </wizard> >+ <wizard >+ category="org.eclipse.pde.PDE" >+ class="org.eclipse.pde.internal.ui.wizards.cheatsheet.NewCheatSheetFileWizard" >+ icon="icons/obj16/cheatsheet_composite_obj.gif" >+ id="org.eclipse.pde.ui.NewCheatSheetWizard" >+ name="%new.cheat.sheet"> >+ <description> >+ %new.cheat.sheet.description >+ </description> >+ </wizard> > </extension> > <extension > point="org.eclipse.ui.importWizards"> >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.728 >diff -u -r1.728 pderesources.properties >--- src/org/eclipse/pde/internal/ui/pderesources.properties 22 Aug 2006 23:34:43 -0000 1.728 >+++ src/org/eclipse/pde/internal/ui/pderesources.properties 23 Aug 2006 19:09:44 -0000 >@@ -1045,6 +1045,7 @@ > BaseExportWizardPage_packageJARs=&Package plug-ins as individual JAR archives > BaseExportWizard_wtitle=Export > BaseExportWizardPage_fPackageJARs=&Package as individual JAR archives (required for JNLP and update sites) >+BaseCheatSheetCreationOperation_0=Creating cheat sheet ... > BaseExportWizardPage_compilerOptions=Compiler Options > BaseFeatureSpecPage_patchGroup_title=Properties of feature being patched > BaseImportWizardSecondPage_autobuild=Build projects after the import operation completes >@@ -1092,6 +1093,7 @@ > > NewSchemaFileWizard_wtitle = New Extension Point Schema File > NewSchemaFileWizard_title = Extension Point Schema Properties >+NewCheatSheetFileWizard_0=New Cheat Sheet File > NewSchemaFileWizard_desc = Specify properties of the extension point schema file. > > BaseExtensionPointMainPage_missingExtensionPointID = Specify a valid extension point ID. No extension point ID specified. >@@ -2550,3 +2552,11 @@ > OSGiPreferencesServiceTemplate_pageTitle = OSGi Preferences Service Example > OSGiPreferencesServiceTemplate_pageDescription = Store your favourite color in the OSGi Preferences service. > OSGiPreferencesServiceTemplate_value = lavender >+CheatSheetFileWizardPage_1=Cheat Sheet >+CheatSheetFileWizardPage_2=Create a new simple cheat sheet or composite cheat sheet. >+CheatSheetFileWizardPage_4=Cheat Sheet Type >+CheatSheetFileWizardPage_5=Simple Cheat Sheet >+CheatSheetFileWizardPage_6=Select this option if you would like to create a simple cheat sheet to help guide users through a series of steps in order to achieve some overall goal. >+CheatSheetFileWizardPage_7=Composite Cheat Sheet >+CheatSheetFileWizardPage_8=Select this option if you would like to create a composite cheat sheet to help guide users through larger problems by breaking that problem into smaller tasks represented by simple cheat sheets. >+CheatSheetFileWizardPage_9=The file name must end with ' >Index: src/org/eclipse/pde/internal/ui/IPDEUIConstants.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/IPDEUIConstants.java,v >retrieving revision 1.19 >diff -u -r1.19 IPDEUIConstants.java >--- src/org/eclipse/pde/internal/ui/IPDEUIConstants.java 3 Apr 2006 19:47:30 -0000 1.19 >+++ src/org/eclipse/pde/internal/ui/IPDEUIConstants.java 23 Aug 2006 19:09:44 -0000 >@@ -21,6 +21,8 @@ > String BUILD_EDITOR_ID = PLUGIN_ID + ".buildEditor"; //$NON-NLS-1$ > String SCHEMA_EDITOR_ID = PLUGIN_ID + ".schemaEditor"; //$NON-NLS-1$ > String PRODUCT_EDITOR_ID = PLUGIN_ID + ".productEditor"; //$NON-NLS-1$ >+ String SIMPLE_CHEAT_SHEET_EDITOR_ID = PLUGIN_ID + ".simpleCheatSheetEditor"; //$NON-NLS-1$ >+ String COMPOSITE_CHEAT_SHEET_EDITOR_ID = PLUGIN_ID + ".compositeCheatSheetEditor"; //$NON-NLS-1$ > String TARGET_EDITOR_ID = PLUGIN_ID + ".targetEditor"; //$NON-NLS-1$ > String PLUGINS_VIEW_ID = "org.eclipse.pde.ui.PluginsView"; //$NON-NLS-1$ > String DEPENDENCIES_VIEW_ID = "org.eclipse.pde.ui.DependenciesView"; //$NON-NLS-1$ >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.184 >diff -u -r1.184 PDEUIMessages.java >--- src/org/eclipse/pde/internal/ui/PDEUIMessages.java 21 Aug 2006 06:35:46 -0000 1.184 >+++ src/org/eclipse/pde/internal/ui/PDEUIMessages.java 23 Aug 2006 19:09:44 -0000 >@@ -17,6 +17,24 @@ > > public static String AddLibraryDialog_nospaces; > >+ public static String BaseCheatSheetCreationOperation_0; >+ >+ public static String CheatSheetFileWizardPage_1; >+ >+ public static String CheatSheetFileWizardPage_2; >+ >+ public static String CheatSheetFileWizardPage_4; >+ >+ public static String CheatSheetFileWizardPage_5; >+ >+ public static String CheatSheetFileWizardPage_6; >+ >+ public static String CheatSheetFileWizardPage_7; >+ >+ public static String CheatSheetFileWizardPage_8; >+ >+ public static String CheatSheetFileWizardPage_9; >+ > public static String CompilersConfigurationTab_incompatEnv; > > public static String ContentSection_addDialogButtonLabel; >@@ -57,6 +75,8 @@ > > public static String MissingResourcePage_unableToOpenFull; > >+ public static String NewCheatSheetFileWizard_0; >+ > public static String RemoveUnknownExecEnvironments_label; > > public static String RevertUnsupportSingletonResolution_desc; >Index: src/org/eclipse/pde/internal/ui/wizards/cheatsheet/CheatSheetFileWizardPage.java >=================================================================== >RCS file: src/org/eclipse/pde/internal/ui/wizards/cheatsheet/CheatSheetFileWizardPage.java >diff -N src/org/eclipse/pde/internal/ui/wizards/cheatsheet/CheatSheetFileWizardPage.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/pde/internal/ui/wizards/cheatsheet/CheatSheetFileWizardPage.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,163 @@ >+/******************************************************************************* >+ * Copyright (c) 2006 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.cheatsheet; >+ >+import org.eclipse.core.runtime.IStatus; >+import org.eclipse.core.runtime.Status; >+import org.eclipse.jface.dialogs.Dialog; >+import org.eclipse.jface.viewers.IStructuredSelection; >+import org.eclipse.pde.internal.ui.PDEPlugin; >+import org.eclipse.pde.internal.ui.PDEUIMessages; >+import org.eclipse.swt.SWT; >+import org.eclipse.swt.events.SelectionAdapter; >+import org.eclipse.swt.events.SelectionEvent; >+import org.eclipse.swt.layout.GridData; >+import org.eclipse.swt.layout.GridLayout; >+import org.eclipse.swt.widgets.Button; >+import org.eclipse.swt.widgets.Composite; >+import org.eclipse.swt.widgets.Group; >+import org.eclipse.swt.widgets.Label; >+import org.eclipse.ui.dialogs.WizardNewFileCreationPage; >+ >+/** >+ * CheatSheetFileWizardPage >+ * >+ */ >+public class CheatSheetFileWizardPage extends WizardNewFileCreationPage { >+ >+ private Button fSimpleCheatSheetButton; >+ >+ private Button fCompositeCheatSheetButton; >+ >+ private Group fGroup; >+ >+ private static final String F_FILE_EXTENSION = ".xml"; //$NON-NLS-1$ >+ >+ public static final int F_SIMPLE_CHEAT_SHEET = 0; >+ >+ public static final int F_COMPOSITE_CHEAT_SHEET = 1; >+ >+ /** >+ * @param pageName >+ * @param selection >+ */ >+ public CheatSheetFileWizardPage(String pageName, >+ IStructuredSelection selection) { >+ super(pageName, selection); >+ setTitle(PDEUIMessages.CheatSheetFileWizardPage_1); >+ setDescription(PDEUIMessages.CheatSheetFileWizardPage_2); >+ } >+ >+ /** >+ * @return >+ */ >+ public int getCheatSheetType() { >+ if (fSimpleCheatSheetButton.getSelection()) { >+ return F_SIMPLE_CHEAT_SHEET; >+ } else if (fCompositeCheatSheetButton.getSelection()) { >+ return F_COMPOSITE_CHEAT_SHEET; >+ } >+ // Neither selected. Unknown type >+ return -1; >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.dialogs.WizardNewFileCreationPage#createAdvancedControls(org.eclipse.swt.widgets.Composite) >+ */ >+ protected void createAdvancedControls(Composite parent) { >+ >+ // Cheat Sheet Group >+ fGroup = new Group(parent, SWT.NONE); >+ fGroup.setText(PDEUIMessages.CheatSheetFileWizardPage_4); >+ fGroup.setLayout(new GridLayout(1, false)); >+ fGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); >+ >+ // Simple Cheat Sheet Button >+ fSimpleCheatSheetButton = new Button(fGroup, SWT.RADIO); >+ fSimpleCheatSheetButton.setText(PDEUIMessages.CheatSheetFileWizardPage_5); >+ fSimpleCheatSheetButton.setSelection(true); >+ fSimpleCheatSheetButton.addSelectionListener(new SelectionAdapter() { >+ public void widgetSelected(SelectionEvent e) { >+ getWizard().getContainer().updateButtons(); >+ } >+ }); >+ >+ // Simple Cheat Sheet Description Label >+ final Label simpleCSText = new Label(fGroup, SWT.WRAP); >+ simpleCSText.setText(PDEUIMessages.CheatSheetFileWizardPage_6); >+ GridData gd = new GridData(GridData.FILL_HORIZONTAL); >+ gd.widthHint = 100; >+ simpleCSText.setLayoutData(gd); >+ >+ // Spacer >+ new Label(fGroup, SWT.NULL); >+ >+ // Composite Cheat Sheet Button >+ fCompositeCheatSheetButton = new Button(fGroup, SWT.RADIO); >+ fCompositeCheatSheetButton.setSelection(false); >+ fCompositeCheatSheetButton >+ .setText(PDEUIMessages.CheatSheetFileWizardPage_7); >+ fCompositeCheatSheetButton.addSelectionListener(new SelectionAdapter() { >+ public void widgetSelected(SelectionEvent e) { >+ getWizard().getContainer().updateButtons(); >+ } >+ }); >+ >+ // Composite Cheat Sheet Description Label >+ final Label compositeCSText = new Label(fGroup, SWT.WRAP); >+ compositeCSText.setText(PDEUIMessages.CheatSheetFileWizardPage_8); >+ gd = new GridData(GridData.FILL_HORIZONTAL); >+ gd.widthHint = 100; >+ compositeCSText.setLayoutData(gd); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.dialogs.WizardNewFileCreationPage#validatePage() >+ */ >+ protected boolean validatePage() { >+ // Verify the filename ends with an XML extension >+ if (!getFileName().trim().endsWith(F_FILE_EXTENSION)) { >+ setErrorMessage(PDEUIMessages.CheatSheetFileWizardPage_9 >+ + F_FILE_EXTENSION + "'."); //$NON-NLS-1$ >+ return false; >+ } >+ // Verify that the name portion of the filename is not empty >+ if (getFileName().trim().length() <= F_FILE_EXTENSION.length()) { >+ return false; >+ } >+ return super.validatePage(); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.dialogs.WizardNewFileCreationPage#validateLinkedResource() >+ */ >+ protected IStatus validateLinkedResource() { >+ return new Status(IStatus.OK, PDEPlugin.getPluginId(), IStatus.OK, >+ "", null); //$NON-NLS-1$ >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.dialogs.WizardNewFileCreationPage#createControl(org.eclipse.swt.widgets.Composite) >+ */ >+ public void createControl(Composite parent) { >+ super.createControl(parent); >+ Dialog.applyDialogFont(fGroup); >+ setFileName(F_FILE_EXTENSION); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.dialogs.WizardNewFileCreationPage#createLinkTarget() >+ */ >+ protected void createLinkTarget() { >+ // NOOP >+ } >+} >Index: src/org/eclipse/pde/internal/ui/wizards/cheatsheet/NewCheatSheetFileWizard.java >=================================================================== >RCS file: src/org/eclipse/pde/internal/ui/wizards/cheatsheet/NewCheatSheetFileWizard.java >diff -N src/org/eclipse/pde/internal/ui/wizards/cheatsheet/NewCheatSheetFileWizard.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/pde/internal/ui/wizards/cheatsheet/NewCheatSheetFileWizard.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,95 @@ >+/******************************************************************************* >+ * Copyright (c) 2006 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.cheatsheet; >+ >+import java.lang.reflect.InvocationTargetException; >+ >+import org.eclipse.core.resources.IFile; >+import org.eclipse.jface.operation.IRunnableWithProgress; >+import org.eclipse.jface.viewers.IStructuredSelection; >+import org.eclipse.pde.internal.ui.PDEPlugin; >+import org.eclipse.pde.internal.ui.PDEPluginImages; >+import org.eclipse.pde.internal.ui.PDEUIMessages; >+import org.eclipse.ui.INewWizard; >+import org.eclipse.ui.IWorkbench; >+import org.eclipse.ui.wizards.newresource.BasicNewFileResourceWizard; >+ >+/** >+ * NewCheatSheetWizard >+ * >+ */ >+public class NewCheatSheetFileWizard extends BasicNewFileResourceWizard implements INewWizard { >+ >+ private CheatSheetFileWizardPage fMainPage; >+ >+ /** >+ * >+ */ >+ public NewCheatSheetFileWizard() { >+ super(); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.wizards.newresource.BasicNewFileResourceWizard#addPages() >+ */ >+ public void addPages() { >+ fMainPage = new CheatSheetFileWizardPage("cheatsheet", getSelection()); //$NON-NLS-1$ >+ addPage(fMainPage); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.wizards.newresource.BasicNewFileResourceWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection) >+ */ >+ public void init(IWorkbench workbench, IStructuredSelection currentSelection) { >+ super.init(workbench, currentSelection); >+ setWindowTitle(PDEUIMessages.NewCheatSheetFileWizard_0); >+ setNeedsProgressMonitor(true); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.wizards.newresource.BasicNewFileResourceWizard#initializeDefaultPageImageDescriptor() >+ */ >+ protected void initializeDefaultPageImageDescriptor() { >+ // TODO: MP: Update with proper image >+ setDefaultPageImageDescriptor(PDEPluginImages.DESC_PRODUCT_WIZ); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.wizards.newresource.BasicNewFileResourceWizard#performFinish() >+ */ >+ public boolean performFinish() { >+ try { >+ getContainer().run(false, true, getOperation()); >+ } catch (InvocationTargetException e) { >+ PDEPlugin.logException(e); >+ return false; >+ } catch (InterruptedException e) { >+ return false; >+ } >+ return true; >+ } >+ >+ /** >+ * @return >+ */ >+ private IRunnableWithProgress getOperation() { >+ IFile file = fMainPage.createNewFile(); >+ int option = fMainPage.getCheatSheetType(); >+ if (option == CheatSheetFileWizardPage.F_SIMPLE_CHEAT_SHEET) { >+ // TODO: MP: Do specific operation for simple cheat sheet >+ } else if (option == CheatSheetFileWizardPage.F_COMPOSITE_CHEAT_SHEET) { >+ // TODO: MP: Do specific operation for composite cheat sheet >+ } >+ // TODO: MP: Revisit when cheat sheet model is complete >+ return new BaseCheatSheetCreationOperation(file); >+ } >+} >Index: src/org/eclipse/pde/internal/ui/wizards/cheatsheet/BaseCheatSheetCreationOperation.java >=================================================================== >RCS file: src/org/eclipse/pde/internal/ui/wizards/cheatsheet/BaseCheatSheetCreationOperation.java >diff -N src/org/eclipse/pde/internal/ui/wizards/cheatsheet/BaseCheatSheetCreationOperation.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/pde/internal/ui/wizards/cheatsheet/BaseCheatSheetCreationOperation.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,97 @@ >+/******************************************************************************* >+ * Copyright (c) 2006 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.cheatsheet; >+ >+import java.lang.reflect.InvocationTargetException; >+ >+import org.eclipse.core.resources.IFile; >+import org.eclipse.core.runtime.CoreException; >+import org.eclipse.core.runtime.IProgressMonitor; >+import org.eclipse.core.runtime.jobs.ISchedulingRule; >+import org.eclipse.jface.viewers.ISelection; >+import org.eclipse.jface.viewers.StructuredSelection; >+import org.eclipse.pde.internal.ui.PDEPlugin; >+import org.eclipse.pde.internal.ui.PDEUIMessages; >+import org.eclipse.swt.widgets.Display; >+import org.eclipse.ui.IWorkbenchPage; >+import org.eclipse.ui.IWorkbenchPart; >+import org.eclipse.ui.IWorkbenchWindow; >+import org.eclipse.ui.PartInitException; >+import org.eclipse.ui.actions.WorkspaceModifyOperation; >+import org.eclipse.ui.ide.IDE; >+import org.eclipse.ui.part.ISetSelectionTarget; >+ >+/** >+ * BaseCheatSheetCreationOperation >+ * >+ */ >+public class BaseCheatSheetCreationOperation extends WorkspaceModifyOperation { >+ >+ private IFile fFile; >+ >+ /** >+ * >+ */ >+ public BaseCheatSheetCreationOperation(IFile file) { >+ fFile = file; >+ } >+ >+ /** >+ * @param rule >+ */ >+ public BaseCheatSheetCreationOperation(ISchedulingRule rule) { >+ super(rule); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.actions.WorkspaceModifyOperation#execute(org.eclipse.core.runtime.IProgressMonitor) >+ */ >+ protected void execute(IProgressMonitor monitor) throws CoreException, >+ InvocationTargetException, InterruptedException { >+ monitor.beginTask(PDEUIMessages.BaseCheatSheetCreationOperation_0, 2); >+ // TODO: MP: Create file content when cheat sheet editor model is complete >+ //createContent(); >+ monitor.worked(1); >+ openFile(); >+ monitor.done(); >+ } >+ >+ /** >+ * >+ */ >+ private void openFile() { >+ Display.getCurrent().asyncExec(new Runnable() { >+ public void run() { >+ IWorkbenchWindow window = PDEPlugin.getActiveWorkbenchWindow(); >+ if (window == null) { >+ return; >+ } >+ IWorkbenchPage page = window.getActivePage(); >+ if ((page == null) || >+ !fFile.exists()) { >+ return; >+ } >+ IWorkbenchPart focusPart = page.getActivePart(); >+ if (focusPart instanceof ISetSelectionTarget) { >+ ISelection selection = new StructuredSelection(fFile); >+ ((ISetSelectionTarget) focusPart).selectReveal(selection); >+ } >+ try { >+ // TODO: MP: Update when cheat sheet editor is complete >+ IDE.openEditor(page, fFile, "org.eclipse.ui.DefaultTextEditor"); //$NON-NLS-1$ >+ } catch (PartInitException e) { >+ // Ignore >+ } >+ } >+ }); >+ } >+}
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 154887
: 48519