Ignore:
Timestamp:
2009-01-23T22:22:10+01:00 (16 years ago)
Author:
stoecker
Message:

reworked plugin handling a lot, more to come

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/AboutAction.java

    r1301 r1326  
    1515import java.net.MalformedURLException;
    1616import java.net.URL;
    17 import java.util.Map.Entry;
    1817import java.util.regex.Matcher;
    1918import java.util.regex.Pattern;
    2019
    21 import javax.swing.AbstractAction;
    2220import javax.swing.BorderFactory;
    23 import javax.swing.Box;
    24 import javax.swing.JButton;
    2521import javax.swing.JLabel;
    2622import javax.swing.JOptionPane;
     
    2925import javax.swing.JTabbedPane;
    3026import javax.swing.JTextArea;
    31 import javax.swing.UIManager;
    3227
    3328import org.openstreetmap.josm.Main;
    34 import org.openstreetmap.josm.plugins.PluginProxy;
     29import org.openstreetmap.josm.plugins.PluginHandler;
    3530import org.openstreetmap.josm.tools.GBC;
    3631import org.openstreetmap.josm.tools.ImageProvider;
     
    145140        about.addTab(tr("Revision"), createScrollPane(revision));
    146141        about.addTab(tr("Contribution"), createScrollPane(contribution));
    147 
    148         JPanel pluginTab = new JPanel(new GridBagLayout());
    149         for (final PluginProxy p : Main.plugins) {
    150             String name = p.info.name + (p.info.version != null && !p.info.version.equals("") ? " Version: "+p.info.version : "");
    151             pluginTab.add(new JLabel(name), GBC.std());
    152             pluginTab.add(Box.createHorizontalGlue(), GBC.std().fill(GBC.HORIZONTAL));
    153             pluginTab.add(new JButton(new AbstractAction(tr("Information")){
    154                 public void actionPerformed(ActionEvent event) {
    155                     StringBuilder b = new StringBuilder();
    156                     for (Entry<String,String> e : p.info.attr.entrySet()) {
    157                         b.append(e.getKey());
    158                         b.append(": ");
    159                         b.append(e.getValue());
    160                         b.append("\n");
    161                     }
    162                     JTextArea a = new JTextArea(10,40);
    163                     a.setEditable(false);
    164                     a.setText(b.toString());
    165                     JOptionPane.showMessageDialog(Main.parent, new JScrollPane(a));
    166                 }
    167             }), GBC.eol());
    168 
    169             JTextArea description = new JTextArea((p.info.description==null? tr("no description available"):p.info.description));
    170             description.setEditable(false);
    171             description.setFont(new JLabel().getFont().deriveFont(Font.ITALIC));
    172             description.setLineWrap(true);
    173             description.setWrapStyleWord(true);
    174             description.setBorder(BorderFactory.createEmptyBorder(0,20,0,0));
    175             description.setBackground(UIManager.getColor("Panel.background"));
    176            
    177             pluginTab.add(description, GBC.eop().fill(GBC.HORIZONTAL));
    178         }
    179         about.addTab(tr("Plugins"), new JScrollPane(pluginTab));
     142        about.addTab(tr("Plugins"), new JScrollPane(PluginHandler.getInfoPanel()));
    180143
    181144        about.setPreferredSize(new Dimension(500,300));
    182145
    183146        JOptionPane.showMessageDialog(Main.parent, about, tr("About JOSM..."),
    184                 JOptionPane.INFORMATION_MESSAGE, ImageProvider.get("logo"));
     147        JOptionPane.INFORMATION_MESSAGE, ImageProvider.get("logo"));
    185148    }
    186149
Note: See TracChangeset for help on using the changeset viewer.