Changeset 23923 in osm for applications/editors/josm/plugins/AddressEdit/src
- Timestamp:
- 2010-10-30T18:43:15+02:00 (15 years ago)
- Location:
- applications/editors/josm/plugins/AddressEdit/src/org/openstreetmap/josm/plugins/addressEdit/gui
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/AddressEdit/src/org/openstreetmap/josm/plugins/addressEdit/gui/AbstractAddressEditAction.java
r23915 r23923 58 58 public void setContainer(AddressEditContainer container) { 59 59 this.container = container; 60 updateEnabledState( container);60 updateEnabledState(); 61 61 } 62 62 63 63 /** 64 * Updates 'enabled' state depending on the given selection event. 65 * @param ev 66 * @return 64 * @return the event 67 65 */ 68 public void updateEnabledState(AddressEditSelectionEvent ev) { 69 // If the tree selection changes, we will get a new event. So this is safe. 70 super.updateEnabledState(); 71 this.event = ev; // save for later use. 72 if (ev != null) { 73 updateEnabledState(ev); 66 protected AddressEditSelectionEvent getEvent() { 67 return event; 68 } 69 70 /** 71 * @param event the event to set 72 */ 73 protected void setEvent(AddressEditSelectionEvent event) { 74 this.event = event; 75 } 76 77 /* (non-Javadoc) 78 * @see org.openstreetmap.josm.actions.JosmAction#updateEnabledState() 79 */ 80 @Override 81 protected void updateEnabledState() { 82 if (this.event != null) { 83 updateEnabledState(this.event); 84 } else { 85 if (container != null) { 86 updateEnabledState(container); 87 } else { 88 super.updateEnabledState(); 89 } 74 90 } 75 91 } … … 81 97 */ 82 98 protected abstract void updateEnabledState(AddressEditContainer container); 99 100 /** 101 * Updates 'enabled' state depending on the given address container object. 102 * @param container The address container (maybe null). 103 * @return 104 */ 105 protected abstract void updateEnabledState(AddressEditSelectionEvent event); 83 106 84 107 /* (non-Javadoc) -
applications/editors/josm/plugins/AddressEdit/src/org/openstreetmap/josm/plugins/addressEdit/gui/AddressEditDialog.java
r23921 r23923 126 126 unresolvedPanel.setMinimumSize(new Dimension(350, 200)); 127 127 128 JPanel unresolvedButtons = new JPanel(new FlowLayout()); 129 SideButton assign = new SideButton(resolveAction); 130 unresolvedButtons.add(assign); 131 SideButton guess = new SideButton(guessAddressAction); 132 unresolvedButtons.add(guess); 133 SideButton applyAllGuesses = new SideButton(applyAllGuessesAction); 134 unresolvedButtons.add(applyAllGuesses); 135 unresolvedPanel.add(unresolvedButtons, BorderLayout.SOUTH); 128 129 try { 130 JPanel unresolvedButtons = new JPanel(new FlowLayout()); 131 SideButton assign = new SideButton(resolveAction); 132 unresolvedButtons.add(assign); 133 SideButton guess = new SideButton(guessAddressAction); 134 unresolvedButtons.add(guess); 135 SideButton applyAllGuesses = new SideButton(applyAllGuessesAction); 136 unresolvedButtons.add(applyAllGuesses); 137 unresolvedPanel.add(unresolvedButtons, BorderLayout.SOUTH); 138 } catch (Exception e) { 139 e.printStackTrace(); 140 } 141 136 142 137 143 /* Map Panel */ -
applications/editors/josm/plugins/AddressEdit/src/org/openstreetmap/josm/plugins/addressEdit/gui/ApplyAllGuessesAction.java
r23922 r23923 28 28 public ApplyAllGuessesAction() { 29 29 //super(tr("Apply all guesses"), "applyguesses_24", "Turns all guesses into the corresponding tag values."); 30 super(tr("Apply all guesses"), null, "Turns all guesses into the corresponding tag values.");30 super(tr("Apply all guesses"), "applyguesses_24", "Turns all guesses into the corresponding tag values."); 31 31 } 32 32 … … 61 61 } 62 62 } 63 64 @Override 65 protected void updateEnabledState(AddressEditSelectionEvent event) { 66 // do nothing here 67 } 63 68 } -
applications/editors/josm/plugins/AddressEdit/src/org/openstreetmap/josm/plugins/addressEdit/gui/GuessAddressDataAction.java
r23915 r23923 30 30 31 31 public GuessAddressDataAction() { 32 super(tr("Guess address data")); 32 super(tr("Guess address data"), "guessstreets_24", "Tries to guess the street name by picking the name of the closest way."); 33 33 } 34 34
Note:
See TracChangeset
for help on using the changeset viewer.