Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 361413 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/pde/internal/ui/shared/target/EditIUContainerPage.java (-1 / +63 lines)
Lines 15-20 Link Here
15
import java.net.URISyntaxException;
15
import java.net.URISyntaxException;
16
import org.eclipse.core.runtime.*;
16
import org.eclipse.core.runtime.*;
17
import org.eclipse.equinox.internal.p2.ui.ProvUI;
17
import org.eclipse.equinox.internal.p2.ui.ProvUI;
18
import org.eclipse.equinox.internal.p2.ui.ProvUIMessages;
18
import org.eclipse.equinox.internal.p2.ui.actions.PropertyDialogAction;
19
import org.eclipse.equinox.internal.p2.ui.actions.PropertyDialogAction;
19
import org.eclipse.equinox.internal.p2.ui.dialogs.*;
20
import org.eclipse.equinox.internal.p2.ui.dialogs.*;
20
import org.eclipse.equinox.internal.p2.ui.query.IUViewQueryContext;
21
import org.eclipse.equinox.internal.p2.ui.query.IUViewQueryContext;
Lines 47-52 Link Here
47
 * @see EditBundleContainerWizard
48
 * @see EditBundleContainerWizard
48
 * @see AddBundleContainerWizard
49
 * @see AddBundleContainerWizard
49
 */
50
 */
51
@SuppressWarnings("restriction")
50
public class EditIUContainerPage extends WizardPage implements IEditBundleContainerPage {
52
public class EditIUContainerPage extends WizardPage implements IEditBundleContainerPage {
51
53
52
	// Status for any errors on the page
54
	// Status for any errors on the page
Lines 234-242 Link Here
234
		GridData data = (GridData) fAvailableIUGroup.getStructuredViewer().getControl().getLayoutData();
236
		GridData data = (GridData) fAvailableIUGroup.getStructuredViewer().getControl().getLayoutData();
235
		data.heightHint = 200;
237
		data.heightHint = 200;
236
238
237
		fSelectionCount = SWTFactory.createLabel(parent, NLS.bind(Messages.EditIUContainerPage_itemsSelected, Integer.toString(0)), 1);
239
		Composite buttonParent = new Composite(parent, SWT.NONE);
240
		GridLayout gridLayout = new GridLayout();
241
		gridLayout.numColumns = 3;
242
		gridLayout.marginWidth = 0;
243
		gridLayout.horizontalSpacing = 10;
244
		buttonParent.setLayout(gridLayout);
245
246
		GridData gridData = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
247
		buttonParent.setLayoutData(gridData);
248
249
		Button selectAll = new Button(buttonParent, SWT.PUSH);
250
		selectAll.setText(ProvUIMessages.SelectableIUsPage_Select_All);
251
		GridData selectAllData = setButtonLayoutData(selectAll);
252
		selectAllData.widthHint = 90;
253
254
		selectAll.addListener(SWT.Selection, new Listener() {
255
			@Override
256
			public void handleEvent(Event event) {
257
				setAllChecked(true);
258
			}
259
		});
260
261
		Button deselectAll = new Button(buttonParent, SWT.PUSH);
262
		deselectAll.setText(ProvUIMessages.SelectableIUsPage_Deselect_All);
263
		GridData deselectAllData = setButtonLayoutData(deselectAll);
264
		deselectAllData.widthHint = 90;
265
		deselectAll.addListener(SWT.Selection, new Listener() {
266
			@Override
267
			public void handleEvent(Event event) {
268
				setAllChecked(false);
269
			}
270
		});
271
		fSelectionCount = SWTFactory.createLabel(buttonParent, NLS.bind(Messages.EditIUContainerPage_itemsSelected, Integer.toString(0)), 1);
272
		GridData labelData = new GridData();
273
		labelData.widthHint = 100;
274
		fSelectionCount.setLayoutData(labelData);
238
	}
275
	}
239
276
277
	@SuppressWarnings("deprecation")
278
	void setAllChecked(boolean checked) {
279
		if (checked) {
280
			// TODO ideally there should be API on AvailableIUGroup to do this.
281
			// This is reachy and too knowledgeable of the group's implementation.
282
			fAvailableIUGroup.getCheckboxTreeViewer().setAllChecked(checked);
283
			// to ensure that the listeners get processed.
284
			fAvailableIUGroup.setChecked(fAvailableIUGroup.getCheckboxTreeViewer().getCheckedElements());
285
286
		} else {
287
			fAvailableIUGroup.setChecked(new Object[0]);
288
		}
289
		updateSelection();
290
	}
291
292
	void updateSelection() {
293
		int count = fAvailableIUGroup.getCheckedLeafIUs().length;
294
		setPageComplete(count > 0);
295
		if (count == 0) {
296
			fSelectionCount.setText(""); //$NON-NLS-1$
297
		} else {
298
			String message = count == 1 ? ProvUIMessages.AvailableIUsPage_SingleSelectionCount : ProvUIMessages.AvailableIUsPage_MultipleSelectionCount;
299
			fSelectionCount.setText(NLS.bind(message, Integer.toString(count)));
300
		}
301
	}
240
	/**
302
	/**
241
	 * Details area underneath the group that displays more info on the selected IU
303
	 * Details area underneath the group that displays more info on the selected IU
242
	 * @param parent parent composite
304
	 * @param parent parent composite

Return to bug 361413