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

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


    // setup temp list
    List<RuleMetadata> metadataList = new ArrayList<RuleMetadata>();

    for (int j = 0; j < metadataCols.size(); j++) {
      MetadataCol meta = metadataCols.get(j);
      String cell = row[j + GuidedDecisionTable.INTERNAL_ELEMENTS];
      if (validCell(cell)) {
        metadataList.add(new RuleMetadata(meta.attr, cell));
      }
    }
View Full Code Here


    dt.getActionCols().add(new ActionInsertFactCol());
    ActionSetFieldCol set = new ActionSetFieldCol();
    set.setFactField( "foo" );
    dt.getActionCols().add(set);

    dt.getMetadataCols().add(new MetadataCol());

    dt.getAttributeCols().add(new AttributeCol());

    dt.getConditionCols().add(new ConditionCol());
View Full Code Here

        // p.doAttribs(0,metadataCols, row, rm);

        assertSame( orig,
                    rm.metadataList );

        MetadataCol col1 = new MetadataCol();
        col1.setMetadata( "foo" );
        MetadataCol col2 = new MetadataCol();
        col2.setMetadata( "foo2" );
        metadataCols.add( col1 );
        metadataCols.add( col2 );

        p.doMetadata( metadataCols,
                      row,
View Full Code Here

    p.doMetadata(metadataCols, row, rm);
//    p.doAttribs(0,metadataCols, row, rm);

    assertSame(orig, rm.metadataList);

    MetadataCol col1 = new MetadataCol();
    col1.attr = "foo";
    MetadataCol col2 = new MetadataCol();
    col2.attr = "foo2";
    metadataCols.add(col1);
    metadataCols.add(col2);

    p.doMetadata(metadataCols, row, rm);
View Full Code Here

    dt.actionCols.add(new ActionInsertFactCol());
    ActionSetFieldCol set = new ActionSetFieldCol();
    set.factField = "foo";
    dt.actionCols.add(set);

    dt.getMetadataCols().add(new MetadataCol());

    dt.attributeCols.add(new AttributeCol());

    dt.conditionCols.add(new ConditionCol());
View Full Code Here

            HorizontalPanel hp = new HorizontalPanel();
            hp.add( new HTML( "&nbsp;&nbsp;&nbsp;&nbsp;" ) );
            hp.add( removeMeta( atc ) );
            hp.add( new SmallLabel( atc.getMetadata() ) );

            final MetadataCol at = atc;
            final CheckBox hide = new CheckBox();
            hide.setValue( atc.isHideColumn() );
            hide.addClickHandler( new ClickHandler() {
                public void onClick(ClickEvent sender) {
                    at.setHideColumn( hide.getValue() );
                    dtable.setColumnVisibility( at,
                                                !at.isHideColumn() );
                }
            } );
            hp.add( new HTML( "&nbsp;&nbsp;" ) );
            hp.add( hide );
            hp.add( new SmallLabel( constants.HideThisColumn() ) );

            attributeConfigWidget.add( hp );
        }
        if ( guidedDecisionTable.getAttributeCols().size() > 0 ) {
            HorizontalPanel hp = new HorizontalPanel();
            hp.add( new HTML( "&nbsp;&nbsp;" ) );
            hp.add( new SmallLabel( constants.Attributes() ) );
            attributeConfigWidget.add( hp );
        }

        for ( AttributeCol atc : guidedDecisionTable.getAttributeCols() ) {
            final AttributeCol at = atc;
            HorizontalPanel hp = new HorizontalPanel();

            hp.add( new HTML( "&nbsp;&nbsp;&nbsp;&nbsp;" ) );
            hp.add( removeAttr( at ) );
            hp.add( new SmallLabel( at.getAttribute() ) );

            final TextBox defaultValue = new TextBox();
            defaultValue.setText( at.getDefaultValue() );
            defaultValue.addChangeHandler( new ChangeHandler() {
                public void onChange(ChangeEvent event) {
                    at.setDefaultValue( defaultValue.getText() );
                }
            } );

            if ( at.getAttribute().equals( RuleAttributeWidget.SALIENCE_ATTR ) ) {
                hp.add( new HTML( "&nbsp;&nbsp;" ) );
                final CheckBox useRowNumber = new CheckBox();
                useRowNumber.setValue( at.isUseRowNumber() );

                hp.add( useRowNumber );
                hp.add( new SmallLabel( constants.UseRowNumber() ) );
                hp.add( new SmallLabel( "(" ) );
                final CheckBox reverseOrder = new CheckBox();
                reverseOrder.setValue( at.isReverseOrder() );
                reverseOrder.setEnabled( at.isUseRowNumber() );

                useRowNumber.addClickHandler( new ClickHandler() {
                    public void onClick(ClickEvent sender) {
                        at.setUseRowNumber( useRowNumber.getValue() );
                        reverseOrder.setEnabled( useRowNumber.getValue() );
                        dtable.updateSystemControlledColumnValues();
                        dtable.redrawSystemControlledColumns();
                    }
                } );

                reverseOrder.addClickHandler( new ClickHandler() {
                    public void onClick(ClickEvent sender) {
                        at.setReverseOrder( reverseOrder.getValue() );
                        dtable.updateSystemControlledColumnValues();
                        dtable.redrawSystemControlledColumns();
                    }
                } );
                hp.add( reverseOrder );
                hp.add( new SmallLabel( constants.ReverseOrder() ) );
                hp.add( new SmallLabel( ")" ) );
            }
            hp.add( new HTML( "&nbsp;&nbsp;" ) );
            hp.add( new SmallLabel( constants.DefaultValue() ) );
            hp.add( defaultValue );

            final CheckBox hide = new CheckBox();
            hide.setValue( at.isHideColumn() );
            hide.addClickHandler( new ClickHandler() {
                public void onClick(ClickEvent sender) {
                    at.setHideColumn( hide.getValue() );
                    dtable.setColumnVisibility( at,
                                                !at.isHideColumn() );
                }
            } );
            hp.add( new HTML( "&nbsp;&nbsp;" ) );
            hp.add( hide );
            hp.add( new SmallLabel( constants.HideThisColumn() ) );
View Full Code Here

                                                           if ( !isUnique( metadata ) ) {
                                                               Window.alert( constants
                                                                       .ThatColumnNameIsAlreadyInUsePleasePickAnother() );
                                                               return;
                                                           }
                                                           MetadataCol met = new MetadataCol();
                                                           met.setHideColumn( true );
                                                           met.setMetadata( metadata );
                                                           dtable.addColumn( met );
                                                           dtable.scrapeColumns();
                                                           refreshAttributeWidget();
                                                           pop.hide();
                                                       }
View Full Code Here

        dt.getActionCols().add( new ActionInsertFactCol() );
        ActionSetFieldCol set = new ActionSetFieldCol();
        set.setFactField( "foo" );
        dt.getActionCols().add( set );

        dt.getMetadataCols().add( new MetadataCol() );

        dt.getAttributeCols().add( new AttributeCol() );

        dt.getConditionCols().add( new ConditionCol() );
View Full Code Here

        // add cols for LHS
        RowNumberCol rnc = new RowNumberCol();
        DescriptionCol dc = new DescriptionCol();

        MetadataCol mdc = new MetadataCol();
        mdc.setMetadata( "cheese" );

        AttributeCol ac = new AttributeCol();
        ac.setAttribute( "salience" );

        ActionSetFieldCol asfc = new ActionSetFieldCol();
View Full Code Here

    public void testConversion() {

        GuidedDecisionTable dt = new GuidedDecisionTable();
        dt.setTableName( "michael" );

        MetadataCol md = new MetadataCol();
        md.setMetadata( "legacy" );
        md.setDefaultValue( "yes" );
        dt.getMetadataCols().add( md );

        AttributeCol attr = new AttributeCol();
        attr.setAttribute( "salience" );
        attr.setDefaultValue( "66" );
View Full Code Here

TOP

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

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.