use of org.jivesoftware.spark.roar.gui.SparkToaster in project Spark by igniterealtime.
the class SparkToasterHandler method messageReceived.
@Override
public void messageReceived(ChatRoom room, Message message, PropertyBundle property) {
SparkToaster toaster = new SparkToaster();
toaster.setDisplayTime(property.duration);
toaster.setBorder(BorderFactory.createBevelBorder(0));
toaster.setTitle(room.getTabTitle());
toaster.setCustomAction(new AbstractAction() {
private static final long serialVersionUID = 8327372636443172019L;
@Override
public void actionPerformed(ActionEvent e) {
ChatFrame chatFrame = SparkManager.getChatManager().getChatContainer().getChatFrame();
chatFrame.setState(Frame.NORMAL);
chatFrame.setVisible(true);
}
});
toaster.showToaster(room.getTabIcon(), message.getBody());
}
Aggregations