KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > debug > ui > variables > VariableOptionsAction


1 /*******************************************************************************
2  * Copyright (c) 2004, 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 implementation
10  *******************************************************************************/

11 package org.eclipse.jdt.internal.debug.ui.variables;
12
13 import org.eclipse.core.runtime.Preferences.IPropertyChangeListener;
14 import org.eclipse.core.runtime.Preferences.PropertyChangeEvent;
15 import org.eclipse.debug.ui.IDebugView;
16 import org.eclipse.jdt.internal.debug.ui.SWTFactory;
17 import org.eclipse.jface.action.IAction;
18 import org.eclipse.jface.viewers.ISelection;
19 import org.eclipse.ui.IViewActionDelegate;
20 import org.eclipse.ui.IViewPart;
21
22 /**
23  * Action which opens preference settings for Java variables.
24  */

25 public class VariableOptionsAction implements IViewActionDelegate, IPropertyChangeListener {
26     
27     private IViewPart fPart;
28
29     /* (non-Javadoc)
30      * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
31      */

32     public void init(IViewPart view) {
33         fPart = view;
34     }
35
36     /* (non-Javadoc)
37      * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
38      */

39     public void run(IAction action) {
40         SWTFactory.showPreferencePage("org.eclipse.jdt.debug.ui.JavaDetailFormattersPreferencePage", //$NON-NLS-1$
41
new String JavaDoc[] {"org.eclipse.jdt.debug.ui.JavaDetailFormattersPreferencePage", //$NON-NLS-1$
42
"org.eclipse.jdt.debug.ui.JavaLogicalStructuresPreferencePage", //$NON-NLS-1$
43
"org.eclipse.jdt.debug.ui.heapWalking", //$NON-NLS-1$
44
"org.eclipse.jdt.debug.ui.JavaPrimitivesPreferencePage"}); //$NON-NLS-1$
45
}
46
47     /* (non-Javadoc)
48      * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
49      */

50     public void selectionChanged(IAction action, ISelection selection) {
51     }
52
53     /* (non-Javadoc)
54      * @see org.eclipse.core.runtime.Preferences.IPropertyChangeListener#propertyChange(org.eclipse.core.runtime.Preferences.PropertyChangeEvent)
55      */

56     public void propertyChange(PropertyChangeEvent event) {
57         if (fPart instanceof IDebugView) {
58             IDebugView view = (IDebugView) fPart;
59             view.getViewer().refresh();
60         }
61         
62     }
63     
64 }
65
Popular Tags