Skip to content

Commit 02e01dd

Browse files
committed
prepare to first release
1 parent a99066e commit 02e01dd

File tree

3 files changed

+53
-30
lines changed

3 files changed

+53
-30
lines changed

pom.xml

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,17 @@
66

77
<groupId>me.vzhilin</groupId>
88
<artifactId>db-tree-view-fx</artifactId>
9-
<version>1.0-SNAPSHOT</version>
9+
<version>0.0.1-SNAPSHOT</version>
1010

1111
<properties>
1212
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
13-
<maven.compiler.release>11</maven.compiler.release>
14-
<javafx.version>11</javafx.version>
13+
<maven.compiler.release>13</maven.compiler.release>
14+
<javafx.version>13</javafx.version>
1515
<antlr4.visitor>true</antlr4.visitor>
1616
<antlr4.listener>true</antlr4.listener>
1717
<antlr4.version>4.7</antlr4.version>
1818
</properties>
1919

20-
<repositories>
21-
<repository>
22-
<id>boundless</id>
23-
<name>Boundless Repository</name>
24-
<url>https://repo.boundlessgeo.com/main/</url>
25-
</repository>
26-
</repositories>
2720
<dependencies>
2821
<dependency>
2922
<groupId>org.openjfx</groupId>
@@ -38,7 +31,7 @@
3831
<dependency>
3932
<groupId>com.github.javakeyring</groupId>
4033
<artifactId>java-keyring</artifactId>
41-
<version>1.0.0</version>
34+
<version>1.0.1</version>
4235
</dependency>
4336
<dependency>
4437
<groupId>com.google.guava</groupId>
@@ -48,7 +41,7 @@
4841
<dependency>
4942
<groupId>me.vzhilin</groupId>
5043
<artifactId>db-row</artifactId>
51-
<version>1.0-SNAPSHOT</version>
44+
<version>0.0.1-SNAPSHOT</version>
5245
</dependency>
5346
<dependency>
5447
<groupId>org.antlr</groupId>
@@ -71,11 +64,6 @@
7164
<artifactId>commons-dbcp2</artifactId>
7265
<version>2.7.0</version>
7366
</dependency>
74-
<dependency>
75-
<groupId>com.oracle.jdbc</groupId>
76-
<artifactId>ojdbc6</artifactId>
77-
<version>11.1.0.6.0</version>
78-
</dependency>
7967
<dependency>
8068
<groupId>log4j</groupId>
8169
<artifactId>log4j</artifactId>
@@ -101,6 +89,11 @@
10189
</resource>
10290
</resources>
10391
<plugins>
92+
<plugin>
93+
<groupId>org.apache.maven.plugins</groupId>
94+
<artifactId>maven-resources-plugin</artifactId>
95+
<version>3.1.0</version>
96+
</plugin>
10497
<plugin>
10598
<groupId>org.openjfx</groupId>
10699
<artifactId>javafx-maven-plugin</artifactId>
@@ -150,6 +143,7 @@
150143
<version>${antlr4.version}</version>
151144
<executions>
152145
<execution>
146+
<phase>generate-sources</phase>
153147
<goals>
154148
<goal>antlr4</goal>
155149
</goals>
@@ -159,7 +153,7 @@
159153
<plugin>
160154
<groupId>org.apache.maven.plugins</groupId>
161155
<artifactId>maven-shade-plugin</artifactId>
162-
<version>3.2.0</version>
156+
<version>3.2.1</version>
163157
<executions>
164158
<execution>
165159
<phase>package</phase>
@@ -169,7 +163,7 @@
169163
<configuration>
170164
<shadedArtifactAttached>true</shadedArtifactAttached>
171165
<shadedClassifierName>project-classifier</shadedClassifierName>
172-
<outputFile>shade\${project.artifactId}.jar</outputFile>
166+
<outputFile>target\shade\${project.artifactId}.jar</outputFile>
173167
<transformers>
174168
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
175169
<mainClass>me.vzhilin.dbtree.MainWindowApp</mainClass>
@@ -180,6 +174,16 @@
180174
<exclude>org.openjfx:*</exclude>
181175
</excludes>
182176
</artifactSet>
177+
<filters>
178+
<filter>
179+
<artifact>*:*</artifact>
180+
<excludes>
181+
<exclude>META-INF/*.SF</exclude>
182+
<exclude>META-INF/*.DSA</exclude>
183+
<exclude>META-INF/*.RSA</exclude>
184+
</excludes>
185+
</filter>
186+
</filters>
183187
</configuration>
184188
</execution>
185189
</executions>

src/main/java/me/vzhilin/dbtree/ui/settings/ConnectionSettingsController.java

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ public Thread newThread(Runnable r) {
8181
}
8282
});
8383

84+
private DbContext localContext;
85+
8486
private DbContext getContext() {
8587
try {
8688
String driver = driverClass.getValue();
@@ -102,8 +104,28 @@ private void initialize() {
102104
ObservableList<String> driverList =
103105
FXCollections.observableArrayList("oracle.jdbc.OracleDriver", "org.postgresql.Driver", "org.mariadb.jdbc.Driver");
104106
driverClass.setItems(driverList);
105-
initTemplateTable();
106-
initLookupTree();
107+
108+
lookupTreeView.setPlaceholder(new ProgressIndicator());
109+
templateTable.setPlaceholder(new ProgressIndicator());
110+
111+
executor.execute(new Runnable() {
112+
DbContext dbContext = null;
113+
114+
@Override
115+
public void run() {
116+
try {
117+
dbContext = getContext();
118+
} finally {
119+
Platform.runLater(() -> {
120+
localContext = dbContext;
121+
lookupTreeView.setPlaceholder(new Label());
122+
templateTable.setPlaceholder(new Label());
123+
initTemplateTable();
124+
initLookupTree();
125+
});
126+
}
127+
}
128+
});
107129
}
108130

109131
private void initLookupTree() {
@@ -204,6 +226,7 @@ private void onTestButton() {
204226
testMessageLabel.setTextFill(Color.DARKGREEN);
205227
testMessageLabel.setText("OK");
206228

229+
localContext = ctx;
207230
Set<Table> allTables = new HashSet<>();
208231
Catalog catalog = ctx.getCatalog();
209232
catalog.forEachTable(allTables::add);
@@ -461,15 +484,14 @@ public void startEdit() {
461484
}
462485

463486
private void bindTextField() {
464-
DbContext context = getContext();
465-
if (context != null) {
487+
if (localContext != null) {
466488
textField = new TextField();
467489
textField.setOnAction(e -> cancelEdit());
468490

469-
Template template = (Template) getTableRow().getItem();
491+
Template template = getTableRow().getItem();
470492
textField.textProperty().bindBidirectional(template.templateProperty());
471493

472-
Catalog catalog = context.getCatalog();
494+
Catalog catalog = localContext.getCatalog();
473495
Table table = catalog.getSchema(template.getSchemaName()).getTable(template.getTableName());
474496
DbSuggestionProvider kcaProvider = new DbSuggestionProvider(table);
475497
autoCompletion = new AutoCompletion(kcaProvider, textField);
@@ -515,8 +537,8 @@ private void setTextForItem(TemplateCell item) {
515537

516538
String tableName = item.getTable();
517539
String schemaName = item.getSchema();
518-
if (getContext() != null) {
519-
Catalog catalog = getContext().getCatalog();
540+
if (localContext != null) {
541+
Catalog catalog = localContext.getCatalog();
520542
Table table = catalog.getSchema(schemaName).getTable(tableName);
521543
if (table != null) {
522544
ParsedTemplate exp = parse(table, item.getText());

src/main/java/module-info.java renamed to src/main/java/module-info.java_

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
module hellofx {
2-
requires javafx.base;
3-
requires javafx.controls;
4-
requires javafx.fxml;
52
requires java.sql;
63
requires dbrow;
74
requires commons.dbcp2;

0 commit comments

Comments
 (0)