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
) {
33 setShellStyle(getShellStyle() | SWT
.RESIZE
);
34 this.localDb
= localDb
;
36 this.destinationString
= destinationString
;
40 protected void createButtonsForButtonBar(final Composite parent
) {
41 createButton(parent
, IDialogConstants
.OK_ID
, IDialogConstants
.OK_LABEL
,
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,
57 tableLayout
.widthHint
= 650;
58 tableLayout
.heightHint
= 300;
59 tableControl
.setLayoutData(tableLayout
);
62 NLS
.bind(UIText
.ResultDialog_title
, destinationString
));