Fixes copy text from chat conversation history and once again the losing focus of chat write area.

fix-message-formatting
Damian Minkov 12 years ago
parent 29c0cf0340
commit 6bb76649e8

@ -64,7 +64,6 @@ public class ChatPanel
ChatRoomLocalUserRoleListener,
ChatRoomMemberPropertyChangeListener,
FileTransferStatusListener,
KeyEventDispatcher,
Skinnable
{
/**
@ -229,9 +228,6 @@ public ChatPanel(ChatContainer chatContainer)
}
this.addComponentListener(new TabSelectionComponentListener());
KeyboardFocusManager.getCurrentKeyboardFocusManager()
.addKeyEventDispatcher(this);
}
/**
@ -449,9 +445,6 @@ public ChatSession getChatSession()
*/
public void dispose()
{
KeyboardFocusManager.getCurrentKeyboardFocusManager()
.removeKeyEventDispatcher(this);
writeMessagePanel.dispose();
chatSession.dispose();
conversationPanel.dispose();
@ -3122,27 +3115,4 @@ public void chatConferenceDescriptionSent(
chatConferencesDialog.setCreatePanelEnabled(!available);
chatConferencesDialog.setEndConferenceButtonEnabled(available);
}
/**
* Dispatches key events and process those that were generated when
* conversationPanel ChatTextPane is focused and they were targeting the
* write message panel.
* @param e the <tt>KeyEvent</tt> to dispatch.
* @return <tt>true</tt> if the KeyboardFocusManager should take no
* further action with regard to the KeyEvent; <tt>false</tt>
* otherwise.
*/
public boolean dispatchKeyEvent(KeyEvent e)
{
if(e.getSource() != conversationPanel.getChatTextPane()
|| writeMessagePanel.getEditorPane().isFocusOwner())
return false;
writeMessagePanel.getEditorPane().requestFocusInWindow();
KeyboardFocusManager.getCurrentKeyboardFocusManager()
.redispatchEvent(writeMessagePanel.getEditorPane(), e);
return true;
}
}

@ -1288,7 +1288,8 @@ public boolean dispatchKeyEvent(KeyEvent e)
// Don't re-dispatch any events if the menu is active. Fixes the
// navigation in the menu.
if (menuBar.isSelected())
if (menuBar.getSelectedMenu() != null
&& menuBar.getSelectedMenu().isPopupMenuVisible())
{
return false;
}

Loading…
Cancel
Save