-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
110 changed files
with
7,109 additions
and
6,999 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
/target/ | ||
*/target/ | ||
*/dependency-reduced-pom.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,2 @@ | ||
eclipse.preferences.version=1 | ||
encoding//src/main/java=UTF-8 | ||
encoding//src/main/resources=UTF-8 | ||
encoding//src/test/java=UTF-8 | ||
encoding//src/test/resources=UTF-8 | ||
encoding/<project>=UTF-8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> | ||
<html> | ||
<head> | ||
<title>Overview</title> | ||
</head> | ||
<body> | ||
<span style="color: rgb(85, 85, 85); font-family: sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; background-color: rgb(255, 255, 255); display: inline ! important; float: none;"> | ||
AJlib is a simple java library with Swing widgets, utilities and other stuff.<br> | ||
<br> | ||
This library tries to simplify the development of Swing applications ... which is sometime a nightmare!<br> | ||
It contains the classes I developed during the <a href="https://www.yapbam.net">Yapbam project</a> in | ||
order to deal with the problems I encountered.<br> | ||
<br> | ||
The source code is available here: <a target="_top" href="https://github.com/fathzer/ajlib">https://github.com/fathzer/ajlib</a><br> | ||
For maven users, AJLib is also available in <a href="https://search.maven.org/artifact/com.fathzer/ajlib">Maven central</a>:<br> | ||
<html> | ||
<head> | ||
<title>Overview</title> | ||
</head> | ||
<body> | ||
<span style="color: rgb(85, 85, 85); font-family: sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; background-color: rgb(255, 255, 255); display: inline ! important; float: none;"> | ||
AJlib is a simple java library with Swing widgets, utilities and other stuff.<br> | ||
<br> | ||
This library tries to simplify the development of Swing applications ... which is sometime a nightmare!<br> | ||
It contains the classes I developed during the <a href="https://www.yapbam.net">Yapbam project</a> in | ||
order to deal with the problems I encountered.<br> | ||
<br> | ||
The source code is available here: <a target="_top" href="https://github.com/fathzer/ajlib">https://github.com/fathzer/ajlib</a><br> | ||
For maven users, AJLib is also available in <a href="https://search.maven.org/artifact/com.fathzer/ajlib">Maven central</a>:<br> | ||
<i><dependency><br> | ||
<groupId>com.fathzer</groupId><br> | ||
<artifactId>ajlib</artifactId><br> | ||
<version>0.3.16</version><br> | ||
<version>0.3.16</version><br> | ||
</dependency></i><br><br> | ||
|
||
It is released under Apache 2 License (information is available <a href="../LICENSE">there</a>). | ||
It requires Java 7+. | ||
It is released under Apache 2 License (information is available <a href="../LICENSE">there</a>). | ||
It requires Java 7+. | ||
</span> | ||
</body></html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>com.fathzer</groupId> | ||
<artifactId>ajlib-parent-pom</artifactId> | ||
<version>1.0.0</version> | ||
</parent> | ||
<artifactId>ajlib</artifactId> | ||
<version>0.3.16</version> | ||
|
||
<packaging>jar</packaging> | ||
|
||
<name>A-JLib</name> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>com.fathzer</groupId> | ||
<artifactId>jlocal</artifactId> | ||
<version>1.0.0</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>animal-sniffer-annotations</artifactId> | ||
<version>${animal-sniffer-version}</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
</dependencies> | ||
</project> |
98 changes: 49 additions & 49 deletions
98
...com/fathzer/soft/ajlib/swing/Browser.java → ...com/fathzer/soft/ajlib/swing/Browser.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,49 @@ | ||
package com.fathzer.soft.ajlib.swing; | ||
|
||
import java.awt.Component; | ||
import java.awt.Desktop; | ||
import java.awt.Toolkit; | ||
import java.awt.datatransfer.Clipboard; | ||
import java.awt.datatransfer.StringSelection; | ||
import java.io.IOException; | ||
import java.net.URI; | ||
|
||
import javax.swing.JOptionPane; | ||
|
||
import com.fathzer.jlocal.Formatter; | ||
import com.fathzer.soft.ajlib.swing.framework.Application; | ||
|
||
|
||
/** A class that is able to open a web browser to display an URI. | ||
*<br>The main advantage of this class is to display an alert dialog if java is not able to open the browser. | ||
*/ | ||
public abstract class Browser { | ||
private Browser() { | ||
//To prevent instance to be constructed | ||
} | ||
|
||
/** Displays an URI in a browser. | ||
* @param uri The uri to display | ||
* @param parent The parent component of the dialog displayed if browser is not available. | ||
* @param errorDialogTitle The title of the dialog displayed if browser is not available. | ||
*/ | ||
public static void show(URI uri, Component parent, String errorDialogTitle) { | ||
try { | ||
Desktop.getDesktop().browse(uri); | ||
} catch (IOException | UnsupportedOperationException e) { | ||
error(uri, parent, errorDialogTitle); | ||
} | ||
} | ||
|
||
private static void error(URI uri, Component parent, String errorDialogTitle) { | ||
String url = uri.toString(); | ||
String message = Formatter.format(Application.getString("Browser.unsupported.message", parent.getLocale()), url); //$NON-NLS-1$ | ||
StringSelection stringSelection = new StringSelection(url); | ||
Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); | ||
clipboard.setContents(stringSelection, null); | ||
if (errorDialogTitle == null) { | ||
errorDialogTitle = ""; | ||
} | ||
JOptionPane.showMessageDialog(Utils.getOwnerWindow(parent), message, errorDialogTitle, JOptionPane.WARNING_MESSAGE); //$NON-NLS-1$ | ||
} | ||
} | ||
package com.fathzer.soft.ajlib.swing; | ||
|
||
import java.awt.Component; | ||
import java.awt.Desktop; | ||
import java.awt.Toolkit; | ||
import java.awt.datatransfer.Clipboard; | ||
import java.awt.datatransfer.StringSelection; | ||
import java.io.IOException; | ||
import java.net.URI; | ||
|
||
import javax.swing.JOptionPane; | ||
|
||
import com.fathzer.jlocal.Formatter; | ||
import com.fathzer.soft.ajlib.swing.framework.Application; | ||
|
||
|
||
/** A class that is able to open a web browser to display an URI. | ||
*<br>The main advantage of this class is to display an alert dialog if java is not able to open the browser. | ||
*/ | ||
public abstract class Browser { | ||
private Browser() { | ||
//To prevent instance to be constructed | ||
} | ||
|
||
/** Displays an URI in a browser. | ||
* @param uri The uri to display | ||
* @param parent The parent component of the dialog displayed if browser is not available. | ||
* @param errorDialogTitle The title of the dialog displayed if browser is not available. | ||
*/ | ||
public static void show(URI uri, Component parent, String errorDialogTitle) { | ||
try { | ||
Desktop.getDesktop().browse(uri); | ||
} catch (IOException | UnsupportedOperationException e) { | ||
error(uri, parent, errorDialogTitle); | ||
} | ||
} | ||
|
||
private static void error(URI uri, Component parent, String errorDialogTitle) { | ||
String url = uri.toString(); | ||
String message = Formatter.format(Application.getString("Browser.unsupported.message", parent.getLocale()), url); //$NON-NLS-1$ | ||
StringSelection stringSelection = new StringSelection(url); | ||
Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); | ||
clipboard.setContents(stringSelection, null); | ||
if (errorDialogTitle == null) { | ||
errorDialogTitle = ""; | ||
} | ||
JOptionPane.showMessageDialog(Utils.getOwnerWindow(parent), message, errorDialogTitle, JOptionPane.WARNING_MESSAGE); //$NON-NLS-1$ | ||
} | ||
} |
Oops, something went wrong.