Package org.cfeclipse.cfml.dictionary

Examples of org.cfeclipse.cfml.dictionary.Parameter


       
        /*
         * I am doing  a simple display this time since the attributes dont seem to get disposed
         *
         */
        Parameter param = (Parameter)iter.next();
        TableItem tedit =   new TableItem(table, SWT.NONE);
        tedit.setData(param);
        String paramName = param.getName();
       
        if(param.isRequired()){
         
          paramName = paramName + "*";
         
        }
       
        String values = param.getValues().toString();
        tedit.setText(new String[]{paramName,param.getType(), values});
        //Need to find out if this param is required
        //param.isRequired()
       
       
       
View Full Code Here


          //This is a nasty hack to filter out the attributes that have already been typed.
          Set proposalSet = syntax.getFilteredAttributes(tagname.trim(),searchText);
          Set toRemove = new HashSet();
          Iterator proposals = proposalSet.iterator();
          Iterator attributes;
          Parameter p;
          while(proposals.hasNext()) {
              p = (Parameter)proposals.next();
              attributes = attribs.iterator();
              while(attributes.hasNext()) {
                  if (attributes.next().toString().equalsIgnoreCase(p.getName())) {
                      toRemove.add(p);
                  }
              }
          }
         
View Full Code Here

          //Assert.isTrue(attrObj instanceof Parameter, "A parameter proposal from a tag attribute contributor is not of type Parameter");
         
          if(!(attrObj instanceof Parameter))
                throw new IllegalArgumentException("A parameter proposal from a tag attribute contributor is not of type Parameter");
         
          Parameter currParam = (Parameter)attrObj;
          //System.out.println("Testing \'" + currParam.getName() + "\'");
          if(currAttribs.containsKey(currParam.getName())) {
            attribs2Remove.add(currParam);
          }
          else if((currParam.isTriggered((HashMap)currAttribs) == Parameter.PARAM_NOTTRIGGERED)) {
            // System.out.println("Adding to the remove list.");
            attribs2Remove.add(currParam);
          }
          //System.out.println("");
        }
View Full Code Here

       
        int x = 0;
        String extraInfo = paramIndent + "<b>" + functionName + "</b> (\n";
        //CompletionProposal proposal = null;
        //String usage = "";
        Parameter activeParam = null;
       
        int paramCount = filteredParams.length;
       
        while(x < paramCount)
        {
          Parameter p = filteredParams[x];
           
          String delimiter = "";
          if (x+1 < paramCount) {
              delimiter = " ,";
          }
          extraInfo += paramIndent + paramIndent;
          if (x == this.paramsSoFar) {
              activeParam = p;
            extraInfo += "<b>";
          }
          if(p != null) {
            extraInfo += p.toString() + delimiter;
          }
         
          if (x == this.paramsSoFar) {
            extraInfo += "</b>";
          }
View Full Code Here

      int x = 0;
      while(i.hasNext())
      {
          Object o = i.next();
          if (o instanceof Parameter) {
              Parameter p = (Parameter)o;
     
            if (p.isTriggered(paramMap) == Parameter.PARAM_NOTTRIGGERED) {
              //System.out.println(p.getName() + " not triggered.");
              continue;
            }
            Trigger currentTrigger = p.activeTrigger();
            if (currentTrigger != null) {
              //System.out.println(p.getName() + " index is " + currentTrigger.paramIndex());
              //this.paramPositions.put(p.getName(),new Integer(currentTrigger.paramIndex()));
              sortingArray[currentTrigger.paramIndex()] = p;
            }
View Full Code Here

      int x = 0;
      while(i.hasNext())
      {
          Object o = i.next();
          if (o instanceof Parameter) {
              Parameter p = (Parameter)o;
     
            if (p.isTriggered(paramMap) == Parameter.PARAM_NOTTRIGGERED) {
              //System.out.println(p.getName() + " not triggered.");
              continue;
            }
            Trigger currentTrigger = p.activeTrigger();
            if (currentTrigger != null) {
              //System.out.println(p.getName() + " index is " + currentTrigger.paramIndex());
              //this.paramPositions.put(p.getName(),new Integer(currentTrigger.paramIndex()));
              sortingArray[currentTrigger.paramIndex()] = p;
            }
View Full Code Here

      }

      public void widgetSelected(SelectionEvent e) {
        if(e.item != null) {         
          if (e.item.getData() instanceof Parameter) {
            Parameter param = (Parameter) e.item.getData();
            preview.setText(param.getHelp());
          }
        }       
      }
     
     
View Full Code Here

    mainContents.setLayout(gl);
   
    if(this.attributes != null){
      Iterator i = this.attributes.iterator();
      while(i.hasNext()){
        Parameter pr = (Parameter)i.next();
       
        String labelname = pr.getName() + " : ";
        if(pr.isRequired()){
          labelname = pr.getName() + " *: ";
        }
       
        Label label = new Label(mainContents, SWT.HORIZONTAL);
        label.setText(labelname);
        label.setToolTipText(pr.getHelp());
       
        GridData gridData = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
        gridData.widthHint = 200;
       
        //Here we need to check if the attribute has multiple, i.e. for a drop down
        if(!pr.getValues().isEmpty()){
          addComboField(mainContents, gridData, pr);
        } else {
          addTextField(mainContents, gridData, pr);
        }
       
View Full Code Here

    if(itemAttributes.size() > 0) {
      attributesFound = " (Found: "+ itemAttributes.keySet().toString() + ")";
    }
   
    for(int i = 0; i < params.length; i++) {
      Parameter currParam = (Parameter)params[i];
     
      if (currParam.isRequired()
          && !(itemAttributes.containsKey(currParam.getName().toLowerCase()) || itemAttributes.containsKey(currParam.getName()
              .toUpperCase())) && !itemAttributes.containsKey("attributecollection")) {
        this.parseMessages.addMessage(new ParseError(lineNumber, startPosition, endPosition, itemData,
          "The attribute \'" + currParam.getName() + "\' is compulsory for the <" + this.itemName + "> tag." + attributesFound));
      }
     
      if(!currParam.getTriggers().isEmpty()  && currParam.isRequired(suggestedAttributes) == 3 && !itemAttributes.containsKey(currParam.getName())){
        this.parseMessages.addMessage(new ParseError(lineNumber, startPosition, endPosition, itemData,
          "The attribute \'" + currParam.getName() + "\' is required for the <" + this.itemName + "> tag." + attributesFound));
//      the logic here is funky for optional tags with triggers TODO: refactor
//      } else if (!currParam.getTriggers().isEmpty()  && currParam.isTriggered(suggestedAttributes) == 0 && itemAttributes.containsKey(currParam.getName())) {
//        this.parseMessages.addMessage(new ParseError(lineNumber, startPosition, endPosition, itemData,
//          "The attribute \'" + currParam.getName() + "\' is not valid for the <" + this.itemName + "> tag." + attributesFound));
      }
View Full Code Here

    Iterator iter = this.funcRef.getParameters().iterator();
    //Enumeration attiterator = this.attribs.keys();
   
    //TODO: make sure this doesnt go backwards!
    while(iter.hasNext()){
      Parameter param = (Parameter)iter.next();
     
      //Find the value in the attribs
      //this.attribs.getProperty(param.getName());
      String filledProp = this.attribs.getProperty(param.getName());
      if(filledProp.length() > 0){
        function.append(filledProp);
      }
      else{
       
          if(param.getType().equals("String")){
            function.append("\"" + param.getName() + "\"");
           
          } else {
            function.append(param.getName());
          }
         
       
      }
     
View Full Code Here

TOP

Related Classes of org.cfeclipse.cfml.dictionary.Parameter

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.