Lines 48-54
Link Here
|
48 |
import org.eclipse.swt.events.ModifyListener; |
48 |
import org.eclipse.swt.events.ModifyListener; |
49 |
import org.eclipse.swt.events.SelectionEvent; |
49 |
import org.eclipse.swt.events.SelectionEvent; |
50 |
import org.eclipse.swt.events.SelectionListener; |
50 |
import org.eclipse.swt.events.SelectionListener; |
51 |
import org.eclipse.swt.graphics.Point; |
|
|
52 |
import org.eclipse.swt.layout.GridData; |
51 |
import org.eclipse.swt.layout.GridData; |
53 |
import org.eclipse.swt.layout.GridLayout; |
52 |
import org.eclipse.swt.layout.GridLayout; |
54 |
import org.eclipse.swt.widgets.Button; |
53 |
import org.eclipse.swt.widgets.Button; |
Lines 72-79
Link Here
|
72 |
public class CompareWithOtherResourceDialog extends TitleAreaDialog { |
71 |
public class CompareWithOtherResourceDialog extends TitleAreaDialog { |
73 |
|
72 |
|
74 |
private int MIN_WIDTH = 320; |
73 |
private int MIN_WIDTH = 320; |
75 |
private int MIN_HEIGHT = 240; |
74 |
private int MIN_HEIGHT_WITH_ANCESTOR = 320; |
76 |
|
75 |
private int MIN_HEIGHT_WITHOUT_ANCESTOR = 238; |
|
|
76 |
|
77 |
private class FileTextDragListener implements DragSourceListener { |
77 |
private class FileTextDragListener implements DragSourceListener { |
78 |
|
78 |
|
79 |
private ContentTypeElement element; |
79 |
private ContentTypeElement element; |
Lines 500-508
Link Here
|
500 |
expandable.addExpansionListener(new ExpansionAdapter() { |
500 |
expandable.addExpansionListener(new ExpansionAdapter() { |
501 |
public void expansionStateChanged(ExpansionEvent e) { |
501 |
public void expansionStateChanged(ExpansionEvent e) { |
502 |
p.layout(); |
502 |
p.layout(); |
503 |
Point size = getShell().getSize(); |
503 |
adjustSize(e.getState()); |
504 |
size.y = getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT, true).y; |
|
|
505 |
getShell().setSize(size); |
506 |
} |
504 |
} |
507 |
}); |
505 |
}); |
508 |
} |
506 |
} |
Lines 724-735
Link Here
|
724 |
setSelection(selection); |
722 |
setSelection(selection); |
725 |
getShell().setText(CompareMessages.CompareWithOther_dialogTitle); |
723 |
getShell().setText(CompareMessages.CompareWithOther_dialogTitle); |
726 |
setTitle(CompareMessages.CompareWithOther_dialogMessage); |
724 |
setTitle(CompareMessages.CompareWithOther_dialogMessage); |
727 |
getShell().setMinimumSize(convertHorizontalDLUsToPixels(MIN_WIDTH), |
725 |
adjustSize(ancestorPanel.expandable.isExpanded()); |
728 |
convertVerticalDLUsToPixels(MIN_HEIGHT)); |
|
|
729 |
|
726 |
|
730 |
return mainPanel; |
727 |
return mainPanel; |
731 |
} |
728 |
} |
732 |
|
729 |
|
|
|
730 |
private void adjustSize(boolean expanded) { |
731 |
int minWidth = convertHorizontalDLUsToPixels(MIN_WIDTH); |
732 |
int minHeight = convertVerticalDLUsToPixels(expanded ? MIN_HEIGHT_WITH_ANCESTOR |
733 |
: MIN_HEIGHT_WITHOUT_ANCESTOR); |
734 |
getShell().setMinimumSize(minWidth, minHeight); |
735 |
} |
736 |
|
733 |
/* |
737 |
/* |
734 |
* (non-Javadoc) |
738 |
* (non-Javadoc) |
735 |
* |
739 |
* |