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 19044 Details for
Bug 88632
[implementation] Use IExecutionListener to end move/copy line compound change
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 for MoveLinesAction.java
MoveLinesAction.txt (text/plain), 4.15 KB, created by
Dani Megert
on 2005-03-21 08:41:44 EST
(
hide
)
Description:
Patch for MoveLinesAction.java
Filename:
MIME Type:
Creator:
Dani Megert
Created:
2005-03-21 08:41:44 EST
Size:
4.15 KB
patch
obsolete
>Index: MoveLinesAction.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/MoveLinesAction.java,v >retrieving revision 1.10 >diff -u -r1.10 MoveLinesAction.java >--- MoveLinesAction.java 25 Feb 2005 15:14:47 -0000 1.10 >+++ MoveLinesAction.java 21 Mar 2005 13:39:23 -0000 >@@ -12,6 +12,8 @@ > > import java.util.ResourceBundle; > >+import org.osgi.framework.Bundle; >+ > import org.eclipse.swt.custom.StyledText; > import org.eclipse.swt.custom.VerifyKeyListener; > import org.eclipse.swt.events.FocusEvent; >@@ -22,6 +24,16 @@ > import org.eclipse.swt.graphics.Point; > import org.eclipse.swt.widgets.Event; > >+import org.eclipse.core.commands.ExecutionEvent; >+import org.eclipse.core.commands.ExecutionException; >+import org.eclipse.core.commands.IExecutionListener; >+import org.eclipse.core.commands.NotHandledException; >+ >+import org.eclipse.core.runtime.ILog; >+import org.eclipse.core.runtime.IStatus; >+import org.eclipse.core.runtime.Platform; >+import org.eclipse.core.runtime.Status; >+ > import org.eclipse.jface.text.Assert; > import org.eclipse.jface.text.BadLocationException; > import org.eclipse.jface.text.DocumentEvent; >@@ -35,6 +47,11 @@ > import org.eclipse.jface.text.TextSelection; > import org.eclipse.jface.text.source.ISourceViewer; > >+import org.eclipse.ui.PlatformUI; >+import org.eclipse.ui.commands.ICommandService; >+import org.eclipse.ui.components.ComponentException; >+import org.eclipse.ui.internal.texteditor.TextEditorPlugin; >+ > /** > * Action for moving selected lines in an editor. > * @since 3.0 >@@ -51,7 +68,7 @@ > * <li>the underlying document gets changed due to anything but this action</li> > * </ul> > */ >- private class ExitStrategy implements VerifyKeyListener, MouseListener, FocusListener, IDocumentListener { >+ private class ExitStrategy implements VerifyKeyListener, MouseListener, FocusListener, IDocumentListener, IExecutionListener { > > /** > * The widget this instance is registered with for <code>VerifyKey</code>-, <code>Mouse</code>- >@@ -92,6 +109,16 @@ > fDocumentEventSource= viewer.getDocument(); > if (fDocumentEventSource != null) > fDocumentEventSource.addDocumentListener(this); >+ >+ try { >+ ICommandService commandService = (ICommandService)PlatformUI.getWorkbench().getService(ICommandService.class); >+ commandService.addExecutionListener(this); >+ } catch (ComponentException ex) { >+ Status status= new Status(IStatus.ERROR, TextEditorPlugin.PLUGIN_ID, IStatus.OK, ex.getLocalizedMessage(), ex); //$NON-NLS-1$ >+ Bundle bundle= Platform.getBundle(PlatformUI.PLUGIN_ID); >+ ILog log= Platform.getLog(bundle); >+ log.log(status); >+ } > } > > /** >@@ -108,6 +135,17 @@ > fDocumentEventSource.removeDocumentListener(this); > fDocumentEventSource= null; > } >+ >+ try { >+ ICommandService commandService = (ICommandService)PlatformUI.getWorkbench().getService(ICommandService.class); >+ commandService.removeExecutionListener(this); >+ } catch (ComponentException ex) { >+ Status status= new Status(IStatus.ERROR, TextEditorPlugin.PLUGIN_ID, IStatus.OK, ex.getLocalizedMessage(), ex); //$NON-NLS-1$ >+ Bundle bundle= Platform.getBundle(PlatformUI.PLUGIN_ID); >+ ILog log= Platform.getLog(bundle); >+ log.log(status); >+ } >+ > fIsInstalled= false; > } > >@@ -139,6 +177,21 @@ > } > > public void documentChanged(DocumentEvent event) {} >+ >+ public void notHandled(String commandId, NotHandledException exception) { >+ } >+ >+ public void postExecuteFailure(String commandId, ExecutionException exception) { >+ } >+ >+ public void postExecuteSuccess(String commandId, Object returnValue) { >+ } >+ >+ public void preExecute(String commandId, ExecutionEvent event) { >+ if (!fCopy && !(ITextEditorActionDefinitionIds.MOVE_LINES_UP.equals(commandId) || ITextEditorActionDefinitionIds.MOVE_LINES_DOWN.equals(commandId)) >+ || fCopy && !(ITextEditorActionDefinitionIds.COPY_LINES_UP.equals(commandId) || ITextEditorActionDefinitionIds.COPY_LINES_DOWN.equals(commandId))) >+ endCompoundEdit(); >+ } > } > > /* keys */
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 88632
: 19044