- Timestamp:
- 2011-12-22T17:15:25+01:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java
r4680 r4697 128 128 public class PropertiesDialog extends ToggleDialog implements SelectionChangedListener, MapView.EditLayerChangeListener, DataSetListenerAdapter.Listener { 129 129 /** 130 * Watches for double clicks and from editing or new property, depending on the 131 * location, the click was. 130 * Watches for mouse clicks 132 131 * @author imi 133 132 */ 134 public class DblClickWatch extends MouseAdapter {133 public class MouseClickWatch extends MouseAdapter { 135 134 @Override public void mouseClicked(MouseEvent e) { 136 135 if (e.getClickCount() < 2) 137 136 { 137 // single click, clear selection in other table not clicked in 138 138 if (e.getSource() == propertyTable) { 139 139 membershipTable.clearSelection(); … … 142 142 } 143 143 } 144 // double click, edit or add property 144 145 else if (e.getSource() == propertyTable) 145 146 { … … 647 648 648 649 propertyData.setColumnIdentifiers(new String[]{tr("Key"),tr("Value")}); 649 propertyTable.setSelectionMode(ListSelectionModel. SINGLE_SELECTION);650 propertyTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); 650 651 propertyTable.getTableHeader().setReorderingAllowed(false); 651 652 propertyTable.addMouseListener(new PopupMenuLauncher() { … … 833 834 })); 834 835 835 DblClickWatchdblClickWatch = newDblClickWatch();836 propertyTable.addMouseListener( dblClickWatch);837 membershipTable.addMouseListener( dblClickWatch);838 scrollPane.addMouseListener( dblClickWatch);836 MouseClickWatch mouseClickWatch = new MouseClickWatch(); 837 propertyTable.addMouseListener(mouseClickWatch); 838 membershipTable.addMouseListener(mouseClickWatch); 839 scrollPane.addMouseListener(mouseClickWatch); 839 840 840 841 selectSth.setPreferredSize(scrollPane.getSize()); … … 1097 1098 @Override 1098 1099 public void actionPerformed(ActionEvent e) { 1099 if (propertyTable.getSelectedRowCount() >0 ) { 1100 int row = propertyTable.getSelectedRow(); 1101 deleteProperty(row); 1100 if (propertyTable.getSelectedRowCount() > 0) { 1101 int[] rows = propertyTable.getSelectedRows(); 1102 for (int i = rows.length - 1; i >= 0; i--) { 1103 deleteProperty(rows[i]); 1104 } 1102 1105 } else if (membershipTable.getSelectedRowCount() > 0) { 1103 1106 int row = membershipTable.getSelectedRow(); … … 1109 1112 protected void updateEnabledState() { 1110 1113 setEnabled( 1111 (propertyTable != null && propertyTable.getSelectedRowCount() == 1)1112 ^(membershipTable != null && membershipTable.getSelectedRowCount() == 1)1114 (propertyTable != null && propertyTable.getSelectedRowCount() >= 1) 1115 || (membershipTable != null && membershipTable.getSelectedRowCount() == 1) 1113 1116 ); 1114 1117 }
Note:
See TracChangeset
for help on using the changeset viewer.