KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > ui > dialogs > OpenTypeSelectionDialog


1 /*******************************************************************************
2  * Copyright (c) 2000, 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.jdt.internal.ui.dialogs;
12
13 import org.eclipse.swt.widgets.Shell;
14
15 import org.eclipse.jface.dialogs.IDialogSettings;
16 import org.eclipse.jface.operation.IRunnableContext;
17
18 import org.eclipse.ui.PlatformUI;
19
20 import org.eclipse.jdt.core.search.IJavaSearchScope;
21
22 import org.eclipse.jdt.ui.dialogs.TypeSelectionExtension;
23
24 import org.eclipse.jdt.internal.ui.IJavaHelpContextIds;
25 import org.eclipse.jdt.internal.ui.JavaPlugin;
26
27 /**
28  * A type selection dialog used for opening types.
29  */

30 public class OpenTypeSelectionDialog extends FilteredTypesSelectionDialog {
31
32     private static final String JavaDoc DIALOG_SETTINGS= "org.eclipse.jdt.internal.ui.dialogs.OpenTypeSelectionDialog2"; //$NON-NLS-1$
33

34     public OpenTypeSelectionDialog(Shell parent, boolean multi, IRunnableContext context, IJavaSearchScope scope, int elementKinds) {
35         this(parent, multi, context, scope, elementKinds, null);
36     }
37
38     public OpenTypeSelectionDialog(Shell parent, boolean multi, IRunnableContext context, IJavaSearchScope scope, int elementKinds, TypeSelectionExtension extension) {
39         super(parent, multi, context, scope, elementKinds, extension);
40     }
41
42     /*
43      * (non-Javadoc)
44      *
45      * @see org.eclipse.ui.dialogs.SelectionStatusDialog#configureShell(org.eclipse.swt.widgets.Shell)
46      */

47     protected void configureShell(Shell newShell) {
48         super.configureShell(newShell);
49         PlatformUI.getWorkbench().getHelpSystem().setHelp(newShell, IJavaHelpContextIds.OPEN_TYPE_DIALOG);
50     }
51
52     /*
53      * (non-Javadoc)
54      *
55      * @see org.eclipse.jdt.internal.ui.dialogs.FilteredTypesSelectionDialog#getDialogSettings()
56      */

57     protected IDialogSettings getDialogSettings() {
58         IDialogSettings settings= JavaPlugin.getDefault().getDialogSettings().getSection(DIALOG_SETTINGS);
59
60         if (settings == null) {
61             settings= JavaPlugin.getDefault().getDialogSettings().addNewSection(DIALOG_SETTINGS);
62         }
63
64         return settings;
65     }
66 }
67
Popular Tags