]>
Commit | Line | Data |
---|---|---|
1b2798f6 EK |
1 | /******************************************************************************* |
2 | * Copyright (c) 2000, 2011 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 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 | @Override | |
48 | protected void configureShell(Shell newShell) { | |
49 | super.configureShell(newShell); | |
50 | PlatformUI.getWorkbench().getHelpSystem().setHelp(newShell, IJavaHelpContextIds.OPEN_TYPE_DIALOG); | |
51 | } | |
52 | ||
53 | /* | |
54 | * (non-Javadoc) | |
55 | * | |
56 | * @see org.eclipse.jdt.internal.ui.dialogs.FilteredTypesSelectionDialog#getDialogSettings() | |
57 | */ | |
58 | @Override | |
59 | protected IDialogSettings getDialogSettings() { | |
60 | IDialogSettings settings= JavaPlugin.getDefault().getDialogSettings().getSection(DIALOG_SETTINGS); | |
61 | ||
62 | if (settings == null) { | |
63 | settings= JavaPlugin.getDefault().getDialogSettings().addNewSection(DIALOG_SETTINGS); | |
64 | } | |
65 | ||
66 | return settings; | |
67 | } | |
68 | } |