Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(105)

Unified Diff: plugins/org.chromium.debug.core/src/org/chromium/debug/core/ReverseLookupContainer.java

Issue 9704071: Issue 61: Provide an extension point to have custom local file -> script mapping (Closed) Base URL: https://chromedevtools.googlecode.com/svn/trunk
Patch Set: format Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | plugins/org.chromium.debug.core/src/org/chromium/debug/core/ReverseSourceLookup.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: plugins/org.chromium.debug.core/src/org/chromium/debug/core/ReverseLookupContainer.java
diff --git a/plugins/org.chromium.debug.core/src/org/chromium/debug/core/ReverseLookupContainer.java b/plugins/org.chromium.debug.core/src/org/chromium/debug/core/ReverseLookupContainer.java
new file mode 100644
index 0000000000000000000000000000000000000000..2632a225773859b4a39c7207ff502e689ca2b3c3
--- /dev/null
+++ b/plugins/org.chromium.debug.core/src/org/chromium/debug/core/ReverseLookupContainer.java
@@ -0,0 +1,46 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.debug.core;
+
+import org.eclipse.debug.core.sourcelookup.ISourceContainer;
+
+/**
+ * A kind of source container that explicitly supports reverse look-up, i.e. mapping
+ * from a source file to element name.
+ * Custom container implementation may also implement this interface.
+ * <p>This interface is used in {@link ReverseSourceLookup} class. The class also provides
+ * reverse look-up for certain standard containers.
+ * <p>Possible downcasting {@link ISourceContainer} to {@link ReverseLookupContainer} is a regular
+ * operation. Since raw "instanceof" is considered anti-typesafe operation, it was incapsulated in
+ * {@link Cast} class.
+ */
+public interface ReverseLookupContainer extends ISourceContainer {
+ /**
+ * Returns a container wrapper instance that will be used for actual look-up. This method
+ * may also be called from UI to check whether container is properly configured for reverse
+ * look-up. The return object is considered light-weight and the method is called
+ * for each look-up.
+ * <p>
+ * If container has inner containers, it is supposed to prepare similar wrapper for them
+ * by calling {@link ReverseSourceLookup#wrapSourceContainer} method.
+ *
+ * @return a container wrapper instance or null if reverse look-up is not (currently) available
+ */
+ ReverseSourceLookup.ContainerWrapper getReveseLookupImpl();
+
+ /**
+ * A utility class that legalizes one particular downcast. Manual instanceof/cast operations are
+ * discouraged, because they are not declared and thus not type-safe.
+ */
+ class Cast {
+ public static ReverseLookupContainer fromContainer(ISourceContainer sourceContainer) {
+ if (sourceContainer instanceof ReverseLookupContainer) {
+ return (ReverseLookupContainer) sourceContainer;
+ } else {
+ return null;
+ }
+ }
+ }
+}
« no previous file with comments | « no previous file | plugins/org.chromium.debug.core/src/org/chromium/debug/core/ReverseSourceLookup.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698