Package org.brixcms

Examples of org.brixcms.Brix


    private final IModel<String> contentEditorModel;

    public EditTab(String id, final IModel<BrixNode> nodeModel) {
        super(id, nodeModel);

        Brix brix = getModelObject().getBrix();
        Form<Void> form = new Form<Void>("form");
        add(form);

        final ModelBuffer adapter = new ModelBuffer(nodeModel);
        IModel<String> stringModel = adapter.forProperty("title");

        form.add(new TextField<String>("title", stringModel));

        String workspace = nodeModel.getObject().getSession().getWorkspace().getName();
        NodeFilter filter = new NodeTypeFilter(TemplateSiteNodePlugin.TYPE);

        IModel<BrixNode> model = adapter.forNodeProperty("template");

        form.add(new SiteNodePickerPanel("templatePicker", model, workspace, filter));

        IModel<Boolean> booleanModel = adapter.forProperty("requiresSSL");
        form.add(new ProtocolSelector("requiresSSL", booleanModel));

        IModel<String> mimeTypeModel = adapter.forProperty("mimeType");
        form.add(new TextField<String>("mimeType", mimeTypeModel));

        // set up markup editor

        contentEditorModel = adapter.forProperty("dataAsString");
        contentEditorParent = form;

        Collection<MarkupEditorFactory> editorFactories = brix.getConfig().getRegistry()
                .lookupCollection(MarkupEditorFactory.POINT);

        setupEditor(editorFactories.iterator().next().getClass().getName());

        // set up buttons to control editor switching
View Full Code Here


            }
        });
    }

    private void setupEditor(String cn) {
        final Brix brix = getModelObject().getBrix();

        Collection<MarkupEditorFactory> factories = brix.getConfig().getRegistry()
                .lookupCollection(MarkupEditorFactory.POINT);

        for (MarkupEditorFactory factory : factories) {
            if (factory.getClass().getName().equals(cn)) {
                contentEditorParent.addOrReplace(factory.newEditor("content", contentEditorModel));
View Full Code Here

TOP

Related Classes of org.brixcms.Brix

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.