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

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


        menuOptions.add(CLOSE_VIEWS_FOR_OBJECT);
        menuOptions.add(CLOSE_OTHER_VIEWS_FOR_OBJECT);

        super.viewMenuOptions(menuOptions);

        final Content content = getContent();
        final UserActionSet suboptions = menuOptions.addNewActionSet("Replace with");
        replaceOptions(Toolkit.getViewFactory().availableViews(new ViewRequirement(content, ViewRequirement.OPEN)), suboptions);
        replaceOptions(Toolkit.getViewFactory().availableViews(new ViewRequirement(content, ViewRequirement.CLOSED)), suboptions);
    }
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 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

                            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

        assertTrue(viewSpecification.canDisplay(requirement));
    }

    @Test
    public void requiresClosedCollection() throws Exception {
        final Content objectContent = context.mock(Content.class, "object");
        context.checking(new Expectations() {
            {
                one(objectContent).isCollection();
                will(returnValue(false));
            }
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

        view.debug(debug);
        debug.appendln();

        // content
        final Content content = view.getContent();
        debug.appendTitle("CONTENT");
        if (content != null) {
            String type = content.getClass().getName();
            type = type.substring(type.lastIndexOf('.') + 1);
            debug.appendln("Content", type);
            content.debugDetails(debug);

            debug.indent();
            debug.appendln("Icon name", content.getIconName());
            debug.appendln("Icon ", content.getIconPicture(32));
            debug.appendln("Window title", content.windowTitle());
            debug.appendln("Persistable", content.isPersistable());
            debug.appendln("Object", content.isObject());
            debug.appendln("Collection", content.isCollection());

            debug.appendln("Parseable", content.isTextParseable());
            debug.unindent();
        } else {
            debug.appendln("Content", "none");
        }
        debug.blankLine();
View Full Code Here

        }, this));

        toolbarView.addView(new Button(new AbstractButtonAction("Date") {
            @Override
            public void execute(final Workspace workspace, View view, final Location at) {
                final Content content = new NullContent() {
                };
                view = DatePickerControl.getPicker(content);
                calendar.today();
                getViewManager().setOverlayView(view);
            }
View Full Code Here

        this.specification = builder;
    }

    @Override
    public void execute(final Workspace workspace, final View view, final Location at) {
        Content content = view.getContent();
        if (content.getAdapter() != null && !(content instanceof FieldContent)) {
            content = Toolkit.getContentFactory().createRootContent(content.getAdapter());
        }
        final View newView = specification.createView(content, view.getViewAxes(), -1);
        LOG.debug("open view " + newView);
        workspace.addWindow(newView, new Placement(view));
        workspace.markDamaged();
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.