rename org.spearce.egit -> org.eclipse.egit and bump version to 0.5.0
[egit/imyousuf.git] / org.eclipse.egit.ui / src / org / eclipse / egit / ui / internal / push / PushResultDialog.java
blob0f3cf34878bc8b64605a1d22c548fa199fb86581
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 * See LICENSE for the full license text, also available.
7 *******************************************************************************/
8 package org.eclipse.egit.ui.internal.push;
10 import org.eclipse.egit.core.op.PushOperationResult;
11 import org.eclipse.egit.ui.UIText;
12 import org.eclipse.jface.dialogs.Dialog;
13 import org.eclipse.jface.dialogs.IDialogConstants;
14 import org.eclipse.osgi.util.NLS;
15 import org.eclipse.swt.SWT;
16 import org.eclipse.swt.layout.GridData;
17 import org.eclipse.swt.widgets.Composite;
18 import org.eclipse.swt.widgets.Control;
19 import org.eclipse.swt.widgets.Label;
20 import org.eclipse.swt.widgets.Shell;
21 import org.spearce.jgit.lib.Repository;
23 class PushResultDialog extends Dialog {
24 private final Repository localDb;
26 private final PushOperationResult result;
28 private final String destinationString;
30 PushResultDialog(final Shell parentShell, final Repository localDb,
31 final PushOperationResult result, final String destinationString) {
32 super(parentShell);
33 setShellStyle(getShellStyle() | SWT.RESIZE);
34 this.localDb = localDb;
35 this.result = result;
36 this.destinationString = destinationString;
39 @Override
40 protected void createButtonsForButtonBar(final Composite parent) {
41 createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL,
42 true);
45 @Override
46 protected Control createDialogArea(final Composite parent) {
47 final Composite composite = (Composite) super.createDialogArea(parent);
49 final Label label = new Label(composite, SWT.NONE);
50 label.setText(NLS.bind(UIText.ResultDialog_label, destinationString));
51 label.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
52 final PushResultTable table = new PushResultTable(composite);
53 table.setData(localDb, result);
54 final Control tableControl = table.getControl();
55 final GridData tableLayout = new GridData(SWT.FILL, SWT.FILL, true,
56 true);
57 tableLayout.widthHint = 650;
58 tableLayout.heightHint = 300;
59 tableControl.setLayoutData(tableLayout);
61 getShell().setText(
62 NLS.bind(UIText.ResultDialog_title, destinationString));
63 return composite;