Skip to content
This repository has been archived by the owner on Mar 15, 2023. It is now read-only.

Commit

Permalink
Fixed some issues for Linux systems and bumped version.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacob van Mourik committed Nov 15, 2015
1 parent 2a1f3fe commit 0369c10
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 9 deletions.
6 changes: 5 additions & 1 deletion .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry including="**/*.java" kind="src" path="src/main/resources"/>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.jvms</groupId>
<artifactId>i18n-editor</artifactId>
<version>0.3.0</version>
<version>0.3.1</version>
<dependencies>
<dependency>
<groupId>org.apache.commons</groupId>
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/jvms/i18neditor/Editor.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public class Editor extends JFrame {

public static final Path SETTINGS_PATH = Paths.get(System.getProperty("user.home"), ".i18n-editor");
public static final String TITLE = "i18n Editor";
public static final String VERSION = "0.3.0";
public static final String VERSION = "0.3.1";
public static final int DEFAULT_WIDTH = 1024;
public static final int DEFAULT_HEIGHT = 768;

Expand Down Expand Up @@ -352,7 +352,7 @@ public boolean closeCurrentSession() {
}

public void launch() {
settings.load(Editor.SETTINGS_PATH);
settings.load(SETTINGS_PATH);

// Try to load previously loaded resources
List<String> dirs = settings.getListProperty("history");
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/com/jvms/i18neditor/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

import javax.swing.UIManager;

import org.apache.commons.lang3.SystemUtils;

/**
* The main entry class of the program.
*
Expand All @@ -19,7 +21,9 @@ public static void main(String[] args) {

private static void setupLookAndFeel() {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
if (!SystemUtils.IS_OS_LINUX) {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
}
} catch (Exception e) {
//
}
Expand Down
18 changes: 14 additions & 4 deletions src/main/java/com/jvms/i18neditor/TranslationTree.java
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,8 @@ private void duplicateNodeByKey(String key, String newKey, boolean keepOld) {
}

private class TranslationTreeMouseListener extends MouseAdapter {
@Override
public void mouseReleased(MouseEvent e) {
if (!e.isPopupTrigger() || !isEditable()) return;
TreePath path = getPathForLocation(e.getX(), e.getY());
private void showPopupMenu(MouseEvent e) {
TreePath path = getPathForLocation(e.getX(), e.getY());
if (path == null) {
setSelectionPath(null);
TranslationTreeMenu menu = new TranslationTreeMenu(editor, TranslationTree.this);
Expand All @@ -187,6 +185,18 @@ public void mouseReleased(MouseEvent e) {
TranslationTreeNodeMenu menu = new TranslationTreeNodeMenu(editor, node);
menu.show(e.getComponent(), e.getX(), e.getY());
}
}

@Override
public void mouseReleased(MouseEvent e) {
if (!e.isPopupTrigger() || !isEditable()) return;
showPopupMenu(e);
}

@Override
public void mousePressed(MouseEvent e) {
if (!e.isPopupTrigger() || !isEditable()) return;
showPopupMenu(e);
}
}
}

0 comments on commit 0369c10

Please sign in to comment.