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

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


            return;
        }

        final View[] subviews = view.getSubviews();
        for (final View fieldView : subviews) {
            final Content content = fieldView.getContent();
            if (content instanceof RootObject) {
                checkFields(saveState, fieldView, forObject);
            } else if (content instanceof FieldContent) {
                final boolean isMandatory = ((FieldContent) content).isMandatory();
                final boolean isEditable = ((FieldContent) content).isEditable().isAllowed();
                final ObjectAdapter field = content.getAdapter();
                final boolean isFieldEmpty = field == null;
                if (isMandatory && isEditable && isFieldEmpty) {
                    final String parameterName = ((FieldContent) content).getFieldName();
                    saveState.addMissingField(parameterName);
View Full Code Here


    @Override
    public void contentMenuOptions(final UserActionSet options) {
        options.setColor(Toolkit.getColor(ColorsAndFonts.COLOR_MENU_CONTENT));

        final Content content = getContent();
        if (content != null) {
            content.contentMenuOptions(options);
        }
    }
View Full Code Here

    public void editComplete(final boolean moveFocus, final boolean toNextField) {
    }

    @Override
    public void entered() {
        final Content cont = getContent();
        if (cont != null) {
            final String description = cont.getDescription();
            if (description != null && !"".equals(description)) {
                getFeedbackManager().setViewDetail(description);
            }
        }
    }
View Full Code Here

    @Override
    public void build(final View view, final Axes axes) {
        Assert.assertEquals("ensure the view is the complete decorated view", view.getView(), view);

        final Content content = view.getContent();
        final ObjectAdapter object = ((ObjectContent) content).getObject();

        LOG.debug("build view " + view + " for " + object);

        final ObjectSpecification spec = object.getSpecification();
View Full Code Here

    @Override
    public void viewMenuOptions(final UserActionSet options) {
        options.setColor(Toolkit.getColor(ColorsAndFonts.COLOR_MENU_VIEW));

        final Content content = getContent();
        addContentMenuItems(options, content);
        addNewViewMenuItems(options, content);

        // TODO ask the viewer for the print option - provided by the underlying
        // system
View Full Code Here

        if (field.isOneToOneAssociation()) {
            IsisContext.getPersistenceSession().resolveField(object, field);
        }

        final Content content1 = Toolkit.getContentFactory().createFieldContent(field, object);
        final View fieldView = subviewDesign.createView(content1, axes, fieldNumber);
        return fieldView;
    }
View Full Code Here

                            throw new ViewerException(e);
                        } catch (final IllegalAccessException e) {
                            throw new ViewerException(e);
                        }

                        Content content = view.getContent();
                        if (!(content instanceof FieldContent)) {
                            content = Toolkit.getContentFactory().createRootContent(content.getAdapter());
                        }
                        final View newView = newSpec.createView(content, view.getViewAxes(), -1);
                        LOG.debug("open view " + newView);
                        workspace.addWindow(newView, new Placement(view));
                        workspace.markDamaged();
View Full Code Here

    public void execute(final Workspace workspace, final View view, final Location at) {
        BackgroundWork.runTaskInBackground(view, new BackgroundTask() {
            @Override
            public void execute() {
                final ActionHelper helper = ActionHelper.createInstance(target, action);
                Content content;
                if (target == null && action.getOnType().isService() || target != null && target.getSpecification().isNotCollection()) {
                    content = new ObjectActionContent(helper);
                } else if (target.getSpecification().isParentedOrFreeCollection()) {
                    content = new CollectionActionContent(helper);
                } else {
View Full Code Here

        if (isEditable) {
            final Location location = click.getLocation();
            final Date selectedDate = getSelectedDate(location);
            if (selectedDate != null) {
                date.setTime(selectedDate);
                final Content content = getContent();
                final DateValueFacet facet = content.getSpecification().getFacet(DateValueFacet.class);
                final ObjectAdapter value = facet.createValue(date.getTime());
                ((TextParseableContent) content).parseTextEntry(value.titleString());
                ((TextParseableContent) content).entryComplete();
                getView().refresh();
            }
View Full Code Here

        throw new IllegalArgumentException("Must be an object or collection: " + object);
    }

    @Override
    public Content createFieldContent(final ObjectAssociation field, final ObjectAdapter object) {
        Content content;
        final ObjectAdapter associatedObject = field.get(object);
        if (field instanceof OneToManyAssociation) {
            content = new OneToManyFieldImpl(object, associatedObject, (OneToManyAssociation) field);
        } else if (field instanceof OneToOneAssociation) {
            final ObjectSpecification fieldSpecification = field.getSpecification();
View Full Code Here

TOP

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

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.