Examples of GWTJahiaNode


Examples of org.jahia.ajax.gwt.client.data.node.GWTJahiaNode

        // add listener after rendering
        DeferredCommand.addCommand(new Command() {
            public void execute() {
                widget.addListener(Events.Expand, new Listener<TreeGridEvent>() {
                    public void handleEvent(TreeGridEvent le) {
                        GWTJahiaNode gwtJahiaNode = (GWTJahiaNode) le.getModel();
                        String path = gwtJahiaNode.getPath();
                        if (!openPath.contains(path)) {
                            openPath.add(path);
                        }
                        Log.debug("Save Path on expand " + openPath);
                        gwtJahiaNode.setExpandOnLoad(true);
//                        refresh(gwtJahiaNode);
                        if (saveOpenPath) {
                            savePaths();
                        }
                    }
                });

                widget.addListener(Events.Collapse, new Listener<TreeGridEvent>() {
                    public void handleEvent(TreeGridEvent el) {
                        GWTJahiaNode gwtJahiaNode = (GWTJahiaNode) el.getModel();
                        String path = gwtJahiaNode.getPath();
                        openPath.remove(path);
                        Log.debug("Save Path on collapse " + openPath);
                        gwtJahiaNode.setExpandOnLoad(false);
//                        refresh(gwtJahiaNode);
                        if (saveOpenPath) {
                            savePaths();
                        }
                    }
View Full Code Here

Examples of org.jahia.ajax.gwt.client.data.node.GWTJahiaNode

            if (currentPage == null) {
                JahiaContentManagementService.App.getInstance()
                        .getRoot(paths, nodeTypes, mimeTypes, filters, fields, selectedPath, openPath,checkSubchilds,
                                displayHiddenTypes, hiddenTypes, hiddenRegex, listAsyncCallback);
            } else {
                GWTJahiaNode gwtJahiaNode = (GWTJahiaNode) currentPage;
                if (gwtJahiaNode.isExpandOnLoad()) {
                    List<GWTJahiaNode> list = new ArrayList<GWTJahiaNode>();
                    for (ModelData modelData : gwtJahiaNode.getChildren()) {
                        list.add((GWTJahiaNode) modelData);
                    }
                    listAsyncCallback.onSuccess(list);
                } else {
                    try {
View Full Code Here

Examples of org.jahia.ajax.gwt.client.data.node.GWTJahiaNode

            super(store, cm);
        }

        protected void onDataChanged(TreeStoreEvent<GWTJahiaNode> mTreeStoreEvent) {
            super.onDataChanged(mTreeStoreEvent);
            final GWTJahiaNode p = mTreeStoreEvent.getParent();
            DeferredCommand.addCommand(new Command() {
                public void execute() {
                    if (p == null) {
                        expandChildren(treeStore.getRootItems());
                    } else {
View Full Code Here

Examples of org.jahia.ajax.gwt.client.data.node.GWTJahiaNode

            setAutoSelect(false);
        }

        protected void onDataChanged(TreeStoreEvent<GWTJahiaNode> mTreeStoreEvent) {
            super.onDataChanged(mTreeStoreEvent);
            final GWTJahiaNode p = mTreeStoreEvent.getParent();
            DeferredCommand.addCommand(new Command() {
                public void execute() {
                    if (p == null) {
                        expandChildren(store.getRootItems());
                    } else {
View Full Code Here

Examples of org.jahia.ajax.gwt.client.data.node.GWTJahiaNode

                                 final Grid<GWTJahiaNode> grid) {

                final CheckBox checkbox = new CheckBox();
                checkbox.setValue(selection.contains(currentNode));

                final GWTJahiaNode parentItem = store.getParent(currentNode);

                checkbox.setToolTip(currentNode.getName());
                boxes.put(currentNode.getPath(), checkbox);
                checkbox.addListener(Events.Change, new Listener<ComponentEvent>() {
                    public void handleEvent(ComponentEvent event) {
                        try {
                            if ((Boolean) ((FieldEvent) event).getValue()) {
                                selection.add(currentNode);

                                // Update dependencies
                                List<String> toCheck = dependencies.get(currentNode.getPath());
                                if (toCheck != null) {
                                    for (String s1 : toCheck) {
                                        CheckBox checkBox = boxes.get(s1);
                                        if (checkBox!=null && !checkBox.getValue()) {
                                            checkBox.setValue(true);
                                        }
                                    }
                                }

                                // Update children
                                checkbox.setData("partial", null);
                                List<GWTJahiaNode> l = store.getChildren(currentNode, true);
                                for (GWTJahiaNode node : l) {
                                    CheckBox b = boxes.get(node.getPath());
                                    if (b != null) {
                                        b.setValue(true);
                                    }
                                    selection.remove(node);
                                }

                                // If all siblings set, set parent
                                if (parentItem != null) {
                                    CheckBox parentBox = boxes.get(parentItem.getPath());
                                    if (!parentBox.getValue()) {
                                        List<GWTJahiaNode> siblings = store.getChildren(parentItem);
                                        boolean checkParent = true;
                                        for (GWTJahiaNode sibling : siblings) {
                                            checkParent &= selection.contains(sibling);
                                        }
                                        if (checkParent) {
                                            parentBox.setData("partial", null);
                                            parentBox.setValue(true);
                                        }
                                    }
                                }
                            } else {
                                selection.remove(currentNode);

                                // Update dependencies
                                Set<String> toCheck = dependencies.keySet();
                                for (String s1 : toCheck) {
                                    if (dependencies.get(s1).contains(currentNode.getPath())) {
                                        CheckBox checkBox = boxes.get(s1);
                                        if (checkBox != null && checkBox.getValue()) {
                                            checkBox.setValue(false);
                                        }
                                    }
                                }

                                // Uncheck parent
                                if (parentItem != null) {
                                    CheckBox parentBox = boxes.get(parentItem.getPath());
                                    if (parentBox.getValue()) {
                                        parentBox.setData("partial", Boolean.TRUE);
                                        parentBox.setValue(false);

                                        List<GWTJahiaNode> siblings = store.getChildren(parentItem);
                                        for (GWTJahiaNode node : siblings) {
                                                if (!node.getPath().equals(currentNode.getPath())) {
                                                    selection.add(node);
                                                }
                                        }
                                    }
                                }

                                // Update children
                                if (checkbox.getData("partial") == null) {
                                    checkbox.setData("partial", null);
                                    List<GWTJahiaNode> l = store.getChildren(currentNode, true);
                                    for (GWTJahiaNode node : l) {
                                        CheckBox b = boxes.get(node.getPath());
                                        if (b != null) {
                                            b.setValue(false);
                                        }
                                    }
                                }
                            }
                        } catch (Exception e) {
                            Log.debug("Exception on "+currentNode.getPath(), e);
                        }
                    }
                });

                if (parentItem != null) {
                    CheckBox parentBox = boxes.get(parentItem.getPath());
                    if (parentBox.getValue()) {
                        checkbox.setValue(true);
                        selection.remove(currentNode);
                    }
                }
View Full Code Here

Examples of org.jahia.ajax.gwt.client.data.node.GWTJahiaNode

         * @return the rendered HTML
         */
        protected Object renderHTML(ModelData model, String property, ColumnData config, int rowIndex, int colIndex,
                                  ListStore<ModelData> store) {

            GWTJahiaNode node = (GWTJahiaNode) model;
            Map<String,GWTJahiaPublicationInfo> infos = node.getAggregatedPublicationInfos();
            if (infos != null) {
                GWTJahiaPublicationInfo info = infos.get(getDataIndex());

                TableData td = new TableData();
                td.setHorizontalAlign(Style.HorizontalAlignment.CENTER);
View Full Code Here

Examples of org.jahia.ajax.gwt.client.data.node.GWTJahiaNode

    @Override public void onComponentSelection() {
        new EmailTestWindow(linker.getSelectionContext().getSingleSelection()).show();
    }

    @Override public void handleNewLinkerSelection() {
        final GWTJahiaNode n = linker.getSelectionContext().getSingleSelection();
        setEnabled(n != null && n.getNodeTypes().contains("jnt:newsletterIssue") &&
                (n.getAggregatedPublicationInfo().getStatus() != GWTJahiaPublicationInfo.NOT_PUBLISHED));
    }
View Full Code Here

Examples of org.jahia.ajax.gwt.client.data.node.GWTJahiaNode

    @Override public void onComponentSelection() {
        new SendMailWindow(linker, linker.getSelectionContext().getSingleSelection()).show();
    }

    @Override public void handleNewLinkerSelection() {
        final GWTJahiaNode n = linker.getSelectionContext().getSingleSelection();
        setEnabled(n != null && n.getNodeTypes().contains("jnt:newsletterIssue") &&
                (n.getAggregatedPublicationInfo().getStatus() != GWTJahiaPublicationInfo.NOT_PUBLISHED));
    }
View Full Code Here

Examples of org.jahia.ajax.gwt.client.data.node.GWTJahiaNode

    @Override
    public void init(NodeHolder engine, AsyncTabItem tab, String locale) {
        if (!engine.isExistingNode() || (engine.getNode() != null)) {
            tab.setProcessed(true);
            tab.setLayout(new BorderLayout());
            final GWTJahiaNode node = engine.getNode();
            initCategoriesStoreA(node, engine);
            if (!engine.isExistingNode() || (PermissionsUtils.isPermitted("jcr:modifyProperties",node) && !node.isLocked())) {
                tab.add(createCategoriedPickerPanel(), new BorderLayoutData(Style.LayoutRegion.NORTH, 250));
            }
            tab.add(createSelectedCategoriesPanel(engine), new BorderLayoutData(Style.LayoutRegion.CENTER));
            tab.layout();
        }
View Full Code Here

Examples of org.jahia.ajax.gwt.client.data.node.GWTJahiaNode

        ColumnConfig action = new ColumnConfig("action", "Action", 100);
        action.setAlignment(Style.HorizontalAlignment.RIGHT);
        action.setRenderer(new GridCellRenderer() {
            public Object render(ModelData modelData, String s, ColumnData columnData, int i, int i1,
                                 ListStore listStore, Grid grid) {
                GWTJahiaNode gwtJahiaNode = (GWTJahiaNode) modelData;
                Button button = null;
                if (gwtJahiaNode.getNodeTypes().contains("jnt:category")) {
                    button = new Button(Messages.get("label.add", "Add"), new SelectionListener<ButtonEvent>() {
                        @Override
                        public void componentSelected(ButtonEvent buttonEvent) {
                            final GWTJahiaNode node1 = (GWTJahiaNode) buttonEvent.getButton().getData("associatedNode");
                            if (catStore.findModel(node1) == null) {
                                catStore.add(node1, false);
                            }
                        }
                    });
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.