Honor workbench setting for Dialog font
[egit.git] / org.eclipse.egit.ui / src / org / eclipse / egit / ui / internal / push / PushResultDialog.java
blobd3b066ecd12a744904af3b038bc78e173a964359
1 /*******************************************************************************
2 * Copyright (C) 2008, Marek Zawirski <marek.zawirski@gmail.com>
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * which accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *******************************************************************************/
9 package org.eclipse.egit.ui.internal.push;
11 import org.eclipse.egit.core.op.PushOperationResult;
12 import org.eclipse.egit.ui.UIText;
13 import org.eclipse.jface.dialogs.Dialog;
14 import org.eclipse.jface.dialogs.IDialogConstants;
15 import org.eclipse.osgi.util.NLS;
16 import org.eclipse.swt.SWT;
17 import org.eclipse.swt.layout.GridData;
18 import org.eclipse.swt.widgets.Composite;
19 import org.eclipse.swt.widgets.Control;
20 import org.eclipse.swt.widgets.Label;
21 import org.eclipse.swt.widgets.Shell;
22 import org.eclipse.jgit.lib.Repository;
24 class PushResultDialog extends Dialog {
25 private final Repository localDb;
27 private final PushOperationResult result;
29 private final String destinationString;
31 PushResultDialog(final Shell parentShell, final Repository localDb,
32 final PushOperationResult result, final String destinationString) {
33 super(parentShell);
34 setShellStyle(getShellStyle() | SWT.RESIZE);
35 this.localDb = localDb;
36 this.result = result;
37 this.destinationString = destinationString;
40 @Override
41 protected void createButtonsForButtonBar(final Composite parent) {
42 createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL,
43 true);
46 @Override
47 protected Control createDialogArea(final Composite parent) {
48 final Composite composite = (Composite) super.createDialogArea(parent);
50 final Label label = new Label(composite, SWT.NONE);
51 label.setText(NLS.bind(UIText.ResultDialog_label, destinationString));
52 label.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
53 final PushResultTable table = new PushResultTable(composite);
54 table.setData(localDb, result);
55 final Control tableControl = table.getControl();
56 final GridData tableLayout = new GridData(SWT.FILL, SWT.FILL, true,
57 true);
58 tableLayout.widthHint = 650;
59 tableLayout.heightHint = 300;
60 tableControl.setLayoutData(tableLayout);
62 getShell().setText(
63 NLS.bind(UIText.ResultDialog_title, destinationString));
64 applyDialogFont(composite);
65 return composite;