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 83967 Details for
Bug 210646
[History View] Enhancements for copying tag action in CVS Resource History view
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Patch
patch_210646_20071128_tableViewerAction.txt (text/plain), 2.94 KB, created by
Tomasz Zarna
on 2007-11-28 07:12:43 EST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Tomasz Zarna
Created:
2007-11-28 07:12:43 EST
Size:
2.94 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.team.cvs.ui >Index: src/org/eclipse/team/internal/ccvs/ui/TableViewerAction.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/TableViewerAction.java,v >retrieving revision 1.1 >diff -u -r1.1 TableViewerAction.java >--- src/org/eclipse/team/internal/ccvs/ui/TableViewerAction.java 22 Nov 2007 12:51:05 -0000 1.1 >+++ src/org/eclipse/team/internal/ccvs/ui/TableViewerAction.java 28 Nov 2007 12:09:52 -0000 >@@ -10,20 +10,22 @@ > *******************************************************************************/ > package org.eclipse.team.internal.ccvs.ui; > >+import java.util.Iterator; >+ > import org.eclipse.jface.action.Action; > import org.eclipse.jface.viewers.StructuredSelection; > import org.eclipse.jface.viewers.TableViewer; >+import org.eclipse.swt.SWTError; > import org.eclipse.swt.dnd.*; > import org.eclipse.swt.widgets.Display; > import org.eclipse.team.core.history.ITag; > > /** >- * Copies the text form the selected element of the given {@link org.eclipse.jface.viewers.TableViewer}. >- * @author Jakub Jurkiewicz >- * >+ * Copies the text form the selected element of the given >+ * {@link org.eclipse.jface.viewers.TableViewer}. > */ > public class TableViewerAction extends Action { >- >+ > /** > * Viewer for which the action is to be performed > */ >@@ -35,21 +37,36 @@ > > /* > * (non-Javadoc) >+ * > * @see org.eclipse.jface.action.Action#run() > */ > public void run() { > if (viewer.getSelection() instanceof StructuredSelection) { >- StructuredSelection sSelection = (StructuredSelection) viewer >- .getSelection(); >- if (sSelection.getFirstElement() instanceof ITag) { >- Clipboard cb = new Clipboard(Display.getCurrent()); >- String textData = ((ITag) sSelection.getFirstElement()) >- .getName(); >- TextTransfer textTransfer = TextTransfer.getInstance(); >- cb.setContents(new Object[] { textData }, >- new Transfer[] { textTransfer }); >+ StructuredSelection selection = (StructuredSelection) viewer.getSelection(); >+ if (!selection.isEmpty()) { >+ Iterator selectionIter = selection.iterator(); >+ >+ StringBuffer buf = new StringBuffer(); >+ ITag firstTag = (ITag) selectionIter.next(); >+ buf.append(firstTag.getName()); >+ while (selectionIter.hasNext()) { >+ String tagName= ((ITag) selectionIter.next()).getName(); >+ buf.append('\r').append('\n').append(tagName); >+ } >+ >+ Clipboard clipboard = new Clipboard(Display.getDefault()); >+ Object[] data = new Object[] { buf.toString() }; >+ Transfer[] dataTypes = new Transfer[] {TextTransfer.getInstance()}; >+ try { >+ clipboard.setContents(data, dataTypes); >+ } catch (SWTError e) { >+ if (e.code != DND.ERROR_CANNOT_SET_CLIPBOARD) { >+ throw e; >+ } >+ } finally { >+ clipboard.dispose(); >+ } > } > } > } >- > }
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 210646
:
83858
|
83967
|
84051