author | Eugene Ostroukhov <eugeneo@symbian.org> |
Thu, 18 Mar 2010 11:56:59 -0700 | |
changeset 276 | f2f4a1259de8 |
parent 52 | f577ea64429e |
child 355 | 8726e95bcbba |
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.core.model; |
|
6 |
||
7 |
import org.chromium.debug.core.util.ChromiumDebugPluginUtil; |
|
8 |
import org.eclipse.core.resources.IResource; |
|
9 |
import org.eclipse.core.runtime.IAdapterFactory; |
|
10 |
import org.eclipse.debug.ui.actions.IToggleBreakpointsTarget; |
|
11 |
import org.eclipse.ui.texteditor.ITextEditor; |
|
12 |
||
13 |
/** |
|
14 |
* Factory of LineBreakpointAdapters for browser scripts. |
|
15 |
*/ |
|
16 |
public class BreakpointAdapterFactory implements IAdapterFactory { |
|
17 |
||
18 |
@SuppressWarnings("unchecked") |
|
19 |
public Object getAdapter(Object adaptableObject, Class adapterType) { |
|
20 |
if (adaptableObject instanceof ITextEditor) { |
|
21 |
ITextEditor editorPart = (ITextEditor) adaptableObject; |
|
22 |
IResource resource = |
|
23 |
(IResource) editorPart.getEditorInput().getAdapter(IResource.class); |
|
24 |
if (resource != null) { |
|
25 |
String extension = resource.getFileExtension(); |
|
26 |
if (extension != null && ChromiumDebugPluginUtil.CHROMIUM_EXTENSION.equals(extension)) { |
|
52
f577ea64429e
Migrated to unmodified Chromium Development Tools version
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
27 |
return new LineBreakpointAdapter.ForVirtualProject(); |
2 | 28 |
} |
29 |
} |
|
30 |
} |
|
31 |
return null; |
|
32 |
} |
|
33 |
||
34 |
@SuppressWarnings("unchecked") |
|
35 |
public Class[] getAdapterList() { |
|
36 |
return new Class[] { IToggleBreakpointsTarget.class }; |
|
37 |
} |
|
38 |
} |