Package ch.ethz.prose.eclipse.internal.run

Examples of ch.ethz.prose.eclipse.internal.run.AspectNode


     */
    public void testWithdrawAspectNotification() {
        ProseRunNode run = new ProseRunNode("test", "dummyhost", -1, null);
        AspectManagerNode aspectManager = new AspectManagerNode(run, true);
        AspectSurrogate surrogate = new AspectSurrogate("Aspect", null);
        AspectNode aspect = new AspectNode(aspectManager, surrogate);
        ProsePlugin.getDefault().fireAspectWithdrawn(aspect);
        assertEquals(aspect, listener.aspect);
    }
View Full Code Here


        Object target = getTarget(event);
        if ((event.currentDataType != null)
                && (transfer.isSupportedType(event.currentDataType))
                && (target instanceof AspectManagerNode)) {
            if (source instanceof AspectNode) {
                AspectNode aspect = (AspectNode) source;
                // Allow drag operations on a different aspect manager node.
                if (target != aspect.getAspectManager()) {
                    event.detail = lastValidOperation;
                    return;
                }
                // Allow copy drag operations on the same aspect manager node.
                if (event.detail == DND.DROP_COPY) {
View Full Code Here

    public void drop(DropTargetEvent event) {
        IType type = null;
        AspectManagerNode targetManager = (AspectManagerNode) getTarget(event);
        Object source = SelectionUtil.getSingleElement(LocalSelectionTransfer.getInstance().getSelection());
        if (source instanceof AspectNode) {
            AspectNode aspect = (AspectNode) source;

            // Since there is no classpath information in an AspectSurrogate, we
            // have to seek the aspect class.
            IJavaProject[] projects = getJavaProjects();
            for (int i = 0; i < projects.length; i++) {
                try {
                    type = projects[i].findType(aspect.getAspect().getAspectClassName());
                    if (type != null)
                        break;
                } catch (JavaModelException e) {
                    ProsePlugin.log(e.getStatus());
                    break;
                }

            }

            if (type == null) {
                ProsePlugin.openErrorDialog("No aspect found", "No project contains an aspect named "
                        + aspect.getAspect().getAspectClassName() + '.');
                event.detail = DND.DROP_NONE;
                return;
            }
        } else if (source instanceof ICompilationUnit){
            type = ((ICompilationUnit) source).findPrimaryType();
View Full Code Here

     * @see org.eclipse.swt.dnd.DragSourceListener#dragFinished(org.eclipse.swt.dnd.DragSourceEvent)
     */
    public void dragFinished(DragSourceEvent event) {
        Object node = SelectionUtil.getSingleElement(viewer.getSelection());
        if (node instanceof AspectNode && event.detail == DND.DROP_MOVE) {
            AspectNode aspect = (AspectNode) node;
            if (event.detail == DND.DROP_MOVE) {
                try {
                    aspect.withdraw();
                } catch (UnreachableException e) {
                    ProsePlugin.log(e);
                    ProsePlugin.openErrorDialog("Aspect withdrawal failed",
                            "Could not withdraw aspect because the Prose application is not reachable.");
                }
View Full Code Here

TOP

Related Classes of ch.ethz.prose.eclipse.internal.run.AspectNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.