Package org.openquark.cal.valuenode

Examples of org.openquark.cal.valuenode.ValueNode


            Map<ValueNode, TypeExpr> valueNodeToUnconstrainedTypeMap = getValueNodeToUnconstrainedTypeMap();
            Map<ValueNode, ValueNode> commitValueMap = valueEditorManager.getValueNodeCommitHelper().getCommitValues(oldChild, newChild, valueNodeToUnconstrainedTypeMap);
           
            PreludeTypeConstants typeConstants = valueEditorManager.getPreludeTypeConstants();
            TypeExpr charType = typeConstants.getCharType();
            ValueNode newValueNodeFromMap = commitValueMap.get(oldValueNode);

            // HACK: if it's a ListOfCharValueNode, convert it to a ListValueNode.
            //   What we need is a way to guarantee the type of value node that is returned by getCommitValues().
            //   This is not possible with the current form of transmuteValueNode() though.
            if (newValueNodeFromMap instanceof ListOfCharValueNode) {
View Full Code Here


     */
    public void cutToClipboard() {

        copyToClipboard();

        ValueNode newVN = valueEditorManager.getValueNodeBuilderHelper().getValueNodeForTypeExpr(getValueNode().getTypeExpr());
        setOwnerValueNode(newVN);
        setInitialValue();
        revalidate();
        valueEditorHierarchyManager.activateCurrentEditor();
    }
View Full Code Here

     * in this ValueEditor, then sets the value in this ValueEditor to the value
     * in the clipboard.
     */
    public void pasteFromClipboard() {

        ValueNode clipboardValueNode = valueEditorManager.getClipboardValue();

        // First, need to place check for 'compatible' types.
        // Also, if there's no clipboard value, then no point going on.
        if ((clipboardValueNode == null) || !clipboardValueNode.getTypeExpr().sameType(getValueNode().getTypeExpr())) {
            // Type incompatible.  Do nothing.
            return;
        }

        setOwnerValueNode(clipboardValueNode);
View Full Code Here

   
    /**
     * Notify listeners that the value of the edit in progress has been committed.
     */
    protected void notifyValueCommitted() {
        ValueNode oldValue = getOwnerValueNode();
        for (int i = 0, listenerCount = listenerList.size(); i < listenerCount; i++) {
            ValueEditorListener listener = listenerList.get(i);
            listener.valueCommitted(new ValueEditorEvent(this, oldValue));
        }
    }
View Full Code Here

         */
        private String generateSqlQuery() {
            // Build the code necessary to execute the query.
            // TODO: what should happen if there are parameters in the code?
            String queryCode = generateSqlFunctionBody();
            ValueNode vn = getValueNodeFromCode(queryCode);

            Object sqlObj = vn.getValue();
            if (sqlObj instanceof String) {
                return (String) sqlObj;
            }
            else {
                return "<Failed to generate SQL query.>";
View Full Code Here

        /**
         * Runs the specified code and returns the result as a Java Object.
         */
        private Object getObjectFromCode(String code) {
            ValueNode vn = getValueNodeFromCode(code);
            return (vn == null) ? null : vn.getValue();
        }
View Full Code Here

                // Only commit the child value if there really is a cell at this location.
                // If the user presses the remove button multiple times it can happen that the cell is gone
                // from the model, but we still try to commit its value.
                if (tableModel.getRowCount() > editRow && tableModel.getColumnCount() > editColumn) {
                   
                    ValueNode oldValueNode = (ValueNode) tableModel.getValueAt(editRow, editColumn);
                    ValueNode newValueNode = tableCellEditor.getValueNode();
                   
                    if (oldValueNode.sameValue(newValueNode)) {
                        return;
                    }
                   
View Full Code Here

    /**
     * {@inheritDoc}
     */
    @Override
    protected void commitValue() {
        ValueNode returnVN = new ColourValueNode(getColourChooser().getColor(), getValueNode().getTypeExpr());
        replaceValueNode(returnVN, false);
        notifyValueCommitted();
    }
View Full Code Here

        // Check if we need to evaluate the user input - maybe it's an undefined result.
        if (isHandlingResultUndefined) {
            exitHandlingResultUndefined();
        }

        ValueNode returnVN = null;
        TypeExpr typeExpr = getValueNode().getTypeExpr();
       
        PreludeTypeConstants typeConstants = valueEditorManager.getValueNodeBuilderHelper().getPreludeTypeConstants();
       
        if (typeExpr.sameType(typeConstants.getByteType())) {
View Full Code Here

            doubleVal = new Double("0.0");
        }

        // Configure the value format - the document for the display area.
        TypeExpr doubleType = TypeExpr.makeNonParametricType(valueEditorManager.getPerspective().getTypeConstructor(CAL_Prelude.TypeConstructors.Double));
        ValueNode doubleValueNode = new LiteralValueNode(doubleVal, doubleType);
       
        ValueFormat valueFormat = new ValueFormat(new ValueEntryPanel(valueEditorHierarchyManager, doubleValueNode));
        valueFormat.setChecking(true);

        // Configure the display area itself.
View Full Code Here

TOP

Related Classes of org.openquark.cal.valuenode.ValueNode

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.