Package org.apache.isis.core.runtime.userprofile

Examples of org.apache.isis.core.runtime.userprofile.Options


    @Override
    public View createView(final Content content, final Axes axes, final int sequence) {
        final View createView = specification.createView(content, axes, sequence);

        final Options viewOptions = Properties.getViewConfigurationOptions(this);
        createView.loadOptions(viewOptions);
        return createView;
    }
View Full Code Here


        }

        final CompositeViewUsingBuilder view = new CompositeViewUsingBuilder(content, this, axes, layout, builder);
        view.setCanDragView(builder.canDragView());
        final View decoratedView = decorateView(view, view.getViewAxes());
        final Options options = Properties.getViewConfigurationOptions(this);
        decoratedView.loadOptions(options);
        return decoratedView;
    }
View Full Code Here

        final boolean isValue = specification != null && specification.containsFacet(ValueFacet.class);
        if (content.isObject() && !isValue && content.getAdapter() == null) {
            return getEmptyFieldSpecification();
        } else {
            if (specification != null) {
                final Options viewOptions = Properties.getDefaultViewOptions(specification);
                String spec = viewOptions.getString("spec");
                if (spec == null) {
                    if (content instanceof ObjectContent && requirement.isObject() && requirement.isClosed()) {
                        spec = Properties.getDefaultIconViewOptions();
                    } else if (content instanceof CollectionContent && requirement.isCollection()) {
                        spec = Properties.getDefaultCollectionViewOptions();
View Full Code Here

            return fallback;
        }
    }

    public void loadUserViewSpecifications() {
        final Options options = Properties.getOptions("views.user-defined");
        final Iterator<String> names = options.names();
        while (names.hasNext()) {
            final String name = names.next();
            final Options viewOptions = options.getOptions(name);
            final String specName = viewOptions.getString("design");
            addSpecification(specName);
        }
    }
View Full Code Here

        if (getContent() instanceof RootObject || getContent() instanceof RootCollection) {
            options.add(new UserActionAbstract("Use as default view for " + getContent().getSpecification().getSingularName(), ActionType.USER) {
                @Override
                public void execute(final Workspace workspace, final View view, final Location at) {
                    final Options viewOptions = Properties.getViewConfigurationOptions(getSpecification());
                    getView().saveOptions(viewOptions);

                    // Options viewOptions =
                    final ObjectSpecification specification = content.getSpecification();
                    final Options settingsOptions = Properties.getDefaultViewOptions(specification);
                    settingsOptions.addOption("spec", getSpecification().getName());
                }
            });
        }
        /*
         * options.add(new UserActionAbstract("Create new specification",
         * UserAction.USER) { // TODO probably needs to be a replace with new
         * view specification public void execute(final Workspace workspace,
         * final View view, final Location at) { UserViewSpecification newSpec =
         * new UserViewSpecification(getView()); Options viewOptions =
         * Properties.getViewConfigurationOptions(newSpec);
         * getView().saveOptions(viewOptions);
         *
         * viewOptions = Properties.getUserViewSpecificationOptions(newSpec);
         * viewOptions.addOption("wrapped-specification",
         * getSpecification().getClass().getName());
         *
         * Toolkit.getViewFactory().addSpecification(newSpec); } });
         */
        options.add(new UserActionAbstract("Save specification", ActionType.USER) {
            @Override
            public void execute(final Workspace workspace, final View view, final Location at) {
                final Options viewOptions = Properties.getViewConfigurationOptions(getSpecification());
                getView().saveOptions(viewOptions);

                Toolkit.getViewFactory().addSpecification(getSpecification());
            }
        });
View Full Code Here

                        final View newView = newSpec.createView(content, view.getViewAxes(), -1);
                        LOG.debug("open view " + newView);
                        workspace.addWindow(newView, new Placement(view));
                        workspace.markDamaged();

                        Options viewOptions = Properties.getViewConfigurationOptions(newSpec);
                        newView.saveOptions(viewOptions);
                        viewOptions = Properties.getUserViewSpecificationOptions(newSpec.getName());
                        viewOptions.addOption("design", specification.getClass().getName());

                        Toolkit.getViewFactory().addSpecification(newSpec);
                    }
                };
View Full Code Here

        return layout.getRequiredSize(this);
    }

    @Override
    public void loadOptions(final Options viewOptions) {
        final Options options = viewOptions.getOptions("fields");
        // options.options()

    }
View Full Code Here

    public IsisSystemWithFixtures iswf = IsisSystemWithFixtures.builder().build();

    @Test
    public void getOptionsCreatesNewOptionsSet() throws Exception {

        final Options options = Properties.getOptions("test");
        assertEquals(false, options.names().hasNext());
    }
View Full Code Here

        assertEquals(30, profile.getOptions().getInteger("width", 30));
    }

    @Test
    public void unknownOptionsCreated() throws Exception {
        final Options options = profile.getOptions().getOptions("");
        assertNotNull(options);
        assertEquals(false, options.names().hasNext());
    }
View Full Code Here

        assertEquals(false, options.names().hasNext());
    }

    @Test
    public void containedOptions() throws Exception {
        final Options options = profile.getOptions().getOptions("opts");
        assertNotNull(options);
        assertEquals("value1", options.getString("option1"));
        assertEquals("value2", options.getString("option2"));
    }
View Full Code Here

TOP

Related Classes of org.apache.isis.core.runtime.userprofile.Options

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.