Package org.drools.ide.common.client.modeldriven.dt

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


        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

        return data;
    }

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

        a.attr = attr;

        return a;
    }
View Full Code Here

            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

                                                   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

            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

            }
        } );

        dt = new TypeSafeGuidedDecisionTable();

        at1 = new AttributeCol();
        at1.setAttribute( "salience" );
        at2 = new AttributeCol();
        at2.setAttribute( "enabled" );

        dt.getAttributeCols().add( at1 );
        dt.getAttributeCols().add( at2 );
View Full Code Here

            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

                                                   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

            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

Related Classes of org.drools.ide.common.client.modeldriven.dt.AttributeCol

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.