View | Details | Raw Unified | Return to bug 222253 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/ecf/internal/example/collab/ui/ChatComposite.java (-10 / +20 lines)
Lines 1-5 Link Here
1
/****************************************************************************
1
/****************************************************************************
2
 * Copyright (c) 2004, 2007 Composent, Inc. and others.
2
 * Copyright (c) 2004, 2008 Composent, Inc. and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 7-12 Link Here
7
 *
7
 *
8
 * Contributors:
8
 * Contributors:
9
 *    Composent, Inc. - initial API and implementation
9
 *    Composent, Inc. - initial API and implementation
10
 *    Hiroyuki Inaba <Hiroyuki <hiroyuki.inaba@gmail.com> - bug 222253
10
 *****************************************************************************/
11
 *****************************************************************************/
11
12
12
package org.eclipse.ecf.internal.example.collab.ui;
13
package org.eclipse.ecf.internal.example.collab.ui;
Lines 59-65 Link Here
59
import org.eclipse.jface.window.Window;
60
import org.eclipse.jface.window.Window;
60
import org.eclipse.osgi.util.NLS;
61
import org.eclipse.osgi.util.NLS;
61
import org.eclipse.swt.SWT;
62
import org.eclipse.swt.SWT;
62
import org.eclipse.swt.custom.SashForm;
63
import org.eclipse.swt.custom.StyleRange;
63
import org.eclipse.swt.custom.StyleRange;
64
import org.eclipse.swt.custom.StyledText;
64
import org.eclipse.swt.custom.StyledText;
65
import org.eclipse.swt.events.DisposeEvent;
65
import org.eclipse.swt.events.DisposeEvent;
Lines 74-83 Link Here
74
import org.eclipse.swt.events.MouseListener;
74
import org.eclipse.swt.events.MouseListener;
75
import org.eclipse.swt.graphics.Color;
75
import org.eclipse.swt.graphics.Color;
76
import org.eclipse.swt.graphics.FontData;
76
import org.eclipse.swt.graphics.FontData;
77
import org.eclipse.swt.graphics.FontMetrics;
78
import org.eclipse.swt.graphics.GC;
77
import org.eclipse.swt.graphics.Image;
79
import org.eclipse.swt.graphics.Image;
78
import org.eclipse.swt.graphics.ImageData;
80
import org.eclipse.swt.graphics.ImageData;
79
import org.eclipse.swt.layout.FillLayout;
81
import org.eclipse.swt.layout.FillLayout;
80
import org.eclipse.swt.layout.GridData;
82
import org.eclipse.swt.layout.GridData;
83
import org.eclipse.swt.layout.GridLayout;
81
import org.eclipse.swt.widgets.Composite;
84
import org.eclipse.swt.widgets.Composite;
82
import org.eclipse.swt.widgets.Control;
85
import org.eclipse.swt.widgets.Control;
83
import org.eclipse.swt.widgets.Display;
86
import org.eclipse.swt.widgets.Display;
Lines 165-178 Link Here
165
			}
168
			}
166
169
167
		});
170
		});
168
		final SashForm sf = new SashForm(this, SWT.NORMAL);
171
		final Composite chattingComposite = new Composite(this, SWT.NONE);
169
		sf.setLayout(new FillLayout());
172
		GridLayout layout = new GridLayout(1, true);
170
		sf.setOrientation(SWT.VERTICAL);
173
		layout.marginHeight = 0;
174
		layout.marginWidth = 0;
175
		chattingComposite.setLayout(layout);
171
176
172
		tableView = table;
177
		tableView = table;
173
178
174
		textoutput = createStyledTextWidget(sf);
179
		textoutput = createStyledTextWidget(chattingComposite);
175
		textoutput.setLayoutData(new GridData(SWT.FILL));
180
		textoutput.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
176
		final String fontName = ClientPlugin.getDefault().getPluginPreferences().getString(ClientPlugin.PREF_CHAT_FONT);
181
		final String fontName = ClientPlugin.getDefault().getPluginPreferences().getString(ClientPlugin.PREF_CHAT_FONT);
177
		if (!(fontName == null) && !(fontName.equals(""))) { //$NON-NLS-1$
182
		if (!(fontName == null) && !(fontName.equals(""))) { //$NON-NLS-1$
178
			final FontRegistry fr = ClientPlugin.getDefault().getFontRegistry();
183
			final FontRegistry fr = ClientPlugin.getDefault().getFontRegistry();
Lines 186-194 Link Here
186
191
187
		textoutput.append(initText);
192
		textoutput.append(initText);
188
193
189
		textinput = new Text(sf, SWT.SINGLE | SWT.BORDER);
194
		textinput = new Text(chattingComposite, SWT.SINGLE | SWT.BORDER);
190
		textinput.setText(TEXT_INPUT_INIT);
195
		textinput.setText(TEXT_INPUT_INIT);
191
		textinput.setLayoutData(new GridData(SWT.FILL));
196
		GridData gd = new GridData(SWT.FILL, SWT.CENTER, true, false);
197
		GC gc = new GC(textinput);
198
		gc.setFont(textinput.getFont());
199
		FontMetrics fontMetrics = gc.getFontMetrics();
200
		gc.dispose();
201
		gd.heightHint = fontMetrics.getHeight() * 2;
202
		textinput.setLayoutData(gd);
192
203
193
		textinput.selectAll();
204
		textinput.selectAll();
194
		textinput.addKeyListener(new KeyListener() {
205
		textinput.addKeyListener(new KeyListener() {
Lines 236-242 Link Here
236
			}
247
			}
237
		});
248
		});
238
249
239
		sf.setWeights(new int[] {90, 10});
240
		// make actions
250
		// make actions
241
		makeActions();
251
		makeActions();
242
		hookContextMenu();
252
		hookContextMenu();
(-)src/org/eclipse/ecf/presence/ui/chatroom/ChatRoomManagerView.java (-19 / +28 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2004, 2007 Composent, Inc. and others.
2
 * Copyright (c) 2004, 2008 Composent, Inc. and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 10-15 Link Here
10
 *    Jacek Pospychala <jacek.pospychala@pl.ibm.com> - bug 192762, 197329, 190851
10
 *    Jacek Pospychala <jacek.pospychala@pl.ibm.com> - bug 192762, 197329, 190851
11
 *    Abner Ballardo <modlost@modlost.net> - bug 192756, 199336, 200630
11
 *    Abner Ballardo <modlost@modlost.net> - bug 192756, 199336, 200630
12
 *    Jakub Jurkiewicz <jakub.jurkiewicz@pl.ibm.com> - bug 197332
12
 *    Jakub Jurkiewicz <jakub.jurkiewicz@pl.ibm.com> - bug 197332
13
 *    Hiroyuki Inaba <Hiroyuki <hiroyuki.inaba@gmail.com> - bug 222253
13
 ******************************************************************************/
14
 ******************************************************************************/
14
package org.eclipse.ecf.presence.ui.chatroom;
15
package org.eclipse.ecf.presence.ui.chatroom;
15
16
Lines 59-68 Link Here
59
60
60
	public static final String PARTICIPANTS_MENU_ID = "org.eclipse.ecf.presence.ui.chatroom.participantsView"; //$NON-NLS-1$ 
61
	public static final String PARTICIPANTS_MENU_ID = "org.eclipse.ecf.presence.ui.chatroom.participantsView"; //$NON-NLS-1$ 
61
62
62
	private static final int RATIO_WRITE_PANE = 1;
63
64
	private static final int RATIO_READ_PANE = 9;
65
66
	private static final int RATIO_READ_WRITE_PANE = 85;
63
	private static final int RATIO_READ_WRITE_PANE = 85;
67
64
68
	private static final int RATIO_PRESENCE_PANE = 15;
65
	private static final int RATIO_PRESENCE_PANE = 15;
Lines 112-118 Link Here
112
109
113
		private CTabItem tabItem;
110
		private CTabItem tabItem;
114
111
115
		private SashForm rightSash;
112
		private Composite rightComposite;
116
113
117
		private StyledText subjectText;
114
		private StyledText subjectText;
118
115
Lines 171-180 Link Here
171
					}
168
					}
172
				});
169
				});
173
170
174
				Composite rightComp = new Composite(fullChat, SWT.NONE);
171
				rightComposite = new Composite(fullChat, SWT.NONE);
175
				rightComp.setLayout(layout);
172
				layout = new GridLayout(1, true);
173
				layout.marginHeight = 0;
174
				layout.marginWidth = 0;
175
				rightComposite.setLayout(layout);
176
176
177
				subjectText = createStyledTextWidget(rightComp, SWT.SINGLE | SWT.BORDER);
177
				subjectText = createStyledTextWidget(rightComposite, SWT.SINGLE | SWT.BORDER);
178
				subjectText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
178
				subjectText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
179
				/*
179
				/*
180
				 * The sendSubjectChange method in Smack 2.2.1 does not seem to be working correctly, so this whole block
180
				 * The sendSubjectChange method in Smack 2.2.1 does not seem to be working correctly, so this whole block
Lines 199-223 Link Here
199
				*/
199
				*/
200
				subjectText.setEditable(false);
200
				subjectText.setEditable(false);
201
				subjectText.setEnabled(false);
201
				subjectText.setEnabled(false);
202
			} else {
203
				rightComposite = new Composite(parent, SWT.NONE);
204
				GridLayout layout = new GridLayout(1, true);
205
				layout.marginHeight = 0;
206
				layout.marginWidth = 0;
207
				rightComposite.setLayout(layout);
208
			}
202
209
203
				rightSash = new SashForm(rightComp, SWT.VERTICAL);
210
			outputText = createStyledTextWidget(rightComposite, SWT.BORDER | SWT.WRAP | SWT.V_SCROLL | SWT.MULTI | SWT.READ_ONLY);
204
				rightSash.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
205
			} else
206
				rightSash = new SashForm(parent, SWT.VERTICAL);
207
208
			outputText = createStyledTextWidget(rightSash, SWT.BORDER | SWT.WRAP | SWT.V_SCROLL | SWT.MULTI | SWT.READ_ONLY);
209
			outputText.setEditable(false);
211
			outputText.setEditable(false);
210
			outputText.setLayoutData(new GridData(GridData.FILL_BOTH));
212
			outputText.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
213
214
			inputText = new Text(rightComposite, SWT.BORDER | SWT.MULTI | SWT.WRAP | SWT.V_SCROLL);
215
			GridData gd = new GridData(SWT.FILL, SWT.CENTER, true, false);
216
			GC gc = new GC(inputText);
217
			gc.setFont(inputText.getFont());
218
			FontMetrics fontMetrics = gc.getFontMetrics();
219
			gc.dispose();
220
			gd.heightHint = fontMetrics.getHeight() * 2;
221
			inputText.setLayoutData(gd);
211
222
212
			inputText = new Text(rightSash, SWT.BORDER | SWT.MULTI | SWT.WRAP | SWT.V_SCROLL);
213
			if (keyListener != null)
223
			if (keyListener != null)
214
				inputText.addKeyListener(keyListener);
224
				inputText.addKeyListener(keyListener);
215
			rightSash.setWeights(new int[] {RATIO_READ_PANE, RATIO_WRITE_PANE});
216
			if (withParticipants) {
225
			if (withParticipants) {
217
				fullChat.setWeights(new int[] {RATIO_PRESENCE_PANE, RATIO_READ_WRITE_PANE});
226
				fullChat.setWeights(new int[] {RATIO_PRESENCE_PANE, RATIO_READ_WRITE_PANE});
218
				tabItem.setControl(fullChat);
227
				tabItem.setControl(fullChat);
219
			} else
228
			} else
220
				tabItem.setControl(rightSash);
229
				tabItem.setControl(rightComposite);
221
230
222
			parent.setSelection(tabItem);
231
			parent.setSelection(tabItem);
223
232

Return to bug 222253