made statusbar clickable
This commit is contained in:
2
pom.xml
2
pom.xml
@@ -4,7 +4,7 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>BelegScanner</groupId>
|
<groupId>BelegScanner</groupId>
|
||||||
<artifactId>BelegScanner</artifactId>
|
<artifactId>BelegScanner</artifactId>
|
||||||
<version>1.0.8</version>
|
<version>1.0.9</version>
|
||||||
|
|
||||||
<name>BelegScanner</name>
|
<name>BelegScanner</name>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ Actions : Aktionen
|
|||||||
Apps missing : Anwendungen fehlen
|
Apps missing : Anwendungen fehlen
|
||||||
Category : Kategorie
|
Category : Kategorie
|
||||||
CATEGORY : KATEGORIE
|
CATEGORY : KATEGORIE
|
||||||
|
Click here to open directory : Hier klicken, um das Verzeichnis zu öffnen
|
||||||
Conversion failed. : Konvertierung fehlgeschlagen.
|
Conversion failed. : Konvertierung fehlgeschlagen.
|
||||||
Converting to PDF… : Kovertiere zu PDF…
|
Converting to PDF… : Kovertiere zu PDF…
|
||||||
current resolution : aktuelle Auflösung
|
current resolution : aktuelle Auflösung
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
package de.srsoftware.belegscanner.gui;
|
package de.srsoftware.belegscanner.gui;
|
||||||
|
|
||||||
|
import java.awt.Desktop;
|
||||||
|
import java.awt.event.MouseAdapter;
|
||||||
|
import java.awt.event.MouseEvent;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
import javax.swing.BoxLayout;
|
import javax.swing.BoxLayout;
|
||||||
import javax.swing.JLabel;
|
import javax.swing.JLabel;
|
||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
@@ -8,6 +14,8 @@ import javax.swing.border.EmptyBorder;
|
|||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import de.srsoftware.belegscanner.Application;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Simple status barwith updateable text.
|
* Simple status barwith updateable text.
|
||||||
* This class may be extended to show more status information.
|
* This class may be extended to show more status information.
|
||||||
@@ -25,6 +33,22 @@ public class StatusBar extends JPanel {
|
|||||||
setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
|
setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
|
||||||
add(path = new JLabel("Kein Pfad gewält."));
|
add(path = new JLabel("Kein Pfad gewält."));
|
||||||
path.setBorder(new EmptyBorder(5,5,5,5));
|
path.setBorder(new EmptyBorder(5,5,5,5));
|
||||||
|
path.setToolTipText(Application.t("Click here to open directory"));
|
||||||
|
path.addMouseListener(new MouseAdapter() {
|
||||||
|
@Override
|
||||||
|
public void mouseClicked(MouseEvent e) {
|
||||||
|
openDir();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void openDir() {
|
||||||
|
try {
|
||||||
|
File dir = new File(path.getText());
|
||||||
|
if (dir.exists()) Desktop.getDesktop().open(dir);
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public StatusBar setPath(String path) {
|
public StatusBar setPath(String path) {
|
||||||
|
|||||||
Reference in New Issue
Block a user