Changeset 5283 in josm for trunk/src/org
- Timestamp:
- 2012-06-17T18:26:55+02:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/io/SaveLayersTableColumnModel.java
r5233 r5283 19 19 class SaveLayersTableColumnModel extends DefaultTableColumnModel { 20 20 /** small renderer class that handles the "should be uploaded/saved" texts. */ 21 private static class RecommendedActionsTableCell extends JPanelimplements TableCellRenderer {21 private static class RecommendedActionsTableCell implements TableCellRenderer { 22 22 private final static JPanel pnlEmpty = new JPanel(); 23 23 private final static JLabel needsUpload = new JLabel(tr("should be uploaded")); … … 26 26 27 27 public RecommendedActionsTableCell() { 28 setLayout(new GridBagLayout());29 28 pnlEmpty.setPreferredSize(new Dimension(1, 19)); 30 29 needsUpload.setPreferredSize(new Dimension(needsUpload.getPreferredSize().width, 19)); … … 34 33 public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, 35 34 boolean hasFocus, int row, int column) { 35 JPanel panel = new JPanel(new GridBagLayout()); 36 36 SaveLayerInfo info = (SaveLayerInfo)value; 37 37 StringBuilder sb = new StringBuilder(); 38 38 sb.append("<html>"); 39 39 if (info.getLayer().requiresUploadToServer() && !info.getLayer().isUploadDiscouraged()) { 40 add(needsUpload, defaultCellStyle);40 panel.add(needsUpload, defaultCellStyle); 41 41 sb.append(tr("Layer ''{0}'' has modifications which should be uploaded to the server.", info.getName())); 42 42 43 43 } else { 44 add(pnlEmpty, defaultCellStyle);44 panel.add(pnlEmpty, defaultCellStyle); 45 45 if (info.getLayer().requiresUploadToServer()) { 46 46 sb.append(tr("Layer ''{0}'' has modifications which are discouraged to be uploaded.", info.getName())); … … 52 52 53 53 if (info.getLayer().requiresSaveToFile()) { 54 add(needsSave, defaultCellStyle);54 panel.add(needsSave, defaultCellStyle); 55 55 sb.append(tr("Layer ''{0}'' has modifications which should be saved to its associated file ''{1}''.", info.getName(), info.getFile().toString())); 56 56 } else { 57 add(pnlEmpty, defaultCellStyle);57 panel.add(pnlEmpty, defaultCellStyle); 58 58 sb.append(tr("Layer ''{0}'' has no modifications to be saved.", info.getName())); 59 59 } 60 60 sb.append("</html>"); 61 setToolTipText(sb.toString());62 return this;61 panel.setToolTipText(sb.toString()); 62 return panel; 63 63 } 64 64 }
Note:
See TracChangeset
for help on using the changeset viewer.