Examples of BindableDescriptor


Examples of org.carrot2.util.attribute.BindableDescriptor

        for (ProcessingComponentDescriptor pcd : componentSuite.getComponents())
        {
            try
            {
                final String id = pcd.getId();
                BindableDescriptor bindableDescriptor = pcd.getBindableDescriptor();
                bindableDescriptors.put(id, bindableDescriptor);
                processingDescriptors.put(id, pcd);
            }
            catch (Exception e)
            {
View Full Code Here

Examples of org.carrot2.util.attribute.BindableDescriptor

        {
            this.componentDescriptor = descriptor;
            this.attributeSets = descriptor.getAttributeSets();

            // Instantiate the component and get bindable metadata
            BindableDescriptor bindableDescriptor = descriptor.getBindableDescriptor();
            this.attributeDescriptors = Maps.newHashMap(bindableDescriptor.attributeDescriptors);

            // Determine groups (it's easier to do that here than in XSLT)
            final HashSet<String> groupSet = Sets.newHashSet();
            for (AttributeDescriptor attributeDescriptor : attributeDescriptors.values())
View Full Code Here

Examples of org.carrot2.util.attribute.BindableDescriptor

    private void createEditors(Composite parent)
    {
        /*
         * Create a filtered view of attribute descriptors.
         */
        BindableDescriptor descriptor = this.descriptor.only(
            Predicates.not(new InternalAttributePredicate(false))).only(
            new HasEditorPredicate());
        if (filterPredicate != null)
        {
            descriptor = descriptor.only(filterPredicate);
        }

        /*
         * CARROT-818: Check if there is anything for display.
         */
        if (descriptor.attributeDescriptors.isEmpty())
        {
            createMessage(mainControl, this, "No attributes.");
        }

        /*
         * Group attributes.
         */
        descriptor = descriptor.group(grouping);
       
        /*
         * Create sections for attribute groups.
         */
        for (Object groupKey : descriptor.attributeGroups.keySet())
View Full Code Here

Examples of org.carrot2.util.attribute.BindableDescriptor

    {
        final PanelName section = PanelName.ATTRIBUTES;
        final Section sec = createSection(parent);
        sec.setText(section.name);

        final BindableDescriptor descriptor = getAlgorithmDescriptor();

        final CScrolledComposite scroller = new CScrolledComposite(sec, SWT.H_SCROLL
            | SWT.V_SCROLL);
        resources.add(scroller);
View Full Code Here

Examples of org.carrot2.util.attribute.BindableDescriptor

    BindableDescriptor getAlgorithmDescriptor()
    {
        final WorkbenchCorePlugin core = WorkbenchCorePlugin.getDefault();
        final String algorithmID = getSearchResult().getInput().getAlgorithmId();

        BindableDescriptor componentDescriptor = core.getComponentDescriptor(algorithmID);
        if (componentDescriptor == null) {
            throw new RuntimeException("No descriptor for algorithm: " + algorithmID);
        }
        return componentDescriptor.only(Input.class,
            Processing.class).only(Predicates.not(new InternalAttributePredicate(false)));
    }
View Full Code Here

Examples of org.carrot2.util.attribute.BindableDescriptor

     * Default attribute value set for a given component.
     */
    @SuppressWarnings("unchecked")
    static AttributeValueSet getDefaultAttributeValueSet(String componentId)
    {
        BindableDescriptor desc = WorkbenchCorePlugin.getDefault()
            .getComponentDescriptor(componentId);

        final HashMap<String, Object> defaults = Maps.newHashMap();
        for (Map.Entry<String, AttributeDescriptor> e : desc.flatten().only(Input.class).attributeDescriptors
            .entrySet())
        {
            defaults.put(e.getKey(), e.getValue().defaultValue);
        }
        removeSpecialKeys(defaults);
View Full Code Here

Examples of org.carrot2.util.attribute.BindableDescriptor

     * from the provided map.
     */
    private static void removeInternalNonConfigurationAttributes(
        Map<String, Object> attrs, String componentId)
    {
        BindableDescriptor desc = WorkbenchCorePlugin.getDefault()
            .getComponentDescriptor(componentId);

        attrs
            .keySet()
            .removeAll(
                desc.flatten().only(new InternalAttributePredicate(false)).attributeDescriptors
                    .keySet());
    }
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.