diff options
Diffstat (limited to 'bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/directedit/DirectEditSelectionTool.java')
-rw-r--r-- | bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/directedit/DirectEditSelectionTool.java | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/directedit/DirectEditSelectionTool.java b/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/directedit/DirectEditSelectionTool.java deleted file mode 100644 index 7eb49a6d1..000000000 --- a/bundles/org.eclipse.wst.wsdl.ui/src-asd/org/eclipse/wst/wsdl/ui/internal/asd/design/directedit/DirectEditSelectionTool.java +++ /dev/null @@ -1,60 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.wsdl.ui.internal.asd.design.directedit; - -import org.eclipse.draw2d.FigureCanvas; -import org.eclipse.draw2d.IFigure; -import org.eclipse.draw2d.geometry.Point; -import org.eclipse.draw2d.geometry.Rectangle; -import org.eclipse.gef.EditPart; -import org.eclipse.gef.editparts.AbstractGraphicalEditPart; -import org.eclipse.gef.tools.SelectionTool; -import org.eclipse.wst.wsdl.ui.internal.asd.design.editparts.INamedEditPart; - -/** - * Extends the default GEF selection tools to send the - * mouse events - */ -public class DirectEditSelectionTool extends SelectionTool { - - protected INamedEditPart getSelectedPart() { - if(getCurrentViewer() == null) - return null; - EditPart ep = getCurrentViewer().getFocusEditPart(); - if(ep instanceof INamedEditPart && ep.isActive()) - return (INamedEditPart)ep; - return null; - } - - protected boolean handleButtonDown(int button) { - super.handleButtonDown(button); - INamedEditPart selectedPart = getSelectedPart(); - - if(selectedPart != null && button == 1) { - Input i = getCurrentInput(); - Point l = translateLocation(i.getMouseLocation()); - - IFigure f = ((AbstractGraphicalEditPart) selectedPart).getFigure(); - Rectangle bounds = f.getBounds(); - if(bounds.contains(l.x,l.y)) { - selectedPart.performDirectEdit(translateLocation(new Point(l.x, l.y))); - return true; - } - } - return true; - } - - protected Point translateLocation(Point mouseLocation) { - FigureCanvas canvas = (FigureCanvas)getCurrentViewer().getControl(); - Point viewLocation = canvas.getViewport().getViewLocation(); - return new Point(mouseLocation.x + viewLocation.x,mouseLocation.y + viewLocation.y); - } -}
\ No newline at end of file |