Revision 45192
trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.swing/org.gvsig.fmap.dal.swing.impl/src/main/java/org/gvsig/fmap/dal/swing/impl/searchpanel/DefaultSearchPanel.java | ||
---|---|---|
8 | 8 |
import java.awt.event.ActionListener; |
9 | 9 |
import java.awt.event.ComponentAdapter; |
10 | 10 |
import java.awt.event.ComponentEvent; |
11 |
import java.awt.event.KeyAdapter; |
|
12 |
import java.awt.event.KeyEvent; |
|
11 | 13 |
import java.net.URL; |
12 | 14 |
import java.text.DateFormat; |
13 | 15 |
import java.text.SimpleDateFormat; |
... | ... | |
19 | 21 |
import java.util.HashMap; |
20 | 22 |
import java.util.List; |
21 | 23 |
import java.util.Map; |
24 |
import java.util.Objects; |
|
22 | 25 |
import javax.swing.AbstractAction; |
23 | 26 |
import javax.swing.Action; |
24 | 27 |
import static javax.swing.Action.ACTION_COMMAND_KEY; |
... | ... | |
28 | 31 |
import javax.swing.JButton; |
29 | 32 |
import javax.swing.JComponent; |
30 | 33 |
import javax.swing.JOptionPane; |
31 |
import javax.swing.JTable; |
|
32 | 34 |
import javax.swing.ListSelectionModel; |
33 | 35 |
import javax.swing.SwingUtilities; |
34 | 36 |
import javax.swing.event.ListSelectionEvent; |
... | ... | |
586 | 588 |
} |
587 | 589 |
}); |
588 | 590 |
this.tblResults.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); |
591 |
this.tblResults.addKeyListener(new KeyAdapter() { |
|
592 |
@Override |
|
593 |
public void keyPressed(KeyEvent e) { |
|
594 |
if( e.getKeyCode()==KeyEvent.VK_F2 ) { |
|
595 |
doShowCellInDialog(); |
|
596 |
} |
|
597 |
} |
|
598 |
|
|
599 |
}); |
|
589 | 600 |
search(); |
590 | 601 |
} |
602 |
|
|
603 |
private void doShowCellInDialog() { |
|
604 |
int row = this.tblResults.getSelectedRow(); |
|
605 |
if( row < 0 ) { |
|
606 |
return; |
|
607 |
} |
|
608 |
int col = this.tblResults.getSelectedColumn(); |
|
609 |
if( col < 0 ) { |
|
610 |
return; |
|
611 |
} |
|
612 |
String s = Objects.toString(this.tblResults.getValueAt(row, col),null); |
|
613 |
if( StringUtils.isBlank(s) ) { |
|
614 |
return; |
|
615 |
} |
|
616 |
ToolsSwingLocator.getToolsSwingManager().showZoomDialog( |
|
617 |
this, |
|
618 |
this.tblResults.getColumnName(col), |
|
619 |
s, |
|
620 |
false |
|
621 |
); |
|
622 |
} |
|
591 | 623 |
|
592 | 624 |
private FeatureType getFeatureType() { |
593 | 625 |
try { |
... | ... | |
652 | 684 |
lblMsg.setText(ToolsLocator.getI18nManager().getTranslation("_Searching")+"..."); |
653 | 685 |
setEnabled(false); |
654 | 686 |
Thread th = new Thread(() -> { |
655 |
FeatureQuery myQuery = null;
|
|
656 |
SearchParameters searchParams;
|
|
687 |
FeatureQuery myQuery;
|
|
688 |
SearchParameters searchParams; |
|
657 | 689 |
try { |
658 | 690 |
searchParams = this.fetch(this.parameters.getCopy()); // esto lo actualiza a la ultima // decidir si se devuelve clonado |
659 | 691 |
Date date = Calendar.getInstance().getTime(); |
... | ... | |
715 | 747 |
return; |
716 | 748 |
} |
717 | 749 |
SimpleFeaturesTableModel model; |
718 |
model = (SimpleFeaturesTableModel) this.tblResults.getModel(); |
|
750 |
// model = (SimpleFeaturesTableModel) this.tblResults.getModel();
|
|
719 | 751 |
List<Feature> features = store.getFeatures(this.parameters.getQuery()); |
720 | 752 |
FacadeOfAFeaturePagingHelper facade = (FacadeOfAFeaturePagingHelper) features; |
721 | 753 |
FeatureType ftype = facade.getFeaturePagingHelper().getFeatureSet().getDefaultFeatureType(); |
Also available in: Unified diff