KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > debug > ui > PackageSelectionDialog


1 /*******************************************************************************
2  * Copyright (c) 2000, 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
12 package org.eclipse.jdt.internal.debug.ui;
13
14 import org.eclipse.jdt.debug.ui.IJavaDebugUIConstants;
15 import org.eclipse.jface.dialogs.IDialogSettings;
16 import org.eclipse.jface.viewers.ILabelProvider;
17 import org.eclipse.swt.widgets.Shell;
18 import org.eclipse.ui.dialogs.ElementListSelectionDialog;
19
20 /*
21  * Same as ElementListSelectionDialog, but persists size/location
22  */

23 public class PackageSelectionDialog extends ElementListSelectionDialog {
24
25     public PackageSelectionDialog(Shell parent, ILabelProvider renderer) {
26         super(parent, renderer);
27     }
28     
29     /**
30      * Returns the name of the section that this dialog stores its settings in
31      *
32      * @return String
33      */

34     protected String JavaDoc getDialogSettingsSectionName() {
35         return IJavaDebugUIConstants.PLUGIN_ID + ".PACKAGE_SELECTION_DIALOG_SECTION"; //$NON-NLS-1$
36
}
37     
38      /* (non-Javadoc)
39      * @see org.eclipse.jface.dialogs.Dialog#getDialogBoundsSettings()
40      */

41     protected IDialogSettings getDialogBoundsSettings() {
42          IDialogSettings settings = JDIDebugUIPlugin.getDefault().getDialogSettings();
43          IDialogSettings section = settings.getSection(getDialogSettingsSectionName());
44          if (section == null) {
45              section = settings.addNewSection(getDialogSettingsSectionName());
46          }
47          return section;
48     }
49 }
50
Popular Tags