summaryrefslogtreecommitdiff
path: root/BKUCommonGUI
diff options
context:
space:
mode:
authorclemenso <clemenso@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4>2008-11-27 15:22:32 +0000
committerclemenso <clemenso@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4>2008-11-27 15:22:32 +0000
commit959130f29903568c6b7fe3d6538b33887b3b1aaf (patch)
tree00097351c3941f9ea18eec620710836c2dcfc032 /BKUCommonGUI
parentd379980f1c64bcf174c9706ff5aa746314a6666f (diff)
downloadmocca-959130f29903568c6b7fe3d6538b33887b3b1aaf.tar.gz
mocca-959130f29903568c6b7fe3d6538b33887b3b1aaf.tar.bz2
mocca-959130f29903568c6b7fe3d6538b33887b3b1aaf.zip
help viewer label removed
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@221 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
Diffstat (limited to 'BKUCommonGUI')
-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
-rw-r--r--BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties2
-rw-r--r--BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages_en.properties14
6 files changed, 42 insertions, 37 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;
}
diff --git a/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties b/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties
index a7363421..e5315c8d 100644
--- a/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties
+++ b/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties
@@ -27,7 +27,7 @@ windowtitle.save=Signaturdaten speichern
windowtitle.savedir=Signaturdaten in Verzeichnis speichern
windowtitle.overwrite=Datei \u00FCberschreiben?
windowtitle.viewer=Signaturedaten
-windowtitle.help=Hilfe
+windowtitle.help=Hilfe zur B\u00FCrgerkarte
message.wait=<html>Bitte warten...</html>
message.insertcard=<html>Bitte die B\u00FCrgerkarte in den Kartenleser stecken</html>
message.enterpin=<html>{0} eingeben</html>
diff --git a/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages_en.properties b/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages_en.properties
index 7aae8eae..96f99a8a 100644
--- a/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages_en.properties
+++ b/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages_en.properties
@@ -14,7 +14,7 @@
# limitations under the License.
title.welcome=<html>Welcome</html>
-title.insertcard=<html>No citizencard found</html>
+title.insertcard=<html>No citizen card found</html>
title.cardnotsupported=<html>This card is not supported</html>
#title.cardpin=<html>Enter {0}</html>
title.cardpin=<html>Reading card</html>
@@ -27,9 +27,9 @@ windowtitle.save=Save signature data
windowtitle.savedir=Save signature data to directory
windowtitle.overwrite=Overwrite file?
windowtitle.viewer=Signature data
-windowtitle.help=Help
+windowtitle.help=Citizen card help
message.wait=<html>Please wait...</html>
-message.insertcard=<html>Please insert your citizencard into the reader</html>
+message.insertcard=<html>Please insert your citizen card into the reader</html>
message.enterpin=<html>Enter {0}</html>
message.hashdatalink=<html><a href=\"anzeige\">Display signature data</a></html>
#message.hashdata=<html>Remark: This is a preview of the data to-be signed. For standards compliant display see help.</html>
@@ -65,16 +65,16 @@ error.pcsc=<html>No PC/SC interface for smartcard access provided</html>
error.cardterminal=<html>Could not find smartcard reader</html>
error.unknown=<html>An error occured: {0}</html>
error.test=<html>Error1 {0} - Error2 {1}</html>
-error.card.locked=<html>Citizencard is locked</html>
-error.card.notactivated=<html>Citizencard not activated</html>
+error.card.locked=<html>Citizen card is locked</html>
+error.card.notactivated=<html>Citizen card not activated</html>
error.viewer=Failed to display contents: {0}
error.external.link=<html>Externer Link {0} wird nicht ge\u00F6ffnet</html>
# Help Topics
help.welcome=Welcome page
help.wait=Wait screen
-help.cardnotsupported=Unsupported citizencard
-help.insertcard=No citizencard found
+help.cardnotsupported=Unsupported citizen card
+help.insertcard=No citizen card found
help.cardpin=Pin entry
help.signpin=Signature pin entry
help.retry=Wrong Pin