KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > debug > internal > ui > commands > actions > UpdateHandlerRequest


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

11 package org.eclipse.debug.internal.ui.commands.actions;
12
13 import org.eclipse.debug.core.commands.IEnabledStateRequest;
14 import org.eclipse.debug.internal.core.commands.DebugCommandRequest;
15
16 /**
17  * Collects whether a handler is enabled for a set of elements and
18  * reports its vote to an action updater collecting results from
19  * other handlers.
20  *
21  * @since 3.3
22  *
23  */

24 public class UpdateHandlerRequest extends DebugCommandRequest implements IEnabledStateRequest {
25     
26     private boolean fEnabled = false;
27     private ActionsUpdater fUpdater;
28     
29     public UpdateHandlerRequest(Object JavaDoc[] elements, ActionsUpdater updater) {
30         super(elements);
31         fUpdater = updater;
32     }
33
34     /* (non-Javadoc)
35      * @see org.eclipse.debug.internal.ui.actions.provisional.IBooleanRequestMonitor#setResult(boolean)
36      */

37     public synchronized void setEnabled(boolean result) {
38         fEnabled = result;
39     }
40
41     /* (non-Javadoc)
42      * @see org.eclipse.core.runtime.IProgressMonitor#done()
43      */

44     public synchronized void done() {
45         fUpdater.setEnabled(fEnabled);
46     }
47
48 }
49
Popular Tags