|
Lines 1-5
Link Here
|
| 1 |
/******************************************************************************* |
1 |
/******************************************************************************* |
| 2 |
* Copyright (c) 2000, 2006 IBM Corporation and others. |
2 |
* Copyright (c) 2000, 2007 IBM Corporation and others. |
| 3 |
* All rights reserved. This program and the accompanying materials |
3 |
* All rights reserved. This program and the accompanying materials |
| 4 |
* are made available under the terms of the Eclipse Public License v1.0 |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
| 5 |
* which accompanies this distribution, and is available at |
5 |
* which accompanies this distribution, and is available at |
|
Lines 31-38
Link Here
|
| 31 |
|
31 |
|
| 32 |
/** |
32 |
/** |
| 33 |
* Constructor for DetailsDialogWithProjects. |
33 |
* Constructor for DetailsDialogWithProjects. |
| 34 |
* @param parentShell |
34 |
* |
| 35 |
* @param dialogTitle |
35 |
* @param parentShell the parent shell |
|
|
36 |
* @param dialogTitle the dialog title |
| 37 |
* @param dialogMessage the dialog message |
| 38 |
* @param detailsTitle the details title |
| 39 |
* @param projects the <code>IProject</code>s |
| 40 |
* @param includeCancelButton <code>true</code> if the 'Cancel' button should be shown |
| 41 |
* @param imageKey the image key (one of the image constants on Dialog) |
| 36 |
*/ |
42 |
*/ |
| 37 |
public DetailsDialogWithProjects(Shell parentShell, String dialogTitle, String dialogMessage, String detailsTitle, IProject[] projects, boolean includeCancelButton, String imageKey) { |
43 |
public DetailsDialogWithProjects(Shell parentShell, String dialogTitle, String dialogMessage, String detailsTitle, IProject[] projects, boolean includeCancelButton, String imageKey) { |
| 38 |
super(parentShell, dialogTitle); |
44 |
super(parentShell, dialogTitle); |
|
Lines 49-59
Link Here
|
| 49 |
protected void createMainDialogArea(Composite composite) { |
55 |
protected void createMainDialogArea(Composite composite) { |
| 50 |
Label label = new Label(composite, SWT.WRAP); |
56 |
Label label = new Label(composite, SWT.WRAP); |
| 51 |
label.setText(message); |
57 |
label.setText(message); |
| 52 |
GridData data = new GridData( |
58 |
GridData data = new GridData(SWT.FILL, SWT.FILL | SWT.CENTER, true, false); |
| 53 |
GridData.GRAB_HORIZONTAL | |
|
|
| 54 |
GridData.GRAB_VERTICAL | |
| 55 |
GridData.HORIZONTAL_ALIGN_FILL | |
| 56 |
GridData.VERTICAL_ALIGN_CENTER); |
| 57 |
data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH); |
59 |
data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH); |
| 58 |
label.setLayoutData(data); |
60 |
label.setLayoutData(data); |
| 59 |
updateEnablements(); |
61 |
updateEnablements(); |
|
Lines 73-88
Link Here
|
| 73 |
composite.setLayout(layout); |
75 |
composite.setLayout(layout); |
| 74 |
composite.setLayoutData(new GridData(GridData.FILL_BOTH)); |
76 |
composite.setLayoutData(new GridData(GridData.FILL_BOTH)); |
| 75 |
|
77 |
|
|
|
78 |
if (detailsTitle != null) { |
| 79 |
Label title = new Label(composite, SWT.NONE); |
| 80 |
title.setText(detailsTitle); |
| 81 |
} |
| 82 |
|
| 76 |
detailsList = new org.eclipse.swt.widgets.List(composite, SWT.BORDER | SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL); |
83 |
detailsList = new org.eclipse.swt.widgets.List(composite, SWT.BORDER | SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL); |
| 77 |
GridData data = new GridData (); |
84 |
GridData data = new GridData (SWT.FILL, SWT.FILL, true, true); |
| 78 |
data.heightHint = 75; |
85 |
data.heightHint = convertHeightInCharsToPixels(5); |
| 79 |
data.horizontalAlignment = GridData.FILL; |
|
|
| 80 |
data.grabExcessHorizontalSpace = true; |
| 81 |
detailsList.setLayoutData(data); |
86 |
detailsList.setLayoutData(data); |
| 82 |
|
87 |
|
| 83 |
if (detailsTitle != null) { |
|
|
| 84 |
detailsList.add(detailsTitle); |
| 85 |
} |
| 86 |
|
88 |
|
| 87 |
for (int i = 0; i < projects.length; i++) { |
89 |
for (int i = 0; i < projects.length; i++) { |
| 88 |
detailsList.add(projects[i].getName()); |
90 |
detailsList.add(projects[i].getName()); |
|
Lines 103-107
Link Here
|
| 103 |
protected boolean includeCancelButton() { |
105 |
protected boolean includeCancelButton() { |
| 104 |
return includeCancelButton; |
106 |
return includeCancelButton; |
| 105 |
} |
107 |
} |
|
|
108 |
|
| 109 |
/* (non-Javadoc) |
| 110 |
* @see org.eclipse.team.internal.ui.dialogs.DetailsDialog#isMainGrabVertical() |
| 111 |
* @since 3.4 |
| 112 |
*/ |
| 113 |
protected boolean isMainGrabVertical() { |
| 114 |
return false; |
| 115 |
} |
| 106 |
|
116 |
|
| 107 |
} |
117 |
} |