IDEA-90579 Tabs: Alphabetical sorting must be OFF by default

This commit is contained in:
Konstantin Bulenkov
2012-08-28 14:46:57 +04:00
parent e3d3823c67
commit ea87093217
2 changed files with 23 additions and 1 deletions
@@ -15,6 +15,9 @@
*/
package com.intellij.ui.tabs.impl;
import com.intellij.ide.IdeBundle;
import com.intellij.ide.ui.UISettings;
import com.intellij.openapi.ui.Messages;
import com.intellij.ui.InplaceButton;
import com.intellij.ui.MouseDragHelper;
import com.intellij.ui.ScreenUtil;
@@ -224,6 +227,24 @@ class DragHelper extends MouseDragHelper {
super.processDragFinish(event, willDragOutStart);
endDrag(willDragOutStart);
final int place = UISettings.getInstance().EDITOR_TAB_PLACEMENT;
if (!willDragOutStart && JBEditorTabs.isAlphabeticalMode() && place != SwingConstants.TOP && place != SwingConstants.BOTTOM) {
final Point p = new Point(event.getPoint());
SwingUtilities.convertPoint(event.getComponent(), p, myTabs);
if (myTabs.getVisibleRect().contains(p)) {
final int answer = Messages.showOkCancelDialog(myTabs,
IdeBundle.message("alphabetical.mode.is.on.warning"),
IdeBundle.message("title.warning"),
Messages.getQuestionIcon());
if (answer == Messages.OK) {
JBEditorTabs.setAlphabeticalMode(false);
myTabs.relayout(true, false);
myTabs.revalidate();
}
}
}
}
private void endDrag(boolean willDragOutStart) {
@@ -1091,4 +1091,5 @@ diff.dialog.title=Diff Between ''{0}'' and ''{1}''
goto.custom.region.command=Go to Custom Region
goto.custom.region.message.dumb.mode=Go to Custom Region action is not available until indices are built.
goto.custom.region.message.unavailable=There are no custom folding regions in the current file.
goto.custom.region.message.unavailable=There are no custom folding regions in the current file.
alphabetical.mode.is.on.warning=Alphabetical order for tabs is ON. Switch it OFF?