Skip to content

Commit

Permalink
Merge pull request #86 from bpangburn/4.0.4-SNAPSHOT
Browse files Browse the repository at this point in the history
  • Loading branch information
bpangburn authored Mar 24, 2021
2 parents 05244b5 + 6413a99 commit 5c70965
Show file tree
Hide file tree
Showing 11 changed files with 392 additions and 285 deletions.
44 changes: 34 additions & 10 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.nqadmin.swingset</groupId>
<artifactId>swingset-parent</artifactId>
<version>4.0.3</version>
<version>4.0.4-SNAPSHOT</version>
<packaging>pom</packaging>

<name>swingset-parent</name>
Expand All @@ -19,6 +19,10 @@
<version.java>1.8</version.java>

<version.maven-enforcer-plugin>3.0.0-M3</version.maven-enforcer-plugin>
<version.maven-clean-plugin>3.1.0</version.maven-clean-plugin>
<version.maven-deploy-plugin>3.0.0-M1</version.maven-deploy-plugin>
<version.maven-install-plugin>3.0.0-M1</version.maven-install-plugin>
<version.maven-site-plugin>3.9.1</version.maven-site-plugin>
</properties>

<build>
Expand All @@ -35,18 +39,17 @@
</goals>
<configuration>
<rules>
<bannedPlugins>
<!-- will only display a warning but does not fail the build. -->
<level>WARN</level>
<excludes>
<exclude>org.apache.maven.plugins:maven-verifier-plugin</exclude>
</excludes>
<message>Please consider using the maven-invoker-plugin
(http://maven.apache.org/plugins/maven-invoker-plugin/)!</message>
</bannedPlugins>
<requirePluginVersions>
<message>Best Practice is to always define plugin versions!</message>
<banLatest>true</banLatest>
<banRelease>true</banRelease>
<banSnapshots>true</banSnapshots>
</requirePluginVersions>

<requireMavenVersion>
<version>${version.maven}</version>
</requireMavenVersion>

<requireJavaVersion>
<version>${version.java}</version>
</requireJavaVersion>
Expand All @@ -55,6 +58,27 @@
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>${version.maven-clean-plugin}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>${version.maven-deploy-plugin}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>${version.maven-install-plugin}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>${version.maven-site-plugin}</version>
</plugin>
</plugins>
</build>

Expand Down
67 changes: 55 additions & 12 deletions swingset-demo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<groupId>com.nqadmin.swingset.demo</groupId>
<artifactId>swingset-demo</artifactId>
<version>4.0.3</version>
<version>4.0.4-SNAPSHOT</version>
<packaging>jar</packaging>

<name>swingset-demo</name>
Expand All @@ -21,12 +21,20 @@
<version.maven>3.6.3</version.maven>
<version.java>1.8</version.java>

<version.log4j>2.14.0</version.log4j>
<version.swingset>4.0.3</version.swingset>
<version.log4j>2.14.1</version.log4j>
<version.swingset>4.0.4-SNAPSHOT</version.swingset>
<version.h2>1.4.200</version.h2>
<version.java-getopt>1.0.13</version.java-getopt>

<version.maven-enforcer-plugin>3.0.0-M3</version.maven-enforcer-plugin>
<version.maven-clean-plugin>3.1.0</version.maven-clean-plugin>
<version.maven-deploy-plugin>3.0.0-M1</version.maven-deploy-plugin>
<version.maven-install-plugin>3.0.0-M1</version.maven-install-plugin>
<version.maven-jar-plugin>3.2.0</version.maven-jar-plugin>
<version.maven-resources-plugin>3.2.0</version.maven-resources-plugin>
<version.maven-site-plugin>3.9.1</version.maven-site-plugin>
<version.maven-surefire-plugin>3.0.0-M5</version.maven-surefire-plugin>

<version.maven-compiler-plugin>3.8.1</version.maven-compiler-plugin>
<version.dependency-check-maven>6.1.1</version.dependency-check-maven>
<version.maven-source-plugin>3.2.1</version.maven-source-plugin>
Expand Down Expand Up @@ -108,18 +116,17 @@
</goals>
<configuration>
<rules>
<bannedPlugins>
<!-- will only display a warning but does not fail the build. -->
<level>WARN</level>
<excludes>
<exclude>org.apache.maven.plugins:maven-verifier-plugin</exclude>
</excludes>
<message>Please consider using the maven-invoker-plugin
(http://maven.apache.org/plugins/maven-invoker-plugin/)!</message>
</bannedPlugins>
<requirePluginVersions>
<message>Best Practice is to always define plugin versions!</message>
<banLatest>true</banLatest>
<banRelease>true</banRelease>
<banSnapshots>true</banSnapshots>
</requirePluginVersions>

<requireMavenVersion>
<version>${version.maven}</version>
</requireMavenVersion>

<requireJavaVersion>
<version>${version.java}</version>
</requireJavaVersion>
Expand All @@ -128,6 +135,42 @@
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>${version.maven-clean-plugin}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>${version.maven-deploy-plugin}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>${version.maven-install-plugin}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>${version.maven-jar-plugin}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>${version.maven-resources-plugin}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>${version.maven-site-plugin}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${version.maven-surefire-plugin}</version>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,16 @@
import java.awt.Container;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Arrays;

import javax.swing.JLabel;
import javax.swing.JMenuBar;
import javax.swing.JOptionPane;
import javax.swing.SwingUtilities;
import javax.swing.plaf.InternalFrameUI;
import javax.swing.plaf.basic.BasicInternalFrameUI;

Expand Down Expand Up @@ -179,9 +182,27 @@ protected void addComponents() throws Exception {
contentPane.add(getDataNavigator(), constraints);
}

/** {@inheritDoc} */
@Override
protected void addCustomListeners() throws Exception {
// nothing to do..
protected void addCustomListeners() {

txtPartName.addFocusListener(new FocusAdapter() {
String oldValue = new String("");

@Override
public void focusGained(FocusEvent fe) {
oldValue = txtPartName.getText();
}

@Override
public void focusLost(FocusEvent fe) {
if (!txtPartName.getText().equals(oldValue)) {
logger.debug("txtPartName triggering update to combo navigator.");
SwingUtilities.invokeLater(() -> updateNavigatorText());
}
}

});
}

@Override// /**
Expand Down Expand Up @@ -291,4 +312,38 @@ public void setUI(InternalFrameUI _ui) {
protected void updateSSDBComboBoxes() {
// nothing to do...
}

/**
* Updates the Combo Navigator based on the current screen values - used after
* editing a component field
*/
private void updateNavigatorText() {

try {
if (getRowset().getRow() > 0) {

long partID = getRowset().getLong("part_id");

getSyncManager().async();

final String update = txtPartName.getText();

// logger.debug("Running on EDT? " + SwingUtilities.isEventDispatchThread());
// logger.debug("Attempting to update combo navigator Option to: " + update);

getComboNav().updateOption(partID, update);

// logger.debug("Combo navigator Option after call to getComboNav().updateOption(): " + getComboNav().getSelectedOption());

getSyncManager().sync();

}

} catch (SQLException _se) {
logger.error("Error occured updating Combo Navigator text.",_se);
JOptionPane.showMessageDialog(getRootFrame(),
"Error occured updating Combo Navigator text.\n" + _se.getMessage());
}

}
}
6 changes: 3 additions & 3 deletions swingset-demo/src/main/resources/log4j2.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="INFO">
<Configuration status="DEBUG">
<Appenders>
<Console name="ConsoleAppender" target="SYSTEM_OUT">
<PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36}.%M() - %msg%n" />
<PatternLayout pattern="%d{HH:mm:ss} [%t] %-5level %logger{36}.%M() - %msg%n" />
</Console>
<File name="FileAppender" fileName="./log/swingset-demo-${date:yyyyMMdd}.log" immediateFlush="false" append="true">
<PatternLayout pattern="%d{yyy-MM-dd HH:mm:ss.SSS} [%t] %-5level %logger{36}.%M() - %msg%n"/>
</File>
</Appenders>
<Loggers>
<Root level="warn">
<Root level="DEBUG">
<AppenderRef ref="ConsoleAppender" />
<AppenderRef ref="FileAppender"/>
</Root>
Expand Down
20 changes: 20 additions & 0 deletions swingset/CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,26 @@
ChangeLog file for the SwingSet Open Toolkit for Java Swing.
==============================================================================

==============================================================================
SwingSet 4.0.4 - Released TBD
==============================================================================

Changes:
1. SSBaseComboBox.updateOption() - Combo editor was not updating
consistently. See https://github.com/bpangburn/swingset/issues/85
2. Updated Log4j and JUnit Maven dependencies.
3. Added explicit Maven plugins versions in POMs to eliminate warnings.
4. Initial fix for Issue #46 moving updateSSComponent out of SSComboBox
and SSDBComboBox.
5. SSTableKeyAdapter - Updated getObjectToSet method to use Date.valueOf
for converting string to date object. See:
https://github.com/bpangburn/swingset/issues/89
6. SSSyncManager - Calling updatePresentRow() on SSDataNavigator in the
combo ActionListener only when a row navigation is needed.
7. Demo: Logging level set to DEBUG by default.
8. Demo: Example4UsingHelper - update combo navigator dynamically when
Part Name is modified.

==============================================================================
SwingSet 4.0.3 - Released 2021-02-22
==============================================================================
Expand Down
Loading

0 comments on commit 5c70965

Please sign in to comment.