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

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


        placement.position(this, icon);
        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


        super.update(object);
        canOpen();
    }

    private void canOpen() {
        final Content content = getContent();
        if (content.isCollection()) {
            canOpen = canOpenCollection(content);
        } else if (content.isObject()) {
            canOpen = canOpenObject(content);
        }
    }
View Full Code Here

        super("Debug...", ActionType.DEBUG);
    }

    @Override
    public void execute(final Workspace workspace, final View view, final Location at) {
        final Content content = view.getContent();
        final ObjectAdapter object = content == null ? null : content.getAdapter();

        final List<DebuggableWithTitle> debug = Lists.newArrayList();
        if (content instanceof PerspectiveContent) {
            final PerspectiveEntry perspectiveEntry = ((PerspectiveContent) content).getPerspective();
            debug.add(UserProfilesDebugUtil.asDebuggableWithTitle(perspectiveEntry));
        } else {
            debug.add(new DebugObjectSpecification(content.getSpecification()));
        }
        if (object != null) {
            debug.add(new DebugAdapter(object));
            debug.add(new DebugObjectGraph(object));
        }
View Full Code Here

        if (forView) {
            status.append("view ");
            status.append(over.getSpecification().getName());
        } else {
            status.append("object");
            final Content content = over.getContent();
            if (content != null) {
                status.append(" '");
                status.append(content.title());
                status.append("'");
            }

        }
        if (includeDebug || includeExploration) {
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.subviewSpecification = subviewSpecification;
    }

    @Override
    public void build(final View view, final Axes axes) {
        final Content content = view.getContent();
        final ObjectAdapter[] options = content.getOptions();

        // TODO sort list
        for (int i = 0; i < options.length; i++) {
            final Content subContent = new OptionContent(options[i]);
            final View subview = subviewSpecification.createView(subContent, axes, i);
            view.addView(subview);
        }
    }
View Full Code Here

    @Override
    public void saveOpenObjects() {
        final List<ObjectAdapter> objects = new ArrayList<ObjectAdapter>();
        for (final View view : rootView.getSubviews()) {
            final Content content = view.getContent();
            if (content instanceof ObjectContent) {
                objects.add(((ObjectContent) content).getAdapter());
            }
        }
        IsisContext.getUserProfileLoader().saveSession(objects);
View Full Code Here

    // REVIEW why can only objects be set to busy? Specifically the service icon
    // do not show as bust when a
    // long standing option is being set up when a menu is being created.
    @Override
    public void setBusy(final View view, final BackgroundTask task) {
        final Content content = view.getContent();
        if (content != null && content.isObject()) {
            final ObjectAdapter object = ((ObjectContent) content).getObject();
            busy.addElement(object);
        }
        showBusyState(view);
View Full Code Here

    }

    @Override
    public boolean isBusy(final View view) {
        if (view != null) {
            final Content content = view.getContent();
            if (content != null && content.isObject()) {
                final ObjectAdapter object = ((ObjectContent) content).getObject();
                if (busy.contains(object)) {
                    return true;
                }
            }
View Full Code Here

        this.view = display;
    }

    @Override
    public void debugData(final DebugBuilder debug) {
        final Content content = view.getContent();
        if (content != null) {
            String type = content.getClass().getName();
            type = type.substring(type.lastIndexOf('.') + 1);
            debug.appendln("Content", type);

            debug.indent();

            content.debugDetails(debug);

            debug.appendln("Icon name", content.getIconName());
            debug.appendln("Icon ", content.getIconPicture(32));
            debug.appendln("Window title", content.windowTitle());

            debug.appendln("Object", content.isObject());
            debug.appendln("Collection", content.isCollection());

            debug.appendln("Text Parseable", content.isTextParseable());

            debug.unindent();
        } else {
            debug.appendln("Content", "none");
        }
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.