| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.debug.ui.actions; | 5 package org.chromium.debug.ui.actions; |
| 6 | 6 |
| 7 import org.chromium.debug.core.model.ChromiumExceptionBreakpoint; | 7 import org.chromium.debug.core.model.ChromiumExceptionBreakpoint; |
| 8 import org.chromium.debug.core.model.ChromiumLineBreakpoint; | 8 import org.chromium.debug.core.model.ChromiumLineBreakpoint; |
| 9 import org.eclipse.debug.core.model.IBreakpoint; | 9 import org.eclipse.debug.core.model.IBreakpoint; |
| 10 import org.eclipse.jface.action.IAction; | 10 import org.eclipse.jface.action.IAction; |
| 11 import org.eclipse.jface.preference.PreferenceDialog; |
| 11 import org.eclipse.jface.viewers.ISelection; | 12 import org.eclipse.jface.viewers.ISelection; |
| 12 import org.eclipse.jface.viewers.ISelectionChangedListener; | |
| 13 import org.eclipse.jface.viewers.ISelectionProvider; | |
| 14 import org.eclipse.jface.viewers.IStructuredSelection; | 13 import org.eclipse.jface.viewers.IStructuredSelection; |
| 15 import org.eclipse.jface.viewers.StructuredSelection; | |
| 16 import org.eclipse.jface.window.IShellProvider; | 14 import org.eclipse.jface.window.IShellProvider; |
| 17 import org.eclipse.ui.IObjectActionDelegate; | 15 import org.eclipse.ui.IObjectActionDelegate; |
| 18 import org.eclipse.ui.IWorkbenchPart; | 16 import org.eclipse.ui.IWorkbenchPart; |
| 19 import org.eclipse.ui.IWorkbenchPartSite; | 17 import org.eclipse.ui.IWorkbenchPartSite; |
| 20 import org.eclipse.ui.dialogs.PropertyDialogAction; | 18 import org.eclipse.ui.dialogs.PreferencesUtil; |
| 21 | 19 |
| 22 /** | 20 /** |
| 23 * Action to bring up the breakpoint properties dialog. | 21 * Action to bring up the breakpoint properties dialog. |
| 24 */ | 22 */ |
| 25 public abstract class JsBreakpointPropertiesAction implements IObjectActionDeleg
ate { | 23 public abstract class JsBreakpointPropertiesAction implements IObjectActionDeleg
ate { |
| 26 | 24 |
| 27 public static class Line extends JsBreakpointPropertiesAction { | 25 public static class Line extends JsBreakpointPropertiesAction { |
| 28 @Override protected boolean isCorrectType(IBreakpoint breakpoint) { | 26 @Override protected boolean isCorrectType(IBreakpoint breakpoint) { |
| 29 return breakpoint instanceof ChromiumLineBreakpoint; | 27 return breakpoint instanceof ChromiumLineBreakpoint; |
| 30 } | 28 } |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 return null; | 69 return null; |
| 72 } | 70 } |
| 73 | 71 |
| 74 return new Runnable() { | 72 return new Runnable() { |
| 75 public void run() { | 73 public void run() { |
| 76 runAction(breakpoint, site); | 74 runAction(breakpoint, site); |
| 77 } | 75 } |
| 78 }; | 76 }; |
| 79 } | 77 } |
| 80 | 78 |
| 81 protected static void runAction(final IBreakpoint breakpoint, IShellProvider s
hell) { | 79 protected static void runAction(IBreakpoint breakpoint, IShellProvider shell)
{ |
| 82 PropertyDialogAction action = | 80 PreferenceDialog propertyDialog = PreferencesUtil.createPropertyDialogOn( |
| 83 new PropertyDialogAction(shell, | 81 shell.getShell(), breakpoint, (String) null, (String[]) null, null); |
| 84 new ISelectionProvider() { | |
| 85 public void addSelectionChangedListener(ISelectionChangedListener li
stener) { | |
| 86 } | |
| 87 | 82 |
| 88 public ISelection getSelection() { | 83 propertyDialog.open(); |
| 89 return new StructuredSelection(breakpoint); | |
| 90 } | |
| 91 | |
| 92 public void removeSelectionChangedListener(ISelectionChangedListener
listener) { | |
| 93 } | |
| 94 | |
| 95 public void setSelection(ISelection selection) { | |
| 96 } | |
| 97 }); | |
| 98 action.run(); | |
| 99 } | 84 } |
| 100 } | 85 } |
| OLD | NEW |