public void UIAttached(UIInstance instance) {
if (instance instanceof UISWTInstance) {
try {
debug("Opening IRC channel " + channel + " on " + server
+ " for user " + alias);
UISWTInstance swtInstance = (UISWTInstance) instance;
UISWTView[] openViews = swtInstance.getOpenViews(UISWTInstance.VIEW_MAIN);
for (int i = 0; i < openViews.length; i++) {
UISWTView view = openViews[i];
// if only there was a way to tell if it was our IRC
view.closeView();
}
swtInstance.openView(UISWTInstance.VIEW_MAIN, "IRC",
new String[] {
server,
channel,
alias
});