compact view for installed plugins

This commit is contained in:
Konstantin Bulenkov
2014-02-24 17:47:32 +01:00
parent a216ae3456
commit a8c7d79ddf
4 changed files with 14 additions and 6 deletions
@@ -28,6 +28,6 @@ class AvailablePluginColumnInfo extends PluginManagerColumnInfo {
@Override
public TableCellRenderer getRenderer(final IdeaPluginDescriptor pluginDescriptor) {
return new PluginsTableRenderer(pluginDescriptor);
return new PluginsTableRenderer(pluginDescriptor, true);
}
}
@@ -642,7 +642,7 @@ public class InstalledPluginsTableModel extends PluginTableModel {
@Override
public TableCellRenderer getRenderer(final IdeaPluginDescriptor pluginDescriptor) {
return new PluginsTableRenderer(pluginDescriptor);
return new PluginsTableRenderer(pluginDescriptor, false);
}
@Override
@@ -29,14 +29,14 @@
</component>
</children>
</grid>
<grid id="cebe0" layout-manager="BorderLayout" hgap="0" vgap="0">
<grid id="cebe0" binding="myInfoPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/>
<properties>
<opaque value="false"/>
</properties>
<border type="none"/>
<children>
<grid id="80605" layout-manager="GridLayoutManager" row-count="1" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<grid id="80605" binding="myBottomPanel" layout-manager="GridLayoutManager" row-count="1" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints border-constraint="South"/>
<properties>
@@ -43,10 +43,13 @@ public class PluginsTableRenderer extends DefaultTableCellRenderer {
private JLabel myCategory;
private JPanel myRightPanel;
private JPanel myBottomPanel;
private JPanel myInfoPanel;
private final IdeaPluginDescriptor myPluginDescriptor;
public PluginsTableRenderer(IdeaPluginDescriptor pluginDescriptor) {
public PluginsTableRenderer(IdeaPluginDescriptor pluginDescriptor, boolean showFullInfo) {
myPluginDescriptor = pluginDescriptor;
boolean myShowFullInfo = showFullInfo;
final Font smallFont;
if (SystemInfo.isMac) {
@@ -61,9 +64,14 @@ public class PluginsTableRenderer extends DefaultTableCellRenderer {
myStatus.setText("");
myCategory.setText("");
myLastUpdated.setFont(smallFont);
if (! (pluginDescriptor instanceof PluginNode)) {
if (!myShowFullInfo || !(pluginDescriptor instanceof PluginNode)) {
myPanel.remove(myRightPanel);
}
if (!myShowFullInfo) {
myInfoPanel.remove(myBottomPanel);
}
myPanel.setBorder(UIUtil.isRetina() ? new EmptyBorder(4,3,4,3) : new EmptyBorder(2,3,2,3));
}