summaryrefslogtreecommitdiffstats
path: root/dozentenmodul/src/main/java/util/GuiManager.java
diff options
context:
space:
mode:
authorSimon Rettberg2015-03-06 18:30:38 +0100
committerSimon Rettberg2015-03-06 18:30:38 +0100
commit3231fee56ce50facd8483e7af4d7f9ff63c5bc38 (patch)
tree9d76b3aeb94ab560e518e3a55b051702761f5118 /dozentenmodul/src/main/java/util/GuiManager.java
parentMACHETE KILLT CODEZEILEN (diff)
downloadtutor-module-3231fee56ce50facd8483e7af4d7f9ff63c5bc38.tar.gz
tutor-module-3231fee56ce50facd8483e7af4d7f9ff63c5bc38.tar.xz
tutor-module-3231fee56ce50facd8483e7af4d7f9ff63c5bc38.zip
Aua, aua...
Diffstat (limited to 'dozentenmodul/src/main/java/util/GuiManager.java')
-rw-r--r--dozentenmodul/src/main/java/util/GuiManager.java19
1 files changed, 4 insertions, 15 deletions
diff --git a/dozentenmodul/src/main/java/util/GuiManager.java b/dozentenmodul/src/main/java/util/GuiManager.java
index 8710cef9..4b8b610e 100644
--- a/dozentenmodul/src/main/java/util/GuiManager.java
+++ b/dozentenmodul/src/main/java/util/GuiManager.java
@@ -23,7 +23,6 @@ import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.UIManager;
-import javax.swing.UnsupportedLookAndFeelException;
import javax.swing.plaf.basic.BasicInternalFrameUI;
import org.apache.log4j.Logger;
@@ -177,9 +176,9 @@ public abstract class GuiManager {
private static boolean addHelp() {
// let's see if we have a HELP_MESSAGE variable defined in
// the class of the currentFrame, if so we need to show it by pressing "Hilfe"
- String test = "";
+ final String helpMessage;
try {
- test = (String) (currentFrame.getClass().getDeclaredField("HELP_MESSAGE").get(currentFrame));
+ helpMessage = (String) (currentFrame.getClass().getDeclaredField("HELP_MESSAGE").get(currentFrame));
} catch (NoSuchFieldException e) {
// only this case if interesting for us,
// since we now we don't have a help message to show
@@ -187,7 +186,7 @@ public abstract class GuiManager {
} catch (IllegalArgumentException|IllegalAccessException|SecurityException e) {
LOGGER.error("Failed to check for 'HELP_MESSAGE' variable in '"
+ currentFrame.getClass() + "' class, see trace: " + e);
- // just do nothing
+ return false;
}
// print it for debugging purposes
// still here? means we have a HELP_MESSAGE to display
@@ -195,14 +194,6 @@ public abstract class GuiManager {
mnNewMenu_Info.addMouseListener(new MouseAdapter() {
@Override
public void mousePressed(MouseEvent arg0) {
- String helpMessage = null;
- try {
- helpMessage = (String) currentFrame.getClass().getField("HELP_MESSAGE").get(currentFrame);
- } catch (IllegalArgumentException | IllegalAccessException
- | NoSuchFieldException | SecurityException e) {
- LOGGER.error("Failed to check for 'HELP_MESSAGE' variable in '"
- + currentFrame.getClass() + "' class, see trace: " + e);
- }
JOptionPane.showMessageDialog(currentFrame, helpMessage != null ? helpMessage : "No help message.",
"Hilfe zu dieser Oberfläche", JOptionPane.INFORMATION_MESSAGE);
}
@@ -265,9 +256,7 @@ public abstract class GuiManager {
newFrame.getWidth(), newFrame.getHeight());
}
}
- /**
- *
- */
+
public static void openPopup(Component popup) {
if (!(popup instanceof JFrame)) {
LOGGER.error("Popup classes need to be JFrame, given a: " + popup.getClass().getName());