Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Vosburgh2016-10-13 14:32:46 -0400
committerBrian Vosburgh2016-10-13 14:32:46 -0400
commitba298370c5733ad57420ff626177332f3d2ad140 (patch)
tree4d5abb1ff327159937b79ce13bc8a4c98bbd118f
parentb7da5714bea5bba919a93f45d39d53eae43a829e (diff)
downloadwebtools.dali-ba298370c5733ad57420ff626177332f3d2ad140.tar.gz
webtools.dali-ba298370c5733ad57420ff626177332f3d2ad140.tar.xz
webtools.dali-ba298370c5733ad57420ff626177332f3d2ad140.zip
Revert "Fix JPA Selection flakiness in Java editor"
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/selection/JpaTextEditorManager.java21
1 files changed, 5 insertions, 16 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/selection/JpaTextEditorManager.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/selection/JpaTextEditorManager.java
index 24b2842dc8..12bb74a5a4 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/selection/JpaTextEditorManager.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/selection/JpaTextEditorManager.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2016 Oracle. All rights reserved.
+ * Copyright (c) 2006, 2012 Oracle. 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.
@@ -36,7 +36,6 @@ import org.eclipse.jpt.jpa.core.JpaStructureNode;
import org.eclipse.jpt.jpa.ui.JpaFileModel;
import org.eclipse.jpt.jpa.ui.internal.plugin.JptJpaUiPlugin;
import org.eclipse.jpt.jpa.ui.selection.JpaEditorManager;
-import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IFileEditorInput;
@@ -262,18 +261,12 @@ class JpaTextEditorManager
/**
* Pre-condition: executing on the UI thread.
- * <p>
- * If all the following are true:<ul>
- * <li>the new JPA selection is non-<code>null</code>
- * <li>the text editor does <em>not</em> have the current focus
- * (i.e. the selection change event did not originate from the text editor)
- * <li>the new JPA selection is different from the text editor's
- * current JPA selection
- * </ul>
- * then modify the text editor's selection.
+ * If the new JPA selection is not <code>null</code> and it is different
+ * from the text editor's current JPA selection, modify the text editor's
+ * selection.
*/
/* CU private */ void setTextEditorJpaSelection_(JpaStructureNode selection) {
- if ((selection != null) && ( ! this.textEditorHasFocus()) && (selection != this.getTextEditorJpaSelection())) {
+ if ((selection != null) && (selection != this.getTextEditorJpaSelection())) {
this.setTextEditorSelection(selection.getSelectionTextRange());
}
}
@@ -298,10 +291,6 @@ class JpaTextEditorManager
return (selProvider == null) ? null : this.getTextEditorJpaSelection(selProvider.getSelection());
}
- private boolean textEditorHasFocus() {
- return this.textEditor.getAdapter(Control.class).isFocusControl();
- }
-
private JpaStructureNode getTextEditorJpaSelection(ISelection selection) {
return (selection instanceof ITextSelection) ? this.getTextEditorJpaSelection((ITextSelection) selection) : null;
}

Back to the top