Package org.openquark.cal.services

Examples of org.openquark.cal.services.GemEntity


                            String name = var.toSourceText();
                           
                            if (QualifiedName.isValidCompoundName(name)) {
                               
                                QualifiedName functionName = QualifiedName.makeFromCompoundName(name);
                                GemEntity gemEntity = getWorkspaceManager().getWorkspace().getGemEntity(functionName);
                               
                                if (gemEntity != null) {
                                    return new GemEntityValueNode(gemEntity, resultType);
                                }
                            }                           
View Full Code Here


     * @param locale the locale for the CALDoc summary (for identifying sentence breaks using BreakIterator).
     * @return the HTML formatted tooltip text for a functional agent gem
     */
    public static String getFunctionalAgentToolTip(FunctionalAgentGem gem, JComponent parent, Locale locale) {
       
        GemEntity gemEntity = gem.getGemEntity();
        FunctionalAgentMetadata metadata = gemEntity.getMetadata(GemCutter.getLocaleFromPreferences());

        // Add the name and the description.
        // Note: we want to show the fully qualified name in the title, so don't use the naming policy
        GemEntity entity = gem.getGemEntity();
        // todo-jowong modify below if tooltips are to display minimally qualified module names
        String name = metadata.getDisplayName() != null ? entity.getName().getModuleName() + "." + metadata.getDisplayName()
                                                        : entity.getName().getQualifiedName();
        StringBuilder text = new StringBuilder();
        text.append("<html><body><b>");
        text.append(name);
        text.append("</b>");

View Full Code Here

    /**
     * @see org.openquark.util.ui.WizardCard#initControls()
     */
    @Override
    protected boolean initControls () {
        GemEntity gemEntity = wizardState.getGemEntity();
       
        if (gemEntity != null) {
            return fillInputList (gemEntity);
        }

View Full Code Here

    /**
     * @see org.openquark.util.ui.WizardCard#onFinish()
     */
    @Override
    protected boolean onFinish () {
        GemEntity gemEntity = wizardState.getGemEntity();
       
        if (gemEntity == null) {
            return false;
        }
       
        List<InputBinding> inputBindings = null;
       
        try {
            inputBindings = getInputBindings();
        } catch (IllegalStateException e) {
            JOptionPane.showMessageDialog(this, e.getLocalizedMessage(), "BAM Sample", JOptionPane.WARNING_MESSAGE);
           
            return false;
        }
       
        if (inputBindings == null) {
            InputListItem listItem = getFirstUnboundListItem();
           
            JOptionPane.showMessageDialog(this, "You must provide a binding for '" + listItem.name + "'", "BAM Sample", JOptionPane.WARNING_MESSAGE);
           
            return false;
        }
       
        switch (usage) {
            case FOR_TRIGGER:
                TriggerDescription triggerDescription = new TriggerDescription (gemEntity.getName().getQualifiedName(), inputBindings);
               
                jobDescription.addTrigger(triggerDescription);
                break;
               
            case FOR_ACTION:
                ActionDescription actionDescription = new ActionDescription (gemEntity.getName().getQualifiedName(), inputBindings);
               
                jobDescription.addAction(actionDescription);
                break;
               
            default:
View Full Code Here

    public List<InputBinding> getInputBindings () {
        List<InputBinding> inputBindings = new ArrayList<InputBinding> ();
       
        ListModel inputListModel =  getInputList().getModel();
       
        GemEntity gemEntity = wizardState.getGemEntity();

        TypeExpr[] argTypes = gemEntity.getTypeExpr ().getTypePieces ();
       
        for (int argN = 0; argN < gemEntity.getNNamedArguments (); ++argN) {
            TypeExpr argType = argTypes [argN];
           
            String argName = gemEntity.getNamedArgument (argN);
           
            InputBinding inputBinding = null;
           
            if (canBindType(argType)) {
                inputBinding = findInputBinding (argName, inputListModel);
View Full Code Here

    /**
     * @see org.openquark.util.ui.WizardCard#commitChanges()
     */
    @Override
    protected boolean commitChanges () {
        GemEntity gemEntity = getSelectedGem();
       
        if (gemEntity != null) {
            wizardState.setGemEntity(gemEntity);
           
            return true;
View Full Code Here

     */
    @Override
    protected WizardCard makeCard () {
        BasicCALServices calServices = app.getCalServices();
       
        GemEntity gemEntity = calServices.getGemEntity(boundGemDescription.getQualifiedName());
       
        bindInputsCard = new BindInputsCard (app, jobDescription, gemEntity, boundGemDescription.getInputBindings (), usage);
       
        return bindInputsCard;
    }
View Full Code Here

     * @param workspace the workspace from which to reload the entity.
     * @param entityName If the gem has been renamed, this should be the new name of the gem.
     */
    void updateGemEntity(CALWorkspace workspace, QualifiedName entityName) throws GemEntityNotPresentException  {       
        // TODO: we should also check/morph for sc arity and type changes, and revalidate any connections.
        GemEntity newEntity = workspace.getGemEntity(entityName);
        QualifiedName oldName = gemEntity.getName();
        if (newEntity == null) {
            throw new GemEntityNotPresentException(gemEntity.getName());
        }
        this.gemEntity = newEntity;
View Full Code Here

                if (!(rootsToAdd.contains(reflectorCollector) || gemGraph.hasGem(reflectorCollector))) {
                    removeGem = true;
                }
            } else if (gem instanceof FunctionalAgentGem) {
                // Can't paste if the entity has changed (as a result of recompilation).
                GemEntity pastingGemEntity = ((FunctionalAgentGem)gem).getGemEntity();
                GemEntity expectedGemEntity = gemCutter.getPerspective().getVisibleGemEntity(pastingGemEntity.getName());

                if (pastingGemEntity != expectedGemEntity) {
                    removeGem = true;
                }
            }
View Full Code Here

                    if (getGemGraph().hasGem(((ReflectorGem)ithGem).getCollector())) {
                        return true;
                    }
                } else if (ithGem instanceof FunctionalAgentGem) {
                    // We can paste this functional agent if its entity is the expected entity.
                    GemEntity pastingGemEntity = ((FunctionalAgentGem)ithGem).getGemEntity();
                    GemEntity expectedGemEntity = gemCutter.getPerspective().getVisibleGemEntity(pastingGemEntity.getName());

                    if (pastingGemEntity == expectedGemEntity) {
                        return true;
                    }
View Full Code Here

TOP

Related Classes of org.openquark.cal.services.GemEntity

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.