25 |
25 |
|
26 |
26 |
import java.awt.Color;
|
27 |
27 |
import java.awt.Component;
|
|
28 |
import java.awt.event.KeyAdapter;
|
|
29 |
import java.awt.event.KeyEvent;
|
28 |
30 |
import java.sql.Timestamp;
|
29 |
31 |
import java.util.Date;
|
|
32 |
import java.util.Objects;
|
30 |
33 |
|
31 |
34 |
import javax.swing.JTable;
|
32 |
35 |
import javax.swing.event.ChangeEvent;
|
... | ... | |
35 |
38 |
import javax.swing.table.TableColumn;
|
36 |
39 |
import javax.swing.table.TableColumnModel;
|
37 |
40 |
import javax.swing.table.TableModel;
|
|
41 |
import org.apache.commons.lang3.StringUtils;
|
38 |
42 |
|
39 |
43 |
import org.gvsig.fmap.dal.exception.DataException;
|
40 |
44 |
import org.gvsig.fmap.dal.feature.Feature;
|
... | ... | |
52 |
56 |
import org.gvsig.fmap.mapcontrol.dal.feature.swing.table.notification.ColumnHeaderSelectionChangeNotification;
|
53 |
57 |
import org.gvsig.tools.observer.Observable;
|
54 |
58 |
import org.gvsig.tools.observer.Observer;
|
|
59 |
import org.gvsig.tools.swing.api.ToolsSwingLocator;
|
55 |
60 |
import org.slf4j.Logger;
|
56 |
61 |
import org.slf4j.LoggerFactory;
|
57 |
62 |
|
... | ... | |
261 |
266 |
} catch(Exception ex) {
|
262 |
267 |
LOGGER.warn("Can't check if selecction is available.", ex);
|
263 |
268 |
}
|
|
269 |
this.addKeyListener(new KeyAdapter() {
|
|
270 |
@Override
|
|
271 |
public void keyPressed(KeyEvent e) {
|
|
272 |
if( e.getKeyCode()==KeyEvent.VK_F4 ) {
|
|
273 |
doShowCellInDialog();
|
|
274 |
}
|
|
275 |
}
|
|
276 |
});
|
|
277 |
|
264 |
278 |
}
|
|
279 |
private void doShowCellInDialog() {
|
|
280 |
int row = this.getSelectedRow();
|
|
281 |
if( row < 0 ) {
|
|
282 |
return;
|
|
283 |
}
|
|
284 |
int col = this.getSelectedColumn();
|
|
285 |
if( col < 0 ) {
|
|
286 |
return;
|
|
287 |
}
|
|
288 |
String s = Objects.toString(this.getValueAt(row, col),null);
|
|
289 |
if( StringUtils.isBlank(s) ) {
|
|
290 |
return;
|
|
291 |
}
|
|
292 |
ToolsSwingLocator.getToolsSwingManager().showZoomDialog(
|
|
293 |
this,
|
|
294 |
this.getColumnName(col),
|
|
295 |
s,
|
|
296 |
false
|
|
297 |
);
|
|
298 |
}
|
265 |
299 |
|
|
300 |
|
266 |
301 |
/**
|
267 |
302 |
* Returns the number of selected columns.
|
268 |
303 |
*
|