rendered paste bodyMain class
BeanContainer.start("/net/sourceforge/sandirc/configuration/sandirc.properties");
menubar = menubar()
String[] actions = ["action.sandirc.serverconnect", "action.sandirc.serverdisconnect", "etc..."]
for(action m_action : actions)
menubar.add(new menu(BeanContainer.get(m_action)))
mainwindow = new window()
mainwindow.setmenubar(menubar)
mainwindow.add(new ircmessagesbox())
mainwindow.add(new inputtextbox())
pluginsmanager.start()
pluginsmanager.collectplugins()
pluginsmanager.registerplugins()
mainwindow.builgui()
mainwindow.setvisible(true)
------------------------------------------
An IRC event handling
package net.sourceforge.irc.actions
def ServerDisconnectAction extends SandIRCAction{
String actionid = "action.sandirc.serverdisconnect";
void execute(){
// create the event
ServerDisconnectEvent e = new ServerDisconnectEvent("Server ID")
// fire the event (remove data from arraylists or hashmaps, etc.)
MainWindow.fireEvent(e);
// close tabs or windows
MainWindow.getInstance.closeServerTabs("Server ID")
}
}