Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2007-06-26 20:10:43 +0000
committerslewis2007-06-26 20:10:43 +0000
commitdd396e18c79461237315e245b02b1cd4aa0ddbec (patch)
tree5558153a631a70a8b11e22970c864453db21b467
parent1a8db1e344e279c854ccaa8249d013b63e3f14a4 (diff)
downloadorg.eclipse.ecf-dd396e18c79461237315e245b02b1cd4aa0ddbec.tar.gz
org.eclipse.ecf-dd396e18c79461237315e245b02b1cd4aa0ddbec.tar.xz
org.eclipse.ecf-dd396e18c79461237315e245b02b1cd4aa0ddbec.zip
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).v20070626-1313
-rw-r--r--framework/bundles/org.eclipse.ecf.ui/META-INF/MANIFEST.MF2
-rw-r--r--framework/bundles/org.eclipse.ecf.ui/src/org/eclipse/ecf/internal/ui/deprecated/views/ChatRoomManagerView.java38
-rw-r--r--framework/bundles/org.eclipse.ecf.ui/src/org/eclipse/ecf/internal/ui/deprecated/views/ChatRoomView.java37
-rw-r--r--framework/bundles/org.eclipse.ecf.ui/src/org/eclipse/ecf/internal/ui/deprecated/views/TextChatComposite.java36
4 files changed, 88 insertions, 25 deletions
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 78794ae6e..78f2c971d 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 @@ Require-Bundle: org.eclipse.ecf,
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 8dbc55fcd..ab8770bb7 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.Map;
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.identity.IDFactory;
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 @@ public class ChatRoomManagerView extends ViewPart implements
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 @@ public class ChatRoomManagerView extends ViewPart implements
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 f510348e7..64106dd7b 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.List;
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 @@ public class ChatRoomView extends ViewPart implements
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 @@ public class ChatRoomView extends ViewPart implements
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 196192c46..9c1204304 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 @@ public class TextChatComposite extends Composite {
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 @@ public class TextChatComposite extends Composite {
}
+ 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() {

Back to the top