mirror of https://github.com/sipwise/jitsi.git
parent
6662878fe6
commit
68549ccdc3
@ -0,0 +1,33 @@
|
||||
/*
|
||||
* SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
|
||||
*
|
||||
* Distributable under LGPL license.
|
||||
* See terms of license at gnu.org.
|
||||
*/
|
||||
package net.java.sip.communicator.impl.gui.lookandfeel;
|
||||
|
||||
import java.awt.Graphics;
|
||||
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.plaf.ComponentUI;
|
||||
import javax.swing.plaf.basic.BasicCheckBoxMenuItemUI;
|
||||
|
||||
import net.java.sip.communicator.impl.gui.utils.AntialiasingManager;
|
||||
/**
|
||||
* The SIPCommCheckBoxMenuItemUI implementation.
|
||||
*
|
||||
* @author Yana Stamcheva
|
||||
*/
|
||||
public class SIPCommCheckBoxMenuItemUI extends BasicCheckBoxMenuItemUI {
|
||||
/**
|
||||
* Creates a new SIPCommCheckBoxMenuItemUI instance.
|
||||
*/
|
||||
public static ComponentUI createUI(JComponent x) {
|
||||
return new SIPCommCheckBoxMenuItemUI();
|
||||
}
|
||||
|
||||
public void paint(Graphics g, JComponent c) {
|
||||
AntialiasingManager.activateAntialiasing(g);
|
||||
super.paint(g, c);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,44 @@
|
||||
package net.java.sip.communicator.impl.gui.main.message.menu;
|
||||
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
|
||||
import javax.swing.JCheckBoxMenuItem;
|
||||
import javax.swing.JMenu;
|
||||
|
||||
import net.java.sip.communicator.impl.gui.main.i18n.Messages;
|
||||
import net.java.sip.communicator.impl.gui.main.message.ChatWindow;
|
||||
|
||||
public class SettingsMenu extends JMenu
|
||||
implements ActionListener {
|
||||
|
||||
private JCheckBoxMenuItem typingNotificationsItem
|
||||
= new JCheckBoxMenuItem(Messages.getString("typingNotifications"), true);
|
||||
|
||||
private ChatWindow chatWindow;
|
||||
|
||||
public SettingsMenu(ChatWindow chatWindow){
|
||||
super(Messages.getString("settings"));
|
||||
|
||||
this.chatWindow = chatWindow;
|
||||
|
||||
this.init();
|
||||
}
|
||||
|
||||
private void init(){
|
||||
this.add(typingNotificationsItem);
|
||||
|
||||
this.typingNotificationsItem.addActionListener(this);
|
||||
}
|
||||
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
JCheckBoxMenuItem item = (JCheckBoxMenuItem)e.getSource();
|
||||
|
||||
if (item.isSelected()) {
|
||||
chatWindow.getCurrentChatPanel().enableTypingNotification(true);
|
||||
}
|
||||
else {
|
||||
chatWindow.getCurrentChatPanel().enableTypingNotification(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in new issue