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.
cusax-fix
Damian Minkov 16 years ago
parent 4f6aaa3ee7
commit 135ede5880

@ -13,7 +13,6 @@
import java.util.List;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.tree.*;
import net.java.sip.communicator.impl.gui.*;
@ -228,6 +227,12 @@ private void init()
this.addKeybindingAction("main-rename",
new RenameAction());
// Remove the default escape key mapping as its a special
// one for the main frame and the contactlist
getRootPane().getInputMap(
JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT)
.remove(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0));
TransparentPanel northPanel
= new TransparentPanel(new BorderLayout(0, 0));

@ -165,16 +165,6 @@ public void stateChanged(ChangeEvent evt)
this.addKeybindingAction( "chat-close",
new CloseAction());
// simple fix adding meta+w on macosx
if (OSUtils.IS_MAC)
{
this.getRootPane().getInputMap(
JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(
KeyStroke.getKeyStroke(
KeyEvent.VK_W, InputEvent.META_DOWN_MASK),
"chat-close");
}
this.addWindowListener(new ChatWindowAdapter());
int width = GuiActivator.getResources()

@ -447,6 +447,9 @@ public Component getListCellRendererComponent(JList list, Object value,
{
ChatRoomProviderWrapper provider = (ChatRoomProviderWrapper)value;
if(provider == null)
return this;
if (isSelected)
{
setBackground(list.getSelectionBackground());

@ -199,6 +199,23 @@ public AboutWindow(Frame owner)
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 Object getSource()
* 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();
}
}
}

@ -151,6 +151,10 @@ private void init()
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 @@ private void init()
add(centerPanel, BorderLayout.NORTH);
}
/**
* Loading the values stored onto configuration form
*/

@ -144,8 +144,19 @@ private void initInputMap()
JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
imap.put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), "close");
// put the defaults for macosx
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");
}
}
/**
* The action invoked when user presses Escape key.
*/

@ -84,6 +84,19 @@ public SIPCommFrame()
imap = rootPane.getInputMap(
JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
imap.put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), "close");
// put the defaults for macosx
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");
}
}
/**

Loading…
Cancel
Save