]> git.uio.no Git - ifi-stolz-refaktor.git/blobdiff - case-study/jdt-after/ui/org/eclipse/jdt/internal/ui/viewsupport/ISelectionListenerWithAST.java
Case Study: adding data and statistics
[ifi-stolz-refaktor.git] / case-study / jdt-after / ui / org / eclipse / jdt / internal / ui / viewsupport / ISelectionListenerWithAST.java
diff --git a/case-study/jdt-after/ui/org/eclipse/jdt/internal/ui/viewsupport/ISelectionListenerWithAST.java b/case-study/jdt-after/ui/org/eclipse/jdt/internal/ui/viewsupport/ISelectionListenerWithAST.java
new file mode 100644 (file)
index 0000000..c1a2550
--- /dev/null
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jdt.internal.ui.viewsupport;
+
+import org.eclipse.jface.text.ITextSelection;
+
+import org.eclipse.ui.IEditorPart;
+
+import org.eclipse.jdt.core.dom.CompilationUnit;
+
+/**
+ * Listener to be informed on text selection changes in an editor (post selection), including the corresponding AST.
+ * The AST is shared and must not be modified.
+ * Listeners can be registered in a <code>SelectionListenerWithASTManager</code>.
+ */
+public interface ISelectionListenerWithAST {
+
+       /**
+        * Called when a selection has changed. The method is called in a post selection event in an background
+        * thread.
+        *
+        * @param part The editor part in which the selection change has occurred.
+        * @param selection The new text selection
+        * @param astRoot The AST tree corresponding to the editor's input. This AST is shared and must
+        * not be modified.
+        */
+       void selectionChanged(IEditorPart part, ITextSelection selection, CompilationUnit astRoot);
+
+}