Changeset 23884 in osm for applications
- Timestamp:
- 2010-10-27T22:45:07+02:00 (14 years ago)
- Location:
- applications/editors/josm/plugins/AddressEdit
- Files:
-
- 1 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/AddressEdit/.project
r23879 r23884 7 7 <buildSpec> 8 8 <buildCommand> 9 <name>org.eclipse.ui.externaltools.ExternalToolBuilder</name> 10 <triggers>full,incremental,</triggers> 9 <name>org.eclipse.jdt.core.javabuilder</name> 11 10 <arguments> 12 <dictionary>13 <key>LaunchConfigHandle</key>14 <value><project>/.externalToolBuilders/org.eclipse.jdt.core.javabuilder (2).launch</value>15 </dictionary>16 11 </arguments> 17 12 </buildCommand> -
applications/editors/josm/plugins/AddressEdit/src/org/openstreetmap/josm/plugins/addressEdit/AddressEditAction.java
r23876 r23884 10 10 import org.openstreetmap.josm.actions.JosmAction; 11 11 import org.openstreetmap.josm.data.SelectionChangedListener; 12 import org.openstreetmap.josm.data.osm.DataSet; 12 13 import org.openstreetmap.josm.data.osm.OsmPrimitive; 13 14 import org.openstreetmap.josm.plugins.addressEdit.gui.AddressEditDialog; … … 21 22 private static final long serialVersionUID = 1L; 22 23 private AddressEditContainer addressEditContainer; 24 private Collection<? extends OsmPrimitive> newSelection; 23 25 24 26 public AddressEditAction() { … … 31 33 setEnabled(false); 32 34 35 addressEditContainer = new AddressEditContainer(); 36 DataSet.addSelectionListener(this); 33 37 } 34 38 39 /* (non-Javadoc) 40 * @see org.openstreetmap.josm.data.SelectionChangedListener#selectionChanged(java.util.Collection) 41 */ 35 42 @Override 36 43 public void selectionChanged(Collection<? extends OsmPrimitive> newSelection) { 37 synchronized (this) { 38 collectAddressesAndStreets(newSelection); 44 this.newSelection = newSelection; 45 if (addressEditContainer != null) { 46 addressEditContainer.invalidate(newSelection); 39 47 } 40 48 } 41 49 50 /* (non-Javadoc) 51 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) 52 */ 42 53 @Override 43 public void actionPerformed(ActionEvent arg0) { 44 addressEditContainer = new AddressEditContainer(); 54 public void actionPerformed(ActionEvent arg0) { 45 55 if (addressEditContainer != null) { 46 addressEditContainer.attachToDataSet( );56 addressEditContainer.attachToDataSet(newSelection); 47 57 try { 48 58 AddressEditDialog dlg = new AddressEditDialog(addressEditContainer); … … 53 63 } 54 64 } 65 55 66 56 private void collectAddressesAndStreets( 57 final Collection<? extends OsmPrimitive> osmData) { 58 if (osmData == null || osmData.isEmpty()) 59 return; 60 61 62 } 63 67 /* (non-Javadoc) 68 * @see org.openstreetmap.josm.actions.JosmAction#updateEnabledState() 69 */ 64 70 @Override 65 71 protected void updateEnabledState() { -
applications/editors/josm/plugins/AddressEdit/src/org/openstreetmap/josm/plugins/addressEdit/AddressEditContainer.java
r23877 r23884 130 130 if (newSegment != null) { 131 131 String name = newSegment.getName(); 132 if (StringUtils.isNullOrEmpty(name)) return; 133 132 134 StreetNode sNode = null; 133 135 if (streetDict.containsKey(name)) { … … 293 295 * be called immediately before an edit session starts. 294 296 */ 295 public void attachToDataSet( ) {297 public void attachToDataSet(Collection<? extends OsmPrimitive> dataToExamine) { 296 298 Main.main.getCurrentDataSet().addDataSetListener(this); 297 invalidate(); 299 if (dataToExamine != null && dataToExamine.size() > 0) { 300 invalidate(dataToExamine); // use given data set (usually the current selection) 301 } else { 302 invalidate(); // use current data set 303 } 298 304 } 299 305 -
applications/editors/josm/plugins/AddressEdit/src/org/openstreetmap/josm/plugins/addressEdit/gui/IncompleteAddressesTableModel.java
r23849 r23884 15 15 16 16 import static org.openstreetmap.josm.tools.I18n.tr; 17 18 17 19 18 import org.openstreetmap.josm.plugins.addressEdit.AddressEditContainer;
Note:
See TracChangeset
for help on using the changeset viewer.