statusSelector = new JButton();
statusSelector.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
StatusSelectorMenu menu = new StatusSelectorMenu();
menu.addPresenceChangedListener(new StatusSelectorMenu.PresenceChangedListener() {
@Override
public void presenceModeUpdated(Mode mode) {
setStatusSelector(mode);
//udelat status field
String status = (statusField.getForeground() == Color.gray) ? "" : statusField.getText();
ConnectionManager.getInstance().updatePresence(Presence.Type.available, status, 20, mode);
}
});
menu.show(statusSelector, 2, statusSelector.getHeight() + 2);
}
});
statusSelector.setFocusable(false);
statusSelector.setRolloverEnabled(true);