rename interface
authorKonstantin Bulenkov <kb@jetbrains.com>
Sat, 13 Jul 2013 12:12:03 +0000 (14:12 +0200)
committerKonstantin Bulenkov <kb@jetbrains.com>
Sat, 13 Jul 2013 12:26:38 +0000 (14:26 +0200)
platform/core-api/src/com/intellij/pom/StatePreservingNavigatable.java [moved from platform/core-api/src/com/intellij/pom/AutoScrollFriendlyNavigatable.java with 85% similarity]
platform/lang-impl/src/com/intellij/ide/projectView/impl/nodes/AbstractPsiBasedNode.java
platform/platform-api/src/com/intellij/util/OpenSourceUtil.java

similarity index 85%
rename from platform/core-api/src/com/intellij/pom/AutoScrollFriendlyNavigatable.java
rename to platform/core-api/src/com/intellij/pom/StatePreservingNavigatable.java
index e341aec48604ff882787a1ca7c61adc2cc4a7c77..1e93e09dc73a96f08561289da3556426885de85a 100644 (file)
@@ -21,6 +21,6 @@ package com.intellij.pom;
  *
  * @author Konstantin Bulenkov
  */
-public interface AutoScrollFriendlyNavigatable extends Navigatable {
-  void navigate(boolean requestFocus, boolean tryToKeepState);
+public interface StatePreservingNavigatable extends Navigatable {
+  void navigate(boolean requestFocus, boolean preserveState);
 }
index 0ed502a6c8b063dd267dd0179f84c092b684e3a8..99c7c8e138edc6603ec53fdf869afac18d786b15 100644 (file)
@@ -35,7 +35,7 @@ import com.intellij.openapi.util.Iconable;
 import com.intellij.openapi.vcs.FileStatus;
 import com.intellij.openapi.vcs.FileStatusManager;
 import com.intellij.openapi.vfs.VirtualFile;
-import com.intellij.pom.AutoScrollFriendlyNavigatable;
+import com.intellij.pom.StatePreservingNavigatable;
 import com.intellij.psi.PsiDirectory;
 import com.intellij.psi.PsiElement;
 import com.intellij.psi.PsiFile;
@@ -53,7 +53,7 @@ import java.util.Collections;
  * method that extract PsiElement from Value.
  * @param <Value> Value of node descriptor
  */
-public abstract class AbstractPsiBasedNode<Value> extends ProjectViewNode<Value> implements ValidateableNode, AutoScrollFriendlyNavigatable {
+public abstract class AbstractPsiBasedNode<Value> extends ProjectViewNode<Value> implements ValidateableNode, StatePreservingNavigatable {
   private static final Logger LOG = Logger.getInstance(AbstractPsiBasedNode.class.getName());
 
   protected AbstractPsiBasedNode(final Project project,
@@ -201,9 +201,9 @@ public abstract class AbstractPsiBasedNode<Value> extends ProjectViewNode<Value>
   }
 
   @Override
-  public void navigate(boolean requestFocus, boolean tryToKeepState) {
+  public void navigate(boolean requestFocus, boolean preserveState) {
     if (canNavigate()) {
-      if (requestFocus || tryToKeepState) {
+      if (requestFocus || preserveState) {
         NavigationUtil.openFileWithPsiElement(extractPsiFromValue(), requestFocus, requestFocus);
       }
       else {
index d96813fd1550970499b79b797f355421dd1341aa..8350232291f3e5066f7a384ad0fb5e52a7d98ca9 100644 (file)
@@ -18,8 +18,8 @@ package com.intellij.util;
 import com.intellij.openapi.actionSystem.DataContext;
 import com.intellij.openapi.actionSystem.DataProvider;
 import com.intellij.openapi.actionSystem.PlatformDataKeys;
-import com.intellij.pom.AutoScrollFriendlyNavigatable;
 import com.intellij.pom.Navigatable;
+import com.intellij.pom.StatePreservingNavigatable;
 
 public class OpenSourceUtil {
 
@@ -58,8 +58,8 @@ public class OpenSourceUtil {
     if (navigatables == null) return;
     for (Navigatable navigatable : navigatables) {
       if (navigatable.canNavigate()) {
-        if (tryNotToScroll && navigatable instanceof AutoScrollFriendlyNavigatable) {
-          ((AutoScrollFriendlyNavigatable)navigatable).navigate(requestFocus, true);
+        if (tryNotToScroll && navigatable instanceof StatePreservingNavigatable) {
+          ((StatePreservingNavigatable)navigatable).navigate(requestFocus, true);
         } else {
           navigatable.navigate(requestFocus);
         }