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

Collapse All | Expand All

(-)compare/org/eclipse/compare/internal/CompareWithOtherResourceDialog.java (-7 / +25 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2008 Aleksandra Wozniak and others.
2
 * Copyright (c) 2008, 2009 Aleksandra Wozniak 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-13 Link Here
7
 *
7
 *
8
 * Contributors:
8
 * Contributors:
9
 *    Aleksandra Wozniak (aleksandra.k.wozniak@gmail.com) - initial implementation
9
 *    Aleksandra Wozniak (aleksandra.k.wozniak@gmail.com) - initial implementation
10
 *    IBM Corporation - Bug 73923 (major refactoring and adjustments) 
10
 *    IBM Corporation - Bug 73923 (major refactoring and adjustments)
11
 *    IBM Corporation - Bug 241649 - [Dialogs] Resizing of the "compare with other" dialog
11
 *******************************************************************************/
12
 *******************************************************************************/
12
package org.eclipse.compare.internal;
13
package org.eclipse.compare.internal;
13
14
Lines 27-32 Link Here
27
import org.eclipse.core.runtime.IPath;
28
import org.eclipse.core.runtime.IPath;
28
import org.eclipse.core.runtime.Path;
29
import org.eclipse.core.runtime.Path;
29
import org.eclipse.jface.dialogs.IDialogConstants;
30
import org.eclipse.jface.dialogs.IDialogConstants;
31
import org.eclipse.jface.dialogs.IDialogSettings;
30
import org.eclipse.jface.dialogs.IMessageProvider;
32
import org.eclipse.jface.dialogs.IMessageProvider;
31
import org.eclipse.jface.dialogs.MessageDialog;
33
import org.eclipse.jface.dialogs.MessageDialog;
32
import org.eclipse.jface.dialogs.TitleAreaDialog;
34
import org.eclipse.jface.dialogs.TitleAreaDialog;
Lines 46-51 Link Here
46
import org.eclipse.swt.events.ModifyListener;
48
import org.eclipse.swt.events.ModifyListener;
47
import org.eclipse.swt.events.SelectionEvent;
49
import org.eclipse.swt.events.SelectionEvent;
48
import org.eclipse.swt.events.SelectionListener;
50
import org.eclipse.swt.events.SelectionListener;
51
import org.eclipse.swt.graphics.Point;
49
import org.eclipse.swt.layout.GridData;
52
import org.eclipse.swt.layout.GridData;
50
import org.eclipse.swt.layout.GridLayout;
53
import org.eclipse.swt.layout.GridLayout;
51
import org.eclipse.swt.widgets.Button;
54
import org.eclipse.swt.widgets.Button;
Lines 68-75 Link Here
68
 */
71
 */
69
public class CompareWithOtherResourceDialog extends TitleAreaDialog {
72
public class CompareWithOtherResourceDialog extends TitleAreaDialog {
70
	
73
	
71
	private int MIN_WIDTH = 300;
74
	private int MIN_WIDTH = 320;
72
	private int MIN_HEIGHT = 175;
75
	private int MIN_HEIGHT = 240;
73
	
76
	
74
	private class FileTextDragListener implements DragSourceListener {
77
	private class FileTextDragListener implements DragSourceListener {
75
78
Lines 497-503 Link Here
497
			expandable.addExpansionListener(new ExpansionAdapter() {
500
			expandable.addExpansionListener(new ExpansionAdapter() {
498
				public void expansionStateChanged(ExpansionEvent e) {
501
				public void expansionStateChanged(ExpansionEvent e) {
499
					p.layout();
502
					p.layout();
500
					getShell().pack();
503
					Point size = getShell().getSize(); 
504
					size.y = getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT, true).y;
505
					getShell().setSize(size);
501
				}
506
				}
502
			});
507
			});
503
		}
508
		}
Lines 700-712 Link Here
700
	protected Control createDialogArea(Composite parent) {
705
	protected Control createDialogArea(Composite parent) {
701
706
702
		Composite mainPanel = new Composite(parent, SWT.NULL);
707
		Composite mainPanel = new Composite(parent, SWT.NULL);
703
		mainPanel.setLayout(new GridLayout(2, true));
708
		mainPanel.setLayout(new GridLayout(1, true));
704
		mainPanel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
709
		mainPanel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
705
710
706
		ancestorPanel = new InternalExpandable(mainPanel);
711
		ancestorPanel = new InternalExpandable(mainPanel);
707
		ancestorPanel.setText(CompareMessages.CompareWithOther_ancestor);
712
		ancestorPanel.setText(CompareMessages.CompareWithOther_ancestor);
708
		GridData ancestorGD = new GridData(SWT.FILL, SWT.FILL, true, false);
713
		GridData ancestorGD = new GridData(SWT.FILL, SWT.FILL, true, false);
709
		ancestorGD.horizontalSpan = 2;
710
		ancestorPanel.setLayoutData(ancestorGD);
714
		ancestorPanel.setLayoutData(ancestorGD);
711
715
712
		leftPanel = new InternalGroup(mainPanel);
716
		leftPanel = new InternalGroup(mainPanel);
Lines 819-822 Link Here
819
					rightResource };
823
					rightResource };
820
		return resources;
824
		return resources;
821
	}
825
	}
826
827
	/*
828
	 * @see org.eclipse.jface.dialogs.Dialog#getDialogBoundsSettings()
829
	 */
830
	protected IDialogSettings getDialogBoundsSettings() {
831
		String sectionName = getClass().getName() + "_dialogBounds"; //$NON-NLS-1$
832
		IDialogSettings settings = CompareUIPlugin.getDefault()
833
				.getDialogSettings();
834
		IDialogSettings section = settings.getSection(sectionName);
835
		if (section == null)
836
			section = settings.addNewSection(sectionName);
837
		return section;
838
	}
839
822
}
840
}

Return to bug 241649