Package org.openquark.gems.client.valueentry

Examples of org.openquark.gems.client.valueentry.ValueEditorDirector


            QualifiedName entityName = null;
            if (connectedGem instanceof FunctionalAgentGem) {
                entityName = ((FunctionalAgentGem)connectedGem).getName();
            }
               
            ValueEditorDirector ved = tableTopExplorer.getValueEditorDirector();
            ValueEditor valueEditor = ved.getRootValueEditor(
                                                tableTopExplorer.getValueEditorHierarchyManager(),
                                                valueGem.getValueNode(),
                                                entityName,
                                                connectedInputNum,
                                                connectedGem == null ? null : tableTopExplorer.getMetadataRunner(connectedGem));
            setupEditorComponentForValueGem(valueEditor, valueGem);
            setupValueEditor(node, valueEditor);
       
        } else if (userObject instanceof Gem.PartInput) {
            Gem.PartInput input = (Gem.PartInput)userObject;
            Gem gem = input.getGem();
            QualifiedName entityName = null;
            if (gem instanceof FunctionalAgentGem) {
                entityName = ((FunctionalAgentGem)gem).getName();
            }
               
            ValueEditorDirector ved = tableTopExplorer.getValueEditorDirector();
            ValueEditor valueEditor = ved.getRootValueEditor(
                                                tableTopExplorer.getValueEditorHierarchyManager(),
                                                input.getType(),
                                                entityName,
                                                input.getInputNum(),
                                                tableTopExplorer.getMetadataRunner(gem));
View Full Code Here


            } else {
                specializedInputTypes = TypeExpr.copyTypeExprs(inputTypes);
            }

            ValueEditorManager valueEditorManager = gemCutter.getValueEditorManager();
            ValueEditorDirector valueEditorDirector = valueEditorManager.getValueEditorDirector();

            Map<PartInput, ValueEditor> inputToEditorMap = new LinkedHashMap<PartInput, ValueEditor>();

            // Step through args, create a new value input panel for each, with the correct value type
            for (int i = 0; i < numArgs; i++) {

                // Get the gem and input
                final Gem.PartInput inputPart = argParts.get(i);
                final Gem inputGem = inputPart.getGem();
               
                int argumentNumber = inputPart.getInputNum();
                QualifiedName scName = null;
               
                if (inputGem instanceof FunctionalAgentGem) {
                    scName = ((FunctionalAgentGem) inputGem).getName();
                }

                // What we do next depends on whether we use cached sink values
                ValueNode cachedVN;
                final ValueEditor editor;
                if (canUseCachedArgs && (cachedVN = gemCutter.getTableTop().getCachedValue(inputPart)) != null) {
                    // use cached sink value to generate the VEP

                    // get a copy of the cached VN but with the new type expr
                    ValueNode newVN = cachedVN.copyValueNode();

                    // instantiate the VEP with the new VN (which has the old cached value)
                    editor = valueEditorDirector.getRootValueEditor(valueEditorHierarchyManager,
                                                                    newVN,
                                                                    scName,
                                                                    argumentNumber,
                                                                    new GemCutterMetadataRunner(gemCutter, inputGem));

                } else {
                    // don't use cached sink value.  Generate the default VEP for this sink.
                    TypeExpr inputType = specializedInputTypes[i];
                    editor = valueEditorDirector.getRootValueEditor(valueEditorHierarchyManager,
                                                                    inputType,
                                                                    scName,
                                                                    argumentNumber,
                                                                    new GemCutterMetadataRunner(gemCutter, inputGem));
                }
View Full Code Here

TOP

Related Classes of org.openquark.gems.client.valueentry.ValueEditorDirector

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.