Examples of ViewRequirement


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

            {
                one(objectContent).isCollection();
                will(returnValue(false));
            }
        });
        final ViewRequirement requirement = new ViewRequirement(objectContent, ViewRequirement.CLOSED);
        assertTrue(!viewSpecification.canDisplay(requirement));
    }
View Full Code Here

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

        }
    }

    private void addFieldView(final ObjectAdapter object, final ObjectAssociation field) {
        final FieldContent fieldContent = (FieldContent) Toolkit.getContentFactory().createFieldContent(field, object);
        final ViewRequirement requirement = new ViewRequirement(fieldContent, ViewRequirement.CLOSED | ViewRequirement.SUBVIEW);
        View fieldView = Toolkit.getViewFactory().createView(requirement);

        fieldView = LabelBorder.createFieldLabelBorder(labelAxis, fieldView);

        addView(fieldView);
View Full Code Here

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

    }

    private void addFieldView(final NewObjectField field) {
        final ObjectAdapter object = getContent().getAdapter();
        final FieldContent fieldContent = (FieldContent) Toolkit.getContentFactory().createFieldContent(field.getField(), object);
        final ViewRequirement requirement = new ViewRequirement(fieldContent, ViewRequirement.CLOSED | ViewRequirement.SUBVIEW);
        View fieldView = Toolkit.getViewFactory().createView(requirement);
        if (field.includeLabel()) {
            fieldView = LabelBorder.createFieldLabelBorder(labelAxis, fieldView);
        }
        addView(fieldView);
View Full Code Here

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

    }

    @Override
    public void showInOverlay(final Content content, final Location location) {
        View view;
        view = Toolkit.getViewFactory().createView(new ViewRequirement(content, ViewRequirement.OPEN));
        view = new LineBorder(2, Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY2), new BackgroundBorder(Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY3), view));
        final Size size = view.getRequiredSize(Size.createMax());
        location.subtract(size.getWidth() / 2, size.getHeight() / 2);
        view.setLocation(location);
        setOverlayView(view);
View Full Code Here

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

        refreshStatus = true;
        scheduleRepaint();
    }

    public void showDialog(final MessageContent content) {
        final ViewRequirement requirement = new ViewRequirement(content, ViewRequirement.OPEN);
        final View view = Toolkit.getViewFactory().createView(requirement);
        rootView.getWorkspace().addDialog(view, new Placement(Placement.CENTER));
        scheduleRepaint();
    }
View Full Code Here

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

    }

    @Override
    public View addWindowFor(final ObjectAdapter object, final Placement placement) {
        final Content content = Toolkit.getContentFactory().createRootContent(object);
        final View view = Toolkit.getViewFactory().createView(new ViewRequirement(content, ViewRequirement.OPEN));
        addWindow(view, placement);
        getViewManager().setKeyboardFocus(view);
        return view;
    }
View Full Code Here

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

    }

    @Override
    public View addIconFor(final ObjectAdapter object, final Placement placement) {
        final Content content = Toolkit.getContentFactory().createRootContent(object);
        final View icon = Toolkit.getViewFactory().createView(new ViewRequirement(content, ViewRequirement.CLOSED | ViewRequirement.ROOT));
        add(iconViews, icon);
        placement.position(this, icon);
        return icon;
    }
View Full Code Here

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

        return icon;
    }

    public void addServiceIconFor(final ObjectAdapter service) {
        final Content content = new ServiceObject(service);
        final View serviceIcon = Toolkit.getViewFactory().createView(new ViewRequirement(content, ViewRequirement.CLOSED | ViewRequirement.SUBVIEW));
        add(serviceViews, serviceIcon);
    }
View Full Code Here

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

        } 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();
View Full Code Here

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

        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));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.