|
|
|
|
@ -31,8 +31,7 @@
|
|
|
|
|
*/
|
|
|
|
|
public class ChatRoomServerRightButtonMenu
|
|
|
|
|
extends JPopupMenu
|
|
|
|
|
implements ActionListener,
|
|
|
|
|
PluginComponentListener
|
|
|
|
|
implements ActionListener
|
|
|
|
|
{
|
|
|
|
|
private I18NString createChatRoomString
|
|
|
|
|
= Messages.getI18NString("createChatRoom");
|
|
|
|
|
@ -77,8 +76,6 @@ private void init()
|
|
|
|
|
this.add(createChatRoomItem);
|
|
|
|
|
this.add(joinChannelItem);
|
|
|
|
|
|
|
|
|
|
this.initPluginComponents();
|
|
|
|
|
|
|
|
|
|
this.createChatRoomItem.setName("createChatRoom");
|
|
|
|
|
this.joinChannelItem.setName("joinChatRoom");
|
|
|
|
|
|
|
|
|
|
@ -91,26 +88,6 @@ private void init()
|
|
|
|
|
this.joinChannelItem.addActionListener(this);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Adds all already registered plugin components to this menu.
|
|
|
|
|
*/
|
|
|
|
|
private void initPluginComponents()
|
|
|
|
|
{
|
|
|
|
|
Iterator pluginComponents = GuiActivator.getUIService()
|
|
|
|
|
.getComponentsForContainer(
|
|
|
|
|
UIService.CONTAINER_CONTACT_RIGHT_BUTTON_MENU);
|
|
|
|
|
|
|
|
|
|
if(pluginComponents.hasNext())
|
|
|
|
|
this.addSeparator();
|
|
|
|
|
|
|
|
|
|
while (pluginComponents.hasNext())
|
|
|
|
|
{
|
|
|
|
|
Component o = (Component)pluginComponents.next();
|
|
|
|
|
|
|
|
|
|
this.add(o);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Handles the <tt>ActionEvent</tt>. Determines which menu item was
|
|
|
|
|
* selected and makes the appropriate operations.
|
|
|
|
|
@ -141,29 +118,5 @@ else if (itemName.equals("joinChatRoom"))
|
|
|
|
|
);
|
|
|
|
|
joinChannelDialog.setVisible(true);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Implements the <tt>PluginComponentListener.pluginComponentAdded</tt>
|
|
|
|
|
* method, in order to add the given plugin component in this container.
|
|
|
|
|
*/
|
|
|
|
|
public void pluginComponentAdded(PluginComponentEvent event)
|
|
|
|
|
{
|
|
|
|
|
Component c = (Component) event.getSource();
|
|
|
|
|
|
|
|
|
|
this.add(c);
|
|
|
|
|
|
|
|
|
|
this.repaint();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Implements the <tt>PluginComponentListener.pluginComponentRemoved</tt>
|
|
|
|
|
* method, in order to remove the given component from this container.
|
|
|
|
|
*/
|
|
|
|
|
public void pluginComponentRemoved(PluginComponentEvent event)
|
|
|
|
|
{
|
|
|
|
|
Component c = (Component) event.getSource();
|
|
|
|
|
|
|
|
|
|
this.remove(c);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|