提交 7bcc6dbd 编写于 作者: A Alexander Fedorov

#2556 add "Toggle Breakpoint" to the ruler menu

上级 f0c660f1
......@@ -9,6 +9,7 @@ Require-Bundle: org.eclipse.core.runtime,
org.eclipse.core.expressions,
org.eclipse.jface.text,
org.eclipse.ui;visibility:=reexport,
org.eclipse.ui.workbench.texteditor,
org.eclipse.debug.ui;visibility:=reexport,
org.jkiss.dbeaver.core,
org.jkiss.dbeaver.ui,
......
......@@ -17,4 +17,6 @@
# limitations under the License.
Bundle-Vendor = JKISS
Bundle-Name = DBeaver Debug UI
\ No newline at end of file
Bundle-Name = DBeaver Debug UI
command.ToggleBreakpoint.label = Toggle Breakpoint
\ No newline at end of file
......@@ -60,4 +60,25 @@
</detailFactories>
</extension>
<extension
point="org.eclipse.ui.handlers">
<handler
class="org.jkiss.dbeaver.debug.ui.actions.ToggleBreakpointHandler"
commandId="org.eclipse.debug.ui.commands.ToggleBreakpoint">
</handler>
</extension>
<extension
point="org.eclipse.ui.menus">
<menuContribution
allPopups="false"
locationURI="popup:#SQLRulerContext?before=additions">
<command
commandId="org.eclipse.debug.ui.commands.ToggleBreakpoint"
label="%command.ToggleBreakpoint.label"
style="push">
</command>
</menuContribution>
</extension>
</plugin>
package org.jkiss.dbeaver.debug.ui.actions;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.commands.IHandler;
import org.eclipse.debug.ui.actions.RulerToggleBreakpointActionDelegate;
import org.eclipse.swt.widgets.Event;
public class ToggleBreakpointHandler extends AbstractHandler implements IHandler {
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
//FIXME:AF: this is a dirty hack to enable ancient 3.x- actions with handlers, needs rework
RulerToggleBreakpointActionDelegate delegate = new RulerToggleBreakpointActionDelegate();
delegate.runWithEvent(null, (Event) event.getTrigger());
return null;
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册