author | Eugene Ostroukhov <eugeneo@symbian.org> |
Mon, 07 Jun 2010 16:51:19 -0700 | |
changeset 355 | 8726e95bcbba |
parent 2 | e4420d2515f1 |
permissions | -rw-r--r-- |
2 | 1 |
// Copyright (c) 2009 The Chromium Authors. All rights reserved. |
2 |
// Use of this source code is governed by a BSD-style license that can be |
|
3 |
// found in the LICENSE file. |
|
4 |
||
5 |
package org.chromium.debug.ui.actions; |
|
6 |
||
7 |
import org.chromium.debug.core.model.ChromiumLineBreakpoint; |
|
8 |
import org.eclipse.debug.core.model.IBreakpoint; |
|
9 |
import org.eclipse.debug.ui.actions.RulerBreakpointAction; |
|
355
8726e95bcbba
Initial commit of updated Chrome Java SDK
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
10 |
import org.eclipse.jface.action.IAction; |
2 | 11 |
import org.eclipse.jface.text.source.IVerticalRulerInfo; |
355
8726e95bcbba
Initial commit of updated Chrome Java SDK
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
12 |
import org.eclipse.ui.texteditor.AbstractRulerActionDelegate; |
2 | 13 |
import org.eclipse.ui.texteditor.ITextEditor; |
14 |
import org.eclipse.ui.texteditor.IUpdate; |
|
15 |
||
16 |
/** |
|
17 |
* Action to bring up the breakpoint properties dialog. |
|
18 |
*/ |
|
19 |
public class JsBreakpointPropertiesRulerAction extends RulerBreakpointAction implements IUpdate { |
|
20 |
||
21 |
private IBreakpoint breakpoint; |
|
22 |
||
23 |
public JsBreakpointPropertiesRulerAction(ITextEditor editor, IVerticalRulerInfo rulerInfo) { |
|
24 |
super(editor, rulerInfo); |
|
25 |
setText(Messages.JsBreakpointPropertiesRulerAction_ItemLabel); |
|
26 |
} |
|
27 |
||
28 |
@Override |
|
29 |
public void run() { |
|
30 |
if (getBreakpoint() != null) { |
|
355
8726e95bcbba
Initial commit of updated Chrome Java SDK
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
31 |
JsBreakpointPropertiesAction.runAction(getBreakpoint(), getEditor().getEditorSite()); |
2 | 32 |
} |
33 |
} |
|
34 |
||
35 |
public void update() { |
|
36 |
breakpoint = null; |
|
37 |
IBreakpoint activeBreakpoint = getBreakpoint(); |
|
38 |
if (activeBreakpoint != null && |
|
39 |
activeBreakpoint instanceof ChromiumLineBreakpoint) { |
|
40 |
breakpoint = activeBreakpoint; |
|
41 |
} |
|
42 |
setEnabled(breakpoint != null); |
|
43 |
} |
|
44 |
||
355
8726e95bcbba
Initial commit of updated Chrome Java SDK
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
45 |
|
8726e95bcbba
Initial commit of updated Chrome Java SDK
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
46 |
public static class Delegate extends AbstractRulerActionDelegate { |
8726e95bcbba
Initial commit of updated Chrome Java SDK
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
47 |
|
8726e95bcbba
Initial commit of updated Chrome Java SDK
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
48 |
@Override |
8726e95bcbba
Initial commit of updated Chrome Java SDK
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
49 |
protected IAction createAction(ITextEditor editor, IVerticalRulerInfo rulerInfo) { |
8726e95bcbba
Initial commit of updated Chrome Java SDK
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
50 |
return new JsBreakpointPropertiesRulerAction(editor, rulerInfo); |
8726e95bcbba
Initial commit of updated Chrome Java SDK
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
51 |
} |
8726e95bcbba
Initial commit of updated Chrome Java SDK
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
52 |
|
8726e95bcbba
Initial commit of updated Chrome Java SDK
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
53 |
} |
2 | 54 |
} |