svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.library / org.gvsig.exportto / org.gvsig.exportto.swing / org.gvsig.exportto.swing.prov / org.gvsig.exportto.swing.prov.jdbc / src / main / java / org / gvsig / exportto / swing / prov / jdbc / panel / UpdateTableStatisticsPanel.java @ 43920
History | View | Annotate | Download (1.95 KB)
1 | 41638 | jjdelcerro | |
---|---|---|---|
2 | package org.gvsig.exportto.swing.prov.jdbc.panel; |
||
3 | |||
4 | import javax.swing.JComponent; |
||
5 | import org.gvsig.exportto.swing.prov.jdbc.ExporttoJDBCOptions; |
||
6 | import org.gvsig.exportto.swing.spi.ExporttoPanelValidationException; |
||
7 | import org.gvsig.exportto.swing.spi.ExporttoSwingProviderPanel; |
||
8 | import org.gvsig.tools.ToolsLocator; |
||
9 | import org.gvsig.tools.i18n.I18nManager; |
||
10 | |||
11 | |||
12 | public class UpdateTableStatisticsPanel extends UpdateTableStatisticsPanelLayout implements ExporttoSwingProviderPanel { |
||
13 | private static final long serialVersionUID = -8450431632002084194L; |
||
14 | |||
15 | 43920 | jjdelcerro | private ExporttoJDBCOptions options;
|
16 | 41638 | jjdelcerro | |
17 | 43920 | jjdelcerro | public UpdateTableStatisticsPanel(ExporttoJDBCOptions options) {
|
18 | this.options = options;
|
||
19 | 41638 | jjdelcerro | initComponents(); |
20 | } |
||
21 | |||
22 | private void initComponents() { |
||
23 | this.chkUpdateStatisticsTableAfterInserts.setEnabled(true); |
||
24 | this.chkUpdateStatisticsTableAfterInserts.setSelected(true); |
||
25 | 41728 | jjdelcerro | this.translate();
|
26 | 41638 | jjdelcerro | } |
27 | 41728 | jjdelcerro | |
28 | private void translate() { |
||
29 | I18nManager i18nManager = ToolsLocator.getI18nManager(); |
||
30 | |||
31 | this.lblHeader.setText("<html>"+i18nManager.getTranslation("_update_table_statistics_header")+"</html>"); |
||
32 | this.chkUpdateStatisticsTableAfterInserts.setText(i18nManager.getTranslation("_Recalcular_estadisticas_de_la_tabla_al_terminar")); |
||
33 | } |
||
34 | 41638 | jjdelcerro | |
35 | 43920 | jjdelcerro | @Override
|
36 | 41638 | jjdelcerro | public String getPanelTitle() { |
37 | I18nManager i18nManager = ToolsLocator.getI18nManager(); |
||
38 | 41728 | jjdelcerro | return i18nManager.getTranslation("_update_table_statistics"); |
39 | 41638 | jjdelcerro | } |
40 | |||
41 | 43920 | jjdelcerro | @Override
|
42 | 41638 | jjdelcerro | public boolean isValidPanel() throws ExporttoPanelValidationException { |
43 | 43920 | jjdelcerro | this.options.setUpdateTableStatistics(this.getUpdateTableStatistics()); |
44 | 41638 | jjdelcerro | return true; |
45 | } |
||
46 | |||
47 | 43920 | jjdelcerro | @Override
|
48 | 41638 | jjdelcerro | public void enterPanel() { |
49 | // Default do nothing
|
||
50 | } |
||
51 | |||
52 | 43920 | jjdelcerro | @Override
|
53 | 41638 | jjdelcerro | public JComponent asJComponent() { |
54 | return this; |
||
55 | } |
||
56 | |||
57 | public boolean getUpdateTableStatistics() { |
||
58 | return this.chkUpdateStatisticsTableAfterInserts.isSelected(); |
||
59 | } |
||
60 | } |