KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > debug > internal > ui > views > memory > MemoryViewPrefAction


1 /*******************************************************************************
2  * Copyright (c) 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.debug.internal.ui.views.memory;
13
14 import org.eclipse.debug.internal.ui.DebugUIPlugin;
15 import org.eclipse.jface.action.IAction;
16 import org.eclipse.jface.preference.IPreferenceNode;
17 import org.eclipse.jface.preference.PreferenceDialog;
18 import org.eclipse.jface.preference.PreferenceManager;
19 import org.eclipse.jface.preference.PreferenceNode;
20 import org.eclipse.jface.viewers.ISelection;
21 import org.eclipse.swt.custom.BusyIndicator;
22 import org.eclipse.ui.IViewActionDelegate;
23 import org.eclipse.ui.IViewPart;
24
25 public class MemoryViewPrefAction implements IViewActionDelegate {
26
27     public void init(IViewPart view) {
28
29     }
30
31     public void run(IAction action) {
32         
33         PreferenceManager prefManager = new PreferenceManager();
34         
35         ResetMemoryBlockPreferencePage page = new ResetMemoryBlockPreferencePage();
36         IPreferenceNode node = new PreferenceNode("org.eclipse.debug.ui.memory.resetMemoryBlock", page); //$NON-NLS-1$
37
prefManager.addToRoot(node);
38         
39         SetPaddedStringPreferencePage page2 = new SetPaddedStringPreferencePage();
40         IPreferenceNode node2 = new PreferenceNode("org.eclipse.debug.ui.memory.setPaddedString", page2); //$NON-NLS-1$
41
prefManager.addToRoot(node2);
42
43         CodePagesPreferencePage page3 = new CodePagesPreferencePage();
44         IPreferenceNode node3 = new PreferenceNode("org.eclipse.debug.ui.memory.codePages", page3); //$NON-NLS-1$
45
prefManager.addToRoot(node3);
46         
47         final PreferenceDialog dialog = new PreferenceDialog(DebugUIPlugin.getShell(), prefManager);
48
49         BusyIndicator.showWhile(DebugUIPlugin.getStandardDisplay(), new Runnable JavaDoc() {
50             public void run() {
51                 dialog.create();
52                 dialog.open();
53             }
54         });
55
56     }
57
58     public void selectionChanged(IAction action, ISelection selection) {
59
60     }
61
62 }
63
Popular Tags