Revert "[vcs] Add toggle button to hide unregistered roots from the table"

This reverts commit 3ec8e6dcf3.

The implementation is buggy, and the need for the button is questionable,
so removing it until explicitly requested.
This commit is contained in:
Kirill Likhodedov
2014-11-25 18:56:13 +03:00
parent ca31b7ff3d
commit 929722f0eb
2 changed files with 9 additions and 24 deletions
@@ -94,7 +94,6 @@ public final class VcsConfiguration implements PersistentStateComponent<VcsConfi
public boolean USE_COMMIT_MESSAGE_MARGIN = false;
public int COMMIT_MESSAGE_MARGIN_SIZE = 72;
public boolean WRAP_WHEN_TYPING_REACHES_RIGHT_MARGIN = false;
public boolean SHOW_UNREGISTERED_ROOTS_IN_SETTINGS = true;
@AbstractCollection(surroundWithTag = false, elementTag = "path")
@Tag("ignored-roots")
@@ -16,7 +16,6 @@
package com.intellij.openapi.vcs.configurable;
import com.intellij.icons.AllIcons;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.options.Configurable;
@@ -127,16 +126,18 @@ public class VcsDirectoryConfigurationPanel extends JPanel implements Configurab
}
}
private class MyDirectoryRenderer extends ColoredTableCellRenderer {
private static class MyDirectoryRenderer extends ColoredTableCellRenderer {
private final Project myProject;
public MyDirectoryRenderer(Project project) {
myProject = project;
}
@Override
protected void customizeCellRenderer(JTable table, Object value, boolean selected, boolean hasFocus, int row, int column) {
if (value instanceof MapInfo) {
MapInfo info = (MapInfo)value;
if (!myVcsConfiguration.SHOW_UNREGISTERED_ROOTS_IN_SETTINGS && !info.type.isRegistered()) {
return;
}
if (!selected && (info == MapInfo.SEPARATOR || info.type == MapInfo.Type.UNREGISTERED)) {
setBackground(getUnregisteredRootBackground());
}
@@ -218,10 +219,6 @@ public class VcsDirectoryConfigurationPanel extends JPanel implements Configurab
return new ColoredTableCellRenderer() {
@Override
protected void customizeCellRenderer(JTable table, Object value, boolean selected, boolean hasFocus, int row, int column) {
if (!myVcsConfiguration.SHOW_UNREGISTERED_ROOTS_IN_SETTINGS && !info.type.isRegistered()) {
return;
}
if (info == MapInfo.SEPARATOR) {
if (!selected) {
setBackground(getUnregisteredRootBackground());
@@ -315,7 +312,7 @@ public class VcsDirectoryConfigurationPanel extends JPanel implements Configurab
setLayout(new BorderLayout());
add(createMainComponent());
myDirectoryRenderer = new MyDirectoryRenderer();
myDirectoryRenderer = new MyDirectoryRenderer(myProject);
DIRECTORY = new ColumnInfo<MapInfo, MapInfo>(VcsBundle.message("column.info.configure.vcses.directory")) {
@Override
public MapInfo valueOf(final MapInfo mapping) {
@@ -568,18 +565,7 @@ public class VcsDirectoryConfigurationPanel extends JPanel implements Configurab
public boolean isEnabled(AnActionEvent e) {
return !myIsDisabled && onlyRegisteredRootsInSelection();
}
}).disableUpDownActions().addExtraAction(new ToggleActionButton("Show unregistered roots", AllIcons.General.Filter) {
@Override
public boolean isSelected(AnActionEvent e) {
return myVcsConfiguration.SHOW_UNREGISTERED_ROOTS_IN_SETTINGS;
}
@Override
public void setSelected(AnActionEvent e, boolean state) {
myVcsConfiguration.SHOW_UNREGISTERED_ROOTS_IN_SETTINGS = state;
myDirectoryMappingTable.repaint();
}
}).createPanel();
}).disableUpDownActions().createPanel();
panelForTable.setPreferredSize(new Dimension(-1, 200));
return panelForTable;
}