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 95670 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]
presence.ui.patch
presence.ui.patch (text/plain), 47.83 KB, created by
Hiroyuki
on 2008-04-11 09:19:16 EDT
(
hide
)
Description:
presence.ui.patch
Filename:
MIME Type:
Creator:
Hiroyuki
Created:
2008-04-11 09:19:16 EDT
Size:
47.83 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.ecf.presence.ui >Index: src/org/eclipse/ecf/internal/presence/ui/preferences/PreferenceConstants.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.ecf/plugins/org.eclipse.ecf.presence.ui/src/org/eclipse/ecf/internal/presence/ui/preferences/PreferenceConstants.java,v >retrieving revision 1.2 >diff -u -r1.2 PreferenceConstants.java >--- src/org/eclipse/ecf/internal/presence/ui/preferences/PreferenceConstants.java 6 Sep 2007 04:41:55 -0000 1.2 >+++ src/org/eclipse/ecf/internal/presence/ui/preferences/PreferenceConstants.java 11 Apr 2008 13:16:16 -0000 >@@ -16,4 +16,5 @@ > */ > public class PreferenceConstants { > public static final String CHATROOM_SHOW_USER_PRESENCE = "chatroom.user.presence.visible"; //$NON-NLS-1$ >+ public static final String CHATROOM_DISPLAY_TIMESTAMP = "chatroom.display.TimeStamp"; //$NON-NLS-1$ > } >Index: src/org/eclipse/ecf/internal/presence/ui/preferences/PreferenceInitializer.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.ecf/plugins/org.eclipse.ecf.presence.ui/src/org/eclipse/ecf/internal/presence/ui/preferences/PreferenceInitializer.java,v >retrieving revision 1.1 >diff -u -r1.1 PreferenceInitializer.java >--- src/org/eclipse/ecf/internal/presence/ui/preferences/PreferenceInitializer.java 27 Jul 2007 22:05:01 -0000 1.1 >+++ src/org/eclipse/ecf/internal/presence/ui/preferences/PreferenceInitializer.java 11 Apr 2008 13:16:16 -0000 >@@ -27,6 +27,7 @@ > public void initializeDefaultPreferences() { > IPreferenceStore store = Activator.getDefault().getPreferenceStore(); > store.setDefault(PreferenceConstants.CHATROOM_SHOW_USER_PRESENCE, false); >+ store.setDefault(PreferenceConstants.CHATROOM_DISPLAY_TIMESTAMP, true); > } > > } >Index: src/org/eclipse/ecf/internal/presence/ui/preferences/ChatRoomPreferencePage.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.ecf/plugins/org.eclipse.ecf.presence.ui/src/org/eclipse/ecf/internal/presence/ui/preferences/ChatRoomPreferencePage.java,v >retrieving revision 1.2 >diff -u -r1.2 ChatRoomPreferencePage.java >--- src/org/eclipse/ecf/internal/presence/ui/preferences/ChatRoomPreferencePage.java 6 Sep 2007 04:41:56 -0000 1.2 >+++ src/org/eclipse/ecf/internal/presence/ui/preferences/ChatRoomPreferencePage.java 11 Apr 2008 13:16:16 -0000 >@@ -11,32 +11,289 @@ > ******************************************************************************/ > package org.eclipse.ecf.internal.presence.ui.preferences; > >-import org.eclipse.ecf.internal.presence.ui.Activator; >-import org.eclipse.ecf.internal.presence.ui.Messages; >-import org.eclipse.jface.preference.BooleanFieldEditor; >-import org.eclipse.jface.preference.FieldEditorPreferencePage; >-import org.eclipse.ui.IWorkbench; >-import org.eclipse.ui.IWorkbenchPreferencePage; >+import org.eclipse.ecf.internal.presence.ui.*; >+import org.eclipse.ecf.presence.ui.chatroom.MessageRenderer; >+import org.eclipse.jface.preference.*; >+import org.eclipse.jface.util.IPropertyChangeListener; >+import org.eclipse.jface.util.PropertyChangeEvent; >+import org.eclipse.osgi.util.NLS; >+import org.eclipse.swt.SWT; >+import org.eclipse.swt.custom.StyleRange; >+import org.eclipse.swt.custom.StyledText; >+import org.eclipse.swt.events.*; >+import org.eclipse.swt.graphics.Color; >+import org.eclipse.swt.layout.GridData; >+import org.eclipse.swt.layout.GridLayout; >+import org.eclipse.swt.widgets.*; >+import org.eclipse.ui.*; >+import org.eclipse.ui.dialogs.PreferencesUtil; >+import org.eclipse.ui.themes.ITheme; > > public class ChatRoomPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage { > >+ class Renderer extends MessageRenderer { >+ public String[] nameColor={DATE_COLOR, >+ RECEIVEDHIGHLIGHT_COLOR,SYSTEM_COLOR, >+ RECEIVED_COLOR,SENT_COLOR}; >+ >+ public String[] loadThemeName() { >+ String[] names = new String[nameColor.length]; >+ for(int n=0; n<nameColor.length; n++) >+ if(nameColor[n].equals(DATE_COLOR)) >+ names[n]=Messages.ChatRoomPreferencePage_DATE; >+ else if(nameColor[n].equals(RECEIVEDHIGHLIGHT_COLOR)) >+ names[n]=Messages.ChatRoomPreferencePage_RECEIVEDHIGHLIGHT_MESSAGE; >+ else if(nameColor[n].equals(SYSTEM_COLOR)) >+ names[n]=Messages.ChatRoomPreferencePage_SYSTEM_MESSAGE; >+ else if(nameColor[n].equals(RECEIVED_COLOR)) >+ names[n]=Messages.ChatRoomPreferencePage_RECEIVED_MESSAGE; >+ else if(nameColor[n].equals(SENT_COLOR)) >+ names[n]=Messages.ChatRoomPreferencePage_SENT_MESSAGE; >+ else >+ names[n]="?"; //$NON-NLS-1$ >+ return names; >+ } >+ public Color[] loadThemeColors() { >+ Color[] colors = new Color[nameColor.length]; >+ ITheme theme = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme(); >+ for(int n=0; n<nameColor.length; n++) >+ colors[n]=theme.getColorRegistry().get(nameColor[n]); >+ return colors; >+ } >+ public void saveThemeColors(Color[] colors) { >+ ITheme theme = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme(); >+ for(int n=0; n<nameColor.length; n++) { >+ if(!theme.getColorRegistry().get(nameColor[n]).getRGB().equals(colors[n].getRGB())) >+ theme.getColorRegistry().put(nameColor[n], colors[n].getRGB()); >+ } >+ } >+ >+ protected void doRender() { >+ if(timestamp.getBooleanValue()) >+ appendDateTime(); >+ if (originator != null) { >+ appendNickname(); >+ } >+ appendMessage(); >+ } >+ protected Color getColor(String name) { >+ if (name == null) { >+ return null; >+ } >+ Color c = null; >+ for(int n=0; n<nameColor.length; n++) { >+ if(name.equals(nameColor[n])) { >+ c = colorElement[n]; >+ break; >+ } >+ } >+ if (c == null) { >+ return Display.getDefault().getSystemColor(SWT.COLOR_BLACK); >+ } >+ return c; >+ } >+ } >+ >+ class CheckboxFieldEditor extends BooleanFieldEditor { >+ public CheckboxFieldEditor(String name, String label, Composite parent, boolean value) { >+ super(name, label, parent); >+ getChangeControl(parent).setSelection(value); >+ } >+ protected void valueChanged(boolean oldValue, boolean newValue) { >+ super.valueChanged(oldValue, newValue); >+ updatePreview(); >+ } >+ } >+ >+ private CheckboxFieldEditor userPresence; >+ CheckboxFieldEditor timestamp; >+ List element; >+ ColorSelector colorButton; >+ //private Button bold; >+ //private Button italic; >+ private StyledText preview; >+ private Renderer messageRenderer; >+ >+ Color[] colorElement; >+ > public ChatRoomPreferencePage() { > super(GRID); > setPreferenceStore(Activator.getDefault().getPreferenceStore()); > } > >- /* (non-Javadoc) >- * @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors() >- */ >+ protected void performDefaults() { >+ super.performDefaults(); >+ colorElement = messageRenderer.loadThemeColors(); >+ int sel = element.getSelectionIndex(); >+ colorButton.setColorValue(colorElement[sel].getRGB()); >+ updatePreview(); >+ } >+ >+ public boolean performOk() { >+ messageRenderer.saveThemeColors(colorElement); >+ return super.performOk(); >+ } >+ > public void createFieldEditors() { >- addField(new BooleanFieldEditor(PreferenceConstants.CHATROOM_SHOW_USER_PRESENCE, Messages.ChatRoomPreferencePage_CHATROOM_SHOW_USER_PRESENCE_TEXT, getFieldEditorParent())); >+ boolean value = getPreferenceStore().getBoolean( >+ PreferenceConstants.CHATROOM_SHOW_USER_PRESENCE); >+ userPresence = new CheckboxFieldEditor( >+ PreferenceConstants.CHATROOM_SHOW_USER_PRESENCE, >+ Messages.ChatRoomPreferencePage_CHATROOM_SHOW_USER_PRESENCE_TEXT, >+ getFieldEditorParent(), >+ value); >+ addField(userPresence); >+ value = getPreferenceStore().getBoolean( >+ PreferenceConstants.CHATROOM_DISPLAY_TIMESTAMP); >+ timestamp=new CheckboxFieldEditor( >+ PreferenceConstants.CHATROOM_DISPLAY_TIMESTAMP, >+ Messages.ChatRoomPreferencePage_CHATROOM_DISPLAY_TIMESTAMP_TEXT, >+ getFieldEditorParent(), >+ value); >+ addField(timestamp); >+ >+ messageRenderer = new Renderer(); >+ colorElement = messageRenderer.loadThemeColors(); >+ >+ final Composite parent = getFieldEditorParent(); >+ new Label(parent, SWT.NONE); >+ >+ Label label = new Label(parent, SWT.NONE); >+ label.setText(Messages.ChatRoomPreferencePage_ELEMENT); >+ >+ Composite group = new Composite(parent, SWT.NONE); >+ group.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL)); >+ GridLayout layout = new GridLayout(3,false); >+ layout.marginHeight=0; >+ layout.marginWidth=0; >+ layout.verticalSpacing=0; >+ group.setLayout(layout); >+ >+ element=new List(group, SWT.SINGLE | SWT.BORDER); >+ GridData gd = new GridData(200, SWT.DEFAULT); >+ element.setLayoutData(gd); >+ String[] names = messageRenderer.loadThemeName(); >+ for(int i=0; i<names.length; i++) >+ element.add(names[i]); >+ >+ label=new Label(group, SWT.NONE); >+ label.setText(" "); //$NON-NLS-1$ >+ >+ Composite subgroup = new Composite(group, SWT.NONE); >+ subgroup.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING)); >+ layout = new GridLayout(2,false); >+ layout.marginHeight=0; >+ layout.marginWidth=0; >+ layout.verticalSpacing=0; >+ subgroup.setLayout(layout); >+ >+ label=new Label(subgroup, SWT.NONE); >+ label.setText(Messages.ChatRoomPreferencePage_COLOR); >+ label.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_CENTER)); >+ colorButton = new ColorSelector(subgroup); >+ colorButton.getButton(); >+ >+ //bold = new Button(subgroup, SWT.CHECK); >+ //bold.setText("Bold"); //$NON-NLS-1$ >+ //gd = new GridData(GridData.VERTICAL_ALIGN_CENTER); >+ //gd.horizontalSpan=2; >+ //bold.setLayoutData(gd); >+ >+ //italic = new Button(subgroup, SWT.CHECK); >+ //italic.setText("Italic"); //$NON-NLS-1$ >+ //gd = new GridData(GridData.VERTICAL_ALIGN_CENTER); >+ //gd.horizontalSpan=2; >+ //italic.setLayoutData(gd); >+ >+ label = new Label(parent, SWT.NONE); >+ label.setText(Messages.ChatRoomPreferencePage_PREVIEW); >+ >+ preview=new StyledText(parent, SWT.BORDER | SWT.WRAP | SWT.V_SCROLL | SWT.MULTI | SWT.READ_ONLY); >+ preview.setLayoutData(new GridData(GridData.FILL_BOTH)); >+ >+ new Label(parent, SWT.NONE); >+ >+ Link link= new Link(parent, SWT.NONE); >+ link.setText(Messages.ChatRoomPreferencePage_LINK_COLORS_AND_FONTS_TEXT); >+ link.addSelectionListener(new SelectionAdapter() { >+ public void widgetSelected(SelectionEvent e) { >+ PreferencesUtil.createPreferenceDialogOn( >+ /*getFieldEditorParent()*/parent.getShell(), >+ e.text, null, null); >+ } >+ }); >+ GridData gridData= new GridData(SWT.FILL, SWT.BEGINNING, true, false); >+ gridData.widthHint= 150; // only expand further if anyone else requires it >+ link.setLayoutData(gridData); >+ >+ new Label(parent, SWT.NONE); >+ >+ element.addSelectionListener(new SelectionListener() { >+ public void widgetDefaultSelected(SelectionEvent e) { >+ int sel = element.getSelectionIndex(); >+ colorButton.setColorValue(colorElement[sel].getRGB()); >+ } >+ public void widgetSelected(SelectionEvent e) { >+ int sel = element.getSelectionIndex(); >+ colorButton.setColorValue(colorElement[sel].getRGB()); >+ } >+ }); >+ element.select(0); >+ colorButton.setColorValue(colorElement[0].getRGB()); >+ colorButton.addListener(new IPropertyChangeListener() { >+ public void propertyChange(PropertyChangeEvent event) { >+ int sel = element.getSelectionIndex(); >+ colorElement[sel] = new Color(colorElement[sel].getDevice(), >+ colorButton.getColorValue()); >+ updatePreview(); >+ } >+ }); >+ >+ updatePreview(); >+ } >+ >+ void updatePreview() { >+ preview.setText(""); //$NON-NLS-1$ >+ String remote1 = "friend1"; //$NON-NLS-1$ >+ String remote2 = "friend2"; //$NON-NLS-1$ >+ String local = "myself"; //$NON-NLS-1$ >+ addPreviewLine("Welcome, everybody...", null, local); //$NON-NLS-1$ >+ addPreviewLine("Home/Wiki: http://myserver.domain", null, local); //$NON-NLS-1$ >+ if(userPresence.getBooleanValue()) { >+ addPreviewLine( >+ NLS.bind(org.eclipse.ecf.internal.presence.ui.Messages.ChatRoomManagerView_ENTERED_MESSAGE, >+ local), null, local); >+ addPreviewLine( >+ NLS.bind(org.eclipse.ecf.internal.presence.ui.Messages.ChatRoomManagerView_ENTERED_MESSAGE, >+ remote1), null, local); >+ addPreviewLine( >+ NLS.bind(org.eclipse.ecf.internal.presence.ui.Messages.ChatRoomManagerView_ENTERED_MESSAGE, >+ remote2), null, local); >+ } >+ addPreviewLine("Hello", remote1, local); //$NON-NLS-1$ >+ addPreviewLine("Hello, "+local, remote2, local); //$NON-NLS-1$ >+ addPreviewLine("Hello", local, local); //$NON-NLS-1$ >+ } >+ >+ private void addPreviewLine(String body, String remote, String local) { >+ String output = messageRenderer.render(body, remote, local); >+ StyleRange[] ranges = messageRenderer.getStyleRanges(); >+ if (output != null) { >+ int startRange = preview.getText().length(); >+ if(!output.endsWith("\n")) //$NON-NLS-1$ >+ output+="\n"; //$NON-NLS-1$ >+ preview.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; >+ } >+ preview.replaceStyleRanges(startRange, output.length(), ranges); >+ } >+ } > } > >- /* >- * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench) >- */ > public void init(IWorkbench workbench) { > // do nothing > } >- > } >Index: src/org/eclipse/ecf/internal/presence/ui/Messages.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.ecf/plugins/org.eclipse.ecf.presence.ui/src/org/eclipse/ecf/internal/presence/ui/Messages.java,v >retrieving revision 1.26 >diff -u -r1.26 Messages.java >--- src/org/eclipse/ecf/internal/presence/ui/Messages.java 3 Sep 2007 03:39:06 -0000 1.26 >+++ src/org/eclipse/ecf/internal/presence/ui/Messages.java 11 Apr 2008 13:16:16 -0000 >@@ -238,7 +238,59 @@ > public static String MessageRenderer_DEFAULT_TIME_FORMAT; > > public static String ChatRoomPreferencePage_CHATROOM_SHOW_USER_PRESENCE_TEXT; >- >+ public static String ChatRoomPreferencePage_CHATROOM_DISPLAY_TIMESTAMP_TEXT; >+ public static String ChatRoomPreferencePage_LINK_COLORS_AND_FONTS_TEXT; >+ public static String ChatRoomPreferencePage_ELEMENT; >+ public static String ChatRoomPreferencePage_COLOR; >+ public static String ChatRoomPreferencePage_PREVIEW; >+ public static String ChatRoomPreferencePage_DATE; >+ public static String ChatRoomPreferencePage_RECEIVEDHIGHLIGHT_MESSAGE; >+ public static String ChatRoomPreferencePage_SYSTEM_MESSAGE; >+ public static String ChatRoomPreferencePage_RECEIVED_MESSAGE; >+ public static String ChatRoomPreferencePage_SENT_MESSAGE; >+ >+ public static String MessagesView_broadcast; >+ >+ public static String RosterItemWrapper_PROPERTY_NAME; >+ public static String RosterItemWrapper_PROPERTY_NICKNAME; >+ public static String RosterItemWrapper_PROPERTY_ID; >+ public static String RosterItemWrapper_PROPERTY_TYPE; >+ public static String RosterItemWrapper_PROPERTY_MODE; >+ public static String RosterItemWrapper_PROPERTY_STATUS; >+ public static String RosterItemWrapper_PROPERTY_GROUP_ACCOUNT; >+ public static String RosterItemWrapper_PROPERTY_GROUP_STATUS; >+ >+ public static String RosterItemWrapper_PRESENCE_TYPE_AVAILABLE; >+ public static String RosterItemWrapper_PRESENCE_TYPE_ERROR; >+ public static String RosterItemWrapper_PRESENCE_TYPE_SUBSCRIBE; >+ public static String RosterItemWrapper_PRESENCE_TYPE_SUBSCRIBED; >+ public static String RosterItemWrapper_PRESENCE_TYPE_UNAVAILABLE; >+ public static String RosterItemWrapper_PRESENCE_TYPE_UNSUBSCRIBE; >+ public static String RosterItemWrapper_PRESENCE_TYPE_UNSUBSCRIBED; >+ public static String RosterItemWrapper_PRESENCE_TYPE_UNKWOWN; >+ >+ public static String RosterItemWrapper_PRESENCE_MODE_AVAILABLE; >+ public static String RosterItemWrapper_PRESENCE_MODE_AWAY; >+ public static String RosterItemWrapper_PRESENCE_MODE_CHAT; >+ public static String RosterItemWrapper_PRESENCE_MODE_DND; >+ public static String RosterItemWrapper_PRESENCE_MODE_EXTENDED_AWAY; >+ public static String RosterItemWrapper_PRESENCE_MODE_INVISIBLE; >+ >+ public static String RosterItemWrapper_VCARD_EMAIL_HOME; >+ public static String RosterItemWrapper_VCARD_EMAIL_WORK; >+ public static String RosterItemWrapper_VCARD_NAME_FIRST; >+ public static String RosterItemWrapper_VCARD_NAME_MIDDLE; >+ public static String RosterItemWrapper_VCARD_NAME_LAST; >+ public static String RosterItemWrapper_VCARD_NAME_NICK; >+ public static String RosterItemWrapper_VCARD_PHONE_HOME_VOICE; >+ public static String RosterItemWrapper_VCARD_PHONE_HOME_CELL; >+ public static String RosterItemWrapper_VCARD_PHONE_WORK_VOICE; >+ public static String RosterItemWrapper_VCARD_PHONE_WORK_CELL; >+ >+ public static String RosterPropertySheetPage_ACCOUNT; >+ public static String RosterPropertySheetPage_PROFILE; >+ public static String RosterPropertySheetPage_AVATAR; >+ > static { > NLS.initializeMessages(BUNDLE_NAME, Messages.class); > } >Index: src/org/eclipse/ecf/internal/presence/ui/messages.properties >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.ecf/plugins/org.eclipse.ecf.presence.ui/src/org/eclipse/ecf/internal/presence/ui/messages.properties,v >retrieving revision 1.28 >diff -u -r1.28 messages.properties >--- src/org/eclipse/ecf/internal/presence/ui/messages.properties 3 Sep 2007 03:39:06 -0000 1.28 >+++ src/org/eclipse/ecf/internal/presence/ui/messages.properties 11 Apr 2008 13:16:16 -0000 >@@ -16,7 +16,8 @@ > > MultiRosterView_SendIM = Send &IM > MultiRosterView_Remove = &Remove >-MultiRosterView_SetStatusAs = Set Status As... >+#MultiRosterView_SetStatusAs = Set Status As... >+MultiRosterView_SetStatusAs = Set Status As > MultiRosterView_SetAvailable = &Available > MultiRosterView_SetAway = A&way > MultiRosterView_SetDoNotDisturb = &Do Not Disturb >@@ -50,6 +51,7 @@ > MessagesView_TypingNotification = {0} is typing a message... > MessagesView_Copy = &Copy > MessagesView_SelectAll = &Select All >+MessagesView_broadcast=<Broadcast> > > AddContactDialog_DialogTitle = Add Contact > AddContactDialog_UserID = User ID: >@@ -145,4 +147,53 @@ > MessageRenderer_DEFAULT_DATETIME_FORMAT=({0}) > > ChatRoomPreferencePage_CHATROOM_SHOW_USER_PRESENCE_TEXT=&Show user entry messages >- >\ No newline at end of file >+ChatRoomPreferencePage_CHATROOM_DISPLAY_TIMESTAMP_TEXT=Show &time for each chat entry >+ChatRoomPreferencePage_LINK_COLORS_AND_FONTS_TEXT=Default colors and fonts can be configured on the <a href=\"org.eclipse.ui.preferencePages.ColorsAndFonts\">Colors and Fonts</a> preference page. >+ChatRoomPreferencePage_ELEMENT=Element: >+ChatRoomPreferencePage_COLOR=Color: >+ChatRoomPreferencePage_PREVIEW=Preview: >+ChatRoomPreferencePage_DATE=Time >+ChatRoomPreferencePage_RECEIVEDHIGHLIGHT_MESSAGE=Highlight message >+ChatRoomPreferencePage_SYSTEM_MESSAGE=System message >+ChatRoomPreferencePage_RECEIVED_MESSAGE=Received message >+ChatRoomPreferencePage_SENT_MESSAGE=Sent message >+ >+RosterItemWrapper_PROPERTY_NAME=Name >+RosterItemWrapper_PROPERTY_NICKNAME=Nickname >+RosterItemWrapper_PROPERTY_ID=ID >+RosterItemWrapper_PROPERTY_TYPE=Type >+RosterItemWrapper_PROPERTY_MODE=Mode >+RosterItemWrapper_PROPERTY_STATUS=Info >+RosterItemWrapper_PROPERTY_GROUP_ACCOUNT=Account >+RosterItemWrapper_PROPERTY_GROUP_STATUS=Status >+ >+RosterItemWrapper_PRESENCE_TYPE_AVAILABLE=Available >+RosterItemWrapper_PRESENCE_TYPE_ERROR=Error >+RosterItemWrapper_PRESENCE_TYPE_SUBSCRIBE=Subscribe >+RosterItemWrapper_PRESENCE_TYPE_SUBSCRIBED=Subscribed >+RosterItemWrapper_PRESENCE_TYPE_UNAVAILABLE=Unavailable >+RosterItemWrapper_PRESENCE_TYPE_UNSUBSCRIBE=Unsubscribe >+RosterItemWrapper_PRESENCE_TYPE_UNSUBSCRIBED=Unsubscribed >+RosterItemWrapper_PRESENCE_TYPE_UNKWOWN=Unknown >+ >+RosterItemWrapper_PRESENCE_MODE_AVAILABLE=Available >+RosterItemWrapper_PRESENCE_MODE_AWAY=Away >+RosterItemWrapper_PRESENCE_MODE_CHAT=Chat >+RosterItemWrapper_PRESENCE_MODE_DND=Do not disturb >+RosterItemWrapper_PRESENCE_MODE_EXTENDED_AWAY=Extended away >+RosterItemWrapper_PRESENCE_MODE_INVISIBLE=Invisible >+ >+RosterItemWrapper_VCARD_EMAIL_HOME=E-Mail (Home) >+RosterItemWrapper_VCARD_EMAIL_WORK=E-Mail (Work) >+RosterItemWrapper_VCARD_NAME_FIRST=First name >+RosterItemWrapper_VCARD_NAME_MIDDLE=Middle name >+RosterItemWrapper_VCARD_NAME_LAST=Last name >+RosterItemWrapper_VCARD_NAME_NICK=Nickname >+RosterItemWrapper_VCARD_PHONE_HOME_VOICE=Phone (Home) >+RosterItemWrapper_VCARD_PHONE_HOME_CELL=Phone (Home cell) >+RosterItemWrapper_VCARD_PHONE_WORK_VOICE=Phone (Work) >+RosterItemWrapper_VCARD_PHONE_WORK_CELL=Phone (Work cell) >+ >+RosterPropertySheetPage_ACCOUNT=Account >+RosterPropertySheetPage_PROFILE=Profile >+RosterPropertySheetPage_AVATAR=Avatar >Index: src/org/eclipse/ecf/presence/ui/chatroom/IMessageRenderer.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.ecf/plugins/org.eclipse.ecf.presence.ui/src/org/eclipse/ecf/presence/ui/chatroom/IMessageRenderer.java,v >retrieving revision 1.2 >diff -u -r1.2 IMessageRenderer.java >--- src/org/eclipse/ecf/presence/ui/chatroom/IMessageRenderer.java 5 Aug 2007 21:15:18 -0000 1.2 >+++ src/org/eclipse/ecf/presence/ui/chatroom/IMessageRenderer.java 11 Apr 2008 13:16:21 -0000 >@@ -11,6 +11,7 @@ > package org.eclipse.ecf.presence.ui.chatroom; > > import org.eclipse.swt.custom.StyleRange; >+import org.eclipse.swt.graphics.Font; > > /** > * Renders chat line, by arranging text content to be finally printed to >@@ -33,5 +34,10 @@ > * @return formatting to be applied to output, or null if no formatting > */ > StyleRange[] getStyleRanges(); >- >+ >+ /** >+ * Returns text font of output >+ * @return text font of output >+ */ >+ Font getTextFont(); > } >Index: src/org/eclipse/ecf/presence/ui/chatroom/ChatRoomManagerView.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.ecf/plugins/org.eclipse.ecf.presence.ui/src/org/eclipse/ecf/presence/ui/chatroom/ChatRoomManagerView.java,v >retrieving revision 1.44 >diff -u -r1.44 ChatRoomManagerView.java >--- src/org/eclipse/ecf/presence/ui/chatroom/ChatRoomManagerView.java 11 Apr 2008 04:52:58 -0000 1.44 >+++ src/org/eclipse/ecf/presence/ui/chatroom/ChatRoomManagerView.java 11 Apr 2008 13:16:21 -0000 >@@ -34,6 +34,7 @@ > import org.eclipse.ecf.presence.ui.MessagesView; > import org.eclipse.jface.action.*; > import org.eclipse.jface.dialogs.MessageDialog; >+import org.eclipse.jface.resource.JFaceResources; > import org.eclipse.jface.text.*; > import org.eclipse.jface.text.source.SourceViewer; > import org.eclipse.jface.util.IPropertyChangeListener; >@@ -59,9 +60,8 @@ > > public static final String PARTICIPANTS_MENU_ID = "org.eclipse.ecf.presence.ui.chatroom.participantsView"; //$NON-NLS-1$ > >- private static final int RATIO_WRITE_PANE = 1; >- >- private static final int RATIO_READ_PANE = 9; >+ //private static final int RATIO_WRITE_PANE = 1; >+ //private static final int RATIO_READ_PANE = 9; > > private static final int RATIO_READ_WRITE_PANE = 85; > >@@ -112,7 +112,8 @@ > > private CTabItem tabItem; > >- private SashForm rightSash; >+ //private SashForm rightSash; >+ Composite rightComp; > > private StyledText subjectText; > >@@ -147,6 +148,9 @@ > GridLayout layout = new GridLayout(1, true); > layout.marginWidth = 0; > layout.marginHeight = 0; >+ layout.marginHeight = 0; >+ layout.verticalSpacing = 3; >+ layout.horizontalSpacing = 3; > memberComp.setLayout(layout); > > participantsNumberLabel = new Label(memberComp, SWT.BORDER | SWT.READ_ONLY); >@@ -171,11 +175,19 @@ > } > }); > >- Composite rightComp = new Composite(fullChat, SWT.NONE); >+ /*Composite*/rightComp = new Composite(fullChat, SWT.NONE); >+ layout = new GridLayout(1, true); >+ layout.marginWidth = 0; >+ layout.marginHeight = 0; >+ layout.marginHeight = 0; >+ layout.verticalSpacing = 3; >+ layout.horizontalSpacing = 3; >+ memberComp.setLayout(layout); > rightComp.setLayout(layout); > > subjectText = createStyledTextWidget(rightComp, SWT.SINGLE | SWT.BORDER); >- subjectText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); >+ //subjectText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL, SWT.CENTER, true, false)); >+ subjectText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); > subjectText.addKeyListener(new KeyAdapter() { > public void keyPressed(KeyEvent evt) { > if (evt.character == SWT.CR || evt.character == SWT.KEYPAD_CR) { >@@ -187,31 +199,49 @@ > chatRoomAdminSender.sendSubjectChange(subjectText.getText()); > } > } catch (ECFException e) { >- disconnected(); >+ //disconnected(); > } > } > } > } > }); > >- rightSash = new SashForm(rightComp, SWT.VERTICAL); >- rightSash.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); >- } else >- rightSash = new SashForm(parent, SWT.VERTICAL); >+ //rightSash = new SashForm(rightComp, SWT.VERTICAL); >+ //rightSash.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); >+ } else { >+ //rightSash = new SashForm(parent, SWT.VERTICAL); >+ rightComp = new Composite(parent, SWT.NONE); >+ rightComp.setLayoutData(new GridData(GridData.FILL_BOTH)); >+ GridLayout layout = new GridLayout(1, true); >+ layout = new GridLayout(1, true); >+ layout.marginWidth = 0; >+ layout.marginHeight = 0; >+ layout.marginHeight = 0; >+ layout.verticalSpacing = 3; >+ layout.horizontalSpacing = 3; >+ rightComp.setLayout(layout); >+ } > >- outputText = createStyledTextWidget(rightSash, SWT.BORDER | SWT.WRAP | SWT.V_SCROLL | SWT.MULTI | SWT.READ_ONLY); >+ outputText = createStyledTextWidget(/*rightSash*/rightComp, SWT.BORDER | SWT.WRAP | SWT.V_SCROLL | SWT.MULTI | SWT.READ_ONLY); > outputText.setEditable(false); > outputText.setLayoutData(new GridData(GridData.FILL_BOTH)); > >- inputText = new Text(rightSash, SWT.BORDER | SWT.MULTI | SWT.WRAP | SWT.V_SCROLL); >+ inputText = new Text(/*rightSash*/rightComp, SWT.BORDER | SWT.MULTI | SWT.WRAP | SWT.V_SCROLL); >+ GridData gd = new GridData(GridData.FILL_HORIZONTAL); >+ GC gc = new GC(inputText); >+ gc.setFont(JFaceResources.getDialogFont()); >+ FontMetrics fontMetrics = gc.getFontMetrics(); >+ gc.dispose(); >+ gd.heightHint = fontMetrics.getHeight() * 2; >+ inputText.setLayoutData(gd); > if (keyListener != null) > inputText.addKeyListener(keyListener); >- rightSash.setWeights(new int[] {RATIO_READ_PANE, RATIO_WRITE_PANE}); >+ //rightSash.setWeights(new int[] {RATIO_READ_PANE, RATIO_WRITE_PANE}); > if (withParticipants) { > fullChat.setWeights(new int[] {RATIO_PRESENCE_PANE, RATIO_READ_WRITE_PANE}); > tabItem.setControl(fullChat); > } else >- tabItem.setControl(rightSash); >+ tabItem.setControl(/*rightSash*/rightComp); > > parent.setSelection(tabItem); > >@@ -424,6 +454,10 @@ > public void setSubject(String subject) { > subjectText.setText(subject); > } >+ >+ public CTabItem getTabItem() { >+ return tabItem; >+ } > } > > public void createPartControl(Composite parent) { >@@ -630,7 +664,7 @@ > }); > chatRoomContainer.addListener(new IContainerListener() { > public void handleEvent(IContainerEvent evt) { >- if (evt instanceof IContainerDisconnectedEvent || evt instanceof IContainerEjectedEvent) { >+ if (evt instanceof IContainerDisconnectedEvent) { > chatroom.disconnected(); > } > } >@@ -1351,10 +1385,12 @@ > } > > protected void appendText(ChatRoomTab chatRoomTab, StyledText st, ChatLine text) { >- if (st == null || text == null) { >+ if (/*st == null ||*/text == null) { > return; > } > >+ /*StyledText*/st = chatRoomTab.getOutputText(); >+ > boolean isAtEndBeforeAppend = !isLastOutputInvisible(st); > > String originator = null; >Index: src/org/eclipse/ecf/presence/ui/chatroom/ChatRoomManagerUI.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.ecf/plugins/org.eclipse.ecf.presence.ui/src/org/eclipse/ecf/presence/ui/chatroom/ChatRoomManagerUI.java,v >retrieving revision 1.14 >diff -u -r1.14 ChatRoomManagerUI.java >--- src/org/eclipse/ecf/presence/ui/chatroom/ChatRoomManagerUI.java 11 Apr 2008 04:52:57 -0000 1.14 >+++ src/org/eclipse/ecf/presence/ui/chatroom/ChatRoomManagerUI.java 11 Apr 2008 13:16:21 -0000 >@@ -92,7 +92,7 @@ > Assert.isNotNull(roomInfo, Messages.ChatRoomManagerUI_EXCEPTION_NO_ROOT_CHAT_ROOM_MANAGER); > final IChatRoomContainer managerChatRoom = roomInfo.createChatRoomContainer(); > chatroomview.initializeWithManager(ChatRoomManagerView.getUsernameFromID(targetID), ChatRoomManagerView.getHostnameFromID(targetID), managerChatRoom, this, createChatRoomViewCloseListener()); >- chatroomview.setMessageRenderer(getDefaultMessageRenderer()); >+ //chatroomview.setMessageRenderer(getDefaultMessageRenderer()); > // Add listener for container, so that if the container is spontaneously > // disconnected, > // then we will be able to have the UI respond by making itself inactive >Index: src/org/eclipse/ecf/presence/ui/chatroom/MessageRenderer.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.ecf/plugins/org.eclipse.ecf.presence.ui/src/org/eclipse/ecf/presence/ui/chatroom/MessageRenderer.java,v >retrieving revision 1.4 >diff -u -r1.4 MessageRenderer.java >--- src/org/eclipse/ecf/presence/ui/chatroom/MessageRenderer.java 6 Sep 2007 04:41:55 -0000 1.4 >+++ src/org/eclipse/ecf/presence/ui/chatroom/MessageRenderer.java 11 Apr 2008 13:16:21 -0000 >@@ -8,17 +8,19 @@ > * Contributors: > * Jacek Pospychala <jacek.pospychala@pl.ibm.com> - bug 197329, 190851 > *****************************************************************************/ >+ > package org.eclipse.ecf.presence.ui.chatroom; > > import java.text.SimpleDateFormat; > import java.util.*; > import org.eclipse.core.runtime.Assert; >+import org.eclipse.ecf.internal.presence.ui.Activator; > import org.eclipse.ecf.internal.presence.ui.Messages; >+import org.eclipse.ecf.internal.presence.ui.preferences.PreferenceConstants; > import org.eclipse.osgi.util.NLS; > import org.eclipse.swt.SWT; > import org.eclipse.swt.custom.StyleRange; >-import org.eclipse.swt.graphics.Color; >-import org.eclipse.swt.graphics.Font; >+import org.eclipse.swt.graphics.*; > import org.eclipse.swt.widgets.Display; > import org.eclipse.ui.PlatformUI; > import org.eclipse.ui.themes.ITheme; >@@ -121,8 +123,8 @@ > } > > protected void doRender() { >- >- appendDateTime(); >+ if(Activator.getDefault().getPreferenceStore().getBoolean(PreferenceConstants.CHATROOM_DISPLAY_TIMESTAMP)) >+ appendDateTime(); > if (originator != null) { > appendNickname(); > } >@@ -161,7 +163,7 @@ > styleRanges.add(styleRange); > } > >- private Color getColor(String name) { >+ protected Color getColor(String name) { > if (name == null) { > return null; > } >@@ -176,7 +178,7 @@ > return c; > } > >- private Font getFont(String name) { >+ protected Font getFont(String name) { > if (name == null) { > return null; > } >@@ -203,4 +205,8 @@ > getCurrentDate(DEFAULT_TIME_FORMAT)); > return buf.toString(); > } >+ >+ public Font getTextFont() { >+ return getFont(font); >+ } > } >Index: plugin.properties >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.ecf/plugins/org.eclipse.ecf.presence.ui/plugin.properties,v >retrieving revision 1.8 >diff -u -r1.8 plugin.properties >--- plugin.properties 22 Mar 2008 17:38:49 -0000 1.8 >+++ plugin.properties 11 Apr 2008 13:16:05 -0000 >@@ -19,7 +19,8 @@ > browse.command.label = Open Contact... > browse.command.tooltip = Open Contact > >-chatroom.preferencePage.name = Chat Room >+#chatroom.preferencePage.name = Chat Room >+chatroom.preferencePage.name = Messages and Chats > themeElementCategory.messagesAndChats = Messages and Chats > themeElementCategory.messagesAndChats.description = Appearance details of ECF message and chat windows. > fontDefinition.dateFont = Date font >@@ -27,19 +28,19 @@ > colorDefinition.dateColor = Date color > colorDefinition.dateColor.description = Color of the date stamp in message window. > fontDefinition.highlightFont = Highlight font >-fontDefinition.highlightFont.description = Font of the date stamp in message window. >+fontDefinition.highlightFont.description = Font of the highlight text in message window. > colorDefinition.highlightColor = Highlight color >-colorDefinition.HighlightColor.description = The default color used to highlight the string of text when the user's name is referred to in the chatroom. The default color is red. >+colorDefinition.HighlightColor.description = The default color used to highlight the string of text when the user's name is referred. The default color is red. > fontDefinition.systemMessagesFont = System messages font >-fontDefinition.systemMessagesFont.description = Font of the date stamp in message window. >+fontDefinition.systemMessagesFont.description = Font of the system messages in message window. > colorDefinition.systemMessagesColor = System messages color > colorDefinition.systemMessagesColor.description = Color of messages sent by the system, eg. a server notifications. > fontDefinition.receivedMessagesFont = Received messages font >-fontDefinition.receivedMessagesFont.description = Font of the date stamp in message window. >+fontDefinition.receivedMessagesFont.description = Font of the received messages in message window. > colorDefinition.receivedMessagesColor = Received messages color > colorDefinition.receivedMessagesColor.description = Color of any received messages. > fontDefinition.sentMessagesFont = Sent messages font >-fontDefinition.sentMessagesFont.description = Font of the date stamp in message window. >+fontDefinition.sentMessagesFont.description = Font of the sent messages in message window. > colorDefinition.sentMessagesColor = Sent messages color > colorDefinition.sentMessagesColor.description = Color of messages sent by local user. > >Index: src/org/eclipse/ecf/presence/ui/MessagesView.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.ecf/plugins/org.eclipse.ecf.presence.ui/src/org/eclipse/ecf/presence/ui/MessagesView.java,v >retrieving revision 1.40 >diff -u -r1.40 MessagesView.java >--- src/org/eclipse/ecf/presence/ui/MessagesView.java 24 Jan 2008 18:32:36 -0000 1.40 >+++ src/org/eclipse/ecf/presence/ui/MessagesView.java 11 Apr 2008 13:16:21 -0000 >@@ -10,16 +10,18 @@ > *****************************************************************************/ > package org.eclipse.ecf.presence.ui; > >-import java.text.SimpleDateFormat; >+//import java.text.SimpleDateFormat; > import java.util.*; > import org.eclipse.core.runtime.*; > import org.eclipse.ecf.core.identity.ID; >+//import org.eclipse.ecf.core.user.User; > import org.eclipse.ecf.core.util.ECFException; >-import org.eclipse.ecf.internal.presence.ui.Activator; >-import org.eclipse.ecf.internal.presence.ui.Messages; >+import org.eclipse.ecf.internal.presence.ui.*; > import org.eclipse.ecf.presence.im.*; >+import org.eclipse.ecf.presence.ui.chatroom.*; > import org.eclipse.jface.action.*; > import org.eclipse.jface.dialogs.MessageDialog; >+import org.eclipse.jface.resource.JFaceResources; > import org.eclipse.jface.text.Document; > import org.eclipse.jface.text.source.SourceViewer; > import org.eclipse.jface.util.IPropertyChangeListener; >@@ -29,7 +31,7 @@ > import org.eclipse.swt.custom.*; > import org.eclipse.swt.events.*; > import org.eclipse.swt.graphics.*; >-import org.eclipse.swt.layout.FillLayout; >+import org.eclipse.swt.layout.*; > import org.eclipse.swt.widgets.*; > import org.eclipse.ui.IWorkbenchPreferenceConstants; > import org.eclipse.ui.PlatformUI; >@@ -40,11 +42,12 @@ > > public class MessagesView extends ViewPart { > >- private static final SimpleDateFormat FORMATTER = new SimpleDateFormat("(hh:mm:ss a)"); //$NON-NLS-1$ >+ //private static final SimpleDateFormat FORMATTER = new SimpleDateFormat("(hh:mm:ss a)"); //$NON-NLS-1$ >+ // private static final SimpleDateFormat FORMATTER = new SimpleDateFormat("(HH:mm:ss)"); //$NON-NLS-1$ > > public static final String VIEW_ID = "org.eclipse.ecf.presence.ui.MessagesView"; //$NON-NLS-1$ > >- private static final int[] WEIGHTS = {75, 25}; >+ //private static final int[] WEIGHTS = {75, 25}; > > private CTabFolder tabFolder; > >@@ -57,6 +60,8 @@ > private boolean showTimestamps = true; > > private static final String getUserName(ID id) { >+ if (id == null) >+ return Messages.MessagesView_broadcast; > IChatID chatID = (IChatID) id.getAdapter(IChatID.class); > return chatID == null ? id.getName() : chatID.getUsername(); > } >@@ -86,7 +91,8 @@ > while (it.hasNext()) { > ChatTab tab = (ChatTab) it.next(); > if (tab.item == e.item) { >- tab.inputText.setFocus(); >+ if (tab.inputText != null) >+ tab.inputText.setFocus(); > break; > } > } >@@ -147,10 +153,10 @@ > } > > private ChatTab getTab(IChatMessageSender messageSender, ITypingMessageSender typingSender, ID localID, ID userID) { >- ChatTab tab = (ChatTab) tabs.get(userID); >+ ChatTab tab = (ChatTab) tabs.get((userID != null) ? userID : (Object) Messages.MessagesView_broadcast); > if (tab == null) { > tab = new ChatTab(messageSender, typingSender, localID, userID); >- tabs.put(userID, tab); >+ tabs.put((userID != null) ? userID : (Object) Messages.MessagesView_broadcast, tab); > } > return tab; > } >@@ -190,7 +196,7 @@ > public synchronized void openTab(IChatMessageSender messageSender, ITypingMessageSender typingSender, ID localID, ID remoteID) { > Assert.isNotNull(messageSender); > Assert.isNotNull(localID); >- Assert.isNotNull(remoteID); >+ //Assert.isNotNull(remoteID); > ChatTab tab = getTab(messageSender, typingSender, localID, remoteID); > // if there is only one tab, select this tab > if (tabs.size() == 1) { >@@ -213,7 +219,7 @@ > public synchronized void showMessage(IChatMessage message) { > Assert.isNotNull(message); > ID remoteID = message.getFromID(); >- ChatTab tab = (ChatTab) tabs.get(remoteID); >+ ChatTab tab = (ChatTab) tabs.get((remoteID != null) ? remoteID : (Object) Messages.MessagesView_broadcast); > if (tab != null) { > tab.append(remoteID, message.getBody()); > } >@@ -225,7 +231,8 @@ > for (Iterator it = tabs.values().iterator(); it.hasNext();) { > ChatTab tab = (ChatTab) it.next(); > if (tab.item == item) { >- tab.inputText.setFocus(); >+ if (tab.inputText != null) >+ tab.inputText.setFocus(); > break; > } > } >@@ -234,10 +241,12 @@ > > private class ChatTab { > >- private CTabItem item; >+ /*private*/ CTabItem item; > > private StyledText chatText; > >+ private MessageRenderer messageRenderer = null; >+ > private Text inputText; > > private IChatMessageSender icms; >@@ -261,43 +270,45 @@ > } > > private void addListeners() { >- inputText.addKeyListener(new KeyAdapter() { >- public void keyPressed(KeyEvent e) { >- switch (e.keyCode) { >- case SWT.CR : >- case SWT.KEYPAD_CR : >- if (e.stateMask == 0) { >- String text = inputText.getText(); >- inputText.setText(""); //$NON-NLS-1$ >- try { >- if (!text.equals("")) { //$NON-NLS-1$ >- icms.sendChatMessage(remoteID, text); >+ if (remoteID != null) >+ inputText.addKeyListener(new KeyAdapter() { >+ public void keyPressed(KeyEvent e) { >+ switch (e.keyCode) { >+ case SWT.CR : >+ case SWT.KEYPAD_CR : >+ if (e.stateMask == 0) { >+ String text = inputText.getText(); >+ inputText.setText(""); //$NON-NLS-1$ >+ try { >+ if (!text.equals("")) { //$NON-NLS-1$ >+ icms.sendChatMessage(remoteID, text); >+ } >+ append(localID, text); >+ } catch (ECFException ex) { >+ setContentDescription(Messages.MessagesView_CouldNotSendMessage); > } >- append(localID, text); >- } catch (ECFException ex) { >- setContentDescription(Messages.MessagesView_CouldNotSendMessage); >+ e.doit = false; >+ sendTyping = false; > } >- e.doit = false; >- sendTyping = false; >- } >- break; >+ break; >+ } > } >- } >- }); >+ }); > >- inputText.addModifyListener(new ModifyListener() { >- public void modifyText(ModifyEvent e) { >- if (!sendTyping && itms != null) { >- sendTyping = true; >- try { >- itms.sendTypingMessage(remoteID, true, null); >- } catch (ECFException ex) { >- // ignored since this is not really that important >- return; >+ if (remoteID != null) >+ inputText.addModifyListener(new ModifyListener() { >+ public void modifyText(ModifyEvent e) { >+ if (!sendTyping && itms != null) { >+ sendTyping = true; >+ try { >+ itms.sendTypingMessage(remoteID, true, null); >+ } catch (ECFException ex) { >+ // ignored since this is not really that important >+ return; >+ } > } > } >- } >- }); >+ }); > > ScrollBar vscrollBar = chatText.getVerticalBar(); > if (vscrollBar != null) { >@@ -334,20 +345,44 @@ > private void append(ID fromID, String body) { > boolean scrollToEnd = shouldScrollToEnd(chatText); > >- if (!isFirstMessage) { >- chatText.append(Text.DELIMITER); >- } >- int length = chatText.getCharCount(); >+ //if (!isFirstMessage) { >+ // chatText.append(Text.DELIMITER); >+ //} >+ //int length = chatText.getCharCount(); > String name = getUserName(fromID); >- if (fromID.equals(remoteID)) { >- if (showTimestamps) { >- chatText.append(FORMATTER.format(new Date(System.currentTimeMillis())) + ' '); >- chatText.setStyleRange(new StyleRange(length, 13, redColor, null)); >- length = chatText.getCharCount(); >- } >- chatText.append(name + ": " + body); //$NON-NLS-1$ >- chatText.setStyleRange(new StyleRange(length, name.length() + 1, redColor, null, SWT.BOLD)); >- setContentDescription(""); //$NON-NLS-1$ >+ String local = getUserName(localID); >+ >+ String output = messageRenderer.render(body, (fromID!=null)? name:null, local); >+ StyleRange[] ranges = messageRenderer.getStyleRanges(); >+ >+ if (fromID == remoteID || fromID.equals(remoteID)) { >+// if (showTimestamps) { >+// //chatText.append(FORMATTER.format(new Date(System.currentTimeMillis())) + ' '); >+// //chatText.setStyleRange(new StyleRange(length, 13, redColor, null)); >+// String text = FORMATTER.format(new Date(System.currentTimeMillis())) + ' '; >+// chatText.append(text); >+// chatText.setStyleRange(new StyleRange(length, text.length(), redColor, null)); >+// length = chatText.getCharCount(); >+// } >+// if (remoteID != null) { >+// chatText.append(name + ": "); //$NON-NLS-1$ >+// //chatText.append(body); >+// { >+// int posStyleRange = chatLink.scan(body); >+// chatText.append(body); >+// chatLink.setStyleRange(posStyleRange); >+// } >+// chatText.setStyleRange(new StyleRange(length, name.length() + 1, redColor, null, SWT.BOLD)); >+// } else { >+// //chatText.append(body); >+// { >+// int posStyleRange = chatLink.scan(body); >+// chatText.append(body); >+// chatLink.setStyleRange(posStyleRange); >+// } >+// chatText.setStyleRange(new StyleRange(length, 0, redColor, null, SWT.BOLD)); >+// } >+// setContentDescription(""); //$NON-NLS-1$ > if (isFirstMessage) { > final MessageNotificationPopup popup = new MessageNotificationPopup(getSite().getWorkbenchWindow(), tabFolder.getShell(), remoteID); > popup.setContent(name, body); >@@ -364,15 +399,46 @@ > }.schedule(5000); > } > } else { >- if (showTimestamps) { >- chatText.append(FORMATTER.format(new Date(System.currentTimeMillis())) + ' '); >- chatText.setStyleRange(new StyleRange(length, 13, blueColor, null)); >- length = chatText.getCharCount(); >- } >- chatText.append(name + ": " + body); //$NON-NLS-1$ >- chatText.setStyleRange(new StyleRange(length, name.length() + 1, blueColor, null, SWT.BOLD)); >+// if (showTimestamps) { >+// //chatText.append(FORMATTER.format(new Date(System.currentTimeMillis())) + ' '); >+// //chatText.setStyleRange(new StyleRange(length, 13, blueColor, null)); >+// String text = FORMATTER.format(new Date(System.currentTimeMillis())) + ' '; >+// chatText.append(text); >+// chatText.setStyleRange(new StyleRange(length, text.length(), blueColor, null)); >+// length = chatText.getCharCount(); >+// } >+// chatText.append(name + ": "); //$NON-NLS-1$ >+// //chatText.append(body); >+// { >+// int posStyleRange = chatLink.scan(body); >+// chatText.append(body); >+// chatLink.setStyleRange(posStyleRange); >+// } >+// chatText.setStyleRange(new StyleRange(length, name.length() + 1, blueColor, null, SWT.BOLD)); > } > isFirstMessage = false; >+ >+ if (output == null) { >+ return; >+ } >+ >+ int startRange = chatText.getText().length(); >+ >+ if (!body.endsWith("\n")) { >+ output += "\n"; //$NON-NLS-1$ >+ } >+ >+ chatText.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; >+ } >+ chatText.replaceStyleRanges(startRange, output.length(), ranges); >+ } >+ > if (scrollToEnd) > chatText.invokeAction(ST.TEXT_END); > boldTabTitle(!scrollToEnd); >@@ -404,13 +470,35 @@ > Composite parent = new Composite(tabFolder, SWT.NONE); > parent.setLayout(new FillLayout()); > >- SashForm sash = new SashForm(parent, SWT.VERTICAL); >- >- chatText = createStyledTextWidget(sash); >+ if (remoteID != null) { >+ //SashForm sash = new SashForm(parent, SWT.VERTICAL); >+ Composite composite = new Composite(parent, SWT.NONE); >+ GridLayout layout = new GridLayout(); >+ layout.marginWidth = 0; >+ layout.marginHeight = 0; >+ layout.marginHeight = 0; >+ layout.verticalSpacing = 3; >+ layout.horizontalSpacing = 3; >+ composite.setLayout(layout); >+ >+ chatText = createStyledTextWidget(/*sash*/composite); >+ chatText.setLayoutData(new GridData(GridData.FILL_BOTH)); >+ >+ inputText = new Text(/*sash*/composite, SWT.MULTI | SWT.BORDER | SWT.V_SCROLL | SWT.WRAP); >+ GridData gd = new GridData(GridData.FILL_HORIZONTAL); >+ GC gc = new GC(inputText); >+ gc.setFont(JFaceResources.getDialogFont()); >+ FontMetrics fontMetrics = gc.getFontMetrics(); >+ gc.dispose(); >+ gd.heightHint = fontMetrics.getHeight() * 2; >+ inputText.setLayoutData(gd); > >- inputText = new Text(sash, SWT.MULTI | SWT.BORDER | SWT.V_SCROLL); >+ //sash.setWeights(WEIGHTS); >+ } else { >+ chatText = createStyledTextWidget(parent); >+ } > >- sash.setWeights(WEIGHTS); >+ messageRenderer = new MessageRenderer(); > > Menu menu = new Menu(chatText); > MenuItem mi = new MenuItem(menu, SWT.PUSH); >Index: src/org/eclipse/ecf/presence/ui/RosterWorkbenchAdapterFactory.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.ecf/plugins/org.eclipse.ecf.presence.ui/src/org/eclipse/ecf/presence/ui/RosterWorkbenchAdapterFactory.java,v >retrieving revision 1.13 >diff -u -r1.13 RosterWorkbenchAdapterFactory.java >--- src/org/eclipse/ecf/presence/ui/RosterWorkbenchAdapterFactory.java 6 Sep 2007 04:41:55 -0000 1.13 >+++ src/org/eclipse/ecf/presence/ui/RosterWorkbenchAdapterFactory.java 11 Apr 2008 13:16:21 -0000 >@@ -175,6 +175,9 @@ > // available > if (pMode.equals(IPresence.Mode.AVAILABLE)) > return getImageDescriptor(SharedImages.IMG_USER_AVAILABLE); >+ // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=223290 >+ else if (pMode.equals(IPresence.Mode.CHAT)) >+ return getImageDescriptor(SharedImages.IMG_USER_AVAILABLE); > // If mode is away then we're away > else if (pMode.equals(IPresence.Mode.AWAY) || pMode.equals(IPresence.Mode.EXTENDED_AWAY)) > return getImageDescriptor(SharedImages.IMG_USER_AWAY);
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