From 959130f29903568c6b7fe3d6538b33887b3b1aaf Mon Sep 17 00:00:00 2001 From: clemenso Date: Thu, 27 Nov 2008 15:22:32 +0000 Subject: help viewer label removed git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@221 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../at/gv/egiz/bku/gui/AbstractHelpListener.java | 5 ++- .../main/java/at/gv/egiz/bku/gui/BKUGUIImpl.java | 7 ++-- .../at/gv/egiz/bku/gui/DefaultHelpListener.java | 8 ++-- .../main/java/at/gv/egiz/bku/gui/HelpViewer.java | 43 ++++++++++++---------- .../at/gv/egiz/bku/gui/Messages.properties | 2 +- .../at/gv/egiz/bku/gui/Messages_en.properties | 14 +++---- 6 files changed, 42 insertions(+), 37 deletions(-) (limited to 'BKUCommonGUI') 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. + *
+ * The help URL is build as [baseURL]/[locale]/[helpTopic].html + * (note that no session information is contained). * * @author Clemens Orthacker */ @@ -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=Bitte warten... message.insertcard=Bitte die B\u00FCrgerkarte in den Kartenleser stecken message.enterpin={0} eingeben 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=Welcome -title.insertcard=No citizencard found +title.insertcard=No citizen card found title.cardnotsupported=This card is not supported #title.cardpin=Enter {0} title.cardpin=Reading card @@ -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=Please wait... -message.insertcard=Please insert your citizencard into the reader +message.insertcard=Please insert your citizen card into the reader message.enterpin=Enter {0} message.hashdatalink=Display signature data #message.hashdata=Remark: This is a preview of the data to-be signed. For standards compliant display see help. @@ -65,16 +65,16 @@ error.pcsc=No PC/SC interface for smartcard access provided error.cardterminal=Could not find smartcard reader error.unknown=An error occured: {0} error.test=Error1 {0} - Error2 {1} -error.card.locked=Citizencard is locked -error.card.notactivated=Citizencard not activated +error.card.locked=Citizen card is locked +error.card.notactivated=Citizen card not activated error.viewer=Failed to display contents: {0} error.external.link=Externer Link {0} wird nicht ge\u00F6ffnet # 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 -- cgit v1.2.3