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.IPresentablePart;
16: import org.eclipse.ui.presentations.IStackPresentationSite;
17:
18: /**
19: * @since 3.0
20: */
21: public class SystemMenuMovePane extends Action {
22:
23: IStackPresentationSite site;
24: IPresentablePart part;
25:
26: public SystemMenuMovePane(IStackPresentationSite site) {
27: this .site = site;
28: setText(WorkbenchMessages.SystemMenuMovePane_PaneName);
29: }
30:
31: /* (non-Javadoc)
32: * @see org.eclipse.jface.action.IAction#run()
33: */
34: public void run() {
35: site.dragStart(part, Display.getDefault().getCursorLocation(),
36: true);
37: }
38:
39: public void setTarget(IPresentablePart part) {
40: this.part = part;
41: setEnabled(part != null && site.isPartMoveable(part));
42: }
43:
44: }
|