01: /*******************************************************************************
02: * Copyright (c) 2003, 2007 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.pde.internal.ui.editor.plugin;
11:
12: import java.util.Vector;
13:
14: import org.eclipse.jdt.core.IJavaProject;
15: import org.eclipse.jface.viewers.ILabelProvider;
16: import org.eclipse.pde.internal.core.util.PDEJavaHelper;
17: import org.eclipse.pde.internal.ui.PDEUIMessages;
18: import org.eclipse.swt.widgets.Composite;
19: import org.eclipse.swt.widgets.Control;
20: import org.eclipse.swt.widgets.Shell;
21: import org.eclipse.ui.dialogs.ElementListSelectionDialog;
22:
23: public class PackageSelectionDialog extends ElementListSelectionDialog {
24:
25: /**
26: * @param parent
27: * @param renderer
28: */
29: public PackageSelectionDialog(Shell parent,
30: ILabelProvider renderer, IJavaProject jProject,
31: Vector existingPackages, boolean allowJava) {
32: super (parent, renderer);
33: //setElements(jProject, existingPackages, allowJava);
34: setElements(PDEJavaHelper.getPackageFragments(jProject,
35: existingPackages, allowJava));
36: setMultipleSelection(true);
37: setMessage(PDEUIMessages.PackageSelectionDialog_label);
38: }
39:
40: /* (non-Javadoc)
41: * @see org.eclipse.ui.dialogs.ElementListSelectionDialog#createDialogArea(org.eclipse.swt.widgets.Composite)
42: */
43: protected Control createDialogArea(Composite parent) {
44: Control control = super.createDialogArea(parent);
45: getShell().setText(PDEUIMessages.PackageSelectionDialog_title);
46: return control;
47: }
48: }
|