use of org.eclipse.ecf.presence.ui.MessagesView in project ecf by eclipse.
the class ChatComposite method sendPrivateTextMsg.
protected void sendPrivateTextMsg(IUser data) {
if (this.view.lch != null) {
IPresenceContainerAdapter ipca = this.view.lch.getPresenceContainer();
MessagesView messagesView = this.view.lch.findMessagesView();
if (messagesView != null) {
IChatManager chatManager = ipca.getChatManager();
messagesView.openTab(chatManager.getChatMessageSender(), chatManager.getTypingMessageSender(), this.view.lch.getContainerID(), data.getID());
}
}
}
use of org.eclipse.ecf.presence.ui.MessagesView in project ecf by eclipse.
the class EclipseCollabSharedObject method appendMessage.
void appendMessage(IChatMessageSender chatMessageSender, ITypingMessageSender typingMessageSender, IChatMessage message) {
IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows();
for (int i = 0; i < windows.length; i++) {
IWorkbenchPage page = windows[i].getActivePage();
if (page != null) {
MessagesView view = (MessagesView) page.findView(MessagesView.VIEW_ID);
if (view != null) {
view.openTab(chatMessageSender, typingMessageSender, containerID, message.getFromID());
view.showMessage(message);
if (!page.isPartVisible(view)) {
IWorkbenchSiteProgressService service = (IWorkbenchSiteProgressService) view.getSite().getService(IWorkbenchSiteProgressService.class);
if (service != null) {
service.warnOfContentChange();
}
}
return;
}
}
}
for (int i = 0; i < windows.length; i++) {
IWorkbenchPage page = windows[i].getActivePage();
if (page != null) {
try {
MessagesView view = (MessagesView) page.showView(MessagesView.VIEW_ID);
view.openTab(chatMessageSender, typingMessageSender, containerID, message.getFromID());
view.showMessage(message);
} catch (PartInitException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
break;
}
}
}
use of org.eclipse.ecf.presence.ui.MessagesView in project ecf by eclipse.
the class MSNConnectWizard method displayMessage.
private void displayMessage(IChatMessageEvent e) {
final IChatMessage message = e.getChatMessage();
Display.getDefault().asyncExec(new Runnable() {
public void run() {
MessagesView view = (MessagesView) workbench.getActiveWorkbenchWindow().getActivePage().findView(MessagesView.VIEW_ID);
if (view != null) {
final IWorkbenchSiteProgressService service = (IWorkbenchSiteProgressService) view.getSite().getAdapter(IWorkbenchSiteProgressService.class);
view.openTab(icms, itms, targetID, message.getFromID());
view.showMessage(message);
service.warnOfContentChange();
} else {
try {
final IWorkbenchPage page = workbench.getActiveWorkbenchWindow().getActivePage();
view = (MessagesView) page.showView(MessagesView.VIEW_ID, null, IWorkbenchPage.VIEW_CREATE);
if (!page.isPartVisible(view)) {
final IWorkbenchSiteProgressService service = (IWorkbenchSiteProgressService) view.getSite().getAdapter(IWorkbenchSiteProgressService.class);
service.warnOfContentChange();
}
view.openTab(icms, itms, targetID, message.getFromID());
view.showMessage(message);
} catch (final PartInitException e) {
e.printStackTrace();
}
}
}
});
}
use of org.eclipse.ecf.presence.ui.MessagesView in project ecf by eclipse.
the class BrowseHandler method execute.
/**
* the command has been executed, so extract extract the needed information
* from the application context.
*/
public Object execute(ExecutionEvent event) throws ExecutionException {
IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event);
IContainerManager containerManager = Activator.getDefault().getContainerManager();
IContainer[] containers = containerManager.getAllContainers();
BrowseDialog dialog = new BrowseDialog(window.getShell(), containers);
int status = dialog.open();
if (status == Window.OK) {
Object[] object = dialog.getResult();
IRosterEntry entry = (IRosterEntry) object[0];
IRoster roster = entry.getRoster();
if (roster != null) {
IChatManager manager = roster.getPresenceContainerAdapter().getChatManager();
IChatMessageSender icms = manager.getChatMessageSender();
ITypingMessageSender itms = manager.getTypingMessageSender();
try {
MessagesView view = (MessagesView) window.getActivePage().showView(MessagesView.VIEW_ID);
view.selectTab(icms, itms, roster.getUser().getID(), entry.getUser().getID(), entry.getUser().getName());
} catch (PartInitException e) {
e.printStackTrace();
}
}
}
return null;
}
use of org.eclipse.ecf.presence.ui.MessagesView in project ecf by eclipse.
the class ChatRoomManagerView method getMessagesView.
private MessagesView getMessagesView() throws PartInitException {
IWorkbenchPage page = getSite().getPage();
MessagesView messageView = (MessagesView) page.findView(MessagesView.VIEW_ID);
if (messageView == null) {
messageView = (MessagesView) page.showView(MessagesView.VIEW_ID, null, IWorkbenchPage.VIEW_CREATE);
}
return messageView;
}
Aggregations