### Eclipse Workspace Patch 1.0 #P org.eclipse.ecf.example.collab 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 Jul 2008 23:18:37 -0000 @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2004, 2007 Composent, Inc. and others. + * Copyright (c) 2004, 2008 Composent, Inc. and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -7,6 +7,7 @@ * * Contributors: * Composent, Inc. - initial API and implementation + * Hiroyuki Inaba - bug 222253 *****************************************************************************/ package org.eclipse.ecf.internal.example.collab.ui; @@ -59,7 +60,6 @@ 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.StyleRange; import org.eclipse.swt.custom.StyledText; import org.eclipse.swt.events.DisposeEvent; @@ -74,10 +74,13 @@ import org.eclipse.swt.events.MouseListener; import org.eclipse.swt.graphics.Color; 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.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; @@ -165,14 +168,16 @@ } }); - final SashForm sf = new SashForm(this, SWT.NORMAL); - sf.setLayout(new FillLayout()); - sf.setOrientation(SWT.VERTICAL); + final Composite chattingComposite = new Composite(this, SWT.NONE); + GridLayout layout = new GridLayout(1, true); + layout.marginHeight = 0; + layout.marginWidth = 0; + chattingComposite.setLayout(layout); tableView = table; - textoutput = createStyledTextWidget(sf); - textoutput.setLayoutData(new GridData(SWT.FILL)); + textoutput = createStyledTextWidget(chattingComposite); + textoutput.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); 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(); @@ -186,9 +191,15 @@ textoutput.append(initText); - textinput = new Text(sf, SWT.SINGLE | SWT.BORDER); + textinput = new Text(chattingComposite, SWT.SINGLE | SWT.BORDER); textinput.setText(TEXT_INPUT_INIT); - textinput.setLayoutData(new GridData(SWT.FILL)); + GridData gd = new GridData(SWT.FILL, SWT.CENTER, true, false); + GC gc = new GC(textinput); + gc.setFont(textinput.getFont()); + FontMetrics fontMetrics = gc.getFontMetrics(); + gc.dispose(); + gd.heightHint = fontMetrics.getHeight() * 2; + textinput.setLayoutData(gd); textinput.selectAll(); textinput.addKeyListener(new KeyListener() { @@ -236,7 +247,6 @@ } }); - sf.setWeights(new int[] {90, 10}); // make actions makeActions(); hookContextMenu(); #P org.eclipse.ecf.presence.ui 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.47 diff -u -r1.47 ChatRoomManagerView.java --- src/org/eclipse/ecf/presence/ui/chatroom/ChatRoomManagerView.java 23 May 2008 19:18:32 -0000 1.47 +++ src/org/eclipse/ecf/presence/ui/chatroom/ChatRoomManagerView.java 11 Jul 2008 23:18:38 -0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2007 Composent, Inc. and others. + * Copyright (c) 2004, 2008 Composent, Inc. and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -10,6 +10,7 @@ * Jacek Pospychala - bug 192762, 197329, 190851 * Abner Ballardo - bug 192756, 199336, 200630 * Jakub Jurkiewicz - bug 197332 + * Hiroyuki Inaba - bug 222253 ******************************************************************************/ package org.eclipse.ecf.presence.ui.chatroom; @@ -59,10 +60,6 @@ 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_READ_WRITE_PANE = 85; private static final int RATIO_PRESENCE_PANE = 15; @@ -112,7 +109,7 @@ private CTabItem tabItem; - private SashForm rightSash; + private Composite rightComposite; private StyledText subjectText; @@ -171,10 +168,13 @@ } }); - Composite rightComp = new Composite(fullChat, SWT.NONE); - rightComp.setLayout(layout); + rightComposite = new Composite(fullChat, SWT.NONE); + layout = new GridLayout(1, true); + layout.marginHeight = 0; + layout.marginWidth = 0; + rightComposite.setLayout(layout); - subjectText = createStyledTextWidget(rightComp, SWT.SINGLE | SWT.BORDER); + subjectText = createStyledTextWidget(rightComposite, SWT.SINGLE | SWT.BORDER); subjectText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); /* * The sendSubjectChange method in Smack 2.2.1 does not seem to be working correctly, so this whole block @@ -199,25 +199,34 @@ */ subjectText.setEditable(false); subjectText.setEnabled(false); + } else { + rightComposite = new Composite(parent, SWT.NONE); + GridLayout layout = new GridLayout(1, true); + layout.marginHeight = 0; + layout.marginWidth = 0; + rightComposite.setLayout(layout); + } - rightSash = new SashForm(rightComp, SWT.VERTICAL); - rightSash.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); - } else - rightSash = new SashForm(parent, SWT.VERTICAL); - - outputText = createStyledTextWidget(rightSash, SWT.BORDER | SWT.WRAP | SWT.V_SCROLL | SWT.MULTI | SWT.READ_ONLY); + outputText = createStyledTextWidget(rightComposite, SWT.BORDER | SWT.WRAP | SWT.V_SCROLL | SWT.MULTI | SWT.READ_ONLY); outputText.setEditable(false); - outputText.setLayoutData(new GridData(GridData.FILL_BOTH)); + outputText.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); + + inputText = new Text(rightComposite, SWT.BORDER | SWT.MULTI | SWT.WRAP | SWT.V_SCROLL); + GridData gd = new GridData(SWT.FILL, SWT.CENTER, true, false); + GC gc = new GC(inputText); + gc.setFont(inputText.getFont()); + FontMetrics fontMetrics = gc.getFontMetrics(); + gc.dispose(); + gd.heightHint = fontMetrics.getHeight() * 2; + inputText.setLayoutData(gd); - inputText = new Text(rightSash, SWT.BORDER | SWT.MULTI | SWT.WRAP | SWT.V_SCROLL); if (keyListener != null) inputText.addKeyListener(keyListener); - 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(rightComposite); parent.setSelection(tabItem);