public InstalledPluginsTableRenderer(IdeaPluginDescriptor pluginDescriptor) {
      myPluginDescriptor = pluginDescriptor;

      myNameLabel.setFont(PluginManagerColumnInfo.getNameFont());
      myBundledLabel.setFont(UIUtil.getLabelFont(UIUtil.FontSize.SMALL));
      myPanel.setBorder(BorderFactory.createEmptyBorder(1, 0, 1, 1));

      myNameLabel.setOpaque(true);
      myPanel.add(myNameLabel, BorderLayout.WEST);
      myPanel.add(myBundledLabel, BorderLayout.EAST);
    }
コード例 #2
0
 private boolean installSelected(PluginTable pluginTable) {
   IdeaPluginDescriptor[] selection = pluginTable.getSelectedObjects();
   if (selection != null) {
     boolean enabled = true;
     for (IdeaPluginDescriptor descr : selection) {
       if (descr instanceof PluginNode) {
         enabled &= !PluginManagerColumnInfo.isDownloaded((PluginNode) descr);
         if (((PluginNode) descr).getStatus() == PluginNode.STATUS_INSTALLED) {
           enabled &= InstalledPluginsTableModel.hasNewerVersion(descr.getPluginId());
         }
       } else if (descr instanceof IdeaPluginDescriptorImpl) {
         PluginId id = descr.getPluginId();
         enabled &= InstalledPluginsTableModel.hasNewerVersion(id);
       }
     }
     if (enabled) {
       new ActionInstallPlugin(this, installed).install();
     }
     return true;
   }
   return false;
 }