Update to make dependency on org.eclipse.ui.editors.text optional in org.eclipse.ecf.presence.ui and org.eclipse.ecf.ui plugins. This allows them to be used in small environments (e.g. RCP).
diff --git a/framework/bundles/org.eclipse.ecf.ui/META-INF/MANIFEST.MF b/framework/bundles/org.eclipse.ecf.ui/META-INF/MANIFEST.MF
index 78794ae..78f2c97 100644
--- a/framework/bundles/org.eclipse.ecf.ui/META-INF/MANIFEST.MF
+++ b/framework/bundles/org.eclipse.ecf.ui/META-INF/MANIFEST.MF
@@ -31,6 +31,6 @@
org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.ecf.filetransfer,
- org.eclipse.ui.editors,
org.eclipse.ecf.sharedobject
+Import-Package: org.eclipse.ui.editors.text;optional=true
diff --git a/framework/bundles/org.eclipse.ecf.ui/src/org/eclipse/ecf/internal/ui/deprecated/views/ChatRoomManagerView.java b/framework/bundles/org.eclipse.ecf.ui/src/org/eclipse/ecf/internal/ui/deprecated/views/ChatRoomManagerView.java
index 8dbc55f..ab8770b 100644
--- a/framework/bundles/org.eclipse.ecf.ui/src/org/eclipse/ecf/internal/ui/deprecated/views/ChatRoomManagerView.java
+++ b/framework/bundles/org.eclipse.ecf.ui/src/org/eclipse/ecf/internal/ui/deprecated/views/ChatRoomManagerView.java
@@ -21,6 +21,8 @@
import java.util.StringTokenizer;
import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
import org.eclipse.ecf.core.IContainerListener;
import org.eclipse.ecf.core.events.IContainerDisconnectedEvent;
import org.eclipse.ecf.core.events.IContainerEvent;
@@ -29,6 +31,7 @@
import org.eclipse.ecf.core.security.ConnectContextFactory;
import org.eclipse.ecf.core.user.IUser;
import org.eclipse.ecf.core.util.ECFException;
+import org.eclipse.ecf.internal.ui.Activator;
import org.eclipse.ecf.presence.IIMMessageEvent;
import org.eclipse.ecf.presence.IIMMessageListener;
import org.eclipse.ecf.presence.IPresence;
@@ -209,14 +212,7 @@
readInlayComp.setLayout(new GridLayout());
readInlayComp.setLayoutData(new GridData(GridData.FILL_BOTH));
- SourceViewer result = new SourceViewer(readInlayComp, null, null,
- true, SWT.BORDER | SWT.WRAP | SWT.V_SCROLL | SWT.MULTI
- | SWT.H_SCROLL | SWT.READ_ONLY);
- result.configure(new TextSourceViewerConfiguration(EditorsUI
- .getPreferenceStore()));
- result.setDocument(new Document());
-
- outputText = result.getTextWidget();
+ outputText = createStyledTextWidget(readInlayComp);
outputText.setEditable(false);
outputText.setLayoutData(new GridData(GridData.FILL_BOTH));
@@ -241,6 +237,32 @@
hookContextMenu();
}
+ private StyledText createStyledTextWidget(Composite parent) {
+ try {
+ SourceViewer result = new SourceViewer(parent, null, null,
+ true, SWT.BORDER | SWT.WRAP | SWT.V_SCROLL | SWT.MULTI
+ | SWT.READ_ONLY);
+ result.configure(new TextSourceViewerConfiguration(EditorsUI
+ .getPreferenceStore()));
+ result.setDocument(new Document());
+ return result.getTextWidget();
+ } catch (Exception e) {
+ Activator
+ .getDefault()
+ .getLog()
+ .log(
+ new Status(
+ IStatus.WARNING,
+ Activator.PLUGIN_ID,
+ IStatus.WARNING,
+ "Source viewer not available. Hyperlinking will be disabled.",
+ e));
+ return new StyledText(parent, SWT.BORDER | SWT.WRAP
+ | SWT.V_SCROLL | SWT.MULTI | SWT.READ_ONLY);
+ }
+ }
+
+
protected void outputClear() {
if (MessageDialog.openConfirm(null, "Confirm Clear Text Output",
"Are you sure you want to clear output?")) {
diff --git a/framework/bundles/org.eclipse.ecf.ui/src/org/eclipse/ecf/internal/ui/deprecated/views/ChatRoomView.java b/framework/bundles/org.eclipse.ecf.ui/src/org/eclipse/ecf/internal/ui/deprecated/views/ChatRoomView.java
index f510348..64106dd 100644
--- a/framework/bundles/org.eclipse.ecf.ui/src/org/eclipse/ecf/internal/ui/deprecated/views/ChatRoomView.java
+++ b/framework/bundles/org.eclipse.ecf.ui/src/org/eclipse/ecf/internal/ui/deprecated/views/ChatRoomView.java
@@ -21,9 +21,12 @@
import java.util.Map;
import java.util.StringTokenizer;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
import org.eclipse.ecf.core.identity.ID;
import org.eclipse.ecf.core.user.IUser;
import org.eclipse.ecf.core.util.ECFException;
+import org.eclipse.ecf.internal.ui.Activator;
import org.eclipse.ecf.presence.IPresence;
import org.eclipse.ecf.presence.chatroom.IChatRoomContainer;
import org.eclipse.ecf.presence.chatroom.IChatRoomInfo;
@@ -188,14 +191,8 @@
readInlayComp.setLayout(new GridLayout());
readInlayComp.setLayoutData(new GridData(GridData.FILL_BOTH));
readInlayComp.setBackground(memberViewer.getList().getBackground());
- SourceViewer result = new SourceViewer(readInlayComp, null, null, true,
- SWT.BORDER | SWT.WRAP | SWT.V_SCROLL | SWT.MULTI | SWT.H_SCROLL
- | SWT.READ_ONLY);
- result.configure(new TextSourceViewerConfiguration(EditorsUI
- .getPreferenceStore()));
- result.setDocument(new Document());
- readText = result.getTextWidget();
+ readText = createStyledTextWidget(readInlayComp);
readText.setEditable(false);
readText.setLayoutData(new GridData(GridData.FILL_BOTH));
@@ -223,6 +220,32 @@
hookContextMenu();
}
+ private StyledText createStyledTextWidget(Composite parent) {
+ try {
+ SourceViewer result = new SourceViewer(parent, null, null,
+ true, SWT.BORDER | SWT.WRAP | SWT.V_SCROLL | SWT.MULTI
+ | SWT.READ_ONLY);
+ result.configure(new TextSourceViewerConfiguration(EditorsUI
+ .getPreferenceStore()));
+ result.setDocument(new Document());
+ return result.getTextWidget();
+ } catch (Exception e) {
+ Activator
+ .getDefault()
+ .getLog()
+ .log(
+ new Status(
+ IStatus.WARNING,
+ Activator.PLUGIN_ID,
+ IStatus.WARNING,
+ "Source viewer not available. Hyperlinking will be disabled.",
+ e));
+ return new StyledText(parent, SWT.BORDER | SWT.WRAP
+ | SWT.V_SCROLL | SWT.MULTI | SWT.READ_ONLY);
+ }
+ }
+
+
protected void setEnabled(boolean enabled) {
if (!writeText.isDisposed())
writeText.setEnabled(enabled);
diff --git a/framework/bundles/org.eclipse.ecf.ui/src/org/eclipse/ecf/internal/ui/deprecated/views/TextChatComposite.java b/framework/bundles/org.eclipse.ecf.ui/src/org/eclipse/ecf/internal/ui/deprecated/views/TextChatComposite.java
index 196192c..9c12043 100644
--- a/framework/bundles/org.eclipse.ecf.ui/src/org/eclipse/ecf/internal/ui/deprecated/views/TextChatComposite.java
+++ b/framework/bundles/org.eclipse.ecf.ui/src/org/eclipse/ecf/internal/ui/deprecated/views/TextChatComposite.java
@@ -136,15 +136,7 @@
SashForm sash = new SashForm(this, SWT.VERTICAL | SWT.SMOOTH);
sash.setLayoutData(new GridData(GridData.FILL_BOTH));
- // Setup text output
- SourceViewer result = new SourceViewer(sash, null, null, true,
- SWT.BORDER | SWT.WRAP | SWT.V_SCROLL | SWT.MULTI | SWT.H_SCROLL
- | SWT.READ_ONLY);
- result.configure(new TextSourceViewerConfiguration(EditorsUI
- .getPreferenceStore()));
- result.setDocument(new Document());
-
- styledText = result.getTextWidget();
+ styledText = createStyledTextWidget(sash);
styledText.setEditable(false);
// Setup text input
@@ -215,6 +207,32 @@
}
+ private StyledText createStyledTextWidget(Composite parent) {
+ try {
+ SourceViewer result = new SourceViewer(parent, null, null,
+ true, SWT.BORDER | SWT.WRAP | SWT.V_SCROLL | SWT.MULTI
+ | SWT.READ_ONLY);
+ result.configure(new TextSourceViewerConfiguration(EditorsUI
+ .getPreferenceStore()));
+ result.setDocument(new Document());
+ return result.getTextWidget();
+ } catch (Exception e) {
+ Activator
+ .getDefault()
+ .getLog()
+ .log(
+ new Status(
+ IStatus.WARNING,
+ Activator.PLUGIN_ID,
+ IStatus.WARNING,
+ "Source viewer not available. Hyperlinking will be disabled.",
+ e));
+ return new StyledText(parent, SWT.BORDER | SWT.WRAP
+ | SWT.V_SCROLL | SWT.MULTI | SWT.READ_ONLY);
+ }
+ }
+
+
private void makeActions() {
outputSelectAll = new Action() {
public void run() {