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 149796 Details for
Bug 214686
if one closes a freshly "prepared" ChangeLog, it should not exist
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]
proposed patch for bug
InsertChangeLogKeyHandler.patch (text/plain), 2.40 KB, created by
Roland Grunberg
on 2009-10-16 17:03:54 EDT
(
hide
)
Description:
proposed patch for bug
Filename:
MIME Type:
Creator:
Roland Grunberg
Created:
2009-10-16 17:03:54 EDT
Size:
2.40 KB
patch
obsolete
>Index: InsertChangeLogKeyHandler.java >=================================================================== >--- InsertChangeLogKeyHandler.java (revision 23273) >+++ InsertChangeLogKeyHandler.java (working copy) >@@ -11,6 +11,8 @@ > *******************************************************************************/ > package org.eclipse.linuxtools.changelog.core.actions; > >+import java.io.File; >+ > import org.eclipse.core.commands.ExecutionEvent; > import org.eclipse.core.commands.ExecutionException; > import org.eclipse.core.commands.IHandler; >@@ -22,6 +24,9 @@ > import org.eclipse.linuxtools.changelog.core.ChangeLogWriter; > import org.eclipse.linuxtools.changelog.core.IParserChangeLogContrib; > import org.eclipse.ui.IEditorPart; >+import org.eclipse.ui.IPartListener; >+import org.eclipse.ui.IPropertyListener; >+import org.eclipse.ui.IWorkbenchPart; > import org.eclipse.ui.IWorkbenchWindow; > import org.eclipse.ui.IWorkbenchWindowActionDelegate; > >@@ -33,6 +38,7 @@ > IHandler, IWorkbenchWindowActionDelegate { > > private IEditorPart currentEditor; >+ private boolean wasSaved; > > public InsertChangeLogKeyHandler() { > super(); >@@ -75,10 +81,11 @@ > false)); > > if (changelog == null) { >+ wasSaved = false; > changelog = askChangeLogLocation(getDocumentLocation( > currentEditor, false)); > } >- >+ > return changelog; > } > } >@@ -156,6 +163,44 @@ > > clw.writeChangeLog(); > >+ final IEditorPart changeLogEditor = clw.getChangelog(); >+ final String changeLogLocation = clw.getChangelogLocation(); >+ >+ changeLogEditor.addPropertyListener(new IPropertyListener() { >+ >+ public void propertyChanged(Object source, int propId) { >+ // listen for save event >+ if (propId == 257) { >+ wasSaved = true; >+ changeLogEditor.removePropertyListener(this); >+ } >+ } >+ }); >+ >+ changeLogEditor.getSite().getPage().addPartListener(new IPartListener() { >+ public void partActivated(IWorkbenchPart part) { >+ } >+ >+ public void partBroughtToTop(IWorkbenchPart part) { >+ } >+ >+ // listen for closed event >+ public void partClosed(IWorkbenchPart part) { >+ if (changeLogEditor.isDirty() && !wasSaved) { >+ File file = new File(changeLogLocation); >+ file.delete(); >+ } >+ changeLogEditor.getSite().getPage().removePartListener(this); >+ } >+ >+ public void partDeactivated(IWorkbenchPart part) { >+ } >+ >+ public void partOpened(IWorkbenchPart part) { >+ } >+ >+ }); >+ > return null; > } >
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 214686
:
149796
|
150018