Package org.apache.isis.viewer.dnd.view

Examples of org.apache.isis.viewer.dnd.view.View


            if (!drag.isShift()) {
                getPerspective().addToObjects(source.getObject());
            }
        }

        View newView;
        if (source.getSpecification().isService()) {
            return;
        } else {
            final Location dropLocation = drag.getTargetLocation();
            dropLocation.subtract(drag.getOffset());

            if (drag.isShift()) {
                newView = Toolkit.getViewFactory().createView(new ViewRequirement(getContent(), ViewRequirement.OPEN | ViewRequirement.SUBVIEW));
                drag.getTargetView().addView(newView);
                newView.setLocation(dropLocation);
            } else {
                // place object onto desktop as icon
                final View sourceView = drag.getSource();
                if (!sourceView.getSpecification().isOpen()) {
                    final View[] subviews = getSubviews();
                    for (final View subview : subviews) {
                        if (subview == sourceView) {
                            sourceView.markDamaged();
                            sourceView.setLocation(dropLocation);
                            sourceView.markDamaged();
                            return;
                        }
                    }
                } else {
                    for (final View view : iconViews) {
View Full Code Here


    @Override
    public void drop(final ViewDrag drag) {
        getFeedbackManager().showDefaultCursor();

        final View sourceView = drag.getSourceView();
        final Location newLocation = drag.getViewDropLocation();
        if (sourceView.getSpecification() != null && sourceView.getSpecification().isSubView()) {
            if (sourceView.getSpecification().isOpen() && sourceView.getSpecification().isReplaceable()) {
                // TODO remove the open view from the container and place on
                // workspace; replace the internal view with an icon
            } else if (sourceView.getContent() instanceof FieldContent) {
                final ViewRequirement requirement = new ViewRequirement(sourceView.getContent(), ViewRequirement.OPEN);
                final View view = Toolkit.getViewFactory().createView(requirement);
                addWindow(view, new Placement(newLocation));
                sourceView.getState().clearViewIdentified();
            } else {
                addWindowFor(sourceView.getContent().getAdapter(), new Placement(newLocation));
                sourceView.getState().clearViewIdentified();
View Full Code Here

        getPerspective().removeFromObjects(object.getObject());
    }

    @Override
    public void secondClick(final Click click) {
        final View subview = subviewFor(click.getLocation());
        if (subview != null) {
            // ignore double-click on self - don't open up new view
            super.secondClick(click);
        }
    }
View Full Code Here

        options.setColor(Toolkit.getColor(ColorsAndFonts.COLOR_MENU_WORKSPACE));

        options.add(new UserActionAbstract("Close all") {
            @Override
            public void execute(final Workspace workspace, final View view, final Location at) {
                final View views[] = getWindowViews();
                for (final View v : views) {
                    // if (v.getSpecification().isOpen()) {
                    v.dispose();
                    // }
                }
View Full Code Here

    protected View[] subviews() {
        final Object[] viewsCopy = views.toArray();
        final Object[] serviceViewsCopy = serviceViews.toArray();
        final Object[] iconViewsCopy = iconViews.toArray();

        final View v[] = new View[viewsCopy.length + serviceViewsCopy.length + iconViewsCopy.length];
        int offset = 0;
        Object[] src = serviceViewsCopy;
        System.arraycopy(src, 0, v, offset, src.length);
        offset += src.length;
        src = iconViewsCopy;
View Full Code Here

    }

    public void clearServiceViews() {
        final Enumeration e = serviceViews.elements();
        while (e.hasMoreElements()) {
            final View view = (View) e.nextElement();
            view.markDamaged();
        }
        serviceViews.clear();
    }
View Full Code Here

        return super.canDisplay(requirement) && requirement.is(ViewRequirement.ROOT);
    }

    @Override
    public View createView(final Content content, final Axes axes, final int sequence) {
        final View icon = super.createView(content, axes, sequence);
        return new ObjectBorder(new IconOpenAction(icon));
    }
View Full Code Here

        return super.canDisplay(requirement) && requirement.is(ViewRequirement.CLOSED) && requirement.is(ViewRequirement.SUBVIEW);
    }

    @Override
    public View createView(final Content content, final Axes axes, final int sequence) {
        final View view = super.createView(content, axes, sequence);
        /*
         * boolean isEditable = content instanceof OneToOneField &&
         * ((OneToOneField) content).isEditable().isAllowed(); boolean
         * hasOptions = content.isOptionEnabled(); if (isEditable && hasOptions)
         * { return new OpenObjectDropDownBorder(view, spec); } return view;
View Full Code Here

    public void replaceView(final View toReplace, final View replacement) {
        wrappedView.replaceView(toReplace, replacement);
    }

    protected void replaceWrappedView(final View withReplacement) {
        final View root = getView();
        final View parent = getParent();
        parent.markDamaged();
        getViewManager().removeFromNotificationList(root);
        for (final View view : root.getSubviews()) {
            view.dispose();
        }
        wrappedView = withReplacement;
View Full Code Here

    private void open() {
        BackgroundWork.runTaskInBackground(this, new BackgroundTask() {
            @Override
            public void execute() {
                final View overlay = createDropDownView();
                final Location location = getView().getAbsoluteLocation();
                location.add(getView().getPadding().getLeft() - 1, getSize().getHeight() + 2);
                overlay.setLocation(location);
                getViewManager().setOverlayView(overlay);
            }

            @Override
            public String getDescription() {
View Full Code Here

TOP

Related Classes of org.apache.isis.viewer.dnd.view.View

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.