01: /*******************************************************************************
02: * Copyright (c) 2004, 2005 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.ui.internal.presentations;
11:
12: import org.eclipse.jface.action.Action;
13: import org.eclipse.swt.widgets.Display;
14: import org.eclipse.ui.internal.WorkbenchMessages;
15: import org.eclipse.ui.presentations.IStackPresentationSite;
16:
17: /**
18: * @since 3.0
19: */
20: public class SystemMenuMoveFolder extends Action implements
21: 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: }
|