summaryrefslogtreecommitdiff
path: root/platform/platform-api/src/com/intellij/ui
diff options
context:
space:
mode:
authorTor Norbye <tnorbye@google.com>2014-08-20 17:01:23 -0700
committerTor Norbye <tnorbye@google.com>2014-08-20 17:01:23 -0700
commit1aa2e09bdbd413eacb677e9fa4b50630530d0656 (patch)
tree2f4cc6d69645bd460aa253fdecb606d764fbd25d /platform/platform-api/src/com/intellij/ui
parent02cf98d65c798d368fcec43ed64a001d513bdd4f (diff)
downloadidea-1aa2e09bdbd413eacb677e9fa4b50630530d0656.tar.gz
Snapshot idea/138.1696 from git://git.jetbrains.org/idea/community.git
Change-Id: I50c97b83a815ce635e49a38380ba5b8765e4b16a
Diffstat (limited to 'platform/platform-api/src/com/intellij/ui')
-rw-r--r--platform/platform-api/src/com/intellij/ui/components/JBScrollPane.java8
-rw-r--r--platform/platform-api/src/com/intellij/ui/content/ContentManagerEvent.java12
-rw-r--r--platform/platform-api/src/com/intellij/ui/table/JBTable.java43
-rw-r--r--platform/platform-api/src/com/intellij/ui/tabs/impl/JBEditorTabs.java2
-rw-r--r--platform/platform-api/src/com/intellij/ui/tabs/impl/JBTabsImpl.java62
-rw-r--r--platform/platform-api/src/com/intellij/ui/tabs/impl/singleRow/SingleRowLayout.java19
-rw-r--r--platform/platform-api/src/com/intellij/ui/tabs/impl/table/TableLayout.java12
-rw-r--r--platform/platform-api/src/com/intellij/ui/treeStructure/Tree.java8
8 files changed, 105 insertions, 61 deletions
diff --git a/platform/platform-api/src/com/intellij/ui/components/JBScrollPane.java b/platform/platform-api/src/com/intellij/ui/components/JBScrollPane.java
index 83944a51755d..97a42176a25b 100644
--- a/platform/platform-api/src/com/intellij/ui/components/JBScrollPane.java
+++ b/platform/platform-api/src/com/intellij/ui/components/JBScrollPane.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2012 JetBrains s.r.o.
+ * Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,6 +18,7 @@ package com.intellij.ui.components;
import com.intellij.openapi.wm.IdeGlassPane;
import com.intellij.ui.IdeBorderFactory;
import com.intellij.util.ArrayUtil;
+import com.intellij.util.ReflectionUtil;
import com.intellij.util.ui.ButtonlessScrollBarUI;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -29,7 +30,6 @@ import javax.swing.plaf.ScrollPaneUI;
import javax.swing.plaf.basic.BasicScrollBarUI;
import java.awt.*;
import java.awt.event.MouseEvent;
-import java.lang.reflect.Method;
public class JBScrollPane extends JScrollPane {
private int myViewportBorderWidth = -1;
@@ -302,9 +302,7 @@ public class JBScrollPane extends JScrollPane {
if (ui instanceof BasicScrollBarUI) {
BasicScrollBarUI bui = (BasicScrollBarUI)ui;
try {
- Method m = BasicScrollBarUI.class.getDeclaredMethod("getThumbBounds", ArrayUtil.EMPTY_CLASS_ARRAY);
- m.setAccessible(true);
- Rectangle rect = (Rectangle)m.invoke(bui);
+ Rectangle rect = (Rectangle)ReflectionUtil.getDeclaredMethod(BasicScrollBarUI.class, "getThumbBounds", ArrayUtil.EMPTY_CLASS_ARRAY).invoke(bui);
Point point = SwingUtilities.convertPoint(e.getComponent(), e.getX(), e.getY(), bar);
return !rect.contains(point);
}
diff --git a/platform/platform-api/src/com/intellij/ui/content/ContentManagerEvent.java b/platform/platform-api/src/com/intellij/ui/content/ContentManagerEvent.java
index 9aae91aaba42..31fe871d0a05 100644
--- a/platform/platform-api/src/com/intellij/ui/content/ContentManagerEvent.java
+++ b/platform/platform-api/src/com/intellij/ui/content/ContentManagerEvent.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2009 JetBrains s.r.o.
+ * Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,10 +18,10 @@ package com.intellij.ui.content;
import java.util.EventObject;
public class ContentManagerEvent extends EventObject {
- private Content myContent;
- private int myIndex;
+ private final Content myContent;
+ private final int myIndex;
private boolean myConsumed;
- private ContentOperation myOperation;
+ private final ContentOperation myOperation;
public ContentManagerEvent(Object source, Content content, int index, ContentOperation operation) {
super(source);
@@ -54,7 +54,7 @@ public class ContentManagerEvent extends EventObject {
return myOperation;
}
- public static enum ContentOperation {
+ public enum ContentOperation {
add, remove, undefined
}
-} \ No newline at end of file
+}
diff --git a/platform/platform-api/src/com/intellij/ui/table/JBTable.java b/platform/platform-api/src/com/intellij/ui/table/JBTable.java
index 435c4358959f..bda230eb767e 100644
--- a/platform/platform-api/src/com/intellij/ui/table/JBTable.java
+++ b/platform/platform-api/src/com/intellij/ui/table/JBTable.java
@@ -52,7 +52,6 @@ public class JBTable extends JTable implements ComponentWithEmptyText, Component
private Integer myMinRowHeight;
private boolean myStriped;
- private boolean isTypeAhead = true;
private AsyncProcessIcon myBusyIcon;
private boolean myBusy;
@@ -69,6 +68,8 @@ public class JBTable extends JTable implements ComponentWithEmptyText, Component
public JBTable(final TableModel model, final TableColumnModel columnModel) {
super(model, columnModel);
+ setSurrendersFocusOnKeystroke(true);
+
myEmptyText = new StatusText(this) {
@Override
protected boolean isStatusVisible() {
@@ -421,7 +422,10 @@ public class JBTable extends JTable implements ComponentWithEmptyText, Component
return false;
}
- if (e instanceof KeyEvent && UIUtil.isReallyTypedEvent((KeyEvent)e)) {
+ if (e instanceof KeyEvent) {
+ // do not start editing in autoStartsEdit mode on Ctrl-Z and other non-typed events
+ if (!UIUtil.isReallyTypedEvent((KeyEvent)e)) return false;
+
SpeedSearchSupply supply = SpeedSearchSupply.getSupply(this);
if (supply != null && supply.isPopupActive()) {
return false;
@@ -449,20 +453,43 @@ public class JBTable extends JTable implements ComponentWithEmptyText, Component
add(editorComp);
editorComp.validate();
- IdeFocusManager.findInstanceByComponent(this).requestFocus(editorComp, false);
+ if (surrendersFocusOnKeyStroke()) {
+ // this replaces focus request in JTable.processKeyBinding
+ final IdeFocusManager focusManager = IdeFocusManager.findInstanceByComponent(this);
+ focusManager.setTypeaheadEnabled(false);
+ focusManager.requestFocus(editorComp, true).doWhenProcessed(new Runnable() {
+ @Override
+ public void run() {
+ focusManager.setTypeaheadEnabled(true);
+ }
+ });
+ }
setCellEditor(editor);
setEditingRow(row);
setEditingColumn(column);
editor.addCellEditorListener(this);
- if (isTypeAhead) {
- JTableCellEditorHelper.typeAhead(this, e, row, column);
- }
+
return true;
}
return false;
}
+ /**
+ * Always returns false.
+ * If you're interested in value of JTable.surrendersFocusOnKeystroke property, call JBTable.surrendersFocusOnKeyStroke()
+ * @return false
+ * @see #surrendersFocusOnKeyStroke
+ */
+ @Override
+ public boolean getSurrendersFocusOnKeystroke() {
+ return false; // prevents JTable.processKeyBinding from requesting editor component to be focused
+ }
+
+ public boolean surrendersFocusOnKeyStroke() {
+ return super.getSurrendersFocusOnKeystroke();
+ }
+
private static boolean isTableDecorationSupported() {
return UIUtil.isUnderAlloyLookAndFeel()
|| UIUtil.isUnderNativeMacLookAndFeel()
@@ -472,10 +499,6 @@ public class JBTable extends JTable implements ComponentWithEmptyText, Component
|| UIUtil.isUnderWindowsLookAndFeel();
}
- public void disableTypeAheadInCellEditors() {
- isTypeAhead = false;
- }
-
@NotNull
@Override
public Component prepareRenderer(@NotNull TableCellRenderer renderer, int row, int column) {
diff --git a/platform/platform-api/src/com/intellij/ui/tabs/impl/JBEditorTabs.java b/platform/platform-api/src/com/intellij/ui/tabs/impl/JBEditorTabs.java
index a842f623ac45..43f06bff2850 100644
--- a/platform/platform-api/src/com/intellij/ui/tabs/impl/JBEditorTabs.java
+++ b/platform/platform-api/src/com/intellij/ui/tabs/impl/JBEditorTabs.java
@@ -49,7 +49,7 @@ public class JBEditorTabs extends JBTabsImpl {
private JBEditorTabsPainter myDefaultPainter = new DefaultEditorTabsPainter();
- public JBEditorTabs(@Nullable Project project, ActionManager actionManager, IdeFocusManager focusManager, @NotNull Disposable parent) {
+ public JBEditorTabs(@Nullable Project project, @NotNull ActionManager actionManager, IdeFocusManager focusManager, @NotNull Disposable parent) {
super(project, actionManager, focusManager, parent);
}
diff --git a/platform/platform-api/src/com/intellij/ui/tabs/impl/JBTabsImpl.java b/platform/platform-api/src/com/intellij/ui/tabs/impl/JBTabsImpl.java
index 60898a6e9bd8..326192072c4b 100644
--- a/platform/platform-api/src/com/intellij/ui/tabs/impl/JBTabsImpl.java
+++ b/platform/platform-api/src/com/intellij/ui/tabs/impl/JBTabsImpl.java
@@ -28,6 +28,7 @@ import com.intellij.openapi.wm.*;
import com.intellij.ui.*;
import com.intellij.ui.awt.RelativePoint;
import com.intellij.ui.awt.RelativeRectangle;
+import com.intellij.ui.components.OrphanGuardian;
import com.intellij.ui.switcher.QuickActionProvider;
import com.intellij.ui.switcher.SwitchProvider;
import com.intellij.ui.switcher.SwitchTarget;
@@ -36,6 +37,7 @@ import com.intellij.ui.tabs.impl.singleRow.SingleRowLayout;
import com.intellij.ui.tabs.impl.singleRow.SingleRowPassInfo;
import com.intellij.ui.tabs.impl.table.TableLayout;
import com.intellij.ui.tabs.impl.table.TablePassInfo;
+import com.intellij.util.Consumer;
import com.intellij.util.Function;
import com.intellij.util.containers.ContainerUtil;
import com.intellij.util.ui.Animator;
@@ -69,7 +71,7 @@ public class JBTabsImpl extends JComponent
public static final Color MAC_AQUA_BG_COLOR = Gray._200;
- final ActionManager myActionManager;
+ @NotNull final ActionManager myActionManager;
private final List<TabInfo> myVisibleInfos = new ArrayList<TabInfo>();
private final Map<TabInfo, Integer> myHiddenInfos = new HashMap<TabInfo, Integer>();
@@ -153,8 +155,8 @@ public class JBTabsImpl extends JComponent
private JBTabsPosition myPosition = JBTabsPosition.top;
private final TabsBorder myBorder = new TabsBorder(this);
- private BaseNavigationAction myNextAction;
- private BaseNavigationAction myPrevAction;
+ private final BaseNavigationAction myNextAction;
+ private final BaseNavigationAction myPrevAction;
private boolean myTabDraggingEnabled;
private DragHelper myDragHelper;
@@ -172,6 +174,7 @@ public class JBTabsImpl extends JComponent
private Runnable myDeferredFocusRequest;
private boolean myAlwaysPaintSelectedTab;
+ private int myFirstTabOffset;
public JBTabsImpl(@NotNull Project project) {
this(project, project);
@@ -185,7 +188,7 @@ public class JBTabsImpl extends JComponent
this(project, ActionManager.getInstance(), focusManager, parent);
}
- public JBTabsImpl(@Nullable Project project, ActionManager actionManager, IdeFocusManager focusManager, @NotNull Disposable parent) {
+ public JBTabsImpl(@Nullable Project project, @NotNull ActionManager actionManager, IdeFocusManager focusManager, @NotNull Disposable parent) {
myProject = project;
myActionManager = actionManager;
myFocusManager = focusManager != null ? focusManager : IdeFocusManager.getGlobalInstance();
@@ -197,13 +200,11 @@ public class JBTabsImpl extends JComponent
myNavigationActions = new DefaultActionGroup();
- if (myActionManager != null) {
- myNextAction = new SelectNextAction(this, myActionManager);
- myPrevAction = new SelectPreviousAction(this, myActionManager);
+ myNextAction = new SelectNextAction(this, myActionManager);
+ myPrevAction = new SelectPreviousAction(this, myActionManager);
- myNavigationActions.add(myNextAction);
- myNavigationActions.add(myPrevAction);
- }
+ myNavigationActions.add(myNextAction);
+ myNavigationActions.add(myPrevAction);
setUiDecorator(null);
@@ -315,6 +316,16 @@ public class JBTabsImpl extends JComponent
}
}
};
+ putClientProperty(OrphanGuardian.CLIENT_PROPERTY_KEY, new OrphanGuardian() {
+
+ @Override
+ public void iterateOrphans(Consumer<JComponent> consumer) {
+ for (TabInfo info : getVisibleInfos()) {
+ if (info == mySelectedInfo) continue;
+ consumer.consume(info.getComponent());
+ }
+ }
+ });
}
protected SingleRowLayout createSingleRowLayout() {
@@ -451,14 +462,14 @@ public class JBTabsImpl extends JComponent
}
private void addTimerUpdate() {
- if (myActionManager != null && !myListenerAdded) {
+ if (!myListenerAdded) {
myActionManager.addTimerListener(500, this);
myListenerAdded = true;
}
}
private void removeTimerUpdate() {
- if (myActionManager != null && myListenerAdded) {
+ if (myListenerAdded) {
myActionManager.removeTimerListener(this);
myListenerAdded = false;
}
@@ -492,6 +503,14 @@ public class JBTabsImpl extends JComponent
myDropInfoIndex = dropInfoIndex;
}
+ public int getFirstTabOffset() {
+ return myFirstTabOffset;
+ }
+
+ public void setFirstTabOffset(int firstTabOffset) {
+ myFirstTabOffset = firstTabOffset;
+ }
+
class TabActionsAutoHideListener extends MouseMotionAdapter implements Weighted {
private TabLabel myCurrentOverLabel;
@@ -1399,7 +1418,7 @@ public class JBTabsImpl extends JComponent
final ActionGroup group = info.getGroup();
final JComponent side = info.getSideComponent();
- if (group != null && myTabs.myActionManager != null) {
+ if (group != null) {
final String place = info.getPlace();
ActionToolbar toolbar =
myTabs.myActionManager.createActionToolbar(place != null ? place : ActionPlaces.UNKNOWN, group, myTabs.myHorizontalSide);
@@ -1604,7 +1623,7 @@ public class JBTabsImpl extends JComponent
return 3;
}
- public static int getGhostTabLength() {
+ public int getGhostTabLength() {
return 15;
}
@@ -2561,6 +2580,7 @@ public class JBTabsImpl extends JComponent
}
private void updateContainer(boolean forced, final boolean layoutNow) {
+ if (myProject != null && !myProject.isOpen()) return;
for (TabInfo each : new ArrayList<TabInfo>(myVisibleInfos)) {
final JComponent eachComponent = each.getComponent();
if (getSelectedInfo() == each && getSelectedInfo() != null) {
@@ -2746,8 +2766,7 @@ public class JBTabsImpl extends JComponent
}
private static boolean isChanged(Object oldObject, Object newObject) {
- if (oldObject == null && newObject == null) return false;
- return oldObject != null && !oldObject.equals(newObject) || newObject != null && !newObject.equals(oldObject);
+ return !Comparing.equal(oldObject, newObject);
}
@Override
@@ -2785,12 +2804,11 @@ public class JBTabsImpl extends JComponent
}
private abstract static class BaseNavigationAction extends AnAction {
-
private final ShadowAction myShadow;
- private final ActionManager myActionManager;
+ @NotNull private final ActionManager myActionManager;
private final JBTabsImpl myTabs;
- protected BaseNavigationAction(final String copyFromID, JBTabsImpl tabs, ActionManager mgr) {
+ protected BaseNavigationAction(@NotNull String copyFromID, @NotNull JBTabsImpl tabs, @NotNull ActionManager mgr) {
myActionManager = mgr;
myTabs = tabs;
myShadow = new ShadowAction(this, myActionManager.getAction(copyFromID), tabs);
@@ -2858,7 +2876,7 @@ public class JBTabsImpl extends JComponent
private static class SelectNextAction extends BaseNavigationAction {
- private SelectNextAction(JBTabsImpl tabs, ActionManager mgr) {
+ private SelectNextAction(JBTabsImpl tabs, @NotNull ActionManager mgr) {
super(IdeActions.ACTION_NEXT_TAB, tabs, mgr);
}
@@ -2874,7 +2892,7 @@ public class JBTabsImpl extends JComponent
}
private static class SelectPreviousAction extends BaseNavigationAction {
- private SelectPreviousAction(JBTabsImpl tabs, ActionManager mgr) {
+ private SelectPreviousAction(JBTabsImpl tabs, @NotNull ActionManager mgr) {
super(IdeActions.ACTION_PREVIOUS_TAB, tabs, mgr);
}
@@ -3351,7 +3369,7 @@ public class JBTabsImpl extends JComponent
return myVisibleInfos.isEmpty();
}
- public static int getInterTabSpaceLength() {
+ public int getInterTabSpaceLength() {
return 1;
}
diff --git a/platform/platform-api/src/com/intellij/ui/tabs/impl/singleRow/SingleRowLayout.java b/platform/platform-api/src/com/intellij/ui/tabs/impl/singleRow/SingleRowLayout.java
index 4e5925d2a2ee..6bd2e1aa52bf 100644
--- a/platform/platform-api/src/com/intellij/ui/tabs/impl/singleRow/SingleRowLayout.java
+++ b/platform/platform-api/src/com/intellij/ui/tabs/impl/singleRow/SingleRowLayout.java
@@ -209,6 +209,7 @@ public class SingleRowLayout extends TabLayout {
protected void prepareLayoutPassInfo(SingleRowPassInfo data, TabInfo selected) {
data.insets = myTabs.getLayoutInsets();
+ data.insets.left += myTabs.getFirstTabOffset();
final JBTabsImpl.Toolbar selectedToolbar = myTabs.myInfo2Toolbar.get(selected);
data.hToolbar = selectedToolbar != null && myTabs.myHorizontalSide && !selectedToolbar.isEmpty() ? selectedToolbar : null;
@@ -216,7 +217,7 @@ public class SingleRowLayout extends TabLayout {
data.toFitLength = getStrategy().getToFitLength(data);
if (myTabs.isGhostsAlwaysVisible()) {
- data.toFitLength -= JBTabsImpl.getGhostTabLength() * 2 + (JBTabsImpl.getInterTabSpaceLength() * 2);
+ data.toFitLength -= myTabs.getGhostTabLength() * 2 + (myTabs.getInterTabSpaceLength() * 2);
}
}
@@ -236,9 +237,9 @@ public class SingleRowLayout extends TabLayout {
private void layoutLabelsAndGhosts(final SingleRowPassInfo data) {
if (data.firstGhostVisible || myTabs.isGhostsAlwaysVisible()) {
- data.firstGhost = getStrategy().getLayoutRect(data, data.position, JBTabsImpl.getGhostTabLength());
+ data.firstGhost = getStrategy().getLayoutRect(data, data.position, myTabs.getGhostTabLength());
myTabs.layout(myLeftGhost, data.firstGhost);
- data.position += getStrategy().getLengthIncrement(data.firstGhost.getSize()) + JBTabsImpl.getInterTabSpaceLength();
+ data.position += getStrategy().getLengthIncrement(data.firstGhost.getSize()) + myTabs.getInterTabSpaceLength();
}
int deltaToFit = 0;
@@ -275,9 +276,9 @@ public class SingleRowLayout extends TabLayout {
boolean continueLayout = applyTabLayout(data, label, length, deltaToFit);
data.position = getStrategy().getMaxPosition(label.getBounds());
- data.position += JBTabsImpl.getInterTabSpaceLength();
+ data.position += myTabs.getInterTabSpaceLength();
- totalLength = getStrategy().getMaxPosition(label.getBounds()) - positionStart + JBTabsImpl.getInterTabSpaceLength();
+ totalLength = getStrategy().getMaxPosition(label.getBounds()) - positionStart + myTabs.getInterTabSpaceLength();
if (!continueLayout) {
layoutStopped = true;
}
@@ -288,7 +289,7 @@ public class SingleRowLayout extends TabLayout {
}
if (data.lastGhostVisible || myTabs.isGhostsAlwaysVisible()) {
- data.lastGhost = getStrategy().getLayoutRect(data, data.position, JBTabsImpl.getGhostTabLength());
+ data.lastGhost = getStrategy().getLayoutRect(data, data.position, myTabs.getGhostTabLength());
myTabs.layout(myRightGhost, data.lastGhost);
}
}
@@ -366,7 +367,7 @@ public class SingleRowLayout extends TabLayout {
protected int getRequiredLength(TabInfo eachInfo) {
TabLabel label = myTabs.myInfo2Label.get(eachInfo);
return getStrategy().getLengthIncrement(label != null ? label.getPreferredSize() : new Dimension())
- + (myTabs.isEditorTabs() ? JBTabsImpl.getInterTabSpaceLength() : 0);
+ + (myTabs.isEditorTabs() ? myTabs.getInterTabSpaceLength() : 0);
}
@@ -417,13 +418,13 @@ public class SingleRowLayout extends TabLayout {
if (!data.firstGhostVisible && isFirstSide) {
data.firstGhostVisible = !myTabs.isEditorTabs();
if (!myTabs.isGhostsAlwaysVisible() && !myTabs.isEditorTabs()) {
- data.toFitLength -= JBTabsImpl.getGhostTabLength();
+ data.toFitLength -= myTabs.getGhostTabLength();
}
}
else if (!data.lastGhostVisible && !isFirstSide) {
data.lastGhostVisible = !myTabs.isEditorTabs();
if (!myTabs.isGhostsAlwaysVisible() && !myTabs.isEditorTabs()) {
- data.toFitLength -= JBTabsImpl.getGhostTabLength();
+ data.toFitLength -= myTabs.getGhostTabLength();
}
}
}
diff --git a/platform/platform-api/src/com/intellij/ui/tabs/impl/table/TableLayout.java b/platform/platform-api/src/com/intellij/ui/tabs/impl/table/TableLayout.java
index 1326531e2465..9b313783dea7 100644
--- a/platform/platform-api/src/com/intellij/ui/tabs/impl/table/TableLayout.java
+++ b/platform/platform-api/src/com/intellij/ui/tabs/impl/table/TableLayout.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2009 JetBrains s.r.o.
+ * Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -56,8 +56,8 @@ public class TableLayout extends TabLayout {
eachX = data.toFitRec.x;
}
myTabs.layout(eachLabel, eachX, 0, size.width, 1);
- eachX += size.width + JBTabsImpl.getInterTabSpaceLength();
- data.requiredWidth += size.width + JBTabsImpl.getInterTabSpaceLength();
+ eachX += size.width + myTabs.getInterTabSpaceLength();
+ data.requiredWidth += size.width + myTabs.getInterTabSpaceLength();
}
int selectedRow = -1;
@@ -84,7 +84,7 @@ public class TableLayout extends TabLayout {
if (myTabs.getSelectedInfo() == eachInfo) {
selectedRow = eachRow;
}
- eachX += size.width + JBTabsImpl.getInterTabSpaceLength();
+ eachX += size.width + myTabs.getInterTabSpaceLength();
}
else {
eachTableRow = new TableRow(data);
@@ -161,9 +161,9 @@ public class TableLayout extends TabLayout {
label.setAlignmentToCenter(deltaToFit > 0);
boolean lastCell = i == eachRow.myColumns.size() - 1;
- eachX += width + (lastCell ? 0 : JBTabsImpl.getInterTabSpaceLength());
+ eachX += width + (lastCell ? 0 : myTabs.getInterTabSpaceLength());
}
- eachY += myTabs.myHeaderFitSize.height - 1 + JBTabsImpl.getInterTabSpaceLength() - (row < data.table.size() - 1 ? tabUnderlineFix : 0);
+ eachY += myTabs.myHeaderFitSize.height - 1 + myTabs.getInterTabSpaceLength() - (row < data.table.size() - 1 ? tabUnderlineFix : 0);
row++;
}
diff --git a/platform/platform-api/src/com/intellij/ui/treeStructure/Tree.java b/platform/platform-api/src/com/intellij/ui/treeStructure/Tree.java
index 0975876055b2..c8c50bc94680 100644
--- a/platform/platform-api/src/com/intellij/ui/treeStructure/Tree.java
+++ b/platform/platform-api/src/com/intellij/ui/treeStructure/Tree.java
@@ -283,7 +283,7 @@ public class Tree extends JTree implements ComponentWithEmptyText, ComponentWith
if (myBusyIcon != null) {
if (myBusy) {
- if (hasFocus()) {
+ if (shouldShowBusyIconIfNeeded()) {
myBusyIcon.resume();
myBusyIcon.setToolTipText("Update is in progress. Click to cancel");
}
@@ -305,6 +305,11 @@ public class Tree extends JTree implements ComponentWithEmptyText, ComponentWith
}
}
+ protected boolean shouldShowBusyIconIfNeeded() {
+ // http://youtrack.jetbrains.com/issue/IDEA-101422 "Rotating wait symbol in Project list whenever typing"
+ return hasFocus();
+ }
+
protected boolean paintNodes() {
return false;
}
@@ -429,7 +434,6 @@ public class Tree extends JTree implements ComponentWithEmptyText, ComponentWith
}
final Method method = ReflectionUtil.getDeclaredMethod(aClass, "isLocationInExpandControl", TreePath.class, int.class, int.class);
if (method != null) {
- method.setAccessible(true);
return (Boolean)method.invoke(ui, path, x, y);
}
}