Examples of AttributeCol


Examples of org.drools.guvnor.client.modeldriven.dt.AttributeCol

  }

  void doAttribs(int numOfMeta, List<AttributeCol> attributeCols, String[] row, RuleModel rm) {
    List<RuleAttribute> attribs = new ArrayList<RuleAttribute>();
    for (int j = 0; j < attributeCols.size(); j++) {
      AttributeCol at = attributeCols.get(j);
      String cell = row[j + 2 + numOfMeta];
      if (validCell(cell)) {
        attribs.add(new RuleAttribute(at.attr, cell));
      }
    }
View Full Code Here

Examples of org.drools.guvnor.client.modeldriven.dt.AttributeCol

  public void test2Rules() throws Exception {
    GuidedDecisionTable dt = new GuidedDecisionTable();
    dt.tableName = "michael";

    AttributeCol attr = new AttributeCol();
    attr.attr = "salience";
    dt.attributeCols.add(attr);

    ConditionCol con = new ConditionCol();
    con.boundName = "f1";
View Full Code Here

Examples of org.drools.guvnor.client.modeldriven.dt.AttributeCol

    RuleAttribute[] orig = rm.attributes;
    p.doAttribs(0,attributeCols, row, rm);

    assertSame(orig, rm.attributes);

    AttributeCol col1 = new AttributeCol();
    col1.attr = "salience";
    AttributeCol col2 = new AttributeCol();
    col2.attr = "agenda-group";
    attributeCols.add(col1);
    attributeCols.add(col2);

    p.doAttribs(0, attributeCols, row, rm);
View Full Code Here

Examples of org.drools.guvnor.client.modeldriven.dt.AttributeCol

  }

  void doAttribs(int numOfMeta, List<AttributeCol> attributeCols, String[] row, RuleModel rm) {
    List<RuleAttribute> attribs = new ArrayList<RuleAttribute>();
    for (int j = 0; j < attributeCols.size(); j++) {
      AttributeCol at = attributeCols.get(j);
      String cell = row[j + GuidedDecisionTable.INTERNAL_ELEMENTS + numOfMeta];
      if (validCell(cell)) {
        attribs.add(new RuleAttribute(at.attr, cell));
      } else if (at.defaultValue != null) {
                attribs.add(new RuleAttribute(at.attr, at.defaultValue));               
View Full Code Here

Examples of org.drools.ide.common.client.modeldriven.dt.AttributeCol

        MetadataCol md = new MetadataCol();
        md.attr = "legacy";
        md.defaultValue = "yes";
        dt.getMetadataCols().add( md );

        AttributeCol attr = new AttributeCol();
        attr.attr = "salience";
        attr.defaultValue = "66";
        dt.attributeCols.add( attr );

        ConditionCol con = new ConditionCol();
View Full Code Here

Examples of org.drools.ide.common.client.modeldriven.dt.AttributeCol

        MetadataCol md = new MetadataCol();
        md.attr = "legacy";
        md.defaultValue = "yes";
        dt.getMetadataCols().add( md );

        AttributeCol attr = new AttributeCol();
        attr.attr = "salience";
        attr.defaultValue = "66";
        dt.attributeCols.add( attr );

        ConditionCol con = new ConditionCol();
View Full Code Here

Examples of org.drools.ide.common.client.modeldriven.dt.AttributeCol

        return data;
    }

    static AttributeCol newAttributeCol(String attr) {
        AttributeCol a = new AttributeCol();

        a.attr = attr;

        return a;
    }
View Full Code Here

Examples of org.drools.ide.common.client.modeldriven.dt.AttributeCol

            hp.add( new SmallLabel( constants.Attributes() ) );
            attributeConfigWidget.add( hp );
        }

        for (AttributeCol atc : dt.attributeCols) {
          final AttributeCol at = atc;
            HorizontalPanel hp = new HorizontalPanel();

            hp.add( new SmallLabel( at.attr ) );

            hp.add( removeAttr( at ) );
View Full Code Here

Examples of org.drools.ide.common.client.modeldriven.dt.AttributeCol

                                                   list.setSelectedIndex( 0 );

                                                   list.addChangeListener( new ChangeListener() {
                                                       public void onChange(Widget w) {
                                                           AttributeCol attr = new AttributeCol();
                                                           attr.attr = list.getItemText( list.getSelectedIndex() );

                                                           dt.attributeCols.add( attr );
                                                           scrapeData( dt.getMetadataCols().size() + dt.attributeCols.size() + 1 );
                                                           refreshGrid();
                                                           refreshAttributeWidget();
                                                           pop.hide();
                                                       }
                                                   } );

                                                   addbutton.setTitle( constants.AddMetadataToTheRule() );

                                                   addbutton.addClickListener( new ClickListener() {
                                                       public void onClick(Widget w) {
                                                           MetadataCol met = new MetadataCol();
                                                           met.attr = box.getText();
                                                           dt.getMetadataCols().add( met );
                                                           scrapeData( dt.getMetadataCols().size() + 1 );
                                                           refreshGrid();
                                                           refreshAttributeWidget();
                                                           pop.hide();
                                                       }
                                                   } );
                                                   DirtyableHorizontalPane horiz = new DirtyableHorizontalPane();
                                                   horiz.add( box );
                                                   horiz.add( addbutton );

                                                   pop.addAttribute( constants.Metadata1(),
                                                                     horiz );
                                                   pop.addAttribute( constants.Attribute(),
                                                                     list );
                                                   //            pop.addAttribute("", ok);
                                                   pop.show();
                                               }

                                               private void addItem(String at,
                                                                    final ListBox list) {
                                                   if ( !hasAttribute( at,
                                                                       dt.attributeCols ) ) list.addItem( at );
                                               }

                                               private boolean hasAttribute(String at,
                                                                            List<AttributeCol> attributeCols) {
                                                   for ( Iterator<AttributeCol> iterator = attributeCols.iterator(); iterator.hasNext(); ) {
                                                       AttributeCol c = iterator.next();
                                                       if ( c.attr.equals( at ) ) {
                                                           return true;
                                                       }
                                                   }
                                                   return false;
View Full Code Here

Examples of org.drools.ide.common.client.modeldriven.dt.AttributeCol

            colCount++;
        }

        //now to attributes
        for ( int i = 0; i < dt.attributeCols.size(); i++ ) {
            final AttributeCol attr = dt.attributeCols.get( i );
            fds[colCount] = new StringFieldDef( attr.attr );
            cols[colCount] = new ColumnConfig() {
                {
                    setHeader( attr.attr );
                    setDataIndex( attr.attr );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.