KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > debug > internal > ui > actions > expressions > SelectAllExpressionsAction


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 package org.eclipse.debug.internal.ui.actions.expressions;
12
13 import org.eclipse.debug.core.DebugPlugin;
14 import org.eclipse.debug.core.IExpressionsListener;
15 import org.eclipse.debug.core.model.IExpression;
16 import org.eclipse.debug.internal.ui.actions.SelectAllAction;
17 import org.eclipse.debug.ui.IDebugView;
18
19 public class SelectAllExpressionsAction extends SelectAllAction implements IExpressionsListener {
20
21     /* (non-Javadoc)
22      * @see org.eclipse.debug.internal.ui.actions.selection.AbstractRemoveAllActionDelegate#isEnabled()
23      */

24     protected boolean isEnabled() {
25         return DebugPlugin.getDefault().getExpressionManager().hasExpressions();
26     }
27
28     /* (non-Javadoc)
29      * @see org.eclipse.debug.internal.ui.actions.SelectAllAction#getActionId()
30      */

31     protected String JavaDoc getActionId() {
32         return IDebugView.SELECT_ALL_ACTION + ".Variables"; //$NON-NLS-1$
33
}
34     
35     /* (non-Javadoc)
36      * @see org.eclipse.debug.internal.ui.actions.AbstractRemoveAllActionDelegate#initialize()
37      */

38     protected void initialize() {
39         DebugPlugin.getDefault().getExpressionManager().addExpressionListener(this);
40     }
41
42     /* (non-Javadoc)
43      * @see org.eclipse.debug.core.IExpressionsListener#expressionsAdded(org.eclipse.debug.core.model.IExpression[])
44      */

45     public void expressionsAdded(IExpression[] expressions) {
46         update();
47     }
48
49     /* (non-Javadoc)
50      * @see org.eclipse.debug.core.IExpressionsListener#expressionsRemoved(org.eclipse.debug.core.model.IExpression[])
51      */

52     public void expressionsRemoved(IExpression[] expressions) {
53         update();
54     }
55
56     /* (non-Javadoc)
57      * @see org.eclipse.debug.core.IExpressionsListener#expressionsChanged(org.eclipse.debug.core.model.IExpression[])
58      */

59     public void expressionsChanged(IExpression[] expressions) {
60     }
61     
62     /* (non-Javadoc)
63      * @see org.eclipse.debug.internal.ui.actions.AbstractRemoveAllActionDelegate#dispose()
64      */

65     public void dispose() {
66         super.dispose();
67         DebugPlugin.getDefault().getExpressionManager().removeExpressionListener(this);
68     }
69 }
70
Popular Tags