KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > internal > presentations > SystemMenuMoveFolder


1 /*******************************************************************************
2  * Copyright (c) 2004, 2005 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.ui.internal.presentations;
12
13 import org.eclipse.jface.action.Action;
14 import org.eclipse.swt.widgets.Display;
15 import org.eclipse.ui.internal.WorkbenchMessages;
16 import org.eclipse.ui.presentations.IStackPresentationSite;
17
18 /**
19  * @since 3.0
20  */

21 public class SystemMenuMoveFolder extends Action implements ISelfUpdatingAction {
22     private IStackPresentationSite site;
23
24     public SystemMenuMoveFolder(IStackPresentationSite site) {
25         this.site = site;
26         setText(WorkbenchMessages.ViewPane_moveFolder);
27     }
28
29     /* (non-Javadoc)
30      * @see org.eclipse.jface.action.IAction#run()
31      */

32     public void run() {
33         site.dragStart(Display.getDefault().getCursorLocation(), true);
34     }
35
36     public void update() {
37         setEnabled(site.isStackMoveable());
38     }
39
40     public boolean shouldBeVisible() {
41         return site.isStackMoveable();
42     }
43 }
44
Popular Tags