Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 95669 Details for
Bug 222253
[collab][ui] The height of the irc/collaboration chat input field is lower
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
example.collab.patch
example.collab.patch (text/plain), 38.34 KB, created by
Hiroyuki
on 2008-04-11 09:18:52 EDT
(
hide
)
Description:
example.collab.patch
Filename:
MIME Type:
Creator:
Hiroyuki
Created:
2008-04-11 09:18:52 EDT
Size:
38.34 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.ecf.example.collab >Index: src/org/eclipse/ecf/internal/example/collab/ui/MessageLoader.properties >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.ecf/plugins/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/internal/example/collab/ui/MessageLoader.properties,v >retrieving revision 1.4 >diff -u -r1.4 MessageLoader.properties >--- src/org/eclipse/ecf/internal/example/collab/ui/MessageLoader.properties 9 Apr 2008 21:25:36 -0000 1.4 >+++ src/org/eclipse/ecf/internal/example/collab/ui/MessageLoader.properties 11 Apr 2008 13:14:33 -0000 >@@ -84,4 +84,38 @@ > LineChatClientView.textinputinit=<input chat text here> > > LineChatClientView.contextmenu.closeMessageTitle=Confirm Close Collaboration for Project >-LineChatClientView.contextmenu.closeMessageMessage=Are you sure you want to close collaboration for ''{0}''? >\ No newline at end of file >+LineChatClientView.contextmenu.closeMessageMessage=Are you sure you want to close collaboration for ''{0}''? >+ >+ClientPreferencePage.PREF_USE_CHAT_WINDOW=Display ECF Collaboration outside of the workbench >+ClientPreferencePage.PREF_DISPLAY_TIMESTAMP=Show time for each chat entry >+ClientPreferencePage.PREF_CHAT_FONT=Chat window font: >+#ClientPreferencePage.PREF_ME_TEXT_COLOR=Chat Text Color For Me: >+ClientPreferencePage.PREF_ME_TEXT_COLOR=Chat text color for message: >+#ClientPreferencePage.PREF_OTHER_TEXT_COLOR=Chat Text Color For Other: >+ClientPreferencePage.PREF_OTHER_TEXT_COLOR=Chat text color for other: >+#ClientPreferencePage.PREF_SYSTEM_TEXT_COLOR=Chat Text Color For System: >+ClientPreferencePage.PREF_SYSTEM_TEXT_COLOR=Chat text color for system: >+ClientPreferencePage.PREF_SHAREDEDITOR_PLAY_EVENTS_IMMEDIATELY=Play shared editor events immediately >+ClientPreferencePage.PREF_SHAREDEDITOR_ASK_RECEIVER=Ask receiver for permission to display shared editor events >+ >+ConnectionDialog.PAGE_DESCRIPTION=Select protocol provider, complete account info and login >+ConnectionDialog.JOINGROUP_FIELDNAME=Group ID: >+ConnectionDialog.NICKNAME_FIELDNAME=Nickname: >+ConnectionDialog.ECF_DEFAULT_URL=ecftcp://localhost:3282/server >+ConnectionDialog.ECF_TEMPLATE_URL=<protocol>://<machinename>:<port>/<servicename> >+ConnectionDialog.PAGE_TITLE=Connect with ECF >+ConnectionDialog.DEFAULT_CLIENT=ecf.generic.client >+ConnectionDialog.Connection_Protocol=Connection Protocol >+ConnectionDialog.Login_automatically=Login &automatically at startup >+ConnectionDialog.ECF_Connection=ECF Connection >+ConnectionDialog.Please_choose_provider=Please choose a provider and supply connection parameters. >+ConnectionDialog.Connect=Connect >+ >+JoinGroupWizardPage.PAGE_DESCRIPTION=Complete account info and choose 'Finish' to login. >+JoinGroupWizardPage.JOINGROUP_FIELDNAME=Group ID: >+JoinGroupWizardPage.NICKNAME_FIELDNAME=Nickname: >+JoinGroupWizardPage.ECF_DEFAULT_URL=ecftcp://ecf.eclipse.org:3282/server >+JoinGroupWizardPage.ECF_TEMPLATE_URL=ecftcp://<server>:<port>/<groupname> >+JoinGroupWizardPage.PAGE_TITLE=Connect Generic Client >+JoinGroupWizardPage.DEFAULT_CLIENT=ecf.generic.client >+JoinGroupWizardPage.Protocol=Protocol: >Index: src/org/eclipse/ecf/internal/example/collab/ui/ChatWindow.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.ecf/plugins/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/internal/example/collab/ui/ChatWindow.java,v >retrieving revision 1.8 >diff -u -r1.8 ChatWindow.java >--- src/org/eclipse/ecf/internal/example/collab/ui/ChatWindow.java 3 Mar 2008 22:32:16 -0000 1.8 >+++ src/org/eclipse/ecf/internal/example/collab/ui/ChatWindow.java 11 Apr 2008 13:14:33 -0000 >@@ -11,6 +11,7 @@ > > package org.eclipse.ecf.internal.example.collab.ui; > >+import org.eclipse.ecf.example.collab.share.User; > import org.eclipse.ecf.internal.example.collab.Messages; > import org.eclipse.ecf.ui.SharedImages; > import org.eclipse.jface.viewers.TableViewer; >@@ -48,6 +49,8 @@ > > private boolean flashing; > >+ private User localUser; >+ > private final Runnable flipImage = new Runnable() { > public void run() { > final Shell shell = getShell(); >@@ -64,10 +67,11 @@ > > private Flash flash; > >- public ChatWindow(LineChatClientView view, TableViewer table, String initText) { >+ public ChatWindow(LineChatClientView view, TableViewer table, User localUser, String initText) { > super(null); > this.view = view; > this.table = table; >+ this.localUser = localUser; > this.initText = initText; > addStatusLine(); > } >@@ -116,7 +120,7 @@ > * @see org.eclipse.jface.window.Window#createContents(org.eclipse.swt.widgets.Composite) > */ > protected Control createContents(Composite parent) { >- chat = new ChatComposite(view, parent, table, initText, this); >+ chat = new ChatComposite(view, parent, table, localUser, initText, this); > chat.setLayoutData(new GridData(GridData.FILL_BOTH)); > chat.setFont(parent.getFont()); > return chat; >Index: src/org/eclipse/ecf/internal/example/collab/ui/TeamChat.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.ecf/plugins/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/internal/example/collab/ui/TeamChat.java,v >retrieving revision 1.10 >diff -u -r1.10 TeamChat.java >--- src/org/eclipse/ecf/internal/example/collab/ui/TeamChat.java 20 Jun 2007 17:34:48 -0000 1.10 >+++ src/org/eclipse/ecf/internal/example/collab/ui/TeamChat.java 11 Apr 2008 13:14:33 -0000 >@@ -24,6 +24,8 @@ > import org.eclipse.swt.custom.SashForm; > import org.eclipse.swt.graphics.Image; > import org.eclipse.swt.layout.FillLayout; >+import org.eclipse.swt.layout.GridData; >+import org.eclipse.swt.layout.GridLayout; > import org.eclipse.swt.widgets.Composite; > import org.eclipse.swt.widgets.Control; > import org.eclipse.swt.widgets.ToolBar; >@@ -35,13 +37,16 @@ > ToolBar bar; > LineChatClientView view; > ChatWindow chatWindow; >+ User localUser; > > static final int DEFAULT_TREE_WIDGET_PERCENT = 15; > > TeamChat(LineChatClientView view, Composite parent, int options, >- String initText) { >+ User localUser, String initText) { > super(parent, options); > >+ this.localUser = localUser; >+ > this.view = view; > setLayout(new FillLayout()); > boolean useChatWindow = ClientPlugin.getDefault() >@@ -57,18 +62,31 @@ > w[1] = 100 - w[0]; > } > >+ Composite left = new Composite(sash, SWT.NONE); >+ GridLayout layout = new GridLayout(); >+ layout.marginHeight=0; >+ layout.marginWidth=0; >+ layout.verticalSpacing=0; >+ layout.horizontalSpacing=0; >+ layout.marginTop=1; >+ layout.marginBottom=0; >+ layout.marginLeft=0; >+ layout.marginRight=0; >+ left.setLayout(layout); >+ > tableView = new TableViewer(useChatWindow ? (Composite) this >- : (Composite) sash, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL >+ : (Composite) /*sash*/left, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL > | SWT.BORDER); > tableView.setContentProvider(new ViewContentProvider()); > tableView.setLabelProvider(new ViewLabelProvider()); >+ tableView.getControl().setLayoutData(new GridData(GridData.FILL_BOTH)); > > if (useChatWindow) { >- chatWindow = new ChatWindow(view, tableView, initText); >+ chatWindow = new ChatWindow(view, tableView, localUser, initText); > chatWindow.create(); > chat = chatWindow.getChat(); > } else { >- chat = new ChatComposite(view, sash, tableView, initText); >+ chat = new ChatComposite(view, sash, tableView, localUser, initText); > sash.setWeights(w); > } > } >Index: src/org/eclipse/ecf/internal/example/collab/ui/ChatComposite.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.ecf/plugins/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/internal/example/collab/ui/ChatComposite.java,v >retrieving revision 1.23 >diff -u -r1.23 ChatComposite.java >--- src/org/eclipse/ecf/internal/example/collab/ui/ChatComposite.java 9 Apr 2008 21:25:36 -0000 1.23 >+++ src/org/eclipse/ecf/internal/example/collab/ui/ChatComposite.java 11 Apr 2008 13:14:33 -0000 >@@ -29,6 +29,8 @@ > import org.eclipse.ecf.example.collab.share.User; > import org.eclipse.ecf.example.collab.share.io.FileTransferParams; > import org.eclipse.ecf.internal.example.collab.ClientPlugin; >+import org.eclipse.ecf.presence.ui.chatroom.MessageRenderer; >+import org.eclipse.ecf.ui.SharedImages; > import org.eclipse.ecf.ui.screencapture.IImageSender; > import org.eclipse.ecf.ui.screencapture.ScreenCaptureJob; > import org.eclipse.jface.action.Action; >@@ -40,8 +42,9 @@ > import org.eclipse.jface.dialogs.InputDialog; > import org.eclipse.jface.dialogs.MessageDialog; > import org.eclipse.jface.preference.IPreferenceStore; >-import org.eclipse.jface.resource.FontRegistry; >+//import org.eclipse.jface.resource.FontRegistry; > import org.eclipse.jface.resource.ImageDescriptor; >+import org.eclipse.jface.resource.JFaceResources; > import org.eclipse.jface.text.Document; > import org.eclipse.jface.text.ITextSelection; > import org.eclipse.jface.text.TextSelection; >@@ -59,11 +62,11 @@ > import org.eclipse.jface.window.Window; > import org.eclipse.osgi.util.NLS; > import org.eclipse.swt.SWT; >-import org.eclipse.swt.custom.SashForm; >+//import org.eclipse.swt.custom.SashForm; > import org.eclipse.swt.custom.StyleRange; > import org.eclipse.swt.custom.StyledText; >-import org.eclipse.swt.events.DisposeEvent; >-import org.eclipse.swt.events.DisposeListener; >+//import org.eclipse.swt.events.DisposeEvent; >+//import org.eclipse.swt.events.DisposeListener; > import org.eclipse.swt.events.FocusEvent; > import org.eclipse.swt.events.FocusListener; > import org.eclipse.swt.events.KeyEvent; >@@ -73,11 +76,14 @@ > import org.eclipse.swt.events.MouseEvent; > import org.eclipse.swt.events.MouseListener; > import org.eclipse.swt.graphics.Color; >-import org.eclipse.swt.graphics.FontData; >+//import org.eclipse.swt.graphics.FontData; >+import org.eclipse.swt.graphics.FontMetrics; >+import org.eclipse.swt.graphics.GC; > import org.eclipse.swt.graphics.Image; > import org.eclipse.swt.graphics.ImageData; >-import org.eclipse.swt.layout.FillLayout; >+//import org.eclipse.swt.layout.FillLayout; > import org.eclipse.swt.layout.GridData; >+import org.eclipse.swt.layout.GridLayout; > import org.eclipse.swt.widgets.Composite; > import org.eclipse.swt.widgets.Control; > import org.eclipse.swt.widgets.Display; >@@ -94,16 +100,17 @@ > import org.eclipse.ui.dialogs.ISelectionStatusValidator; > import org.eclipse.ui.editors.text.EditorsUI; > import org.eclipse.ui.editors.text.TextSourceViewerConfiguration; >+//import org.eclipse.ui.part.ViewPart; > import org.eclipse.ui.views.IViewCategory; > import org.eclipse.ui.views.IViewDescriptor; > import org.eclipse.ui.views.IViewRegistry; > > public class ChatComposite extends Composite { >- private static final String CHAT_OUTPUT_FONT = "ChatFont"; //$NON-NLS-1$ >+// private static final String CHAT_OUTPUT_FONT = "ChatFont"; //$NON-NLS-1$ > final LineChatClientView view; >- private Color meColor = null; >- private Color otherColor = null; >- private Color systemColor = null; >+// private Color meColor = null; >+// private Color otherColor = null; >+// private Color systemColor = null; > > Action appShare = null; > >@@ -121,12 +128,15 @@ > > Action showChatWindow; > >- protected final String TEXT_INPUT_INIT = MessageLoader.getString("LineChatClientView.textinputinit"); //$NON-NLS-1$ >+// protected final String TEXT_INPUT_INIT = MessageLoader.getString("LineChatClientView.textinputinit"); //$NON-NLS-1$ > protected static final int DEFAULT_INPUT_HEIGHT = 25; > protected static final int DEFAULT_INPUT_SEPARATOR = 5; > > Text textinput = null; > StyledText textoutput = null; >+ >+ MessageRenderer messageRenderer = null; >+ > TableViewer tableView = null; > ChatDropTarget chatDropTarget = null; > TreeDropTarget treeDropTarget = null; >@@ -134,61 +144,97 @@ > ChatWindow chatWindow; > boolean typing; > >- ChatComposite(LineChatClientView view, Composite parent, TableViewer table, String initText) { >- this(view, parent, table, initText, null); >+ User localUser; >+ >+ ChatComposite(LineChatClientView view, Composite parent, TableViewer table, User localUser, String initText) { >+ this(view, parent, table, localUser, initText, null); > } > >- ChatComposite(LineChatClientView view, Composite parent, TableViewer table, String initText, ChatWindow chatWindow) { >+ ChatComposite(LineChatClientView view, Composite parent, TableViewer table, User localUser, String initText, ChatWindow chatWindow) { > super(parent, SWT.NONE); > this.view = view; > this.chatWindow = chatWindow; >- setLayout(new FillLayout()); >- meColor = colorFromRGBString(ClientPlugin.getDefault().getPluginPreferences().getString(ClientPlugin.PREF_ME_TEXT_COLOR)); >- otherColor = colorFromRGBString(ClientPlugin.getDefault().getPluginPreferences().getString(ClientPlugin.PREF_OTHER_TEXT_COLOR)); >- systemColor = colorFromRGBString(ClientPlugin.getDefault().getPluginPreferences().getString(ClientPlugin.PREF_SYSTEM_TEXT_COLOR)); >+ this.localUser = localUser; >+ //setLayout(new FillLayout()); >+ GridLayout layout = new GridLayout(); >+ layout.marginHeight=0; >+ layout.marginWidth=0; >+ layout.verticalSpacing=3; >+ layout.horizontalSpacing=3; >+ layout.marginTop=1; >+ layout.marginBottom=0; >+ layout.marginRight=1; >+ setLayout(layout); >+// meColor = colorFromRGBString(ClientPlugin.getDefault().getPluginPreferences().getString(ClientPlugin.PREF_ME_TEXT_COLOR)); >+// otherColor = colorFromRGBString(ClientPlugin.getDefault().getPluginPreferences().getString(ClientPlugin.PREF_OTHER_TEXT_COLOR)); >+// systemColor = colorFromRGBString(ClientPlugin.getDefault().getPluginPreferences().getString(ClientPlugin.PREF_SYSTEM_TEXT_COLOR)); > ClientPlugin.getDefault().getPluginPreferences().addPropertyChangeListener(new ColorPropertyChangeListener()); > >- this.addDisposeListener(new DisposeListener() { >- >- public void widgetDisposed(DisposeEvent e) { >- if (meColor != null) { >- meColor.dispose(); >- } >- >- if (otherColor != null) { >- otherColor.dispose(); >- } >- >- if (systemColor != null) { >- systemColor.dispose(); >- } >- } >- >- }); >- final SashForm sf = new SashForm(this, SWT.NORMAL); >- sf.setLayout(new FillLayout()); >- sf.setOrientation(SWT.VERTICAL); >+// this.addDisposeListener(new DisposeListener() { >+// >+// public void widgetDisposed(DisposeEvent e) { >+// if (meColor != null) { >+// meColor.dispose(); >+// } >+// >+// if (otherColor != null) { >+// otherColor.dispose(); >+// } >+// >+// if (systemColor != null) { >+// systemColor.dispose(); >+// } >+// } >+// >+// }); >+ >+ //final SashForm sf = new SashForm(this, SWT.NORMAL); >+ //sf.setLayout(new FillLayout()); >+ //sf.setOrientation(SWT.VERTICAL); >+ Composite sf = this; > > tableView = table; > > textoutput = createStyledTextWidget(sf); >- textoutput.setLayoutData(new GridData(SWT.FILL)); >- final String fontName = ClientPlugin.getDefault().getPluginPreferences().getString(ClientPlugin.PREF_CHAT_FONT); >- if (!(fontName == null) && !(fontName.equals(""))) { //$NON-NLS-1$ >- final FontRegistry fr = ClientPlugin.getDefault().getFontRegistry(); >- final FontData[] newFont = {new FontData(fontName)}; >- >- fr.put(CHAT_OUTPUT_FONT, newFont); >- textoutput.setFont(fr.get(CHAT_OUTPUT_FONT)); >- } >+ //textoutput.setLayoutData(new GridData(SWT.FILL)); >+ textoutput.setLayoutData(new GridData(GridData.FILL_BOTH)); >+// final String fontName = ClientPlugin.getDefault().getPluginPreferences().getString(ClientPlugin.PREF_CHAT_FONT); >+// if (!(fontName == null) && !(fontName.equals(""))) { //$NON-NLS-1$ >+// final FontRegistry fr = ClientPlugin.getDefault().getFontRegistry(); >+// final FontData[] newFont = {new FontData(fontName)}; >+// >+// fr.put(CHAT_OUTPUT_FONT, newFont); >+// textoutput.setFont(fr.get(CHAT_OUTPUT_FONT)); >+// } > >+ messageRenderer = new MessageRenderer(); >+ > ClientPlugin.getDefault().getPluginPreferences().addPropertyChangeListener(new FontPropertyChangeListener()); > >- textoutput.append(initText); >- >- textinput = new Text(sf, SWT.SINGLE | SWT.BORDER); >- textinput.setText(TEXT_INPUT_INIT); >- textinput.setLayoutData(new GridData(SWT.FILL)); >+ String local = localUser.getNickname(); >+ String output = messageRenderer.render(initText, null, local); >+ StyleRange[] ranges = messageRenderer.getStyleRanges(); >+ int startRange = textoutput.getText().length(); >+ textoutput.append(output); >+ if (ranges != null) { >+ // set all ranges to start as message line starts >+ for (int i = 0; i < ranges.length; i++) { >+ ranges[i].start += startRange; >+ } >+ textoutput.replaceStyleRanges(startRange, output.length(), ranges); >+ } >+ >+ //textinput = new Text(sf, SWT.SINGLE | SWT.BORDER); >+ textinput = new Text(sf, SWT.MULTI | SWT.BORDER | SWT.V_SCROLL | SWT.WRAP); >+// textinput.setText(TEXT_INPUT_INIT); >+ //textinput.setLayoutData(new GridData(SWT.FILL)); >+ GridData gd = new GridData(GridData.FILL_HORIZONTAL); >+ GC gc = new GC(textinput); >+ gc.setFont(JFaceResources.getDialogFont()); >+ FontMetrics fontMetrics = gc.getFontMetrics(); >+ gc.dispose(); >+ gd.heightHint = fontMetrics.getHeight() * 2; >+ textinput.setLayoutData(gd); > > textinput.selectAll(); > textinput.addKeyListener(new KeyListener() { >@@ -202,10 +248,10 @@ > }); > textinput.addFocusListener(new FocusListener() { > public void focusGained(FocusEvent e) { >- final String t = textinput.getText(); >- if (t.equals(TEXT_INPUT_INIT)) { >- textinput.selectAll(); >- } >+// final String t = textinput.getText(); >+// if (t.equals(TEXT_INPUT_INIT)) { >+// textinput.selectAll(); >+// } > } > > public void focusLost(FocusEvent e) { >@@ -219,10 +265,10 @@ > } > > public void mouseUp(MouseEvent e) { >- final String t = textinput.getText(); >- if (t.equals(TEXT_INPUT_INIT)) { >- textinput.selectAll(); >- } >+// final String t = textinput.getText(); >+// if (t.equals(TEXT_INPUT_INIT)) { >+// textinput.selectAll(); >+// } > } > }); > textinput.addModifyListener(new ModifyListener() { >@@ -236,7 +282,8 @@ > } > }); > >- sf.setWeights(new int[] {90, 10}); >+ //sf.setWeights(new int[] {90, 10}); >+ > // make actions > makeActions(); > hookContextMenu(); >@@ -265,32 +312,64 @@ > } > > final User user = text.getOriginator(); >- final StyleRange range = new StyleRange(); >- range.start = textoutput.getText().length(); >- if (user != null) { >- String prefix = user.getNickname() + ": "; //$NON-NLS-1$ >- final String date = text.getDate(); >- if (date != null && !date.equals("")) { //$NON-NLS-1$ >- prefix = date + ' ' + prefix; >- } >- range.length = prefix.length(); >- range.foreground = user.equals(view.userdata) ? meColor : otherColor; >- textoutput.append(prefix); >- textoutput.setStyleRange(range); >- textoutput.append(text.getText()); >- } else { >- String content = text.getText(); >- final String date = text.getDate(); >- if (date != null && !date.equals("")) { //$NON-NLS-1$ >- content = date + ' ' + content; >- } >- range.length = content.length(); >- range.foreground = otherColor; >- textoutput.append(content); >+ >+ String name = (user!=null)? user.getNickname() : null; >+ String local = localUser.getNickname(); >+ String output = messageRenderer.render(text.getText(), name, local); >+ StyleRange[] ranges = messageRenderer.getStyleRanges(); >+ >+// final StyleRange range = new StyleRange(); >+// range.start = textoutput.getText().length(); >+// if (user != null) { >+// String prefix = user.getNickname() + ": "; //$NON-NLS-1$ >+// final String date = text.getDate(); >+// if (date != null && !date.equals("")) { //$NON-NLS-1$ >+// prefix = date + ' ' + prefix; >+// } >+// range.length = prefix.length(); >+// range.foreground = user.equals(view.userdata) ? meColor : otherColor; >+// textoutput.append(prefix); >+// textoutput.setStyleRange(range); >+// //textoutput.append(text.getText()); >+// String content = text.getText(); >+// int startLength = textoutput.getText().length(); >+// hyperlinkRenderer.scan(content); >+// textoutput.append(content); >+// hyperlinkRenderer.setStyleRange(startLength, null); >+// } else { >+// String content = text.getText(); >+// final String date = text.getDate(); >+// if (date != null && !date.equals("")) { //$NON-NLS-1$ >+// content = date + ' ' + content; >+// } >+// range.length = content.length(); >+// range.foreground = otherColor; >+// >+// int startLength = textoutput.getText().length(); >+// hyperlinkRenderer.scan(content); >+// textoutput.append(content); >+// hyperlinkRenderer.setStyleRange(startLength, null); >+// } >+ >+ if (output == null) { >+ return; > } > >+ int startRange = textoutput.getText().length(); >+ > if (!text.isNoCRLF()) { >- textoutput.append(Text.DELIMITER); >+ output = output+Text.DELIMITER; >+ } >+ >+ textoutput.append(output); >+ >+ if (ranges != null) { >+ >+ // set all ranges to start as message line starts >+ for (int i = 0; i < ranges.length; i++) { >+ ranges[i].start += startRange; >+ } >+ textoutput.replaceStyleRanges(startRange, output.length(), ranges); > } > > // scroll to end >@@ -635,7 +714,7 @@ > } > }; > coBrowseURL.setText(MessageLoader.getString("LineChatClientView.contextmenu.cobrowse")); //$NON-NLS-1$ >- >+ > appShare = new Action() { > public void run() { > } >@@ -843,8 +922,9 @@ > } > > protected void outputClear() { >- if (MessageDialog.openConfirm(null, MessageLoader.getString("ChatComposite.DIALOG_CONFIRM_CLEAR_TITLE"), MessageLoader.getString("ChatComposite.DIALOG_CONFIRM_CLEAR_TEXT"))) //$NON-NLS-1$ //$NON-NLS-2$ >+ if (MessageDialog.openConfirm(null, MessageLoader.getString("ChatComposite.DIALOG_CONFIRM_CLEAR_TITLE"), MessageLoader.getString("ChatComposite.DIALOG_CONFIRM_CLEAR_TEXT"))) { //$NON-NLS-1$ //$NON-NLS-2$ > textoutput.setText(""); //$NON-NLS-1$ >+ } > } > > protected void outputCopy() { >@@ -1034,14 +1114,14 @@ > treeDropTarget = new TreeDropTarget(view, tableView.getControl(), this); > } > >- private Color colorFromRGBString(String rgb) { >- if (rgb == null || rgb.equals("")) { //$NON-NLS-1$ >- return new Color(getShell().getDisplay(), 0, 0, 0); >- } else { >- final String[] vals = rgb.split(","); //$NON-NLS-1$ >- return new Color(getShell().getDisplay(), Integer.parseInt(vals[0]), Integer.parseInt(vals[1]), Integer.parseInt(vals[2])); >- } >- } >+// private Color colorFromRGBString(String rgb) { >+// if (rgb == null || rgb.equals("")) { //$NON-NLS-1$ >+// return new Color(getShell().getDisplay(), 0, 0, 0); >+// } else { >+// final String[] vals = rgb.split(","); //$NON-NLS-1$ >+// return new Color(getShell().getDisplay(), Integer.parseInt(vals[0]), Integer.parseInt(vals[1]), Integer.parseInt(vals[2])); >+// } >+// } > > private class ColorPropertyChangeListener implements org.eclipse.core.runtime.Preferences.IPropertyChangeListener { > >@@ -1051,12 +1131,12 @@ > * @see org.eclipse.core.runtime.Preferences.IPropertyChangeListener#propertyChange(org.eclipse.core.runtime.Preferences.PropertyChangeEvent) > */ > public void propertyChange(PropertyChangeEvent event) { >- meColor.dispose(); >- otherColor.dispose(); >- systemColor.dispose(); >- meColor = colorFromRGBString(ClientPlugin.getDefault().getPluginPreferences().getString(ClientPlugin.PREF_ME_TEXT_COLOR)); >- otherColor = colorFromRGBString(ClientPlugin.getDefault().getPluginPreferences().getString(ClientPlugin.PREF_OTHER_TEXT_COLOR)); >- systemColor = colorFromRGBString(ClientPlugin.getDefault().getPluginPreferences().getString(ClientPlugin.PREF_SYSTEM_TEXT_COLOR)); >+// meColor.dispose(); >+// otherColor.dispose(); >+// systemColor.dispose(); >+// meColor = colorFromRGBString(ClientPlugin.getDefault().getPluginPreferences().getString(ClientPlugin.PREF_ME_TEXT_COLOR)); >+// otherColor = colorFromRGBString(ClientPlugin.getDefault().getPluginPreferences().getString(ClientPlugin.PREF_OTHER_TEXT_COLOR)); >+// systemColor = colorFromRGBString(ClientPlugin.getDefault().getPluginPreferences().getString(ClientPlugin.PREF_SYSTEM_TEXT_COLOR)); > } > > } >@@ -1068,16 +1148,16 @@ > * @see org.eclipse.core.runtime.Preferences.IPropertyChangeListener#propertyChange(org.eclipse.core.runtime.Preferences.PropertyChangeEvent) > */ > public void propertyChange(org.eclipse.core.runtime.Preferences.PropertyChangeEvent event) { >- if (event.getProperty().equals(ClientPlugin.PREF_CHAT_FONT)) { >- final String fontName = ClientPlugin.getDefault().getPluginPreferences().getString(ClientPlugin.PREF_CHAT_FONT); >- if (!(fontName == null) && !(fontName.equals(""))) { //$NON-NLS-1$ >- final FontRegistry fr = ClientPlugin.getDefault().getFontRegistry(); >- final FontData[] newFont = {new FontData(fontName)}; >- >- fr.put(CHAT_OUTPUT_FONT, newFont); >- textoutput.setFont(fr.get(CHAT_OUTPUT_FONT)); >- } >- } >+// if (event.getProperty().equals(ClientPlugin.PREF_CHAT_FONT)) { >+// final String fontName = ClientPlugin.getDefault().getPluginPreferences().getString(ClientPlugin.PREF_CHAT_FONT); >+// if (!(fontName == null) && !(fontName.equals(""))) { //$NON-NLS-1$ >+// final FontRegistry fr = ClientPlugin.getDefault().getFontRegistry(); >+// final FontData[] newFont = {new FontData(fontName)}; >+// >+// fr.put(CHAT_OUTPUT_FONT, newFont); >+// textoutput.setFont(fr.get(CHAT_OUTPUT_FONT)); >+// } >+// } > } > > } >Index: src/org/eclipse/ecf/internal/example/collab/ui/ClientPreferencePage.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.ecf/plugins/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/internal/example/collab/ui/ClientPreferencePage.java,v >retrieving revision 1.3 >diff -u -r1.3 ClientPreferencePage.java >--- src/org/eclipse/ecf/internal/example/collab/ui/ClientPreferencePage.java 3 Mar 2008 22:32:16 -0000 1.3 >+++ src/org/eclipse/ecf/internal/example/collab/ui/ClientPreferencePage.java 11 Apr 2008 13:14:33 -0000 >@@ -35,8 +35,8 @@ > > this.getPreferenceStore().setDefault(ClientPlugin.PREF_USE_CHAT_WINDOW, > false); >- this.getPreferenceStore().setDefault( >- ClientPlugin.PREF_DISPLAY_TIMESTAMP, true); >+// this.getPreferenceStore().setDefault( >+// ClientPlugin.PREF_DISPLAY_TIMESTAMP, true); > > // this.getPreferenceStore().setDefault(ClientPlugin.PREF_CHAT_FONT, > // ""); >@@ -71,21 +71,21 @@ > addField(new BooleanFieldEditor(ClientPlugin.PREF_USE_CHAT_WINDOW, > Messages.ClientPreferencePage_USE_CHAT_WINDOW_FIELD_TEXT, > getFieldEditorParent())); >- addField(new BooleanFieldEditor(ClientPlugin.PREF_DISPLAY_TIMESTAMP, >- Messages.ClientPreferencePage_SHOW_TIME_FOR_CHAT_FIELD, getFieldEditorParent())); >- addField(new FontFieldEditor(ClientPlugin.PREF_CHAT_FONT, >- Messages.ClientPreferencePage_CHAT_WINDOW_FONT_FIELD, getFieldEditorParent())); >+// addField(new BooleanFieldEditor(ClientPlugin.PREF_DISPLAY_TIMESTAMP, >+// Messages.ClientPreferencePage_SHOW_TIME_FOR_CHAT_FIELD, getFieldEditorParent())); >+// addField(new FontFieldEditor(ClientPlugin.PREF_CHAT_FONT, >+// Messages.ClientPreferencePage_CHAT_WINDOW_FONT_FIELD, getFieldEditorParent())); > // addField(new > // BooleanFieldEditor(ClientPlugin.PREF_CONFIRM_FILE_RECEIVE, "Confirm > // before receiving file.", getFieldEditorParent())); > // addField(new SpacerFieldEditor( > // getFieldEditorParent())); >- addField(new ColorFieldEditor(ClientPlugin.PREF_ME_TEXT_COLOR, >- Messages.ClientPreferencePage_CHAT_COLOR_FOR_ME_FIELD, getFieldEditorParent())); >- addField(new ColorFieldEditor(ClientPlugin.PREF_OTHER_TEXT_COLOR, >- Messages.ClientPreferencePage_CHAT_TEXT_COLOR_FOR_OTHER_FIELD, getFieldEditorParent())); >- addField(new ColorFieldEditor(ClientPlugin.PREF_SYSTEM_TEXT_COLOR, >- Messages.ClientPreferencePage_CHAT_COLOR_FOR_SYSTEM_FIELD, getFieldEditorParent())); >+// addField(new ColorFieldEditor(ClientPlugin.PREF_ME_TEXT_COLOR, >+// Messages.ClientPreferencePage_CHAT_COLOR_FOR_ME_FIELD, getFieldEditorParent())); >+// addField(new ColorFieldEditor(ClientPlugin.PREF_OTHER_TEXT_COLOR, >+// Messages.ClientPreferencePage_CHAT_TEXT_COLOR_FOR_OTHER_FIELD, getFieldEditorParent())); >+// addField(new ColorFieldEditor(ClientPlugin.PREF_SYSTEM_TEXT_COLOR, >+// Messages.ClientPreferencePage_CHAT_COLOR_FOR_SYSTEM_FIELD, getFieldEditorParent())); > addField(new SpacerFieldEditor(getFieldEditorParent())); > > playImmediate = new BooleanFieldEditor( >Index: src/org/eclipse/ecf/internal/example/collab/ui/LineChatClientView.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.ecf/plugins/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/internal/example/collab/ui/LineChatClientView.java,v >retrieving revision 1.15 >diff -u -r1.15 LineChatClientView.java >--- src/org/eclipse/ecf/internal/example/collab/ui/LineChatClientView.java 3 Mar 2008 22:32:16 -0000 1.15 >+++ src/org/eclipse/ecf/internal/example/collab/ui/LineChatClientView.java 11 Apr 2008 13:14:33 -0000 >@@ -61,8 +61,9 @@ > public static final String SHOWURLARGTYPES[] = {ID.class.getName(), "java.lang.String"}; //$NON-NLS-1$ > public static final String SHOWURLCLASSNAME = ShowURLSharedObject.class.getName(); > >- private boolean showTimestamp = ClientPlugin.getDefault().getPreferenceStore().getBoolean(ClientPlugin.PREF_DISPLAY_TIMESTAMP); >- private final SimpleDateFormat df = new SimpleDateFormat("MM/dd hh:mm a"); //$NON-NLS-1$ >+// private boolean showTimestamp = ClientPlugin.getDefault().getPreferenceStore().getBoolean(ClientPlugin.PREF_DISPLAY_TIMESTAMP); >+ //private final SimpleDateFormat df = new SimpleDateFormat("MM/dd hh:mm a"); //$NON-NLS-1$ >+ private final SimpleDateFormat df = new SimpleDateFormat("hh:MM:ss"); //$NON-NLS-1$ > String downloaddir; > EclipseCollabSharedObject lch; > Hashtable myNames = new Hashtable(); >@@ -78,20 +79,23 @@ > this.lch = lch; > this.view = view; > this.name = name; >- this.teamChat = new TeamChat(this, view.tabFolder, SWT.NULL, initText); > this.userdata = lch.getUser(); >+ this.teamChat = new TeamChat(this, view.tabFolder, SWT.NULL, userdata, initText); > this.downloaddir = downloaddir; > users = new ArrayList(); > teamChat.getTableViewer().setInput(users); >+ >+ view.getSite().setSelectionProvider(teamChat.getTableViewer()); >+ > if (userdata != null) > addUser(userdata); > > ClientPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(new IPropertyChangeListener() { > > public void propertyChange(PropertyChangeEvent event) { >- if (event.getProperty().equals(ClientPlugin.PREF_DISPLAY_TIMESTAMP)) { >- showTimestamp = ((Boolean) event.getNewValue()).booleanValue(); >- } >+// if (event.getProperty().equals(ClientPlugin.PREF_DISPLAY_TIMESTAMP)) { >+// showTimestamp = ((Boolean) event.getNewValue()).booleanValue(); >+// } > } > > }); >@@ -331,9 +335,9 @@ > } > > public void showLine(ChatLine line) { >- if (showTimestamp) { >- line.setDate(getCurrentDateTime()); >- } >+// if (showTimestamp) { >+// line.setDate(getCurrentDateTime()); >+// } > appendAndScrollToBottom(line); > } > >Index: src/org/eclipse/ecf/internal/example/collab/ClientPlugin.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.ecf/plugins/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/internal/example/collab/ClientPlugin.java,v >retrieving revision 1.8 >diff -u -r1.8 ClientPlugin.java >--- src/org/eclipse/ecf/internal/example/collab/ClientPlugin.java 10 Mar 2008 22:56:04 -0000 1.8 >+++ src/org/eclipse/ecf/internal/example/collab/ClientPlugin.java 11 Apr 2008 13:14:32 -0000 >@@ -53,7 +53,7 @@ > > protected void setPreferenceDefaults() { > this.getPreferenceStore().setDefault(ClientPlugin.PREF_USE_CHAT_WINDOW, false); >- this.getPreferenceStore().setDefault(ClientPlugin.PREF_DISPLAY_TIMESTAMP, true); >+// this.getPreferenceStore().setDefault(ClientPlugin.PREF_DISPLAY_TIMESTAMP, true); > // this.getPreferenceStore().setDefault(ClientPlugin.PREF_CHAT_FONT, > // ""); > this.getPreferenceStore().setDefault(ClientPlugin.PREF_CONFIRM_FILE_SEND, true); >Index: src/org/eclipse/ecf/internal/example/collab/Messages.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.ecf/plugins/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/internal/example/collab/Messages.java,v >retrieving revision 1.4 >diff -u -r1.4 Messages.java >--- src/org/eclipse/ecf/internal/example/collab/Messages.java 16 Mar 2008 02:53:42 -0000 1.4 >+++ src/org/eclipse/ecf/internal/example/collab/Messages.java 11 Apr 2008 13:14:32 -0000 >@@ -23,12 +23,12 @@ > public static String AutoLoginPreferencePage_URILISTEDITOR_TEXT; > public static String ChatWindow_SHELL_TEXT; > public static String ClientPreferencePage_ASK_RECEIVER_FOR_PERMISSION; >- public static String ClientPreferencePage_CHAT_COLOR_FOR_ME_FIELD; >- public static String ClientPreferencePage_CHAT_COLOR_FOR_SYSTEM_FIELD; >- public static String ClientPreferencePage_CHAT_TEXT_COLOR_FOR_OTHER_FIELD; >- public static String ClientPreferencePage_CHAT_WINDOW_FONT_FIELD; >+// public static String ClientPreferencePage_CHAT_COLOR_FOR_ME_FIELD; >+// public static String ClientPreferencePage_CHAT_COLOR_FOR_SYSTEM_FIELD; >+// public static String ClientPreferencePage_CHAT_TEXT_COLOR_FOR_OTHER_FIELD; >+// public static String ClientPreferencePage_CHAT_WINDOW_FONT_FIELD; > public static String ClientPreferencePage_PLAY_EDITOR_EVENTS_IMMEDIATELY; >- public static String ClientPreferencePage_SHOW_TIME_FOR_CHAT_FIELD; >+// public static String ClientPreferencePage_SHOW_TIME_FOR_CHAT_FIELD; > public static String ClientPreferencePage_USE_CHAT_WINDOW_FIELD_TEXT; > public static String CollabClient_WORKSPACE_NAME; > public static String CollabStart_EXCEPTION_STARTING_CONNECTION; >Index: src/org/eclipse/ecf/internal/example/collab/ClientPluginConstants.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.ecf/plugins/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/internal/example/collab/ClientPluginConstants.java,v >retrieving revision 1.5 >diff -u -r1.5 ClientPluginConstants.java >--- src/org/eclipse/ecf/internal/example/collab/ClientPluginConstants.java 10 Mar 2008 22:56:04 -0000 1.5 >+++ src/org/eclipse/ecf/internal/example/collab/ClientPluginConstants.java 11 Apr 2008 13:14:32 -0000 >@@ -21,16 +21,16 @@ > * Contants for perference items. > */ > public static final String PREF_USE_CHAT_WINDOW = "useChatWindow"; //$NON-NLS-1$ >- public static final String PREF_DISPLAY_TIMESTAMP = "displayTimeStamp"; //$NON-NLS-1$ >- public static final String PREF_CHAT_FONT = "chatFont"; //$NON-NLS-1$ >+// public static final String PREF_DISPLAY_TIMESTAMP = "displayTimeStamp"; //$NON-NLS-1$ >+// public static final String PREF_CHAT_FONT = "chatFont"; //$NON-NLS-1$ > public static final String PREF_FILE_TRANSFER_RATE = "fileTransferRate"; //$NON-NLS-1$ > public static final String PREF_CONFIRM_FILE_SEND = "confirmFileSend"; //$NON-NLS-1$ > public static final String PREF_CONFIRM_REMOTE_VIEW = "confirmRemoteView"; //$NON-NLS-1$ > public static final String PREF_FILE_SEND_PATH = "findSendPath"; //$NON-NLS-1$ > public static final String PREF_CONFIRM_FILE_RECEIVE = "confirmFileReceive"; //$NON-NLS-1$ >- public static final String PREF_ME_TEXT_COLOR = "prefMeTextColor"; //$NON-NLS-1$ >- public static final String PREF_OTHER_TEXT_COLOR = "prefOtherTextColor"; //$NON-NLS-1$ >- public static final String PREF_SYSTEM_TEXT_COLOR = "prefSystemTextColor"; //$NON-NLS-1$ >+// public static final String PREF_ME_TEXT_COLOR = "prefMeTextColor"; //$NON-NLS-1$ >+// public static final String PREF_OTHER_TEXT_COLOR = "prefOtherTextColor"; //$NON-NLS-1$ >+// public static final String PREF_SYSTEM_TEXT_COLOR = "prefSystemTextColor"; //$NON-NLS-1$ > > public static final String PREF_START_SERVER = "startServerOnStartup"; //$NON-NLS-1$ > public static final String PREF_REGISTER_SERVER = "registerServerOnStartup"; //$NON-NLS-1$ >Index: src/org/eclipse/ecf/internal/example/collab/messages.properties >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.ecf/plugins/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/internal/example/collab/messages.properties,v >retrieving revision 1.5 >diff -u -r1.5 messages.properties >--- src/org/eclipse/ecf/internal/example/collab/messages.properties 16 Mar 2008 02:53:43 -0000 1.5 >+++ src/org/eclipse/ecf/internal/example/collab/messages.properties 11 Apr 2008 13:14:32 -0000 >@@ -3,12 +3,12 @@ > AutoLoginPreferencePage_URILISTEDITOR_TEXT=The following will be connected upon ECF start > ChatWindow_SHELL_TEXT=Team Chat {0} > ClientPreferencePage_ASK_RECEIVER_FOR_PERMISSION=Ask receiver for permission to display shared editor events >-ClientPreferencePage_CHAT_COLOR_FOR_ME_FIELD=Chat Text Color For Me: >-ClientPreferencePage_CHAT_COLOR_FOR_SYSTEM_FIELD=Chat Text Color For System: >-ClientPreferencePage_CHAT_TEXT_COLOR_FOR_OTHER_FIELD=Chat Text Color For Other: >-ClientPreferencePage_CHAT_WINDOW_FONT_FIELD=Chat window font: >+#ClientPreferencePage_CHAT_COLOR_FOR_ME_FIELD=Chat Text Color For Me: >+#ClientPreferencePage_CHAT_COLOR_FOR_SYSTEM_FIELD=Chat Text Color For System: >+#ClientPreferencePage_CHAT_TEXT_COLOR_FOR_OTHER_FIELD=Chat Text Color For Other: >+#ClientPreferencePage_CHAT_WINDOW_FONT_FIELD=Chat window font: > ClientPreferencePage_PLAY_EDITOR_EVENTS_IMMEDIATELY=Play shared editor events immediately >-ClientPreferencePage_SHOW_TIME_FOR_CHAT_FIELD=Show time for each chat entry >+#ClientPreferencePage_SHOW_TIME_FOR_CHAT_FIELD=Show time for each chat entry > ClientPreferencePage_USE_CHAT_WINDOW_FIELD_TEXT=Display ECF Collaboration outside of the workbench > CollabClient_WORKSPACE_NAME=<workspace> > CollabStart_EXCEPTION_STARTING_CONNECTION=Exception in starting connection >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.ecf/plugins/org.eclipse.ecf.example.collab/META-INF/MANIFEST.MF,v >retrieving revision 1.109 >diff -u -r1.109 MANIFEST.MF >--- META-INF/MANIFEST.MF 6 Apr 2008 22:58:21 -0000 1.109 >+++ META-INF/MANIFEST.MF 11 Apr 2008 13:14:32 -0000 >@@ -28,5 +28,6 @@ > org.eclipse.ecf.discovery.ui, > org.eclipse.ecf.provider, > org.eclipse.ecf.ui, >- org.eclipse.ecf.server.generic >+ org.eclipse.ecf.server.generic, >+ org.eclipse.ecf.presence.ui > Bundle-ActivationPolicy: lazy
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
remy.suen
:
iplog+
Actions:
View
|
Diff
Attachments on
bug 222253
:
92183
|
92184
|
95506
|
95669
|
95670
|
107248