Package org.openquark.cal.metadata

Examples of org.openquark.cal.metadata.ArgumentMetadata


       
        Set<String> setOfArgumentNames = new HashSet<String>();
       
        for (int i = 0 ; i < nArgs; i++) {
            currentPage.addText(" ");
            ArgumentMetadata argMetadata = (i < argMetadataArray.length) ? argMetadataArray[i] : null;
            generateArgumentName(entityWithArgumentNames, i, argMetadata, docCommentForArguments, setOfArgumentNames);
        }
       
        currentPage.closeTag(HTML.Tag.CODE);
       
View Full Code Here


        SourceModel.TypeSignature[] typePieceSignatures = TypeExpr.toSourceModelArray(typePieces, true, ScopedEntityNamingPolicy.FULLY_QUALIFIED);
       
        Set<String> setOfArgumentNames = new HashSet<String>();
       
        for (int i = 0; i < nArgs; i++) {
            ArgumentMetadata argMetadata = (i < argMetadataArray.length) ? argMetadataArray[i] : null;
            CALDocComment.TextBlock argTextBlock = (docCommentForArguments != null && i < docCommentForArguments.getNArgBlocks()) ? docCommentForArguments.getNthArgBlock(i).getTextBlock() : null;
           
            String metadataValue = getBestDescriptionFromMetadata(argMetadata);
           
            ////
View Full Code Here

                argDesc = null;
               
            } else {
               
                // First load the information from the design metadata.
                ArgumentMetadata designMetadata = inputPart.getDesignMetadata();
                argName = inputPart.getArgumentName().getCompositeName();
                argDesc = designMetadata.getShortDescription();
               
                if (argDesc == null && gem instanceof FunctionalAgentGem) {
                   
                    // If there is no design description of the input,
                    // show the description of the gem argument instead.
View Full Code Here

           
            // reuse any existing inputs if possible, otherwise create a new one.
            PartInput input = getReflectingInput(reflectedInput);
            if (input == null) {
                input = createInputPart(index);
                ArgumentMetadata inputMetadata = reflectedInput.getDesignMetadata();
                inputMetadata.setDisplayName(reflectedInput.getArgumentName().getCompositeName());
                input.setDesignMetadata(inputMetadata);
                input.setArgumentName(new ArgumentName(reflectedInput.getArgumentName()));
            } else {
                // update the input num.
                input.setInputNum(index);
View Full Code Here

            } else if (treeNode.getUserObject() instanceof Gem.PartInput) {

                Gem.PartInput input = (Gem.PartInput) treeNode.getUserObject();
                ValueNode valueNode = tableTopExplorerOwner.getValueNode(input);
                ArgumentMetadata metadata = input.getDesignMetadata();

                if (tableTopExplorerOwner.highlightInput(input)) {
                    // TODO: instead of hardcoding the highlighted font style, perhaps the renderer
                    //       should be passed to the highlight fn and let it set whatever is appropriate...
                    setTextNonSelectionColor(Color.RED);
                    setFont(tree.getFont().deriveFont(Font.ITALIC));
                }

                if (tableTopExplorerOwner.canEditInputsAsValues() && valueNode != null && !input.isBurnt()) {
                    customText = input.getArgumentName().getCompositeName() + ":  " + valueNode.getTextValue();

                } else {
                    customIcon = partInputIcon;

                    if (input.isBurnt()) {
                        setTextNonSelectionColor(Color.RED.darker());
                        setTextSelectionColor(Color.WHITE);
                        setBackgroundSelectionColor(Color.RED.darker());
                        customIcon = burnIcon;                     
                    }

                    if (metadata.getShortDescription() != null) {
                        customText = input.getArgumentName().getCompositeName() + " - " + metadata.getShortDescription();
                    } else {
                        customText = input.getArgumentName().getCompositeName();
                    }
                }
            }
View Full Code Here

        // but setting the argument name is necessary to change the display instantly.
        input.setArgumentName(new ArgumentName(newInputName));

        // Update the metadata as well. For now user-set names will be lost when renaming happens
        // this line: input.getDesignMetadata().setDisplayName(newInputName); does not overwrite the existing metadata.
        ArgumentMetadata metadata = new ArgumentMetadata(CALFeatureName.getArgumentFeatureName(fieldIndex), input.getDesignMetadata().getLocale());
        metadata.setDisplayName(newInputName);
        input.setDesignMetadata(metadata);
       
        if (nameChangeListener != null) {
            nameChangeListener.nameChanged(new NameChangeEvent(this, oldName));
        }
View Full Code Here

                String argName = getArgumentString(name);
                input.setArgumentName(new ArgumentName(argName));
                input.setOriginalInputName(argName);

                // Needs to set metadata because of locale
                ArgumentMetadata metadata = new ArgumentMetadata(CALFeatureName.getArgumentFeatureName(i), input.getDesignMetadata().getLocale());
                metadata.setDisplayName(argName);
                input.setDesignMetadata(metadata);
            }

            newInputArray[i] = input;
        }
View Full Code Here

       
        for (final NavEditorComponent<?> listItem : getEditors()) {
           
            if (listItem instanceof NavEntityArgumentEditor) {
                NavEntityArgumentEditor editor = (NavEntityArgumentEditor) listItem;
                ArgumentMetadata metadata = editor.getValue();
               
                if (metadata.getDisplayName() != null &&
                        !LanguageInfo.isValidFunctionName(metadata.getDisplayName())) {
                   
                    setEditorErrorMessage(editor, NavigatorMessages.getString("NAV_InvalidArgName_Message"));
                    return false;
                   
                } else {
View Full Code Here

    /**
     * @see org.openquark.gems.client.navigator.NavEditorSection#doSave()
     */
    @Override
    void doSave() {
        ArgumentMetadata metadata = (ArgumentMetadata) getMetadata();
        metadata.setDefaultValuesOnly(((Boolean) getEditorValue(DEFAULTS_ONLY_KEY)).booleanValue());
        metadata.setDefaultValuesExpression((CALExpression) getEditorValue(DEFAULTS_EXPRESSION_KEY));
        metadata.setPromptingTextExpression((CALExpression) getEditorValue(PROMPTING_EXPRESSION_KEY));
    }
View Full Code Here

    /**
     * @see org.openquark.gems.client.navigator.NavEditorSection#doRevert()
     */
    @Override
    void doRevert() {
        ArgumentMetadata metadata = (ArgumentMetadata) getMetadata();
       
        setEditorValue(DEFAULTS_ONLY_KEY,        Boolean.valueOf(metadata.useDefaultValuesOnly()));
        setEditorValue(DEFAULTS_EXPRESSION_KEY,  metadata.getDefaultValuesExpression());
        setEditorValue(PROMPTING_EXPRESSION_KEY, metadata.getPromptingTextExpression());
    }
View Full Code Here

TOP

Related Classes of org.openquark.cal.metadata.ArgumentMetadata

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.