KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > debug > internal > ui > viewers > FindElementDialog


1 /*******************************************************************************
2  * Copyright (c) 2005, 2006 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.debug.internal.ui.viewers;
12
13 import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
14 import org.eclipse.jface.viewers.ILabelProvider;
15 import org.eclipse.swt.widgets.Composite;
16 import org.eclipse.swt.widgets.Control;
17 import org.eclipse.swt.widgets.Shell;
18 import org.eclipse.ui.PlatformUI;
19 import org.eclipse.ui.dialogs.ElementListSelectionDialog;
20
21 /**
22  * A dialog used to select elements from a list.
23  *
24  * @since 3.3
25  *
26  */

27 public class FindElementDialog extends ElementListSelectionDialog {
28     
29     /**
30      * Constructs a dialog to navigate to an element in the given viewer.
31      *
32      * @param shell shell to open on
33      * @param provider label provider
34      * @param elements elements to choose from
35      */

36     public FindElementDialog(Shell shell, ILabelProvider provider, Object JavaDoc[] elements) {
37         super(shell, provider);
38         setElements(elements);
39         setMultipleSelection(false);
40     }
41
42     /* (non-Javadoc)
43      * @see org.eclipse.ui.dialogs.ElementListSelectionDialog#createDialogArea(org.eclipse.swt.widgets.Composite)
44      */

45     protected Control createDialogArea(Composite parent) {
46         Control comp = super.createDialogArea(parent);
47         PlatformUI.getWorkbench().getHelpSystem().setHelp(comp, IDebugHelpContextIds.FIND_ELEMENT_DIALOG);
48         return comp;
49     }
50     
51 }
52
Popular Tags