Переделка под DB
This commit is contained in:
BIN
libs/ini4j-0.5.4.jar
Normal file
BIN
libs/ini4j-0.5.4.jar
Normal file
Binary file not shown.
BIN
libs/postgresql-42.6.0.jar
Normal file
BIN
libs/postgresql-42.6.0.jar
Normal file
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@ -1,8 +1,8 @@
|
||||
build.xml.data.CRC32=d935f596
|
||||
build.xml.script.CRC32=b59ecd6a
|
||||
build.xml.stylesheet.CRC32=8064a381@1.68.1.46
|
||||
build.xml.stylesheet.CRC32=f85dc8f2@1.106.0.48
|
||||
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
|
||||
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
|
||||
nbproject/build-impl.xml.data.CRC32=d935f596
|
||||
nbproject/build-impl.xml.script.CRC32=da5956f2
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=830a3534@1.80.1.48
|
||||
nbproject/build-impl.xml.script.CRC32=da07b80d
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.106.0.48
|
||||
|
||||
0
nbproject/private/config.properties
Normal file
0
nbproject/private/config.properties
Normal file
@ -1,2 +1,8 @@
|
||||
compile.on.save=true
|
||||
user.properties.file=C:\\Users\\ivanov.i.ISTT\\AppData\\Roaming\\NetBeans\\8.2\\build.properties
|
||||
do.depend=false
|
||||
do.jar=true
|
||||
do.jlink=false
|
||||
javac.debug=true
|
||||
javadoc.preview=true
|
||||
jlink.strip=false
|
||||
user.properties.file=C:\\Users\\ivanov.i\\AppData\\Roaming\\NetBeans\\17\\build.properties
|
||||
|
||||
@ -2,6 +2,9 @@
|
||||
<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
|
||||
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
|
||||
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
|
||||
<group/>
|
||||
<group>
|
||||
<file>file:/O:/MyDocuments/projects/Workspace_JavaWin/GettextDB/src/potoxml/AssemblyJFrame.java</file>
|
||||
<file>file:/O:/MyDocuments/projects/Workspace_JavaWin/GettextDB/src/potoxml/NewJFrame.java</file>
|
||||
</group>
|
||||
</open-files>
|
||||
</project-private>
|
||||
|
||||
@ -1,9 +1,10 @@
|
||||
annotation.processing.enabled=true
|
||||
annotation.processing.enabled.in.editor=false
|
||||
annotation.processing.processor.options=
|
||||
annotation.processing.processors.list=
|
||||
annotation.processing.run.all.processors=true
|
||||
annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
|
||||
application.title=POTOXML_JavaSE
|
||||
application.vendor=ivanov.i
|
||||
build.classes.dir=${build.dir}/classes
|
||||
build.classes.excludes=**/*.java,**/*.form
|
||||
# This directory is removed when the project is cleaned:
|
||||
@ -18,31 +19,46 @@ build.test.results.dir=${build.dir}/test/results
|
||||
#debug.transport=dt_socket
|
||||
debug.classpath=\
|
||||
${run.classpath}
|
||||
debug.modulepath=\
|
||||
${run.modulepath}
|
||||
debug.test.classpath=\
|
||||
${run.test.classpath}
|
||||
debug.test.modulepath=\
|
||||
${run.test.modulepath}
|
||||
# This directory is removed when the project is cleaned:
|
||||
dist.dir=dist
|
||||
dist.jar=${dist.dir}/POTOXML_JavaSE.jar
|
||||
dist.javadoc.dir=${dist.dir}/javadoc
|
||||
endorsed.classpath=
|
||||
excludes=
|
||||
file.reference.ini4j-0.5.4.jar=O:\\projects\\Workspace_Java\\GettextDB\\libs\\ini4j-0.5.4.jar
|
||||
file.reference.postgresql-42.6.0.jar=O:\\projects\\Workspace_Java\\GettextDB\\libs\\postgresql-42.6.0.jar
|
||||
includes=**
|
||||
jar.compress=false
|
||||
javac.classpath=
|
||||
javac.classpath=\
|
||||
${file.reference.postgresql-42.6.0.jar}:\
|
||||
${file.reference.ini4j-0.5.4.jar}
|
||||
# Space-separated list of extra javac options
|
||||
javac.compilerargs=
|
||||
javac.deprecation=false
|
||||
javac.external.vm=false
|
||||
javac.modulepath=
|
||||
javac.processormodulepath=
|
||||
javac.processorpath=\
|
||||
${javac.classpath}
|
||||
javac.source=1.6
|
||||
javac.target=1.6
|
||||
javac.source=1.8
|
||||
javac.target=1.8
|
||||
javac.test.classpath=\
|
||||
${javac.classpath}:\
|
||||
${build.classes.dir}
|
||||
javac.test.modulepath=\
|
||||
${javac.modulepath}
|
||||
javac.test.processorpath=\
|
||||
${javac.test.classpath}
|
||||
javadoc.additionalparam=
|
||||
javadoc.author=false
|
||||
javadoc.encoding=${source.encoding}
|
||||
javadoc.html5=false
|
||||
javadoc.noindex=false
|
||||
javadoc.nonavbar=false
|
||||
javadoc.notree=false
|
||||
@ -51,6 +67,8 @@ javadoc.splitindex=true
|
||||
javadoc.use=true
|
||||
javadoc.version=false
|
||||
javadoc.windowtitle=
|
||||
jlink.launcher=false
|
||||
jlink.launcher.name=POTOXML_JavaSE
|
||||
main.class=potoxml.NewJFrame
|
||||
manifest.file=manifest.mf
|
||||
meta.inf.dir=${src.dir}/META-INF
|
||||
@ -63,9 +81,13 @@ run.classpath=\
|
||||
# You may also define separate properties like run-sys-prop.name=value instead of -Dname=value.
|
||||
# To set system properties for unit tests define test-sys-prop.name=value:
|
||||
run.jvmargs=
|
||||
run.modulepath=\
|
||||
${javac.modulepath}
|
||||
run.test.classpath=\
|
||||
${javac.test.classpath}:\
|
||||
${build.test.classes.dir}
|
||||
run.test.modulepath=\
|
||||
${javac.test.modulepath}
|
||||
source.encoding=UTF-8
|
||||
src.dir=src
|
||||
test.src.dir=test
|
||||
|
||||
2
settings.txt
Normal file
2
settings.txt
Normal file
@ -0,0 +1,2 @@
|
||||
O:\projects\Workspace_PHP\transit.istt.kz
|
||||
O:\temp\1.txt
|
||||
@ -8,6 +8,9 @@
|
||||
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
|
||||
<SyntheticProperty name="generateCenter" type="boolean" value="false"/>
|
||||
</SyntheticProperties>
|
||||
<Events>
|
||||
<EventHandler event="windowActivated" listener="java.awt.event.WindowListener" parameters="java.awt.event.WindowEvent" handler="formWindowActivated"/>
|
||||
</Events>
|
||||
<AuxValues>
|
||||
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
|
||||
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
|
||||
@ -23,29 +26,20 @@
|
||||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="textArea2" max="32767" attributes="0"/>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel2" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" max="-2" attributes="0">
|
||||
<Component id="jButton2" max="32767" attributes="0"/>
|
||||
<Component id="jButton3" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<Component id="textArea1" alignment="0" max="32767" attributes="0"/>
|
||||
<Component id="jButton1" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||
<Component id="jButton1" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Component id="jTabbedPane1" alignment="1" max="32767" attributes="0"/>
|
||||
<Group type="102" attributes="0">
|
||||
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<Component id="jPanel4" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
@ -54,22 +48,8 @@
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Group type="103" groupAlignment="1" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace min="-2" pref="24" max="-2" attributes="0"/>
|
||||
<Component id="jButton2" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jButton3" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
<Component id="textArea2" min="-2" pref="118" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="jPanel4" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace pref="71" max="32767" attributes="0"/>
|
||||
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="textArea1" min="-2" pref="143" max="-2" attributes="0"/>
|
||||
@ -83,45 +63,6 @@
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JButton" name="jButton1">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Сканировать"/>
|
||||
<Property name="name" type="java.lang.String" value="" noResource="true"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel1">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Перебираем файлы и создаём единый PHP файлик с _(“слово”)."/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="java.awt.TextArea" name="textArea1">
|
||||
</Component>
|
||||
<Component class="java.awt.TextArea" name="textArea2">
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="jButton2">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Сохранить настройки"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton2ActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel2">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Пути для сканирования"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="jButton3">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Экспорт"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton3ActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Container class="javax.swing.JTabbedPane" name="jTabbedPane1">
|
||||
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout"/>
|
||||
@ -187,8 +128,8 @@
|
||||
<Container class="javax.swing.JPanel" name="jPanel2">
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
|
||||
<JTabbedPaneConstraints tabName="Русский">
|
||||
<Property name="tabTitle" type="java.lang.String" value="Русский"/>
|
||||
<JTabbedPaneConstraints tabName="Настройки путей сканирования">
|
||||
<Property name="tabTitle" type="java.lang.String" value="Настройки путей сканирования"/>
|
||||
</JTabbedPaneConstraints>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
@ -196,16 +137,221 @@
|
||||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<EmptySpace min="0" pref="772" max="32767" attributes="0"/>
|
||||
<Component id="jScrollPane1" alignment="0" pref="772" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<EmptySpace min="0" pref="338" max="32767" attributes="0"/>
|
||||
<Component id="jScrollPane1" alignment="0" pref="338" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Container class="javax.swing.JScrollPane" name="jScrollPane1">
|
||||
<AuxValues>
|
||||
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
|
||||
</AuxValues>
|
||||
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JTable" name="jTable1">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor">
|
||||
<Table columnCount="4" rowCount="4">
|
||||
<Column editable="true" title="Файл/Путь" type="java.lang.String"/>
|
||||
<Column editable="true" title="Расширения файлов" type="java.lang.String"/>
|
||||
<Column editable="true" title="Шаблон поиска" type="java.lang.String"/>
|
||||
<Column editable="true" title="Шаблон проверки" type="java.lang.String"/>
|
||||
</Table>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Container class="javax.swing.JPanel" name="jPanel3">
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
|
||||
<JTabbedPaneConstraints tabName="Настройки соединения с базой">
|
||||
<Property name="tabTitle" type="java.lang.String" value="Настройки соединения с базой"/>
|
||||
</JTabbedPaneConstraints>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
|
||||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="jLabel4" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel5" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel6" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="jTFDBPassword" max="32767" attributes="0"/>
|
||||
<Component id="jTFDBUser" max="32767" attributes="0"/>
|
||||
<Component id="jTFDBURL" pref="647" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||
<Component id="jButton5" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="jTFDBURL" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="jTFDBUser" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="jTFDBPassword" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel6" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="jButton5" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace pref="222" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JLabel" name="jLabel4">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Строка соединения"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JTextField" name="jTFDBURL">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="jdbc:postgresql://10.1.7.74:5432/pilot"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel5">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Пользователь"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JTextField" name="jTFDBUser">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="translate"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel6">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Пароль"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JTextField" name="jTFDBPassword">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="translate"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="jButton5">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Проверить соединение"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Component class="javax.swing.JButton" name="jButton1">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Сканировать"/>
|
||||
<Property name="name" type="java.lang.String" value="" noResource="true"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel1">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Перебираем файлы и создаём единый PHP файлик с _(“слово”)."/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="java.awt.TextArea" name="textArea1">
|
||||
</Component>
|
||||
<Container class="javax.swing.JPanel" name="jPanel4">
|
||||
|
||||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="1" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||
<Component id="jBSaveSettings" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="202" max="-2" attributes="0"/>
|
||||
<Component id="jButton3" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<Component id="textArea2" alignment="0" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jButton3" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="textArea2" min="-2" pref="118" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="jBSaveSettings" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JLabel" name="jLabel2">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Пути для сканирования"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="jButton3">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Экспорт PO или XML файла"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton3ActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="java.awt.TextArea" name="textArea2">
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="jBSaveSettings">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Сохранить настройки"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jBSaveSettingsActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
</SubComponents>
|
||||
|
||||
@ -17,6 +17,11 @@ import java.util.List;
|
||||
import java.util.Stack;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import java.sql.Connection;
|
||||
import java.sql.DriverManager;
|
||||
import java.sql.SQLException;
|
||||
import javax.swing.table.DefaultTableModel;
|
||||
import org.ini4j.Ini;
|
||||
|
||||
/**
|
||||
*
|
||||
@ -60,45 +65,35 @@ public class NewJFrame extends javax.swing.JFrame
|
||||
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||
private void initComponents() {
|
||||
|
||||
jButton1 = new javax.swing.JButton();
|
||||
jLabel1 = new javax.swing.JLabel();
|
||||
textArea1 = new java.awt.TextArea();
|
||||
textArea2 = new java.awt.TextArea();
|
||||
jButton2 = new javax.swing.JButton();
|
||||
jLabel2 = new javax.swing.JLabel();
|
||||
jButton3 = new javax.swing.JButton();
|
||||
jTabbedPane1 = new javax.swing.JTabbedPane();
|
||||
jPanel1 = new javax.swing.JPanel();
|
||||
jTextField1 = new javax.swing.JTextField();
|
||||
jLabel3 = new javax.swing.JLabel();
|
||||
jButton4 = new javax.swing.JButton();
|
||||
jPanel2 = new javax.swing.JPanel();
|
||||
jScrollPane1 = new javax.swing.JScrollPane();
|
||||
jTable1 = new javax.swing.JTable();
|
||||
jPanel3 = new javax.swing.JPanel();
|
||||
jLabel4 = new javax.swing.JLabel();
|
||||
jTFDBURL = new javax.swing.JTextField();
|
||||
jLabel5 = new javax.swing.JLabel();
|
||||
jTFDBUser = new javax.swing.JTextField();
|
||||
jLabel6 = new javax.swing.JLabel();
|
||||
jTFDBPassword = new javax.swing.JTextField();
|
||||
jButton5 = new javax.swing.JButton();
|
||||
jButton1 = new javax.swing.JButton();
|
||||
jLabel1 = new javax.swing.JLabel();
|
||||
textArea1 = new java.awt.TextArea();
|
||||
jPanel4 = new javax.swing.JPanel();
|
||||
jLabel2 = new javax.swing.JLabel();
|
||||
jButton3 = new javax.swing.JButton();
|
||||
textArea2 = new java.awt.TextArea();
|
||||
jBSaveSettings = new javax.swing.JButton();
|
||||
|
||||
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
|
||||
|
||||
jButton1.setText("Сканировать");
|
||||
jButton1.setName(""); // NOI18N
|
||||
jButton1.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
jButton1ActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
jLabel1.setText("Перебираем файлы и создаём единый PHP файлик с _(“слово”).");
|
||||
|
||||
jButton2.setText("Сохранить настройки");
|
||||
jButton2.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
jButton2ActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
jLabel2.setText("Пути для сканирования");
|
||||
|
||||
jButton3.setText("Экспорт");
|
||||
jButton3.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
jButton3ActionPerformed(evt);
|
||||
addWindowListener(new java.awt.event.WindowAdapter() {
|
||||
public void windowActivated(java.awt.event.WindowEvent evt) {
|
||||
formWindowActivated(evt);
|
||||
}
|
||||
});
|
||||
|
||||
@ -139,18 +134,154 @@ public class NewJFrame extends javax.swing.JFrame
|
||||
|
||||
jTabbedPane1.addTab("English", jPanel1);
|
||||
|
||||
jTable1.setModel(new javax.swing.table.DefaultTableModel(
|
||||
new Object [][] {
|
||||
{null, null, null, null},
|
||||
{null, null, null, null},
|
||||
{null, null, null, null},
|
||||
{null, null, null, null}
|
||||
},
|
||||
new String [] {
|
||||
"Файл/Путь", "Расширения файлов", "Шаблон поиска", "Шаблон проверки"
|
||||
}
|
||||
) {
|
||||
Class[] types = new Class [] {
|
||||
java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class
|
||||
};
|
||||
|
||||
public Class getColumnClass(int columnIndex) {
|
||||
return types [columnIndex];
|
||||
}
|
||||
});
|
||||
jScrollPane1.setViewportView(jTable1);
|
||||
|
||||
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
|
||||
jPanel2.setLayout(jPanel2Layout);
|
||||
jPanel2Layout.setHorizontalGroup(
|
||||
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 772, Short.MAX_VALUE)
|
||||
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 772, Short.MAX_VALUE)
|
||||
);
|
||||
jPanel2Layout.setVerticalGroup(
|
||||
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 338, Short.MAX_VALUE)
|
||||
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 338, Short.MAX_VALUE)
|
||||
);
|
||||
|
||||
jTabbedPane1.addTab("Русский", jPanel2);
|
||||
jTabbedPane1.addTab("Настройки путей сканирования", jPanel2);
|
||||
|
||||
jLabel4.setText("Строка соединения");
|
||||
|
||||
jTFDBURL.setText("jdbc:postgresql://10.1.7.74:5432/pilot");
|
||||
|
||||
jLabel5.setText("Пользователь");
|
||||
|
||||
jTFDBUser.setText("translate");
|
||||
|
||||
jLabel6.setText("Пароль");
|
||||
|
||||
jTFDBPassword.setText("translate");
|
||||
|
||||
jButton5.setText("Проверить соединение");
|
||||
|
||||
javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
|
||||
jPanel3.setLayout(jPanel3Layout);
|
||||
jPanel3Layout.setHorizontalGroup(
|
||||
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel3Layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel3Layout.createSequentialGroup()
|
||||
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(jLabel4)
|
||||
.addComponent(jLabel5)
|
||||
.addComponent(jLabel6))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(jTFDBPassword)
|
||||
.addComponent(jTFDBUser)
|
||||
.addComponent(jTFDBURL, javax.swing.GroupLayout.DEFAULT_SIZE, 647, Short.MAX_VALUE)))
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
|
||||
.addGap(0, 0, Short.MAX_VALUE)
|
||||
.addComponent(jButton5)))
|
||||
.addContainerGap())
|
||||
);
|
||||
jPanel3Layout.setVerticalGroup(
|
||||
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel3Layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(jTFDBURL, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(jLabel4))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(jTFDBUser, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(jLabel5))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(jTFDBPassword, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(jLabel6))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(jButton5)
|
||||
.addContainerGap(222, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
jTabbedPane1.addTab("Настройки соединения с базой", jPanel3);
|
||||
|
||||
jButton1.setText("Сканировать");
|
||||
jButton1.setName(""); // NOI18N
|
||||
jButton1.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
jButton1ActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
jLabel1.setText("Перебираем файлы и создаём единый PHP файлик с _(“слово”).");
|
||||
|
||||
jLabel2.setText("Пути для сканирования");
|
||||
|
||||
jButton3.setText("Экспорт PO или XML файла");
|
||||
jButton3.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
jButton3ActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
jBSaveSettings.setText("Сохранить настройки");
|
||||
jBSaveSettings.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
jBSaveSettingsActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
|
||||
jPanel4.setLayout(jPanel4Layout);
|
||||
jPanel4Layout.setHorizontalGroup(
|
||||
jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addGroup(jPanel4Layout.createSequentialGroup()
|
||||
.addGap(0, 0, Short.MAX_VALUE)
|
||||
.addComponent(jBSaveSettings))
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel4Layout.createSequentialGroup()
|
||||
.addComponent(jLabel2)
|
||||
.addGap(202, 202, 202)
|
||||
.addComponent(jButton3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
.addComponent(textArea2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
.addContainerGap())
|
||||
);
|
||||
jPanel4Layout.setVerticalGroup(
|
||||
jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel4Layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(jLabel2)
|
||||
.addComponent(jButton3))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(textArea2, javax.swing.GroupLayout.PREFERRED_SIZE, 118, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(jBSaveSettings)
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
|
||||
getContentPane().setLayout(layout);
|
||||
@ -159,38 +290,22 @@ public class NewJFrame extends javax.swing.JFrame
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(textArea2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(jLabel1)
|
||||
.addComponent(jLabel2))
|
||||
.addGap(0, 0, Short.MAX_VALUE)))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
|
||||
.addComponent(jButton2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(jButton3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
|
||||
.addComponent(textArea1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(jButton1, javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(jTabbedPane1, javax.swing.GroupLayout.Alignment.TRAILING))
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||
.addGap(0, 0, Short.MAX_VALUE)
|
||||
.addComponent(jButton1))
|
||||
.addComponent(jTabbedPane1, javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addComponent(jLabel1)
|
||||
.addGap(0, 0, Short.MAX_VALUE))
|
||||
.addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
.addContainerGap())
|
||||
);
|
||||
layout.setVerticalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(24, 24, 24)
|
||||
.addComponent(jButton2))
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(jLabel2)
|
||||
.addComponent(jButton3))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(textArea2, javax.swing.GroupLayout.PREFERRED_SIZE, 118, javax.swing.GroupLayout.PREFERRED_SIZE)))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 71, Short.MAX_VALUE)
|
||||
.addComponent(jLabel1)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(textArea1, javax.swing.GroupLayout.PREFERRED_SIZE, 143, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
@ -216,7 +331,8 @@ public class NewJFrame extends javax.swing.JFrame
|
||||
bufferedWriter.write("<?\n");
|
||||
|
||||
List searchRes = null;
|
||||
searchRes = finder.findAll(rootDir,"(.*\\.as$)||(.*\\.mxml$)||(.*\\.xml$)");
|
||||
//searchRes = finder.findAll(rootDir,"(.*\\.as$)||(.*\\.mxml$)||(.*\\.xml$)");
|
||||
searchRes = finder.findAll(rootDir,"(.*\\.php$)||(.*\\.html$)||(.*\\.xml$)||(.*\\.js$)");
|
||||
|
||||
//выводим результаты
|
||||
for (int i = 0; i < searchRes.size(); i++)
|
||||
@ -242,20 +358,22 @@ public class NewJFrame extends javax.swing.JFrame
|
||||
int from=0;
|
||||
while(true) //Если несколько значений в строке
|
||||
{
|
||||
int s=line.indexOf("_(", from);
|
||||
if(s>=0)
|
||||
{
|
||||
from=s+2;
|
||||
int e=-1;
|
||||
if(line.charAt(s+2) == '"') { e=line.indexOf("\")", from); }
|
||||
if(line.charAt(s+2) == '\'') { e = line.indexOf("')", from); }
|
||||
if(e>=0)
|
||||
{
|
||||
textArea1.append(line.substring(s, e + 2)+";\n");
|
||||
bufferedWriter.write(" "+line.substring(s, e + 2)+";\n");
|
||||
from=e+2;
|
||||
}
|
||||
}else { break; }
|
||||
String pattern="trt(";
|
||||
//int s=line.indexOf("_(", from);
|
||||
int s=line.indexOf(pattern, from);
|
||||
if(s>=0)
|
||||
{
|
||||
from=s+pattern.length();
|
||||
int e=-1;
|
||||
if(line.charAt(s+pattern.length()) == '"') { e=line.indexOf("\")", from); }
|
||||
if(line.charAt(s+pattern.length()) == '\'') { e = line.indexOf("')", from); }
|
||||
if(e>=0)
|
||||
{
|
||||
textArea1.append(line.substring(s, e + 2)+";\n");
|
||||
bufferedWriter.write(" "+line.substring(s, e + 2)+";\n");
|
||||
from=e+2;
|
||||
}
|
||||
}else { break; }
|
||||
}
|
||||
}
|
||||
bufferedReader.close();
|
||||
@ -275,49 +393,69 @@ public class NewJFrame extends javax.swing.JFrame
|
||||
|
||||
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_jButton1ActionPerformed
|
||||
{//GEN-HEADEREND:event_jButton1ActionPerformed
|
||||
BufferedReader reader = new BufferedReader(new StringReader(textArea2.getText()));
|
||||
String line1;
|
||||
String line2;
|
||||
try
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
line1 = reader.readLine();
|
||||
line2 = reader.readLine();
|
||||
if(line1==null || line2 == null) break;
|
||||
//Парсим файлы и выписываем идентификаторы для перевода
|
||||
parse(line1, line2); //Перезаписывает файл
|
||||
}
|
||||
} catch (IOException ex)
|
||||
{
|
||||
Logger.getLogger(NewJFrame.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
//Подключаюсь к базе данных
|
||||
String url = jTFDBURL.getText(); //"jdbc:postgresql://10.1.7.74:5432/pilot";
|
||||
String user = jTFDBUser.getText(); //"translate";
|
||||
String password = jTFDBUser.getText(); //"translate";
|
||||
Connection conn = null;
|
||||
try {
|
||||
Class.forName("org.postgresql.Driver");
|
||||
conn = DriverManager.getConnection(url, user, password);
|
||||
System.out.println("Connected to the PostgreSQL server successfully.");
|
||||
}catch(ClassNotFoundException | SQLException e){
|
||||
System.out.println(e.getMessage());
|
||||
}
|
||||
|
||||
BufferedReader reader = new BufferedReader(new StringReader(textArea2.getText()));
|
||||
String line1;
|
||||
String line2;
|
||||
try
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
line1 = reader.readLine();
|
||||
line2 = reader.readLine();
|
||||
if(line1==null || line2 == null) break;
|
||||
//Парсим файлы и выписываем идентификаторы для перевода
|
||||
parse(line1, line2); //Перезаписывает файл
|
||||
}
|
||||
} catch (IOException ex)
|
||||
{
|
||||
Logger.getLogger(NewJFrame.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
|
||||
}//GEN-LAST:event_jButton1ActionPerformed
|
||||
|
||||
|
||||
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_jButton2ActionPerformed
|
||||
{//GEN-HEADEREND:event_jButton2ActionPerformed
|
||||
FileWriter fileWriter = null;
|
||||
try
|
||||
{
|
||||
fileWriter = new FileWriter("settings.txt");
|
||||
BufferedWriter bufferedWriter = new BufferedWriter(fileWriter);
|
||||
bufferedWriter.write(textArea2.getText());
|
||||
bufferedWriter.close();
|
||||
} catch (IOException ex)
|
||||
{
|
||||
Logger.getLogger(NewJFrame.class.getName()).log(Level.SEVERE, null, ex);
|
||||
} finally
|
||||
{
|
||||
try
|
||||
{
|
||||
fileWriter.close();
|
||||
} catch (IOException ex)
|
||||
{
|
||||
Logger.getLogger(NewJFrame.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
}
|
||||
}//GEN-LAST:event_jButton2ActionPerformed
|
||||
private void jBSaveSettingsActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_jBSaveSettingsActionPerformed
|
||||
{//GEN-HEADEREND:event_jBSaveSettingsActionPerformed
|
||||
FileWriter fileWriter = null;
|
||||
try
|
||||
{
|
||||
Ini ini = new Ini(new File("O:\\temp\\settings.ini"));
|
||||
ini.put("main", "db_url", jTFDBURL.getText());
|
||||
ini.put("main", "db_user", jTFDBUser.getText());
|
||||
ini.put("main", "db_password", jTFDBPassword.getText());
|
||||
ini.store();
|
||||
|
||||
fileWriter = new FileWriter("settings.txt");
|
||||
BufferedWriter bufferedWriter = new BufferedWriter(fileWriter);
|
||||
bufferedWriter.write(textArea2.getText());
|
||||
bufferedWriter.close();
|
||||
} catch (IOException ex)
|
||||
{
|
||||
Logger.getLogger(NewJFrame.class.getName()).log(Level.SEVERE, null, ex);
|
||||
} finally
|
||||
{
|
||||
try
|
||||
{
|
||||
fileWriter.close();
|
||||
} catch (IOException ex)
|
||||
{
|
||||
Logger.getLogger(NewJFrame.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
}
|
||||
}//GEN-LAST:event_jBSaveSettingsActionPerformed
|
||||
|
||||
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
|
||||
|
||||
@ -329,6 +467,35 @@ public class NewJFrame extends javax.swing.JFrame
|
||||
// TODO add your handling code here:
|
||||
}//GEN-LAST:event_jButton4ActionPerformed
|
||||
|
||||
private void formWindowActivated(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowActivated
|
||||
|
||||
try {
|
||||
File file = new File("O:\\temp\\settings.ini");
|
||||
if(file.exists()){
|
||||
Ini ini = new Ini(file);
|
||||
jTFDBURL.setText(ini.get("main", "db_url"));
|
||||
jTFDBUser.setText(ini.get("main", "db_user"));
|
||||
jTFDBPassword.setText(ini.get("main", "db_password"));
|
||||
|
||||
DefaultTableModel model = (DefaultTableModel) jTable1.getModel();
|
||||
for(int i=0;i<100;i++){
|
||||
if(ini.get("path"+i)!=null){
|
||||
String path = ini.get("path"+i, "path");
|
||||
String check = ini.get("path"+i, "check");
|
||||
String extensions = ini.get("path"+i, "extensions");
|
||||
model.addRow(new Object[]{path, extensions, check});
|
||||
|
||||
System.out.print(path);
|
||||
}
|
||||
}
|
||||
//ini.store();
|
||||
}
|
||||
} catch (IOException ex) {
|
||||
Logger.getLogger(NewJFrame.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
|
||||
}//GEN-LAST:event_formWindowActivated
|
||||
|
||||
/**
|
||||
* @param args the command line arguments
|
||||
*/
|
||||
@ -374,16 +541,27 @@ public class NewJFrame extends javax.swing.JFrame
|
||||
});
|
||||
}
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JButton jBSaveSettings;
|
||||
private javax.swing.JButton jButton1;
|
||||
private javax.swing.JButton jButton2;
|
||||
private javax.swing.JButton jButton3;
|
||||
private javax.swing.JButton jButton4;
|
||||
private javax.swing.JButton jButton5;
|
||||
private javax.swing.JLabel jLabel1;
|
||||
private javax.swing.JLabel jLabel2;
|
||||
private javax.swing.JLabel jLabel3;
|
||||
private javax.swing.JLabel jLabel4;
|
||||
private javax.swing.JLabel jLabel5;
|
||||
private javax.swing.JLabel jLabel6;
|
||||
private javax.swing.JPanel jPanel1;
|
||||
private javax.swing.JPanel jPanel2;
|
||||
private javax.swing.JPanel jPanel3;
|
||||
private javax.swing.JPanel jPanel4;
|
||||
private javax.swing.JScrollPane jScrollPane1;
|
||||
private javax.swing.JTextField jTFDBPassword;
|
||||
private javax.swing.JTextField jTFDBURL;
|
||||
private javax.swing.JTextField jTFDBUser;
|
||||
private javax.swing.JTabbedPane jTabbedPane1;
|
||||
private javax.swing.JTable jTable1;
|
||||
private javax.swing.JTextField jTextField1;
|
||||
private java.awt.TextArea textArea1;
|
||||
private java.awt.TextArea textArea2;
|
||||
|
||||
Reference in New Issue
Block a user