use of org.eclipse.ecf.ui.dialogs.IDCreateErrorDialog in project ecf by eclipse.
the class IRCConnectWizard method performFinish.
public boolean performFinish() {
final String connectID = page.getConnectID();
final String password = page.getPassword();
connectContext = ConnectContextFactory.createPasswordConnectContext(password);
page.saveComboText();
try {
targetID = IDFactory.getDefault().createID(container.getConnectNamespace(), connectID);
} catch (final IDCreateException e) {
new IDCreateErrorDialog(null, connectID, e).open();
return false;
}
final IChatRoomManager manager = (IChatRoomManager) this.container.getAdapter(IChatRoomManager.class);
final IRCUI ui = new IRCUI(this.container, manager, null);
ui.showForTarget(targetID);
// If it's not already connected, then we connect this new container
if (!ui.isContainerConnected()) {
page.saveComboItems();
// bug 274613, we need to remove the extra autojoin channel bits
IRCID id = (IRCID) targetID;
// start with user, then host, then port, abc@irc.freenode.net:6667
StringBuffer buffer = new StringBuffer(id.getUsername());
buffer.append('@').append(id.getHost());
buffer.append(':').append(id.getPort());
// create a truncated ID instance for the container to connect to
id = (IRCID) container.getConnectNamespace().createInstance(new Object[] { buffer.toString() });
new AsynchContainerConnectAction(container, id, connectContext, null, new Runnable() {
public void run() {
cachePassword(page.getPasswordKeyFromUserName(connectID), password);
}
}).run();
}
return true;
}
use of org.eclipse.ecf.ui.dialogs.IDCreateErrorDialog in project ecf by eclipse.
the class MSNConnectWizard method performFinish.
public boolean performFinish() {
final String connectID = page.getEmail();
final String password = page.getPassword();
// Save combo text even if we don't successfully login
page.saveComboText();
connectContext = ConnectContextFactory.createPasswordConnectContext(password);
try {
targetID = container.getConnectNamespace().createInstance(new Object[] { connectID });
} catch (final IDCreateException e) {
new IDCreateErrorDialog(null, connectID, e).open();
return false;
}
page.saveComboItems();
final IPresenceContainerAdapter adapter = (IPresenceContainerAdapter) container.getAdapter(IPresenceContainerAdapter.class);
container.addListener(new IContainerListener() {
public void handleEvent(IContainerEvent event) {
if (event instanceof IContainerConnectedEvent) {
Display.getDefault().asyncExec(new Runnable() {
public void run() {
openView();
}
});
}
}
});
final IChatManager icm = adapter.getChatManager();
icms = icm.getChatMessageSender();
itms = icm.getTypingMessageSender();
icm.addMessageListener(new IIMMessageListener() {
public void handleMessageEvent(IIMMessageEvent e) {
if (e instanceof IChatMessageEvent) {
displayMessage((IChatMessageEvent) e);
} else if (e instanceof ITypingMessageEvent) {
displayTypingNotification((ITypingMessageEvent) e);
}
}
});
new AsynchContainerConnectAction(container, targetID, connectContext, null, new Runnable() {
public void run() {
cachePassword(connectID, password);
}
}).run();
return true;
}
use of org.eclipse.ecf.ui.dialogs.IDCreateErrorDialog in project ecf by eclipse.
the class XMPPConnectWizard method performFinish.
public boolean performFinish() {
final String connectID = page.getConnectID();
final String password = page.getPassword();
// Save combo text even if we don't successfully login
page.saveComboText();
connectContext = createConnectContext();
try {
targetID = IDFactory.getDefault().createID(container.getConnectNamespace(), connectID);
} catch (final IDCreateException e) {
new IDCreateErrorDialog(null, connectID, e).open();
return false;
}
// Save combo items if targetID created successfully
page.saveComboItems();
final IPresenceContainerAdapter adapter = (IPresenceContainerAdapter) container.getAdapter(IPresenceContainerAdapter.class);
container.addListener(new IContainerListener() {
public void handleEvent(IContainerEvent event) {
if (event instanceof IContainerConnectedEvent) {
Display.getDefault().asyncExec(new Runnable() {
public void run() {
openView();
}
});
}
}
});
final IChatManager icm = adapter.getChatManager();
icms = icm.getChatMessageSender();
itms = icm.getTypingMessageSender();
icm.addMessageListener(new IIMMessageListener() {
public void handleMessageEvent(IIMMessageEvent e) {
if (e instanceof IChatMessageEvent) {
displayMessage((IChatMessageEvent) e);
} else if (e instanceof ITypingMessageEvent) {
displayTypingNotification((ITypingMessageEvent) e);
}
}
});
final ISendFileTransferContainerAdapter ioftca = (ISendFileTransferContainerAdapter) container.getAdapter(ISendFileTransferContainerAdapter.class);
ioftca.addListener(requestListener);
// Connect
new AsynchContainerConnectAction(container, targetID, connectContext, null, new Runnable() {
public void run() {
cachePassword(connectID, password);
}
}).run();
return true;
}
Aggregations