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

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


        return layout.getRequiredSize(this);
    }

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

    }
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

    @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

    @Test
    public void getOptionsCreatesNewOptionsSet() throws Exception {
        Logger.getRootLogger().setLevel(Level.OFF);
        new TestProxySystemII().init();

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

    private Options options;
    private Options suboptions;

    @Before
    public void setup() throws Exception {
        suboptions = new Options();
        suboptions.addOption("name-3", "value-2");

        options = new Options();
        options.addOption("test", "value");
        options.addOption("anInt", "23");
        options.addOptions("suboptions", suboptions);
    }
View Full Code Here

        assertTrue(names.hasNext());
    }

    @Test
    public void copy() throws Exception {
        final Options copy = new Options();
        copy.copy(options);
        assertEquals("value", copy.getString("test"));
    }
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

        assertEquals("value", copy.getString("test"));
    }

    @Test
    public void addOptions() throws Exception {
        final Options suboptions = options.getOptions("suboptions");
        assertEquals("value-2", suboptions.getString("name-3"));
    }
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.