Examples of ViewRequirement


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

        // TODO resolving should be done by the views?
        // resolveApplicationContextCollection(rootObject, "services");
        // resolveApplicationContextCollection(rootObject, "objects");
        final RootWorkspaceSpecification spec = new RootWorkspaceSpecification();
        final PerspectiveContent content = new PerspectiveContent(userProfiler.getPerspective());
        if (spec.canDisplay(new ViewRequirement(content, ViewRequirement.CLOSED))) {
            // View view = spec.createView(new RootObject(rootObject), null);
            final View view = spec.createView(content, new Axes(), -1);
            viewer.setRootView(view);
        } else {
            throw new IsisException();
View Full Code Here

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

        @Override
        public View createView(final Content content, final Axes axes, final int fieldNumber) {
            if (content instanceof TextParseableParameter) {
                final GlobalViewFactory factory = Toolkit.getViewFactory();
                return factory.createView(new ViewRequirement(content, ViewRequirement.CLOSED | ViewRequirement.SUBVIEW));
            } else if (content instanceof ObjectParameter) {
                final GlobalViewFactory factory = Toolkit.getViewFactory();
                return factory.createView(new ViewRequirement(content, ViewRequirement.CLOSED | ViewRequirement.SUBVIEW));
            }

            return null;
        }
View Full Code Here

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

                        cellSpec = new CheckboxField.Specification();
                    } else {
                        cellSpec = new UnlinedTextFieldSpecification();
                    }
                } else {
                    return factory.createView(new ViewRequirement(content, ViewRequirement.CLOSED));
                }
            } else {
                content = new OneToOneFieldImpl(object, value, (OneToOneAssociation) field);
               
                if (!field.isVisible(IsisContext.getAuthenticationSession(), object, where).isAllowed()) {
                    return new BlankView(content);
                }
                return factory.createView(new ViewRequirement(content, ViewRequirement.CLOSED | ViewRequirement.SUBVIEW));

            }

        } else {
            throw new UnknownTypeException(field);
View Full Code Here

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

            final GlobalViewFactory factory = Toolkit.getViewFactory();

            final ViewSpecification elementSpecification = axes.getAxis(ConfigurationAxis.class).getElementSpecification();
            if (elementSpecification == null) {
                final int defaultRequirement = ViewRequirement.CLOSED | ViewRequirement.SUBVIEW;
                final ViewRequirement viewRequirement = new ViewRequirement(content, defaultRequirement);
                return factory.createView(viewRequirement);
            } else {
                return elementSpecification.createView(content, axes, sequence);
            }
        }
View Full Code Here

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

    }

    private boolean fieldContainsReference(final ObjectAdapter parent, final ObjectAssociation field) {
        final OneToOneAssociation association = (OneToOneAssociation) field;
        final OneToOneFieldImpl fieldContent = new OneToOneFieldImpl(parent, field.get(parent), association);
        if (openViewSpecification.canDisplay(new ViewRequirement(fieldContent, ViewRequirement.OPEN))) {
            return true;
        }
        return false;
    }
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.