KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > pde > internal > ui > editor > plugin > PackageSelectionDialog


1 /*******************************************************************************
2  * Copyright (c) 2003, 2007 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.pde.internal.ui.editor.plugin;
12
13 import java.util.Vector JavaDoc;
14
15 import org.eclipse.jdt.core.IJavaProject;
16 import org.eclipse.jface.viewers.ILabelProvider;
17 import org.eclipse.pde.internal.core.util.PDEJavaHelper;
18 import org.eclipse.pde.internal.ui.PDEUIMessages;
19 import org.eclipse.swt.widgets.Composite;
20 import org.eclipse.swt.widgets.Control;
21 import org.eclipse.swt.widgets.Shell;
22 import org.eclipse.ui.dialogs.ElementListSelectionDialog;
23
24 public class PackageSelectionDialog extends ElementListSelectionDialog {
25
26     /**
27      * @param parent
28      * @param renderer
29      */

30     public PackageSelectionDialog(Shell parent, ILabelProvider renderer, IJavaProject jProject, Vector JavaDoc existingPackages, boolean allowJava) {
31         super(parent, renderer);
32         //setElements(jProject, existingPackages, allowJava);
33
setElements(PDEJavaHelper.getPackageFragments(jProject, existingPackages, allowJava));
34         setMultipleSelection(true);
35         setMessage(PDEUIMessages.PackageSelectionDialog_label);
36     }
37     
38     /* (non-Javadoc)
39      * @see org.eclipse.ui.dialogs.ElementListSelectionDialog#createDialogArea(org.eclipse.swt.widgets.Composite)
40      */

41     protected Control createDialogArea(Composite parent) {
42         Control control = super.createDialogArea(parent);
43         getShell().setText(PDEUIMessages.PackageSelectionDialog_title);
44         return control;
45     }
46 }
47
Popular Tags