Package org.openquark.gems.client.valueentry

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


            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


                public void valueCommitted(ValueEditorEvent evt) {
                    // HACK: We have to remove the listener so that it doesn't cancel editing
                    // as a result of our own change.
                    valueGem.removeValueChangeListener(editorValueGemListener);
                   
                    ValueEditor valueEditor = ((ValueEditor)editorComponent);
                    ValueNode vn = valueEditor.getValueNode();
                    explorerOwner.changeValueNode(valueGem, vn);
                    valueEditor.changeOwnerValue(explorerOwner.getValueNode(valueGem));

                    valueGem.addValueChangeListener(editorValueGemListener);
                }
               
                public void valueCanceled(ValueEditorEvent evt) {
                }
        };

        valueEditor.addValueEditorListener(vel);
        valueEditor.setContext(explorerOwner.getValueEditorContext(valueGem));
    }
View Full Code Here

        private InputPolicy[] getInputPolicies() {
            List<ValueEditor> argPanelList = getArgumentPanels();
            InputPolicy[] ips = new InputPolicy[argPanelList.size()];
            for (int i = 0, nArgs = argPanelList.size(); i < nArgs; i++) {
                ValueEditor argPanel = argPanelList.get(i);
                ips[i] = argPanel.getValueNode().getInputPolicy();
            }
           
            return ips;
        }
View Full Code Here

       
        private TypeExpr[] getArgTypes() {
            List<ValueEditor> argPanelList = getArgumentPanels();
            TypeExpr[] argTypes = new TypeExpr[argPanelList.size()];
            for (int i = 0, nArgs = argPanelList.size(); i < nArgs; i++) {
                ValueEditor argPanel = argPanelList.get(i);
                argTypes[i] = argPanel.getValueNode().getTypeExpr();
            }
           
            return argTypes;
        }
View Full Code Here

            List<ValueEditor> argPanelList = getArgumentPanels();
            ArrayList<Object> inputJavaValues = new ArrayList<Object>();
           
            for (int i = 0, nArgs = argPanelList.size(); i < nArgs; i++) {
                ValueEditor argPanel = argPanelList.get(i);
                Object[] values = argPanel.getValueNode().getInputJavaValues();
                for (final Object value: values) {
                    inputJavaValues.add(value);
                }
            }
            return inputJavaValues.toArray();
View Full Code Here

     * @param messageTitle the title of the message to display
     * @param errorString boolean flag to indicate whether result is an error condition
     */
    public void displayOutput(ValueNode dataVN, DisplayedGem target, String messageTitle, String errorString) {
   
        final ValueEditor editor;
        if (dataVN != null) {
           
            // Create the resultVEP.  (Remember, the resultVEP should not be editable).
            editor = valueEditorManager.getValueEditorDirector().getRootValueEditor(outputPanelHierarchyManager, dataVN, null, 0, null);
            editor.setEditable(false);
       
            // This ensures that code pertaining to the ValueEditorHierarchy is not confused by this ValueEntryPanel.
            outputPanelHierarchyManager.addTopValueEditor(editor);
        } else {
            editor = null;
View Full Code Here

   
        // Set up the navigation buttons.
        int argIndex = 0;
        for (final Map.Entry<PartInput, ValueEditor> mapEntry : inputToEditorMap.entrySet()) {
            Gem.PartInput inputPart = mapEntry.getKey();
            ValueEditor editor = mapEntry.getValue();
           
            // Create a navigation button, and hook it up to its action.
            JButton navigationButton = new JButton(String.valueOf(argIndex + 1));
            navigationButton.addActionListener(new ParameterNavigationActionListener(editor));
            navigationButton.setMargin(new Insets(0, 0, 0, 0));
View Full Code Here

            throw new IllegalStateException("Programming Error: matching " + numArgs + " arguments and " + argPanels.size() + " argument panels.");
        }
   
        for (int i = 0; i < numArgs; i++) {
            Gem.PartInput argPart = argParts.get(i);
            ValueEditor argPanel = argPanels.get(i);
            ValueNode argNode = argPanel.getValueNode();
            gemCutter.getTableTop().cacheArgValue(argPart, argNode);
        }
    }
View Full Code Here

        // If there are argument panels, we use these to specialize the target
        // type.
        int nPanels = argPanelList.size ();
        TypeExpr[] argPanelTypes = new TypeExpr[nPanels];
        for (int i = 0; i < nPanels; i++) {
            ValueEditor argPanel = argPanelList.get (i);
            argPanelTypes[i] = argPanel.getValueNode ().getTypeExpr ();
        }

        gemCutter.getStatusMessageDisplayer ().clearMessage (this);
        gemCutter.setTargetRunningButtons (true);
       
View Full Code Here

        /**
         * {@inheritDoc}
         */
        @Override
        public void valueCommitted(ValueEditorEvent evt) {
            ValueEditor committedEditor = (ValueEditor)evt.getSource();
           
            ValueNode oldValue = evt.getOldValue();
            ValueNode newValue = committedEditor.getValueNode();
           
            if (!oldValue.sameValue(newValue)) {
                switchValueNodeTypeExpr(oldValue, newValue);
                committedEditor.setSize(committedEditor.getPreferredSize());
            }
        }
View Full Code Here

TOP

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

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.