mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-134782 (hide plugin rating panel when data not available)
This commit is contained in:
@@ -85,14 +85,14 @@ public class PluginsTableRenderer extends DefaultTableCellRenderer {
|
||||
myCategory.setText("");
|
||||
myLastUpdated.setFont(smallFont);
|
||||
|
||||
if (!showFullInfo || !(pluginDescriptor instanceof PluginNode)) {
|
||||
if (myPluginsView || pluginDescriptor.getDownloads() == null || !(pluginDescriptor instanceof PluginNode)) {
|
||||
myPanel.remove(myRightPanel);
|
||||
}
|
||||
if (!showFullInfo) {
|
||||
if (myPluginsView) {
|
||||
myInfoPanel.remove(myBottomPanel);
|
||||
}
|
||||
|
||||
myPanel.setBorder(UIUtil.isRetina() ? new EmptyBorder(4,3,4,3) : new EmptyBorder(2,3,2,3));
|
||||
myPanel.setBorder(UIUtil.isRetina() ? new EmptyBorder(4, 3, 4, 3) : new EmptyBorder(2, 3, 2, 3));
|
||||
}
|
||||
|
||||
private void createUIComponents() {
|
||||
@@ -134,6 +134,9 @@ public class PluginsTableRenderer extends DefaultTableCellRenderer {
|
||||
if (category != null) {
|
||||
myCategory.setText(category.toUpperCase(Locale.getDefault()));
|
||||
}
|
||||
else if (!myPluginsView) {
|
||||
myCategory.setText(AvailablePluginsManagerMain.N_A);
|
||||
}
|
||||
|
||||
myStatus.setIcon(AllIcons.Nodes.Plugin);
|
||||
if (myPluginDescriptor.isBundled()) {
|
||||
@@ -145,19 +148,15 @@ public class PluginsTableRenderer extends DefaultTableCellRenderer {
|
||||
myStatus.setIcon(AllIcons.Nodes.PluginJB);
|
||||
}
|
||||
|
||||
if (myPluginDescriptor instanceof PluginNode) {
|
||||
PluginNode pluginNode = (PluginNode)myPluginDescriptor;
|
||||
|
||||
String downloads = pluginNode.getDownloads();
|
||||
if (downloads != null) {
|
||||
if (downloads.length() > 3) {
|
||||
downloads = new DecimalFormat("#,###").format(Integer.parseInt(downloads));
|
||||
}
|
||||
myDownloads.setText(downloads);
|
||||
String downloads = myPluginDescriptor.getDownloads();
|
||||
if (downloads != null && myPluginDescriptor instanceof PluginNode) {
|
||||
if (downloads.length() > 3) {
|
||||
downloads = new DecimalFormat("#,###").format(Integer.parseInt(downloads));
|
||||
}
|
||||
myDownloads.setText(downloads);
|
||||
|
||||
myRating.setRate(pluginNode.getRating());
|
||||
myLastUpdated.setText(DateFormatUtil.formatBetweenDates(pluginNode.getDate(), System.currentTimeMillis()));
|
||||
myRating.setRate(((PluginNode)myPluginDescriptor).getRating());
|
||||
myLastUpdated.setText(DateFormatUtil.formatBetweenDates(((PluginNode)myPluginDescriptor).getDate(), System.currentTimeMillis()));
|
||||
}
|
||||
|
||||
// plugin state-dependent rendering
|
||||
|
||||
Reference in New Issue
Block a user