View | Details | Raw Unified | Return to bug 184659
Collapse All | Expand All

(-)Eclipse UI/org/eclipse/ui/internal/keys/NewKeysPreferencePage.java (-26 / +6 lines)
Lines 57-63 Link Here
57
import org.eclipse.jface.contexts.IContextIds;
57
import org.eclipse.jface.contexts.IContextIds;
58
import org.eclipse.jface.databinding.swt.SWTObservables;
58
import org.eclipse.jface.databinding.swt.SWTObservables;
59
import org.eclipse.jface.databinding.viewers.ViewersObservables;
59
import org.eclipse.jface.databinding.viewers.ViewersObservables;
60
import org.eclipse.jface.dialogs.IDialogConstants;
61
import org.eclipse.jface.dialogs.IDialogSettings;
60
import org.eclipse.jface.dialogs.IDialogSettings;
62
import org.eclipse.jface.dialogs.MessageDialog;
61
import org.eclipse.jface.dialogs.MessageDialog;
63
import org.eclipse.jface.internal.databinding.provisional.swt.ControlUpdater;
62
import org.eclipse.jface.internal.databinding.provisional.swt.ControlUpdater;
Lines 1137-1143 Link Here
1137
	private final Control createButtonBar(final Composite parent) {
1136
	private final Control createButtonBar(final Composite parent) {
1138
		GridLayout layout;
1137
		GridLayout layout;
1139
		GridData gridData;
1138
		GridData gridData;
1140
		int widthHint;
1141
1139
1142
		// Create the composite to house the button bar.
1140
		// Create the composite to house the button bar.
1143
		final Composite buttonBar = new Composite(parent, SWT.NONE);
1141
		final Composite buttonBar = new Composite(parent, SWT.NONE);
Lines 1150-1161 Link Here
1150
1148
1151
		// Advanced button.
1149
		// Advanced button.
1152
		final Button advancedButton = new Button(buttonBar, SWT.PUSH);
1150
		final Button advancedButton = new Button(buttonBar, SWT.PUSH);
1153
		gridData = new GridData();
1154
		widthHint = convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
1155
		advancedButton.setText(NewKeysPreferenceMessages.AdvancedButton_Text);
1151
		advancedButton.setText(NewKeysPreferenceMessages.AdvancedButton_Text);
1156
		gridData.widthHint = Math.max(widthHint, advancedButton.computeSize(
1152
		setButtonLayoutData(advancedButton);
1157
				SWT.DEFAULT, SWT.DEFAULT, true).x) + 5;
1158
		advancedButton.setLayoutData(gridData);
1159
		advancedButton.addSelectionListener(new SelectionListener() {
1153
		advancedButton.addSelectionListener(new SelectionListener() {
1160
			public void widgetDefaultSelected(SelectionEvent e) {
1154
			public void widgetDefaultSelected(SelectionEvent e) {
1161
			}
1155
			}
Lines 1182-1187 Link Here
1182
	 * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
1176
	 * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
1183
	 */
1177
	 */
1184
	protected final Control createContents(final Composite parent) {
1178
	protected final Control createContents(final Composite parent) {
1179
		initializeDialogUnits(parent);
1185
		GridLayout layout = null;
1180
		GridLayout layout = null;
1186
1181
1187
		long startTime = 0L;
1182
		long startTime = 0L;
Lines 1308-1316 Link Here
1308
				| SWT.ARROW);
1303
				| SWT.ARROW);
1309
		addKeyButton
1304
		addKeyButton
1310
				.setToolTipText(NewKeysPreferenceMessages.AddKeyButton_ToolTipText);
1305
				.setToolTipText(NewKeysPreferenceMessages.AddKeyButton_ToolTipText);
1311
		gridData = new GridData();
1306
		setButtonLayoutData(addKeyButton);
1312
		gridData.heightHint = schemeCombo.getCombo().getTextHeight();
1313
		addKeyButton.setLayoutData(gridData);
1314
1307
1315
		// Arrow buttons aren't normally added to the tab list. Let's fix that.
1308
		// Arrow buttons aren't normally added to the tab list. Let's fix that.
1316
		final Control[] tabStops = dataArea.getTabList();
1309
		final Control[] tabStops = dataArea.getTabList();
Lines 1554-1560 Link Here
1554
	private final Control createTreeControls(final Composite parent) {
1547
	private final Control createTreeControls(final Composite parent) {
1555
		GridLayout layout;
1548
		GridLayout layout;
1556
		GridData gridData;
1549
		GridData gridData;
1557
		int widthHint;
1558
1550
1559
		// Creates controls related to the tree.
1551
		// Creates controls related to the tree.
1560
		final Composite treeControls = new Composite(parent, SWT.NONE);
1552
		final Composite treeControls = new Composite(parent, SWT.NONE);
Lines 1587-1599 Link Here
1587
1579
1588
		// Create the delete binding button.
1580
		// Create the delete binding button.
1589
		final Button addBindingButton = new Button(treeControls, SWT.PUSH);
1581
		final Button addBindingButton = new Button(treeControls, SWT.PUSH);
1590
		gridData = new GridData();
1591
		widthHint = convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
1592
		addBindingButton
1582
		addBindingButton
1593
				.setText(NewKeysPreferenceMessages.AddBindingButton_Text);
1583
				.setText(NewKeysPreferenceMessages.AddBindingButton_Text);
1594
		gridData.widthHint = Math.max(widthHint, addBindingButton.computeSize(
1584
		setButtonLayoutData(addBindingButton);
1595
				SWT.DEFAULT, SWT.DEFAULT, true).x) + 5;
1596
		addBindingButton.setLayoutData(gridData);
1597
		addBindingButton.addSelectionListener(new SelectionAdapter() {
1585
		addBindingButton.addSelectionListener(new SelectionAdapter() {
1598
			public final void widgetSelected(final SelectionEvent event) {
1586
			public final void widgetSelected(final SelectionEvent event) {
1599
				selectAddBindingButton(event);
1587
				selectAddBindingButton(event);
Lines 1609-1621 Link Here
1609
1597
1610
		// Create the delete binding button.
1598
		// Create the delete binding button.
1611
		final Button removeBindingButton = new Button(treeControls, SWT.PUSH);
1599
		final Button removeBindingButton = new Button(treeControls, SWT.PUSH);
1612
		gridData = new GridData();
1613
		widthHint = convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
1614
		removeBindingButton
1600
		removeBindingButton
1615
				.setText(NewKeysPreferenceMessages.RemoveBindingButton_Text);
1601
				.setText(NewKeysPreferenceMessages.RemoveBindingButton_Text);
1616
		gridData.widthHint = Math.max(widthHint, removeBindingButton
1602
		setButtonLayoutData(removeBindingButton);
1617
				.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x) + 5;
1618
		removeBindingButton.setLayoutData(gridData);
1619
		removeBindingButton.addSelectionListener(new SelectionAdapter() {
1603
		removeBindingButton.addSelectionListener(new SelectionAdapter() {
1620
			public final void widgetSelected(final SelectionEvent event) {
1604
			public final void widgetSelected(final SelectionEvent event) {
1621
				selectRemoveBindingButton(event);
1605
				selectRemoveBindingButton(event);
Lines 1631-1642 Link Here
1631
1615
1632
		// Create the delete binding button.
1616
		// Create the delete binding button.
1633
		final Button restore = new Button(treeControls, SWT.PUSH);
1617
		final Button restore = new Button(treeControls, SWT.PUSH);
1634
		gridData = new GridData();
1635
		widthHint = convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
1636
		restore.setText(NewKeysPreferenceMessages.RestoreBindingButton_Text);
1618
		restore.setText(NewKeysPreferenceMessages.RestoreBindingButton_Text);
1637
		gridData.widthHint = Math.max(widthHint, restore.computeSize(
1619
		setButtonLayoutData(restore);
1638
				SWT.DEFAULT, SWT.DEFAULT, true).x) + 5;
1639
		restore.setLayoutData(gridData);
1640
		restore.addSelectionListener(new SelectionAdapter() {
1620
		restore.addSelectionListener(new SelectionAdapter() {
1641
			public final void widgetSelected(final SelectionEvent event) {
1621
			public final void widgetSelected(final SelectionEvent event) {
1642
				selectRestoreBindingButton(event);
1622
				selectRestoreBindingButton(event);

Return to bug 184659