Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkgilmer2006-04-25 19:42:29 +0000
committerkgilmer2006-04-25 19:42:29 +0000
commitee5dcc026b905d38c16fb5e1b669dc68f7661e25 (patch)
tree3eb10a58a448b3f2d226735df351ebbed42e8e7a /examples/bundles/org.eclipse.ecf.example.collab.editor
parente608fa968b034fd422f525d4fb9a1ef3e76920f0 (diff)
downloadorg.eclipse.ecf-ee5dcc026b905d38c16fb5e1b669dc68f7661e25.tar.gz
org.eclipse.ecf-ee5dcc026b905d38c16fb5e1b669dc68f7661e25.tar.xz
org.eclipse.ecf-ee5dcc026b905d38c16fb5e1b669dc68f7661e25.zip
bugfix
Diffstat (limited to 'examples/bundles/org.eclipse.ecf.example.collab.editor')
-rw-r--r--examples/bundles/org.eclipse.ecf.example.collab.editor/src/org/eclipse/ecf/example/collab/editor/EditChannelListener.java22
1 files changed, 13 insertions, 9 deletions
diff --git a/examples/bundles/org.eclipse.ecf.example.collab.editor/src/org/eclipse/ecf/example/collab/editor/EditChannelListener.java b/examples/bundles/org.eclipse.ecf.example.collab.editor/src/org/eclipse/ecf/example/collab/editor/EditChannelListener.java
index e0049250c..ad23c6d5d 100644
--- a/examples/bundles/org.eclipse.ecf.example.collab.editor/src/org/eclipse/ecf/example/collab/editor/EditChannelListener.java
+++ b/examples/bundles/org.eclipse.ecf.example.collab.editor/src/org/eclipse/ecf/example/collab/editor/EditChannelListener.java
@@ -45,15 +45,16 @@ public class EditChannelListener implements IChannelListener {
if (event instanceof IChannelMessageEvent) {
setEditorEditable(false);
Activator.getDefault().setListenerActive(false);
-
+
IChannelMessageEvent msg = (IChannelMessageEvent) event;
ByteArrayInputStream bins = new ByteArrayInputStream(msg.getData());
ObjectInputStream ois;
try {
ois = new ObjectInputStream(bins);
- EditorChangeMessage message = (EditorChangeMessage) ois.readObject();
-
+ EditorChangeMessage message = (EditorChangeMessage) ois
+ .readObject();
+
// Append text from remote to end of document
appendLocallyFromRemote(message);
} catch (IOException e) {
@@ -77,7 +78,8 @@ public class EditChannelListener implements IChannelListener {
return;
}
- ISelection selection = editor.getSelectionProvider().getSelection();
+ ISelection selection = editor.getSelectionProvider()
+ .getSelection();
if (selection instanceof TextSelection) {
TextSelection textSelection = (TextSelection) selection;
document.set(message.getDocument());
@@ -88,10 +90,12 @@ public class EditChannelListener implements IChannelListener {
}
private void setEditorEditable(final boolean editable) {
- Display.getDefault().syncExec(new Runnable() {
- public void run() {
- textControl.setEditable(editable);
- }
- });
+ if (!textControl.isDisposed()) {
+ Display.getDefault().syncExec(new Runnable() {
+ public void run() {
+ textControl.setEditable(editable);
+ }
+ });
+ }
}
}

Back to the top