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 / export / jdbc / swing / panels / IdentifiersOptionsPanel.java @ 43968
History | View | Annotate | Download (3.11 KB)
1 | 41598 | jjdelcerro | /*
|
---|---|---|---|
2 | * To change this license header, choose License Headers in Project Properties.
|
||
3 | * To change this template file, choose Tools | Templates
|
||
4 | * and open the template in the editor.
|
||
5 | */
|
||
6 | |||
7 | 43925 | jjdelcerro | package org.gvsig.export.jdbc.swing.panels; |
8 | 41598 | jjdelcerro | |
9 | import javax.swing.JComponent; |
||
10 | 43925 | jjdelcerro | import org.gvsig.export.jdbc.service.ExportJDBCParameters; |
11 | import org.gvsig.export.swing.JExportProcessPanel; |
||
12 | import org.gvsig.export.swing.spi.ExportPanel; |
||
13 | import org.gvsig.export.swing.spi.ExportPanelValidationException; |
||
14 | 41598 | jjdelcerro | import org.gvsig.tools.ToolsLocator; |
15 | import org.gvsig.tools.i18n.I18nManager; |
||
16 | |||
17 | /**
|
||
18 | *
|
||
19 | * @author usuario
|
||
20 | */
|
||
21 | 43925 | jjdelcerro | public class IdentifiersOptionsPanel |
22 | extends IdentifiersOptionsPanelView
|
||
23 | implements ExportPanel
|
||
24 | { |
||
25 | 41598 | jjdelcerro | private static final long serialVersionUID = -6390855050271511346L; |
26 | |||
27 | 43925 | jjdelcerro | private final ExportJDBCParameters parameters; |
28 | private final JExportProcessPanel processPanel; |
||
29 | 41598 | jjdelcerro | |
30 | 43925 | jjdelcerro | public IdentifiersOptionsPanel(
|
31 | JExportProcessPanel processPanel, |
||
32 | ExportJDBCParameters parameters |
||
33 | ) { |
||
34 | this.processPanel = processPanel;
|
||
35 | this.parameters = parameters;
|
||
36 | 41598 | jjdelcerro | initComponents(); |
37 | } |
||
38 | |||
39 | private void initComponents() { |
||
40 | this.chkRemoveSpaces.setSelected(true); |
||
41 | this.chkTraslateToLowerCase.setSelected(true); |
||
42 | 41724 | jjdelcerro | |
43 | this.translate();
|
||
44 | 41598 | jjdelcerro | } |
45 | |||
46 | 41724 | jjdelcerro | private void translate() { |
47 | I18nManager i18nManager = ToolsLocator.getI18nManager(); |
||
48 | |||
49 | this.chkRemoveSpaces.setText(i18nManager.getTranslation("_Trasladar_espacios_a_guiones")); |
||
50 | this.chkTraslateToLowerCase.setText(i18nManager.getTranslation("_Trasladar_identificadores_a_minusculas")); |
||
51 | 43413 | jjdelcerro | this.chkTraslateHyphens.setText(i18nManager.getTranslation("_Trasladar_guiones_en_los_identificadores_a_guion_bajo")); |
52 | 41724 | jjdelcerro | this.lblHeader.setText("<html>"+i18nManager.getTranslation("_Table_and_fields_name_options_header")+"<html>"); |
53 | } |
||
54 | 43925 | jjdelcerro | |
55 | 43377 | jjdelcerro | @Override
|
56 | 43925 | jjdelcerro | public String getIdPanel() { |
57 | return this.getClass().getCanonicalName(); |
||
58 | } |
||
59 | |||
60 | @Override
|
||
61 | public String getTitlePanel() { |
||
62 | 41598 | jjdelcerro | I18nManager i18nManager = ToolsLocator.getI18nManager(); |
63 | return i18nManager.getTranslation("_Table_and_fields_name_options"); |
||
64 | } |
||
65 | |||
66 | 43377 | jjdelcerro | @Override
|
67 | 43968 | jjdelcerro | public void previousPanel() { |
68 | |||
69 | } |
||
70 | |||
71 | @Override
|
||
72 | public void nextPanel() { |
||
73 | 43925 | jjdelcerro | this.parameters.setRemoveSpacesInIdentifiers(this.chkRemoveSpaces.isSelected()); |
74 | this.parameters.setTranslateIdentifiersToLowerCase(this.chkTraslateToLowerCase.isSelected()); |
||
75 | this.parameters.setTranslateHyphens(this.chkTraslateHyphens.isSelected()); |
||
76 | 41598 | jjdelcerro | } |
77 | |||
78 | 43377 | jjdelcerro | @Override
|
79 | 43925 | jjdelcerro | public boolean validatePanel() throws ExportPanelValidationException { |
80 | return true; |
||
81 | } |
||
82 | |||
83 | @Override
|
||
84 | 41598 | jjdelcerro | public void enterPanel() { |
85 | |||
86 | } |
||
87 | |||
88 | 43377 | jjdelcerro | @Override
|
89 | 41598 | jjdelcerro | public JComponent asJComponent() { |
90 | return this; |
||
91 | } |
||
92 | |||
93 | public boolean getTranslateToLowerCase() { |
||
94 | return this.chkTraslateToLowerCase.isSelected(); |
||
95 | } |
||
96 | |||
97 | public boolean getRemoveSpacesInTableName() { |
||
98 | return this.chkRemoveSpaces.isSelected(); |
||
99 | } |
||
100 | 43377 | jjdelcerro | |
101 | public boolean getTranslateHyphens() { |
||
102 | return this.chkTraslateHyphens.isSelected(); |
||
103 | } |
||
104 | |||
105 | 41598 | jjdelcerro | } |