Changeset 9751 in josm for trunk/src/org/openstreetmap/josm/gui/io/ActionFlagsTableCell.java
- Timestamp:
- 2016-02-07T17:06:04+01:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/io/ActionFlagsTableCell.java
r9078 r9751 57 57 ActionMap am = getActionMap(); 58 58 for (final JCheckBox b : checkBoxes) { 59 add(b, GBC.eol().fill(GBC.HORIZONTAL));60 59 b.setPreferredSize(new Dimension(b.getPreferredSize().width, 19)); 61 60 b.addActionListener(al); … … 68 67 }); 69 68 } 70 71 setToolTipText(tr("<html>"+72 "Select which actions to perform for this layer, if you click the leftmost button.<br/>"+73 "Check \"upload\" to upload the changes to the OSM server.<br/>"+74 "Check \"Save\" to save the layer to the file specified on the left."+75 "</html>"));76 69 } 77 70 … … 91 84 } 92 85 86 private void updatePanel(SaveLayerInfo info) { 87 StringBuilder sb = new StringBuilder(); 88 sb.append("<html>"); 89 sb.append(tr("Select which actions to perform for this layer, if you click the leftmost button.")); 90 removeAll(); 91 if (info != null) { 92 if (info.isUploadable()) { 93 sb.append("<br/>"); 94 sb.append(tr("Check \"Upload\" to upload the changes to the OSM server.")); 95 add(checkBoxes[0], GBC.eol().fill(GBC.HORIZONTAL)); 96 } 97 if (info.isSavable()) { 98 sb.append("<br/>"); 99 sb.append(tr("Check \"Save\" to save the layer to the file specified on the left.")); 100 add(checkBoxes[1], GBC.eol().fill(GBC.HORIZONTAL)); 101 } 102 } 103 sb.append("</html>"); 104 setToolTipText(sb.toString()); 105 } 106 93 107 @Override 94 108 public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { 109 updatePanel((SaveLayerInfo) value); 95 110 updateCheckboxes(value); 96 111 return this; … … 138 153 @Override 139 154 public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) { 155 updatePanel((SaveLayerInfo) value); 140 156 updateCheckboxes(value); 141 157 return this;
Note:
See TracChangeset
for help on using the changeset viewer.