diff --git a/platform/platform-api/src/com/intellij/openapi/ui/popup/PopupChooserBuilder.java b/platform/platform-api/src/com/intellij/openapi/ui/popup/PopupChooserBuilder.java index 6f108c5f4224..c7f616c90fe4 100644 --- a/platform/platform-api/src/com/intellij/openapi/ui/popup/PopupChooserBuilder.java +++ b/platform/platform-api/src/com/intellij/openapi/ui/popup/PopupChooserBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * Copyright 2000-2015 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. @@ -538,7 +538,7 @@ public class PopupChooserBuilder { ListUtil.installAutoSelectOnMouseMove(list); } - ListScrollingUtil.installActions(list); + ScrollingUtil.installActions(list); setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); myList = list; diff --git a/platform/platform-api/src/com/intellij/ui/ReorderableListController.java b/platform/platform-api/src/com/intellij/ui/ReorderableListController.java index f0c541508668..f90a9c1a8687 100644 --- a/platform/platform-api/src/com/intellij/ui/ReorderableListController.java +++ b/platform/platform-api/src/com/intellij/ui/ReorderableListController.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2015 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. @@ -106,7 +106,7 @@ public abstract class ReorderableListController { ((DefaultListModel)listModel).addElement(element); } myList.clearSelection(); - ListScrollingUtil.selectItem(myList, element); + ScrollingUtil.selectItem(myList, element); } public static ReorderableListController create(final JList list, final DefaultActionGroup actionGroup) { diff --git a/platform/platform-api/src/com/intellij/util/ui/tree/TreeUtil.java b/platform/platform-api/src/com/intellij/util/ui/tree/TreeUtil.java index 0d947d45c440..29f22ff89639 100644 --- a/platform/platform-api/src/com/intellij/util/ui/tree/TreeUtil.java +++ b/platform/platform-api/src/com/intellij/util/ui/tree/TreeUtil.java @@ -23,7 +23,7 @@ import com.intellij.openapi.project.Project; import com.intellij.openapi.util.ActionCallback; import com.intellij.openapi.util.Comparing; import com.intellij.openapi.wm.IdeFocusManager; -import com.intellij.ui.ListScrollingUtil; +import com.intellij.ui.ScrollingUtil; import com.intellij.ui.SimpleColoredComponent; import com.intellij.ui.awt.RelativePoint; import com.intellij.ui.treeStructure.Tree; @@ -383,7 +383,7 @@ public final class TreeUtil { return showRowCentred(tree, tree.getRowForPath(path)); } else { final int row = tree.getRowForPath(path); - return showAndSelect(tree, row - ListScrollingUtil.ROW_PADDING, row + ListScrollingUtil.ROW_PADDING, row, -1); + return showAndSelect(tree, row - ScrollingUtil.ROW_PADDING, row + ScrollingUtil.ROW_PADDING, row, -1); } } diff --git a/platform/platform-impl/src/com/intellij/ide/actionMacro/ActionMacroConfigurationPanel.java b/platform/platform-impl/src/com/intellij/ide/actionMacro/ActionMacroConfigurationPanel.java index d945e63dff53..a0d15c5b0578 100644 --- a/platform/platform-impl/src/com/intellij/ide/actionMacro/ActionMacroConfigurationPanel.java +++ b/platform/platform-impl/src/com/intellij/ide/actionMacro/ActionMacroConfigurationPanel.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2015 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. @@ -76,7 +76,7 @@ public class ActionMacroConfigurationPanel implements Disposable { myMacrosModel.addElement(macro.clone()); } myMacrosList.setModel(myMacrosModel); - ListScrollingUtil.ensureSelectionExists(myMacrosList); + ScrollingUtil.ensureSelectionExists(myMacrosList); } public void apply() { @@ -136,7 +136,7 @@ public class ActionMacroConfigurationPanel implements Disposable { actionModel.addElement(action); } myMacroActionsList.setModel(actionModel); - ListScrollingUtil.ensureSelectionExists(myMacroActionsList); + ScrollingUtil.ensureSelectionExists(myMacroActionsList); } public JPanel getPanel() { diff --git a/platform/platform-impl/src/com/intellij/ide/actions/Switcher.java b/platform/platform-impl/src/com/intellij/ide/actions/Switcher.java index f2f6dd5b9f9b..f60166870af4 100644 --- a/platform/platform-impl/src/com/intellij/ide/actions/Switcher.java +++ b/platform/platform-impl/src/com/intellij/ide/actions/Switcher.java @@ -321,10 +321,10 @@ public class Switcher extends AnAction implements DumbAware { } }); toolWindows.addKeyListener(this); - ListScrollingUtil.installActions(toolWindows); + ScrollingUtil.installActions(toolWindows); toolWindows.addMouseListener(this); toolWindows.addMouseMotionListener(this); - ListScrollingUtil.ensureSelectionExists(toolWindows); + ScrollingUtil.ensureSelectionExists(toolWindows); myClickListener.installOn(toolWindows); toolWindows.getSelectionModel().addListSelectionListener(new ListSelectionListener() { public void valueChanged(@NotNull ListSelectionEvent e) { @@ -512,11 +512,11 @@ public class Switcher extends AnAction implements DumbAware { files.setCellRenderer(filesRenderer); files.setBorder(IdeBorderFactory.createEmptyBorder(5, 5, 5, 20)); files.addKeyListener(this); - ListScrollingUtil.installActions(files); + ScrollingUtil.installActions(files); files.addMouseListener(this); files.addMouseMotionListener(this); myClickListener.installOn(files); - ListScrollingUtil.ensureSelectionExists(files); + ScrollingUtil.ensureSelectionExists(files); this.add(toolWindows, BorderLayout.WEST); if (filesModel.size() > 0) { @@ -1066,7 +1066,7 @@ public class Switcher extends AnAction implements DumbAware { files.repaint(); toolWindows.repaint(); if (value != null) { - ListScrollingUtil.ensureSelectionExists(getSelectedList(list)); + ScrollingUtil.ensureSelectionExists(getSelectedList(list)); } } } diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/actions/ContentChooser.java b/platform/platform-impl/src/com/intellij/openapi/editor/actions/ContentChooser.java index 7764bcfa51a5..125b49c95a6d 100644 --- a/platform/platform-impl/src/com/intellij/openapi/editor/actions/ContentChooser.java +++ b/platform/platform-impl/src/com/intellij/openapi/editor/actions/ContentChooser.java @@ -168,8 +168,8 @@ public abstract class ContentChooser extends DialogWrapper { mySplitter.setSecondComponent(new JPanel()); rebuildListContent(); - ListScrollingUtil.installActions(myList); - ListScrollingUtil.ensureSelectionExists(myList); + ScrollingUtil.installActions(myList); + ScrollingUtil.ensureSelectionExists(myList); updateViewerForSelection(); myList.addListSelectionListener(new ListSelectionListener() { @Override @@ -309,7 +309,7 @@ public abstract class ContentChooser extends DialogWrapper { public void setSelectedIndex(int index) { myList.setSelectedIndex(index); - ListScrollingUtil.ensureIndexIsVisible(myList, index, 0); + ScrollingUtil.ensureIndexIsVisible(myList, index, 0); updateViewerForSelection(); } diff --git a/platform/platform-impl/src/com/intellij/openapi/fileChooser/ex/FileTextFieldImpl.java b/platform/platform-impl/src/com/intellij/openapi/fileChooser/ex/FileTextFieldImpl.java index 64f56eb750eb..cda2aa936254 100644 --- a/platform/platform-impl/src/com/intellij/openapi/fileChooser/ex/FileTextFieldImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/fileChooser/ex/FileTextFieldImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * Copyright 2000-2015 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. @@ -35,7 +35,7 @@ import com.intellij.openapi.util.text.StringUtil; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.psi.codeStyle.MinusculeMatcher; import com.intellij.psi.codeStyle.NameUtil; -import com.intellij.ui.ListScrollingUtil; +import com.intellij.ui.ScrollingUtil; import com.intellij.ui.components.JBList; import com.intellij.ui.popup.list.GroupedItemsListRenderer; import com.intellij.util.ui.update.LazyUiDisposable; @@ -778,20 +778,20 @@ public abstract class FileTextFieldImpl implements FileLookup, Disposable, FileT if ("selectNextRow".equals(action)) { if (ensureSelectionExists()) { - ListScrollingUtil.moveDown(myList, e.getModifiersEx()); + ScrollingUtil.moveDown(myList, e.getModifiersEx()); e.consume(); } } else if ("selectPreviousRow".equals(action)) { - ListScrollingUtil.moveUp(myList, e.getModifiersEx()); + ScrollingUtil.moveUp(myList, e.getModifiersEx()); e.consume(); } else if ("scrollDown".equals(action)) { - ListScrollingUtil.movePageDown(myList); + ScrollingUtil.movePageDown(myList); e.consume(); } else if ("scrollUp".equals(action)) { - ListScrollingUtil.movePageUp(myList); + ScrollingUtil.movePageUp(myList); e.consume(); } else if (getSelectedFileFromCompletionPopup() != null && (e.getKeyCode() == KeyEvent.VK_ENTER || e.getKeyCode() == KeyEvent.VK_TAB) && e.getModifiers() == 0) { diff --git a/platform/platform-impl/src/com/intellij/openapi/fileTypes/ex/FileTypeChooser.java b/platform/platform-impl/src/com/intellij/openapi/fileTypes/ex/FileTypeChooser.java index 6118ebab35fd..91d50d80b69a 100644 --- a/platform/platform-impl/src/com/intellij/openapi/fileTypes/ex/FileTypeChooser.java +++ b/platform/platform-impl/src/com/intellij/openapi/fileTypes/ex/FileTypeChooser.java @@ -29,7 +29,7 @@ import com.intellij.psi.PsiManager; import com.intellij.psi.impl.PsiManagerEx; import com.intellij.ui.CollectionComboBoxModel; import com.intellij.ui.DoubleClickListener; -import com.intellij.ui.ListScrollingUtil; +import com.intellij.ui.ScrollingUtil; import com.intellij.util.FunctionUtil; import com.intellij.util.containers.ContainerUtil; import org.jetbrains.annotations.NotNull; @@ -109,7 +109,7 @@ public class FileTypeChooser extends DialogWrapper { } ); - ListScrollingUtil.selectItem(myList, FileTypes.PLAIN_TEXT); + ScrollingUtil.selectItem(myList, FileTypes.PLAIN_TEXT); return myPanel; } diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/welcomeScreen/EditProjectGroupAction.java b/platform/platform-impl/src/com/intellij/openapi/wm/impl/welcomeScreen/EditProjectGroupAction.java index f2eea817d9ba..c7e71b8c5c3e 100644 --- a/platform/platform-impl/src/com/intellij/openapi/wm/impl/welcomeScreen/EditProjectGroupAction.java +++ b/platform/platform-impl/src/com/intellij/openapi/wm/impl/welcomeScreen/EditProjectGroupAction.java @@ -22,7 +22,7 @@ import com.intellij.openapi.actionSystem.AnAction; import com.intellij.openapi.actionSystem.AnActionEvent; import com.intellij.openapi.ui.InputValidatorEx; import com.intellij.openapi.ui.Messages; -import com.intellij.ui.ListScrollingUtil; +import com.intellij.ui.ScrollingUtil; import org.jetbrains.annotations.Nullable; import javax.swing.*; @@ -77,7 +77,7 @@ public class EditProjectGroupAction extends RecentProjectsWelcomeScreenActionBas Object element = model.get(i); if (element instanceof ProjectGroupActionGroup) { if (((ProjectGroupActionGroup)element).getGroup().equals(group)) { - ListScrollingUtil.selectItem(list, i); + ScrollingUtil.selectItem(list, i); break; } } diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/welcomeScreen/FlatWelcomeFrame.java b/platform/platform-impl/src/com/intellij/openapi/wm/impl/welcomeScreen/FlatWelcomeFrame.java index 3482fa604c0b..90eb177e4c57 100644 --- a/platform/platform-impl/src/com/intellij/openapi/wm/impl/welcomeScreen/FlatWelcomeFrame.java +++ b/platform/platform-impl/src/com/intellij/openapi/wm/impl/welcomeScreen/FlatWelcomeFrame.java @@ -350,7 +350,7 @@ public class FlatWelcomeFrame extends JFrame implements IdeFrame { @Override public void run() { final JBList list = panel.second; - ListScrollingUtil.ensureSelectionExists(list); + ScrollingUtil.ensureSelectionExists(list); final ListSelectionListener[] listeners = ((DefaultListSelectionModel)list.getSelectionModel()).getListeners(ListSelectionListener.class); diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/welcomeScreen/RemoveSelectedProjectsAction.java b/platform/platform-impl/src/com/intellij/openapi/wm/impl/welcomeScreen/RemoveSelectedProjectsAction.java index 866079e26cd2..1411cc5b026b 100644 --- a/platform/platform-impl/src/com/intellij/openapi/wm/impl/welcomeScreen/RemoveSelectedProjectsAction.java +++ b/platform/platform-impl/src/com/intellij/openapi/wm/impl/welcomeScreen/RemoveSelectedProjectsAction.java @@ -20,7 +20,7 @@ import com.intellij.ide.RecentProjectsManager; import com.intellij.ide.ReopenProjectAction; import com.intellij.openapi.actionSystem.AnAction; import com.intellij.openapi.actionSystem.AnActionEvent; -import com.intellij.ui.ListScrollingUtil; +import com.intellij.ui.ScrollingUtil; import javax.swing.*; @@ -47,7 +47,7 @@ public class RemoveSelectedProjectsAction extends RecentProjectsWelcomeScreenAct JList list = getList(e); if (list != null) { - ListScrollingUtil.ensureSelectionExists(list); + ScrollingUtil.ensureSelectionExists(list); } } diff --git a/platform/platform-impl/src/com/intellij/ui/FinderRecursivePanel.java b/platform/platform-impl/src/com/intellij/ui/FinderRecursivePanel.java index 4331a877ffbd..654ecfc3e656 100644 --- a/platform/platform-impl/src/com/intellij/ui/FinderRecursivePanel.java +++ b/platform/platform-impl/src/com/intellij/ui/FinderRecursivePanel.java @@ -217,7 +217,7 @@ public abstract class FinderRecursivePanel extends JBSplitter implements Data updateRightComponent(true); } }); - ListScrollingUtil.installActions(list); + ScrollingUtil.installActions(list); // installSpeedSearch(list); // TODO diff --git a/platform/platform-impl/src/com/intellij/ui/ListSpeedSearch.java b/platform/platform-impl/src/com/intellij/ui/ListSpeedSearch.java index a72b455ee340..e4fb2bf1899e 100644 --- a/platform/platform-impl/src/com/intellij/ui/ListSpeedSearch.java +++ b/platform/platform-impl/src/com/intellij/ui/ListSpeedSearch.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2015 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. @@ -43,7 +43,7 @@ public class ListSpeedSearch extends SpeedSearchBase { } protected void selectElement(Object element, String selectedText) { - ListScrollingUtil.selectItem(myComponent, element); + ScrollingUtil.selectItem(myComponent, element); } protected int getSelectedIndex() { diff --git a/platform/platform-impl/src/com/intellij/ui/MultipleTraitsListSpeedSearch.java b/platform/platform-impl/src/com/intellij/ui/MultipleTraitsListSpeedSearch.java index 43545dd038a6..833cf783560b 100644 --- a/platform/platform-impl/src/com/intellij/ui/MultipleTraitsListSpeedSearch.java +++ b/platform/platform-impl/src/com/intellij/ui/MultipleTraitsListSpeedSearch.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * Copyright 2000-2015 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. @@ -44,6 +44,6 @@ public class MultipleTraitsListSpeedSearch extends MultipleTraitsSpeedSearch) { int[] indices = ((MultiSelectionListPopupStep)listStep).getDefaultOptionIndices(); if (indices.length > 0) { - ListScrollingUtil.ensureIndexIsVisible(myList, indices[0], 0); + ScrollingUtil.ensureIndexIsVisible(myList, indices[0], 0); myList.setSelectedIndices(indices); selected = true; } @@ -132,7 +132,7 @@ public class ListPopupImpl extends WizardPopup implements ListPopup { else { final int defaultIndex = listStep.getDefaultOptionIndex(); if (defaultIndex >= 0 && defaultIndex < myList.getModel().getSize()) { - ListScrollingUtil.selectItem(myList, defaultIndex); + ScrollingUtil.selectItem(myList, defaultIndex); selected = true; } } @@ -170,7 +170,7 @@ public class ListPopupImpl extends WizardPopup implements ListPopup { } if (mostUsedValue > 0) { - ListScrollingUtil.selectItem(myList, mostUsedValue); + ScrollingUtil.selectItem(myList, mostUsedValue); return true; } } @@ -237,7 +237,7 @@ public class ListPopupImpl extends WizardPopup implements ListPopup { Insets padding = UIUtil.getListViewportPadding(); myList.setBorder(new EmptyBorder(padding)); - ListScrollingUtil.installActions(myList); + ScrollingUtil.installActions(myList); myList.setCellRenderer(getListElementRenderer()); diff --git a/platform/platform-impl/src/com/intellij/util/ui/ListModelEditor.java b/platform/platform-impl/src/com/intellij/util/ui/ListModelEditor.java index a93d61051905..67005649dcb7 100644 --- a/platform/platform-impl/src/com/intellij/util/ui/ListModelEditor.java +++ b/platform/platform-impl/src/com/intellij/util/ui/ListModelEditor.java @@ -43,14 +43,14 @@ public class ListModelEditor extends ListModelEditorBase { if (!model.isEmpty()) { T lastItem = model.getElementAt(model.getSize() - 1); if (ListModelEditor.this.itemEditor.isEmpty(lastItem)) { - ListScrollingUtil.selectItem(list, ContainerUtil.indexOfIdentity(model.getItems(), lastItem)); + ScrollingUtil.selectItem(list, ContainerUtil.indexOfIdentity(model.getItems(), lastItem)); return; } } T item = createElement(); model.add(item); - ListScrollingUtil.selectItem(list, ContainerUtil.indexOfIdentity(model.getItems(), item)); + ScrollingUtil.selectItem(list, ContainerUtil.indexOfIdentity(model.getItems(), item)); } }) .setRemoveActionUpdater(new AnActionButtonUpdater() { diff --git a/plugins/tasks/tasks-core/src/com/intellij/tasks/actions/SearchSupport.java b/plugins/tasks/tasks-core/src/com/intellij/tasks/actions/SearchSupport.java index 13e38cc72a83..8b99213f41f8 100644 --- a/plugins/tasks/tasks-core/src/com/intellij/tasks/actions/SearchSupport.java +++ b/plugins/tasks/tasks-core/src/com/intellij/tasks/actions/SearchSupport.java @@ -1,17 +1,17 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2015 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. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package com.intellij.tasks.actions; @@ -29,7 +29,7 @@ import com.intellij.openapi.ui.popup.*; import com.intellij.openapi.util.Computable; import com.intellij.tasks.Task; import com.intellij.ui.EditorTextField; -import com.intellij.ui.ListScrollingUtil; +import com.intellij.ui.ScrollingUtil; import com.intellij.ui.SortedListModel; import com.intellij.ui.components.JBList; import org.jetbrains.annotations.Nullable; @@ -141,17 +141,17 @@ public abstract class SearchSupport { if ("selectNextRow".equals(action)) { if (ensureSelectionExists()) { - ListScrollingUtil.moveDown(myList, e.getModifiersEx()); + ScrollingUtil.moveDown(myList, e.getModifiersEx()); } } else if ("selectPreviousRow".equals(action)) { - ListScrollingUtil.moveUp(myList, e.getModifiersEx()); + ScrollingUtil.moveUp(myList, e.getModifiersEx()); } else if ("scrollDown".equals(action)) { - ListScrollingUtil.movePageDown(myList); + ScrollingUtil.movePageDown(myList); } else if ("scrollUp".equals(action)) { - ListScrollingUtil.movePageUp(myList); + ScrollingUtil.movePageUp(myList); } else if ((e.getKeyCode() == KeyEvent.VK_ENTER || e.getKeyCode() == KeyEvent.VK_TAB) && e.getModifiers() == 0) { hideCurrentPopup(); diff --git a/plugins/testng/src/com/theoryinpractice/testng/configuration/browser/GroupList.java b/plugins/testng/src/com/theoryinpractice/testng/configuration/browser/GroupList.java index 7f14866d0cfe..c0be62ab92a6 100644 --- a/plugins/testng/src/com/theoryinpractice/testng/configuration/browser/GroupList.java +++ b/plugins/testng/src/com/theoryinpractice/testng/configuration/browser/GroupList.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * Copyright 2000-2015 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. @@ -17,8 +17,8 @@ package com.theoryinpractice.testng.configuration.browser; import com.intellij.openapi.ui.DialogBuilder; import com.intellij.psi.PsiClass; -import com.intellij.ui.ListScrollingUtil; import com.intellij.ui.ScrollPaneFactory; +import com.intellij.ui.ScrollingUtil; import com.intellij.ui.SortedListModel; import com.intellij.ui.components.JBList; import com.intellij.util.ArrayUtil; @@ -50,7 +50,7 @@ public class GroupList extends JPanel model.addAll(array); add(ScrollPaneFactory.createScrollPane(list)); list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); - ListScrollingUtil.ensureSelectionExists(list); + ScrollingUtil.ensureSelectionExists(list); } public String getSelected()