Changeset 12537 in josm for trunk/src/org/openstreetmap/josm/gui/io
- Timestamp:
- 2017-07-30T00:22:46+02:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/io
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/io/LayerNameAndFilePathTableCell.java
r11893 r12537 38 38 */ 39 39 class LayerNameAndFilePathTableCell extends JPanel implements TableCellRenderer, TableCellEditor { 40 private static final Color colorError= new Color(255, 197, 197);40 private static final Color COLOR_ERROR = new Color(255, 197, 197); 41 41 private static final String ELLIPSIS = '…' + File.separator; 42 42 … … 46 46 private final JButton btnFileChooser = new JButton(new LaunchFileChooserAction()); 47 47 48 private static final GBC defaultCellStyle= GBC.eol().fill(GBC.HORIZONTAL).insets(2, 0, 2, 0);48 private static final GBC DEFAULT_CELL_STYLE = GBC.eol().fill(GBC.HORIZONTAL).insets(2, 0, 2, 0); 49 49 50 50 private final transient CellEditorSupport cellEditorSupport = new CellEditorSupport(this); … … 137 137 lblLayerName.setIcon(info.getLayer().getIcon()); 138 138 lblLayerName.setText(info.getName()); 139 add(lblLayerName, defaultCellStyle);139 add(lblLayerName, DEFAULT_CELL_STYLE); 140 140 return tr("The bold text is the name of the layer."); 141 141 } … … 164 164 } 165 165 166 lblFilename.setBackground(error ? colorError: getBackground());167 btnFileChooser.setBackground(error ? colorError: getBackground());168 169 add(lblFilename, defaultCellStyle);166 lblFilename.setBackground(error ? COLOR_ERROR : getBackground()); 167 btnFileChooser.setBackground(error ? COLOR_ERROR : getBackground()); 168 169 add(lblFilename, DEFAULT_CELL_STYLE); 170 170 return tr("Click cell to change the file path.") + "<br/>" + tooltip; 171 171 } -
trunk/src/org/openstreetmap/josm/gui/io/SaveLayersTableColumnModel.java
r12452 r12537 27 27 private final JLabel needsUpload = new JLabel(tr("should be uploaded")); 28 28 private final JLabel needsSave = new JLabel(tr("should be saved")); 29 private static final GBC defaultCellStyle= GBC.eol().fill(GBC.HORIZONTAL).insets(2, 0, 2, 0);29 private static final GBC DEFAULT_CELL_STYLE = GBC.eol().fill(GBC.HORIZONTAL).insets(2, 0, 2, 0); 30 30 31 31 /** … … 48 48 String htmlInfoName = Utils.escapeReservedCharactersHTML(info.getName()); 49 49 if (info.getLayer().requiresUploadToServer() && !info.getLayer().isUploadDiscouraged()) { 50 panel.add(needsUpload, defaultCellStyle);50 panel.add(needsUpload, DEFAULT_CELL_STYLE); 51 51 sb.append(tr("Layer ''{0}'' has modifications which should be uploaded to the server.", htmlInfoName)); 52 52 53 53 } else { 54 54 if (info.isUploadable()) { 55 panel.add(pnlEmpty, defaultCellStyle);55 panel.add(pnlEmpty, DEFAULT_CELL_STYLE); 56 56 } 57 57 if (info.getLayer().requiresUploadToServer()) { … … 64 64 65 65 if (info.getLayer().requiresSaveToFile()) { 66 panel.add(needsSave, defaultCellStyle);66 panel.add(needsSave, DEFAULT_CELL_STYLE); 67 67 sb.append(tr("Layer ''{0}'' has modifications which should be saved to its associated file ''{1}''.", 68 68 htmlInfoName, info.getFile().toString())); 69 69 } else { 70 70 if (info.isSavable()) { 71 panel.add(pnlEmpty, defaultCellStyle);71 panel.add(pnlEmpty, DEFAULT_CELL_STYLE); 72 72 } 73 73 sb.append(tr("Layer ''{0}'' has no modifications to be saved.", htmlInfoName)); -
trunk/src/org/openstreetmap/josm/gui/io/UploadDialog.java
r12531 r12537 75 75 76 76 /** list of custom components that can be added by plugins at JOSM startup */ 77 private static final Collection<Component> customComponents= new ArrayList<>();77 private static final Collection<Component> CUSTOM_COMPONENTS = new ArrayList<>(); 78 78 79 79 /** the "created_by" changeset OSM key */ … … 136 136 137 137 // Custom components 138 for (Component c : customComponents) {138 for (Component c : CUSTOM_COMPONENTS) { 139 139 pnl.add(c, GBC.eol().fill(GBC.HORIZONTAL)); 140 140 } … … 406 406 public static boolean addCustomComponent(Component c) { 407 407 if (c != null) { 408 return customComponents.add(c);408 return CUSTOM_COMPONENTS.add(c); 409 409 } 410 410 return false;
Note:
See TracChangeset
for help on using the changeset viewer.