Examples of ToolUI


Examples of com.psddev.cms.db.ToolUi

                sct.setDisplayName(selected.getDisplayName());
                sct.setInternalName(selected.getInternalName());
            }

            for (ObjectField of : selected.getFields()) {
                ToolUi ui = of.as(ToolUi.class);

                if (!ui.isHidden()) {
                    boolean found = false;
                    for (ContentField cf : sct.getFields()) {
                        if (of.getInternalName().equals(cf.getInternalName())) {
                            found = true;
                            break;
                        }
                    }

                    if (!found) {
                        ContentField cf = new ContentField();

                        cf.setTab(ui.getTab());
                        cf.setDisplayName(of.getDisplayName());
                        cf.setInternalName(of.getInternalName());
                        sct.getFields().add(cf);
                    }
                }
View Full Code Here

Examples of com.psddev.cms.db.ToolUi

        this.page = page;
        this.writer = page.getWriter();
        this.search = search;

        ObjectType selectedType = search.getSelectedType();
        ToolUi ui = selectedType == null ? null : selectedType.as(ToolUi.class);
        PaginatedResult<?> result = null;

        if (selectedType != null) {
            if (search.getSort() != null) {
                AuthenticationFilter.Static.putUserSetting(page.getRequest(), SORT_SETTING_PREFIX + selectedType.getId(), search.getSort());

            } else {
                Object sortSetting = AuthenticationFilter.Static.getUserSetting(page.getRequest(), SORT_SETTING_PREFIX + selectedType.getId());

                if (!ObjectUtils.isBlank(sortSetting)) {
                    search.setSort(sortSetting.toString());
                }
            }
        }

        if (search.getSort() == null) {
            search.setShowMissing(true);

            if (ui != null && ui.getDefaultSortField() != null) {
                search.setSort(ui.getDefaultSortField());

            } else if (!ObjectUtils.isBlank(search.getQueryString())) {
                search.setSort(Search.RELEVANT_SORT_VALUE);

            } else {
View Full Code Here

Examples of com.psddev.cms.db.ToolUi

     * @param attributes Extra attributes for the HTML tag.
     */
    public void writeObjectSelect(ObjectField field, Object value, Object... attributes) throws IOException {
        ErrorUtils.errorIfNull(field, "field");

        ToolUi ui = field.as(ToolUi.class);
        String placeholder = ObjectUtils.firstNonNull(ui.getPlaceholder(), "");

        if (field.isRequired()) {
            placeholder += " (Required)";
        }

        if (isObjectSelectDropDown(field)) {
            Search dropDownSearch = new Search(field);
            dropDownSearch.setParentId(param(UUID.class, OBJECT_ID_PARAMETER));
            dropDownSearch.setParentTypeId(param(UUID.class, TYPE_ID_PARAMETER));

            List<?> items;
            if (field.getTypes().contains(ObjectType.getInstance(ObjectType.class))) {
                List<ObjectType> types = new ArrayList<ObjectType>();
                Predicate predicate = dropDownSearch.toQuery(getSite()).getPredicate();

                for (ObjectType t : Database.Static.getDefault().getEnvironment().getTypes()) {
                    if (t.is(predicate)) {
                        types.add(t);
                    }
                }
                items = new ArrayList<Object>(types);
            } else {
                items = dropDownSearch.toQuery(getSite()).selectAll();
            }

            Collections.sort(items, new ObjectFieldComparator("_label", false));

            writeStart("select",
                    "data-searchable", "true",
                    attributes);
                writeStart("option", "value", "");
                    writeHtml(placeholder);
                writeEnd();

                for (Object item : items) {
                    State itemState = State.getInstance(item);
                    writeStart("option",
                            "selected", item.equals(value) ? "selected" : null,
                            "value", itemState.getId());
                        writeObjectLabel(item);
                    writeEnd();
                }
            writeEnd();

        } else {
            State state = State.getInstance(value);
            StringBuilder typeIds = new StringBuilder();

            for (ObjectType type : field.getTypes()) {
                typeIds.append(type.getId());
                typeIds.append(',');
            }

            if (typeIds.length() > 0) {
                typeIds.setLength(typeIds.length() - 1);
            }

            writeElement("input",
                    "type", "text",
                    "class", "objectId",
                    "data-additional-query", field.getPredicate(),
                    "data-generic-argument-index", field.getGenericArgumentIndex(),
                    "data-dynamic-placeholder", ui.getPlaceholderDynamicText(),
                    "data-label", value != null ? getObjectLabel(value) : null,
                    "data-pathed", ToolUi.isOnlyPathed(field),
                    "data-preview", getPreviewThumbnailUrl(value),
                    "data-searcher-path", ui.getInputSearcherPath(),
                    "data-suggestions", ui.isEffectivelySuggestions(),
                    "data-typeIds", typeIds,
                    "data-visibility", value != null ? state.getVisibilityLabel() : null,
                    "value", value != null ? state.getId() : null,
                    "placeholder", placeholder,
                    attributes);
View Full Code Here

Examples of com.psddev.cms.db.ToolUi

                        if (absMax != null) {
                            constraints.add("Absolute Maximum: " + absMax);
                        }

                        ToolUi fieldUi = field.as(ToolUi.class);
                        Object sugMin = fieldUi.getSuggestedMinimum();
                        Object sugMax = fieldUi.getSuggestedMaximum();

                        if (sugMin != null) {
                            constraints.add("Suggested Minimum: " + sugMin);
                        }
View Full Code Here

Examples of org.gephi.tools.spi.ToolUI

        //Get tools ui
        HashMap<ToolUI, Tool> toolMap = new HashMap<ToolUI, Tool>();
        List<ToolUI> toolsUI = new ArrayList<ToolUI>();
        for (Tool tool : tools) {
            ToolUI ui = tool.getUI();
            if (ui != null) {
                toolsUI.add(ui);
                toolMap.put(ui, tool);
            }
View Full Code Here

Examples of org.gephi.tools.spi.ToolUI

        };
        return listeners;
    }

    public ToolUI getUI() {
        return new ToolUI() {

            public JPanel getPropertiesBar(Tool tool) {
                heatMapPanel = new HeatMapPanel(gradientColors, gradientPositions, dontPaintUnreachable);
                return heatMapPanel;
            }
View Full Code Here

Examples of org.gephi.tools.spi.ToolUI

        };
        return listeners;
    }

    public ToolUI getUI() {
        return new ToolUI() {

            public JPanel getPropertiesBar(Tool tool) {
                edgePencilPanel = new EdgePencilPanel();
                edgePencilPanel.setColor(color);
                edgePencilPanel.setWeight(weight);
View Full Code Here

Examples of org.gephi.tools.spi.ToolUI

        };
        return listeners;
    }

    public ToolUI getUI() {
        return new ToolUI() {

            public JPanel getPropertiesBar(Tool tool) {
                shortestPathPanel = new ShortestPathPanel();
                shortestPathPanel.setColor(color);
                shortestPathPanel.setStatus(NbBundle.getMessage(ShortestPath.class, "ShortestPath.status1"));
View Full Code Here

Examples of org.gephi.tools.spi.ToolUI

                }
            }};
    }

    public ToolUI getUI() {
        return new ToolUI() {

            public JPanel getPropertiesBar(Tool tool) {
                return new JPanel();
            }
View Full Code Here

Examples of org.gephi.tools.spi.ToolUI

        };
        return listeners;
    }

    public ToolUI getUI() {
        return new ToolUI() {

            public JPanel getPropertiesBar(Tool tool) {
                sizerPanel = new SizerPanel();
                return sizerPanel;
            }
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.