Changeset 1326 in josm for trunk/src/org/openstreetmap/josm/actions
- Timestamp:
- 2009-01-23T22:22:10+01:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/AboutAction.java
r1301 r1326 15 15 import java.net.MalformedURLException; 16 16 import java.net.URL; 17 import java.util.Map.Entry;18 17 import java.util.regex.Matcher; 19 18 import java.util.regex.Pattern; 20 19 21 import javax.swing.AbstractAction;22 20 import javax.swing.BorderFactory; 23 import javax.swing.Box;24 import javax.swing.JButton;25 21 import javax.swing.JLabel; 26 22 import javax.swing.JOptionPane; … … 29 25 import javax.swing.JTabbedPane; 30 26 import javax.swing.JTextArea; 31 import javax.swing.UIManager;32 27 33 28 import org.openstreetmap.josm.Main; 34 import org.openstreetmap.josm.plugins.Plugin Proxy;29 import org.openstreetmap.josm.plugins.PluginHandler; 35 30 import org.openstreetmap.josm.tools.GBC; 36 31 import org.openstreetmap.josm.tools.ImageProvider; … … 145 140 about.addTab(tr("Revision"), createScrollPane(revision)); 146 141 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())); 180 143 181 144 about.setPreferredSize(new Dimension(500,300)); 182 145 183 146 JOptionPane.showMessageDialog(Main.parent, about, tr("About JOSM..."), 184 147 JOptionPane.INFORMATION_MESSAGE, ImageProvider.get("logo")); 185 148 } 186 149
Note:
See TracChangeset
for help on using the changeset viewer.