From 135ede588038b677f68d63868f814d15d676e9f4 Mon Sep 17 00:00:00 2001 From: Damian Minkov Date: Fri, 23 Jul 2010 09:11:52 +0000 Subject: Rest of the work on issue#528, add default macosx bindings(Ctrl+w and Cmd+w). Fix a font issue for proxy config reported by Lubomir Marinov. --- .../communicator/plugin/branding/AboutWindow.java | 29 ++++++++++++++++++++++ .../globalproxyconfig/GlobalProxyConfigForm.java | 6 ++++- 2 files changed, 34 insertions(+), 1 deletion(-) (limited to 'src/net/java/sip/communicator/plugin') diff --git a/src/net/java/sip/communicator/plugin/branding/AboutWindow.java b/src/net/java/sip/communicator/plugin/branding/AboutWindow.java index 4554222..31031d0 100644 --- a/src/net/java/sip/communicator/plugin/branding/AboutWindow.java +++ b/src/net/java/sip/communicator/plugin/branding/AboutWindow.java @@ -199,6 +199,23 @@ public class AboutWindow this.setResizable(false); setLocationRelativeTo(getParent()); + + this.getRootPane().getActionMap().put("close", new CloseAction()); + + InputMap imap = this.getRootPane().getInputMap( + JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); + + imap.put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), "close"); + + if(OSUtils.IS_MAC) + { + imap.put( + KeyStroke.getKeyStroke(KeyEvent.VK_W, InputEvent.META_DOWN_MASK), + "close"); + imap.put( + KeyStroke.getKeyStroke(KeyEvent.VK_W, InputEvent.CTRL_DOWN_MASK), + "close"); + } } /** @@ -326,4 +343,16 @@ public class AboutWindow * Implementation of {@link ExportedWindow#setParams(Object[])}. */ public void setParams(Object[] windowParams) {} + + /** + * The action invoked when user presses Escape key. + */ + private class CloseAction extends UIAction + { + public void actionPerformed(ActionEvent e) + { + setVisible(false); + dispose(); + } + } } diff --git a/src/net/java/sip/communicator/plugin/globalproxyconfig/GlobalProxyConfigForm.java b/src/net/java/sip/communicator/plugin/globalproxyconfig/GlobalProxyConfigForm.java index 4473913..c14a223 100644 --- a/src/net/java/sip/communicator/plugin/globalproxyconfig/GlobalProxyConfigForm.java +++ b/src/net/java/sip/communicator/plugin/globalproxyconfig/GlobalProxyConfigForm.java @@ -151,6 +151,10 @@ public class GlobalProxyConfigForm table.setContentType("text/html"); table.setEditable(false); table.setOpaque(false); + + table.putClientProperty( + JEditorPane.HONOR_DISPLAY_PROPERTIES, Boolean.TRUE); + table.setText(Resources.getString( "plugin.globalproxy.PROTOCOL_SUPPORT")); centerPanel.add( @@ -159,7 +163,7 @@ public class GlobalProxyConfigForm add(centerPanel, BorderLayout.NORTH); } - + /** * Loading the values stored onto configuration form */ -- cgit v1.1