From 00004f21edbdea1429b2de2223c366e10740d16d Mon Sep 17 00:00:00 2001 From: Mark Peters Date: Fri, 10 Oct 2014 14:25:38 -0500 Subject: [PATCH] Omaha #3711 Allow configuration of how chat lines will display Change-Id: Ibe66602c4e527a265be4ce9758652eaebdbe132f Former-commit-id: 5d87f3d22dcc5486916979ccbceb8bac3fa930b9 [formerly b929d424107b0a2495f4305fd2500e362cccce4e] Former-commit-id: fb6131869c155761eae1fc6dbb1c3bbb121570cf --- .../ui/prefs/CollaborationPreferencePage.java | 9 ++++++++- .../collaboration/ui/session/AbstractSessionView.java | 6 +++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/prefs/CollaborationPreferencePage.java b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/prefs/CollaborationPreferencePage.java index 2308086953..ed748bc880 100644 --- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/prefs/CollaborationPreferencePage.java +++ b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/prefs/CollaborationPreferencePage.java @@ -45,6 +45,7 @@ import com.raytheon.uf.viz.collaboration.ui.prefs.CollabPrefConstants.HandleOpti * Jan 14, 2014 2630 bclement added away on idle * Jan 27, 2014 2700 bclement added auto accept subscribe * Feb 3, 2014 2699 bclement added handle preferences + * Oct 9, 2014 3711 mapeters added chat lines preferences * * * @@ -83,9 +84,15 @@ public class CollaborationPreferencePage extends FieldEditorPreferencePage */ @Override protected void createFieldEditors() { + FieldEditor chatLines = new BooleanFieldEditor("chatLines", + "Display Chat Messages On Separate Line From Time And Name", + getFieldEditorParent()); + this.addField(chatLines); + FieldEditor notifications = new BooleanFieldEditor("notifications", - "Show Notifications", getFieldEditorParent()); + "Show Chat Notification Popups", getFieldEditorParent()); this.addField(notifications); + FieldEditor autojoinColl = new BooleanFieldEditor( CollabPrefConstants.AUTO_JOIN, "Join Discussion On Login", getFieldEditorParent()); diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/session/AbstractSessionView.java b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/session/AbstractSessionView.java index f7e2c95fd5..11990c7c8f 100644 --- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/session/AbstractSessionView.java +++ b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/session/AbstractSessionView.java @@ -93,6 +93,7 @@ import com.raytheon.viz.ui.views.CaveFloatingView; * Mar 11, 2014 #2865 lvenable Added null checks for msgArchive. * Jun 20, 2014 3281 bclement made sendErrorMessage() public * Jun 27, 2014 3323 bclement fixed disposed font issue + * Oct 09, 2014 3711 mapeters Display chat text in accordance with preferences. * * * @author rferrel @@ -358,8 +359,11 @@ public abstract class AbstractSessionView extends sb.append("(").append(time).append(") "); int offset = sb.length(); - sb.append(name).append(": ").append(body); + boolean newLine = Activator.getDefault() + .getPreferenceStore().getBoolean("chatLines"); + String displayPreference = newLine ? ("\n ") : (": "); + sb.append(name).append(displayPreference).append(body); // here is the place to put the font and color changes for // keywords // read in localization file once and then don't read in again,