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 |
|