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 177980 Details for
Bug 321701
[api] Support common keyboard commands for textual navigation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
patch demonstrating candidate fix
patch.txt (text/plain), 7.14 KB, created by
David Green
on 2010-09-01 12:01:11 EDT
(
hide
)
Description:
patch demonstrating candidate fix
Filename:
MIME Type:
Creator:
David Green
Created:
2010-09-01 12:01:11 EDT
Size:
7.14 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.mylyn.wikitext.tasks.ui >Index: plugin.xml >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.wikitext.tasks.ui/plugin.xml,v >retrieving revision 1.17 >diff -u -r1.17 plugin.xml >--- plugin.xml 29 Jul 2010 14:26:18 -0000 1.17 >+++ plugin.xml 1 Sep 2010 16:00:49 -0000 >@@ -224,4 +224,19 @@ > schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"> > </key> > </extension> >+ <extension >+ point="org.eclipse.ui.handlers"> >+ <handler >+ class="org.eclipse.mylyn.internal.wikitext.tasks.ui.commands.DeleteLineHandler" >+ commandId="org.eclipse.ui.edit.text.delete.line"> >+ <activeWhen> >+ <with variable="activeContexts"> >+ <iterate operator="or" ifEmpty="false"> >+ <equals >+ value="org.eclipse.mylyn.wikitext.tasks.ui.markupSourceContext"/> >+ </iterate> >+ </with> >+ </activeWhen> >+ </handler> >+ </extension> > </plugin> >Index: src/org/eclipse/mylyn/internal/wikitext/tasks/ui/commands/AbstractDeleteLineHandler.java >=================================================================== >RCS file: src/org/eclipse/mylyn/internal/wikitext/tasks/ui/commands/AbstractDeleteLineHandler.java >diff -N src/org/eclipse/mylyn/internal/wikitext/tasks/ui/commands/AbstractDeleteLineHandler.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/mylyn/internal/wikitext/tasks/ui/commands/AbstractDeleteLineHandler.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,53 @@ >+/******************************************************************************* >+ * Copyright (c) 2007, 2010 David Green and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * David Green - initial API and implementation >+ *******************************************************************************/ >+ >+package org.eclipse.mylyn.internal.wikitext.tasks.ui.commands; >+ >+import org.eclipse.core.commands.ExecutionEvent; >+import org.eclipse.core.commands.ExecutionException; >+import org.eclipse.core.commands.IHandler; >+import org.eclipse.jface.text.BadLocationException; >+import org.eclipse.jface.text.ITextSelection; >+import org.eclipse.jface.text.source.ISourceViewer; >+import org.eclipse.ui.texteditor.TextViewerDeleteLineTarget; >+ >+/** >+ * Abstract command handler that uses {@link TextViewerDeleteLineTarget}. Subclasses can specify the type of delete line >+ * and copyToClipboard. >+ * >+ * @author David Green >+ */ >+public class AbstractDeleteLineHandler extends AbstractMarkupSourceViewerHandler implements IHandler { >+ protected final int type; >+ >+ protected final boolean copyToClipboard; >+ >+ protected AbstractDeleteLineHandler(int type, boolean copyToClipboard) { >+ this.type = type; >+ this.copyToClipboard = copyToClipboard; >+ } >+ >+ public Object execute(ExecutionEvent event) throws ExecutionException { >+ ISourceViewer viewer = getSourceViewer(event); >+ if (viewer != null) { >+ TextViewerDeleteLineTarget target = new TextViewerDeleteLineTarget(viewer); >+ >+ try { >+ target.deleteLine(viewer.getDocument(), (ITextSelection) viewer.getSelectionProvider().getSelection(), >+ type, copyToClipboard); >+ } catch (BadLocationException e) { >+ throw new ExecutionException(e.getMessage(), e); >+ } >+ } >+ return null; >+ } >+ >+} >Index: src/org/eclipse/mylyn/internal/wikitext/tasks/ui/commands/AbstractMarkupSourceViewerHandler.java >=================================================================== >RCS file: src/org/eclipse/mylyn/internal/wikitext/tasks/ui/commands/AbstractMarkupSourceViewerHandler.java >diff -N src/org/eclipse/mylyn/internal/wikitext/tasks/ui/commands/AbstractMarkupSourceViewerHandler.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/mylyn/internal/wikitext/tasks/ui/commands/AbstractMarkupSourceViewerHandler.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,37 @@ >+/******************************************************************************* >+ * Copyright (c) 2007, 2010 David Green and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * David Green - initial API and implementation >+ *******************************************************************************/ >+ >+package org.eclipse.mylyn.internal.wikitext.tasks.ui.commands; >+ >+import org.eclipse.core.commands.AbstractHandler; >+import org.eclipse.core.commands.ExecutionEvent; >+import org.eclipse.core.commands.ExecutionException; >+import org.eclipse.jface.text.source.ISourceViewer; >+import org.eclipse.swt.custom.StyledText; >+import org.eclipse.ui.handlers.HandlerUtil; >+ >+/** >+ * Abstract command handler that can get the current source viewer >+ * >+ * @author David Green >+ */ >+public abstract class AbstractMarkupSourceViewerHandler extends AbstractHandler { >+ >+ protected ISourceViewer getSourceViewer(ExecutionEvent event) throws ExecutionException { >+ Object activeFocusControl = HandlerUtil.getVariable(event, "activeFocusControl"); //$NON-NLS-1$ >+ if (activeFocusControl instanceof StyledText) { >+ StyledText textWidget = (StyledText) activeFocusControl; >+ ISourceViewer viewer = (ISourceViewer) textWidget.getData(ISourceViewer.class.getName()); >+ return viewer; >+ } >+ return null; >+ } >+} >\ No newline at end of file >Index: src/org/eclipse/mylyn/internal/wikitext/tasks/ui/commands/DeleteLineHandler.java >=================================================================== >RCS file: src/org/eclipse/mylyn/internal/wikitext/tasks/ui/commands/DeleteLineHandler.java >diff -N src/org/eclipse/mylyn/internal/wikitext/tasks/ui/commands/DeleteLineHandler.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/mylyn/internal/wikitext/tasks/ui/commands/DeleteLineHandler.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,25 @@ >+/******************************************************************************* >+ * Copyright (c) 2007, 2010 David Green and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * David Green - initial API and implementation >+ *******************************************************************************/ >+ >+package org.eclipse.mylyn.internal.wikitext.tasks.ui.commands; >+ >+import org.eclipse.ui.texteditor.DeleteLineAction; >+ >+/** >+ * Command handler for delete line command (whole) >+ * >+ * @author David Green >+ */ >+public class DeleteLineHandler extends AbstractDeleteLineHandler { >+ public DeleteLineHandler() { >+ super(DeleteLineAction.WHOLE, false); >+ } >+}
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 321701
:
177626
| 177980 |
177981
|
179419
|
179420
|
181533
|
181534