Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrsuen2008-12-14 07:44:25 -0500
committerrsuen2008-12-14 07:44:25 -0500
commit826acef2cc54462d652da95f0fc5cadca493719b (patch)
tree093cca5018ef40ecd9e3d74bf505a77ae591b018 /examples/bundles/org.eclipse.ecf.example.collab
parentfe88ff65c9687300d4d7fd300c4789ac8ad53bf4 (diff)
downloadorg.eclipse.ecf-826acef2cc54462d652da95f0fc5cadca493719b.tar.gz
org.eclipse.ecf-826acef2cc54462d652da95f0fc5cadca493719b.tar.xz
org.eclipse.ecf-826acef2cc54462d652da95f0fc5cadca493719b.zip
Only show the message in one 'Messages' view.
Diffstat (limited to 'examples/bundles/org.eclipse.ecf.example.collab')
-rw-r--r--examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/share/EclipseCollabSharedObject.java38
1 files changed, 23 insertions, 15 deletions
diff --git a/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/share/EclipseCollabSharedObject.java b/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/share/EclipseCollabSharedObject.java
index 1b7bc9ea1..9f9b76c08 100644
--- a/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/share/EclipseCollabSharedObject.java
+++ b/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/share/EclipseCollabSharedObject.java
@@ -119,25 +119,33 @@ public class EclipseCollabSharedObject extends GenericSharedObject {
IWorkbenchPage page = windows[i].getActivePage();
if (page != null) {
MessagesView view = (MessagesView) page.findView(MessagesView.VIEW_ID);
- if (view == null) {
- try {
- view = (MessagesView) page.showView(MessagesView.VIEW_ID, null, IWorkbenchPage.VIEW_CREATE);
- } catch (PartInitException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- return;
+ 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;
+ }
+ }
- 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();
- }
+ 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;
}
}
}

Back to the top