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 5858 Details for
Bug 41926
Ctrl+V getting the wrong focus
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
AbstractTextEditor & TextOperationAction Patch
org.eclipse.ui.workbench.texteditor-Bug41926.patch (text/plain), 2.85 KB, created by
Douglas Pollock
on 2003-08-26 11:32:33 EDT
(
hide
)
Description:
AbstractTextEditor & TextOperationAction Patch
Filename:
MIME Type:
Creator:
Douglas Pollock
Created:
2003-08-26 11:32:33 EDT
Size:
2.85 KB
patch
obsolete
>Index: src/org/eclipse/ui/texteditor/AbstractTextEditor.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractTextEditor.java,v >retrieving revision 1.74 >diff -u -r1.74 AbstractTextEditor.java >--- src/org/eclipse/ui/texteditor/AbstractTextEditor.java 22 Aug 2003 15:03:36 -0000 1.74 >+++ src/org/eclipse/ui/texteditor/AbstractTextEditor.java 26 Aug 2003 15:11:44 -0000 >@@ -4781,4 +4781,16 @@ > public boolean isChangeInformationShowing() { > return false; > } >-} >\ No newline at end of file >+ >+ /** >+ * Checks whether the given control is the same as the control being used >+ * internally by the editor. >+ * @param control The control with which to compare; may be >+ * <code>null</code>. >+ * @return <code>true</code> if the control is the same; <code>false</code> >+ * otherwise. >+ */ >+ public final boolean usesControl(final Control control) { >+ return (getSourceViewer().getTextWidget() == control); >+ } >+} >Index: src/org/eclipse/ui/texteditor/TextOperationAction.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/TextOperationAction.java,v >retrieving revision 1.6 >diff -u -r1.6 TextOperationAction.java >--- src/org/eclipse/ui/texteditor/TextOperationAction.java 24 Mar 2003 11:16:52 -0000 1.6 >+++ src/org/eclipse/ui/texteditor/TextOperationAction.java 26 Aug 2003 15:11:44 -0000 >@@ -15,12 +15,10 @@ > > import java.util.ResourceBundle; > >+import org.eclipse.jface.text.ITextOperationTarget; > import org.eclipse.swt.custom.BusyIndicator; > import org.eclipse.swt.widgets.Display; > import org.eclipse.swt.widgets.Shell; >- >-import org.eclipse.jface.text.ITextOperationTarget; >- > import org.eclipse.ui.IWorkbenchPartSite; > > >@@ -93,6 +91,26 @@ > fRunsOnReadOnly= runsOnReadOnly; > update(); > } >+ >+ /** >+ * Checks whether the action should be enabled. This verifies that the text >+ * editor on which the operation is meant to act is the same as the control >+ * that currently has focus. Otherwise, it allows its super class to >+ * decide. >+ * @return <code>false</code> if the control with focus is not the control >+ * used by this text editor; otherwise decided by the super class. >+ */ >+ public final boolean isEnabled() { >+ final ITextEditor textEditor = getTextEditor(); >+ if (textEditor instanceof AbstractTextEditor) { >+ final AbstractTextEditor abstractEditor = (AbstractTextEditor) textEditor; >+ if (!abstractEditor.usesControl(Display.getCurrent().getFocusControl())) { >+ return false; >+ } >+ } >+ >+ return super.isEnabled(); >+ } > > /** > * The <code>TextOperationAction</code> implementation of this
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 41926
:
5857
| 5858