Revision 5379 trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/Table.java
Table.java | ||
---|---|---|
267 | 267 |
refreshControls(); |
268 | 268 |
TableColumn tc=getTable().getColumnModel().getColumn(0); |
269 | 269 |
tc.setCellRenderer(new MyTableCellRenderer()); |
270 |
|
|
271 |
|
|
270 | 272 |
} |
271 | 273 |
class MyTableCellRenderer extends JLabel implements TableCellRenderer { |
272 | 274 |
final Border grayBorder = BorderFactory.createLineBorder(Color.darkGray); |
... | ... | |
440 | 442 |
|
441 | 443 |
public DefaultEditor(JTextField tf) { |
442 | 444 |
super(tf); |
445 |
//MouseListener[] mouseListeners=getTable().getEditorComponent().getMouseListeners(); |
|
446 |
// if (!mouseListeners[mouseListeners.length-1].getClass().equals(MouseRow.class)){ |
|
447 |
tf.addMouseListener(new MouseRow()); |
|
448 |
// } |
|
443 | 449 |
getComponent().addKeyListener(new KeyAdapter() { |
444 | 450 |
int keyPressed = 0; |
445 | 451 |
|
... | ... | |
723 | 729 |
// } |
724 | 730 |
} |
725 | 731 |
private void initEditField(int[] x,int[] y){ |
732 |
if (getTable().getRowCount()>0){ |
|
726 | 733 |
if (isEditing()) { |
727 | 734 |
|
728 | 735 |
if (x.length == 1 && y.length == 1) |
... | ... | |
738 | 745 |
} |
739 | 746 |
|
740 | 747 |
} |
748 |
} |
|
741 | 749 |
} |
742 | 750 |
/** |
743 | 751 |
* DOCUMENT ME! |
... | ... | |
1003 | 1011 |
public void removeRow() throws DriverIOException, IOException { |
1004 | 1012 |
int[] index = getSelectedRowIndices(); |
1005 | 1013 |
getModel().getModelo().startComplexRow(); |
1006 |
for (int i = 0; i < index.length; i++) {
|
|
1014 |
for (int i = index.length-1; i >=0; i--) {
|
|
1007 | 1015 |
getModel().getModelo().removeRow(index[i],"Eliminar fila", EditionEvent.ALPHANUMERIC); |
1008 | 1016 |
} |
1009 |
//////////// |
|
1010 | 1017 |
int[] sel={0}; |
1018 |
getTable().setEditingRow(0); |
|
1011 | 1019 |
initEditField(sel,sel); |
1020 |
|
|
1012 | 1021 |
getModel().getModelo().endComplexRow(); |
1013 | 1022 |
getTable().clearSelection(); |
1014 | 1023 |
|
... | ... | |
1214 | 1223 |
throw new UnsupportedOperationException("Row Number is a read-only column"); |
1215 | 1224 |
columnIndex--; |
1216 | 1225 |
Value v; |
1217 |
if (getValueAt(rowIndex,columnIndex)==null || getValueAt(rowIndex,columnIndex).toString().equals(aValue))
|
|
1226 |
if (getValueAt(rowIndex,columnIndex+1)==null || getValueAt(rowIndex,columnIndex+1).toString().equals(aValue))
|
|
1218 | 1227 |
return; |
1219 | 1228 |
try { |
1220 | 1229 |
v = ValueFactory.createValueByType(aValue.toString(), |
... | ... | |
1447 | 1456 |
* @param e DOCUMENT ME! |
1448 | 1457 |
*/ |
1449 | 1458 |
public void mouseClicked(MouseEvent e) { |
1459 |
|
|
1450 | 1460 |
/* JTableHeader h = (JTableHeader) e.getSource(); |
1451 | 1461 |
TableColumnModel columnModel = h.getColumnModel(); |
1452 | 1462 |
int viewColumn = columnModel.getColumnIndexAtX(e.getX()); |
... | ... | |
1502 | 1512 |
*/ |
1503 | 1513 |
public void mouseClicked(MouseEvent e) { |
1504 | 1514 |
super.mouseClicked(e); |
1515 |
|
|
1516 |
|
|
1505 | 1517 |
PluginServices.getMainFrame().enableControls(); |
1506 | 1518 |
|
1507 | 1519 |
if (e.getButton() == MouseEvent.BUTTON3) { |
Also available in: Unified diff