-
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.
Merge pull request #68 from mkacct/gui
Further improvements to GUI
- Loading branch information
Showing
8 changed files
with
328 additions
and
158 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
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,32 @@ | ||
package general; | ||
|
||
import java.io.IOException; | ||
import java.io.InputStream; | ||
import java.util.Properties; | ||
|
||
public final class ProductInfo { | ||
public static final String NAME = "Linter"; | ||
public static final String VERSION = "UNRELEASED"; | ||
private static final String PRODUCT_INFO_RES_PATH = "/product-info.properties"; | ||
|
||
private static final ProductInfoReader READER = new ProductInfoReader(); | ||
|
||
public static String getName() {return READER.getProperty("name");} | ||
public static String getVersion() {return READER.getProperty("version");} | ||
|
||
private static final class ProductInfoReader { | ||
private final Properties properties; | ||
|
||
private ProductInfoReader() { | ||
InputStream inputStream = this.getClass().getResourceAsStream(PRODUCT_INFO_RES_PATH); | ||
this.properties = new Properties(); | ||
try { | ||
this.properties.load(inputStream); | ||
} catch (IOException ex) { | ||
throw new RuntimeException(ex); | ||
} | ||
} | ||
|
||
public String getProperty(String key) { | ||
return this.properties.getProperty(key); | ||
} | ||
} | ||
} |
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
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
Oops, something went wrong.