summaryrefslogtreecommitdiff
path: root/BKUCommonGUI/src/main/java/at/gv/egiz
diff options
context:
space:
mode:
Diffstat (limited to 'BKUCommonGUI/src/main/java/at/gv/egiz')
-rw-r--r--BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/AbstractHelpListener.java5
-rw-r--r--BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIImpl.java7
-rw-r--r--BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/DefaultHelpListener.java8
-rw-r--r--BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HelpViewer.java43
4 files changed, 34 insertions, 29 deletions
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/AbstractHelpListener.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/AbstractHelpListener.java
index f46f5227..b871263e 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/AbstractHelpListener.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/AbstractHelpListener.java
@@ -30,6 +30,9 @@ import org.apache.commons.logging.LogFactory;
* This class does not keep a GUI reference and subclasses should not interfere with the GUI.
* Therefore, any errors occurring in showDocument() should be handled/displayed within
* showDocument() and exceptions thrown from showDocument() are logged, not displayed in the GUI.
+ * <br/>
+ * The help URL is build as [baseURL]/[locale]/[helpTopic].html
+ * (note that no session information is contained).
*
* @author Clemens Orthacker <clemens.orthacker@iaik.tugraz.at>
*/
@@ -41,7 +44,7 @@ public abstract class AbstractHelpListener implements ActionListener {
protected ResourceBundle messages;
public AbstractHelpListener(URL baseURL, Locale locale) {
- if (baseURL == null || "".equals(baseURL)) {
+ if (baseURL == null || "".equals(baseURL.toString())) {
throw new RuntimeException("no help URL provided");
}
this.baseURL = baseURL;
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIImpl.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIImpl.java
index c786a291..d61c9a03 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIImpl.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIImpl.java
@@ -58,9 +58,6 @@ import javax.swing.ListSelectionModel;
import javax.swing.SwingUtilities;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
-import javax.swing.table.TableCellRenderer;
-import javax.swing.table.TableColumn;
-import javax.swing.table.TableModel;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -117,7 +114,9 @@ public class BKUGUIImpl implements BKUGUIFacade {
this.contentPane = contentPane;
if (locale != null) {
- messages = ResourceBundle.getBundle(MESSAGES_BUNDLE, locale);
+ Locale lang = new Locale(locale.getLanguage().substring(0,2));
+ log.debug("loading applet resources for language: " + lang.toString());
+ messages = ResourceBundle.getBundle(MESSAGES_BUNDLE, lang);
} else {
messages = ResourceBundle.getBundle(MESSAGES_BUNDLE);
}
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/DefaultHelpListener.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/DefaultHelpListener.java
index 3c8c7d6c..c8594fe1 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/DefaultHelpListener.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/DefaultHelpListener.java
@@ -57,10 +57,10 @@ public class DefaultHelpListener extends AbstractHelpListener {
/**
* blocks until help viewer returns (is closed)
* @param helpURL
- * @param helpTopic
+ * @param helpTopic ignored
*/
@Override
- public void showDocument(final URL helpURL, final String helpTopic) {
+ public void showDocument(final URL helpURL, final String helpTopic) {
// try {
log.debug("schedule help dialog");
@@ -72,9 +72,9 @@ public class DefaultHelpListener extends AbstractHelpListener {
log.debug("show help dialog");
if (ctx == null) {
- HelpViewer.showHelpDialog(helpURL, helpTopic, messages);
+ HelpViewer.showHelpDialog(helpURL, messages); // helpTopic, messages);
} else {
- HelpViewer.showHelpDialog(ctx, helpURL, helpTopic, messages);
+ HelpViewer.showHelpDialog(ctx, helpURL, messages); //helpTopic, messages);
}
}
});
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HelpViewer.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HelpViewer.java
index 0fef3f75..364da6ec 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HelpViewer.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HelpViewer.java
@@ -32,7 +32,6 @@ import javax.swing.GroupLayout;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JEditorPane;
-import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
@@ -64,45 +63,44 @@ public class HelpViewer extends JDialog
*/
public static void showHelpDialog(AppletContext ctx,
URL helpURL,
- String helpTopic,
+// String helpTopic,
ResourceBundle messages) {
- showHelpDialog(null, ctx, helpURL, helpTopic, messages);
+ showHelpDialog(null, ctx, helpURL, messages); //helpTopic, messages);
}
public static void showHelpDialog(URL helpURL,
- String helpTopic,
+// String helpTopic,
ResourceBundle messages) {
- showHelpDialog(null, null, helpURL, helpTopic, messages);
+ showHelpDialog(null, null, helpURL, messages); // helpTopic, messages);
}
public static void showHelpDialog(Component owner,
AppletContext ctx,
URL helpURL,
- String helpTopic,
+// String helpTopic,
ResourceBundle messages) {
Frame frame = null;
if (owner != null) {
JOptionPane.getFrameForComponent(owner);
}
- dialog = new HelpViewer(frame, messages, ctx, helpURL, helpTopic);
+ dialog = new HelpViewer(frame, messages, ctx, helpURL); //, helpTopic);
dialog.setVisible(true);
}
private HelpViewer(Frame frame,
ResourceBundle messages,
AppletContext ctx,
- URL helpURL,
- String helpTopic) {
+ URL helpURL) { //, String helpTopic) {
super(frame, messages.getString(BKUGUIFacade.WINDOWTITLE_HELP), true);
this.messages = messages;
this.ctx = ctx;
- String p = messages.getString(BKUGUIFacade.MESSAGE_HELP);
- String helpItem = messages.getString(helpTopic);
- String viewerLabel = MessageFormat.format(p, new Object[]{helpItem});
+// String p = messages.getString(BKUGUIFacade.MESSAGE_HELP);
+// String helpItem = messages.getString(helpTopic);
+// String viewerLabel = MessageFormat.format(p, new Object[]{helpItem});
- JPanel helpPanel = createViewerPanel(viewerLabel, helpURL);
+ JPanel helpPanel = createViewerPanel(helpURL); //viewerLabel, helpURL);
JPanel buttonPanel = createButtonPanel();
initContentPane(new Dimension(600, 600), helpPanel, buttonPanel);
@@ -128,7 +126,7 @@ public class HelpViewer extends JDialog
mainLayout.createSequentialGroup().addContainerGap().addComponent(viewerPanel, 0, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE).addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED).addComponent(buttonPanel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE).addContainerGap());
}
- private JPanel createViewerPanel(String viewerLabelText, URL helpURL) {
+ private JPanel createViewerPanel(URL helpURL) { //String viewerLabelText,
log.debug("viewer dialog: " + helpURL.toString());
final JEditorPane viewer = new JEditorPane();
@@ -170,19 +168,24 @@ public class HelpViewer extends JDialog
scrollPane.setAlignmentX(LEFT_ALIGNMENT);
viewer.setCaretPosition(0);
- JLabel viewerLabel = new JLabel();
- viewerLabel.setText(viewerLabelText);
- viewerLabel.setFont(viewerLabel.getFont().deriveFont(viewerLabel.getFont().getStyle() | java.awt.Font.BOLD));
- viewerLabel.setLabelFor(viewer);
+// JLabel viewerLabel = new JLabel();
+// viewerLabel.setText(viewerLabelText);
+// viewerLabel.setFont(viewerLabel.getFont().deriveFont(viewerLabel.getFont().getStyle() | java.awt.Font.BOLD));
+// viewerLabel.setLabelFor(viewer);
JPanel viewerPanel = new JPanel();
GroupLayout viewerPanelLayout = new GroupLayout(viewerPanel);
viewerPanel.setLayout(viewerPanelLayout);
viewerPanelLayout.setHorizontalGroup(
- viewerPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addComponent(viewerLabel).addComponent(scrollPane));
+ viewerPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+// .addComponent(viewerLabel)
+ .addComponent(scrollPane));
viewerPanelLayout.setVerticalGroup(
- viewerPanelLayout.createSequentialGroup().addComponent(viewerLabel).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(scrollPane));
+ viewerPanelLayout.createSequentialGroup()
+// .addComponent(viewerLabel)
+// .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(scrollPane));
return viewerPanel;
}