Changeset 7312 in josm for trunk/src/org/openstreetmap/josm/gui/util
- Timestamp:
- 2014-07-15T16:48:46+02:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/util/GuiHelper.java
r7204 r7312 11 11 import java.awt.Font; 12 12 import java.awt.GraphicsEnvironment; 13 import java.awt.GridBagLayout; 13 14 import java.awt.Image; 14 15 import java.awt.Stroke; … … 29 30 import javax.swing.Icon; 30 31 import javax.swing.ImageIcon; 32 import javax.swing.JLabel; 31 33 import javax.swing.JOptionPane; 34 import javax.swing.JPanel; 32 35 import javax.swing.JScrollPane; 33 36 import javax.swing.SwingUtilities; … … 36 39 import org.openstreetmap.josm.Main; 37 40 import org.openstreetmap.josm.gui.ExtendedDialog; 41 import org.openstreetmap.josm.gui.widgets.HtmlPanel; 42 import org.openstreetmap.josm.tools.GBC; 38 43 import org.openstreetmap.josm.tools.ImageProvider; 39 44 … … 132 137 133 138 /** 139 * Warns user about a dangerous action requiring confirmation. 140 * @param title Title of dialog 141 * @param content Content of dialog 142 * @param baseActionIcon Unused? FIXME why is this parameter unused? 143 * @param continueToolTip Tooltip to display for "continue" button 134 144 * @return true if the user wants to cancel, false if they want to continue 135 145 */ … … 150 160 dlg.setCancelButton(1); 151 161 return dlg.showDialog().getValue() != 2; 162 } 163 164 /** 165 * Notifies user about an error received from an external source as an HTML page. 166 * @param parent Parent component 167 * @param title Title of dialog 168 * @param message Message displayed at the top of the dialog 169 * @param html HTML content to display (real error message) 170 * @since 7312 171 */ 172 public static final void notifyUserHtmlError(Component parent, String title, String message, String html) { 173 JPanel p = new JPanel(new GridBagLayout()); 174 p.add(new JLabel(message), GBC.eol()); 175 p.add(new JLabel(tr("Received error page:")), GBC.eol()); 176 JScrollPane sp = embedInVerticalScrollPane(new HtmlPanel(html)); 177 sp.setPreferredSize(new Dimension(640, 240)); 178 p.add(sp, GBC.eol().fill(GBC.BOTH)); 179 180 ExtendedDialog ed = new ExtendedDialog(parent, title, new String[] {tr("OK")}); 181 ed.setButtonIcons(new String[] {"ok.png"}); 182 ed.setContent(p); 183 ed.showDialog(); 152 184 } 153 185
Note:
See TracChangeset
for help on using the changeset viewer.