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 229 Details for
Bug 2296
AddBookmarkAction should use IAdaptable to retrieve the resource (1GEN8B7)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix for org.eclipse.ui.actions.AddBookmarkAction.java
2296 (text/plain), 1.45 KB, created by
Knut Radloff
on 2002-01-16 17:14:52 EST
(
hide
)
Description:
Proposed fix for org.eclipse.ui.actions.AddBookmarkAction.java
Filename:
MIME Type:
Creator:
Knut Radloff
Created:
2002-01-16 17:14:52 EST
Size:
1.45 KB
patch
obsolete
>Index: Eclipse UI/org/eclipse/ui/actions/AddBookmarkAction.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.ui/Eclipse UI/org/eclipse/ui/actions/AddBookmarkAction.java,v >retrieving revision 1.3 >diff -u -r1.3 AddBookmarkAction.java >--- Eclipse UI/org/eclipse/ui/actions/AddBookmarkAction.java 3 Oct 2001 21:20:46 -0000 1.3 >+++ Eclipse UI/org/eclipse/ui/actions/AddBookmarkAction.java 16 Jan 2002 22:08:36 -0000 >@@ -6,6 +6,7 @@ > */ > import org.eclipse.core.resources.*; > import org.eclipse.core.runtime.CoreException; >+import org.eclipse.core.runtime.IAdaptable; > import org.eclipse.core.runtime.IProgressMonitor; > import org.eclipse.ui.PlatformUI; > import org.eclipse.ui.help.WorkbenchHelp; >@@ -15,6 +16,7 @@ > import org.eclipse.ui.internal.misc.Assert; > import org.eclipse.jface.viewers.IStructuredSelection; > import org.eclipse.swt.widgets.Shell; >+ > import java.util.Iterator; > > /** >@@ -58,8 +60,12 @@ > IStructuredSelection selection = getStructuredSelection(); > for (Iterator enum = selection.iterator(); enum.hasNext();) { > Object o = enum.next(); >- if (o instanceof IFile) >- createMarker((IFile) o, markerType); >+ if (o instanceof IAdaptable) { >+ // don't rely on selection being of type IFile. fixes bug 2296 >+ Object resource= ((IAdaptable)o).getAdapter(IResource.class); >+ if (resource instanceof IFile) >+ createMarker((IFile)resource, markerType); >+ } > } > } > /**
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 2296
: 229