public void onClick( ClickEvent w ) { editingCol.setFactField( box.getItemText( box.getSelectedIndex() ) ); editingCol.setType( oracle.getFieldType( factType, editingCol.getFactField() ) ); makeLimitedValueWidget(); makeDefaultValueWidget(); doFieldLabel(); doValueList(); pop.hide(); } } );
private ActionSetFieldCol52 makeNewActionColumn( final AvailableField f ) { final GuidedDecisionTable52.TableFormat format = presenter.getTableFormat(); if ( format == GuidedDecisionTable52.TableFormat.EXTENDED_ENTRY ) { final ActionSetFieldCol52 a = new ActionSetFieldCol52(); a.setBoundName( availablePatternsSelection.getBoundName() ); a.setFactField( f.getName() ); a.setType( f.getType() ); return a; } else { final LimitedEntryActionSetFieldCol52 a = new LimitedEntryActionSetFieldCol52(); a.setBoundName( availablePatternsSelection.getBoundName() ); a.setFactField( f.getName() ); a.setType( f.getType() ); return a; } }
asf.setBoundName( "x" ); asf.setFactField( "age" ); asf.setType( DataType.TYPE_NUMERIC_INTEGER ); asf.setUpdate( true );
private void populateModelColumn( final ActionSetFieldCol52 col, final ActionSetFieldCol52 editingCol ) { col.setBoundName( editingCol.getBoundName() ); col.setType( editingCol.getType() ); col.setFactField( editingCol.getFactField() ); col.setHeader( editingCol.getHeader() ); col.setValueList( editingCol.getValueList() ); col.setDefaultValue( editingCol.getDefaultValue() ); col.setHideColumn( editingCol.isHideColumn() ); col.setUpdate( editingCol.isUpdate() ); if ( col instanceof LimitedEntryCol && editingCol instanceof LimitedEntryCol ) { ( (LimitedEntryCol) col ).setValue( ( (LimitedEntryCol) editingCol ).getValue() ); } }
@Test public void testNoConstraints() { GuidedDecisionTable52 dt = new GuidedDecisionTable52(); Pattern52 p1 = new Pattern52(); p1.setBoundName( "x" ); p1.setFactType( "Context" ); ConditionCol52 c = new ConditionCol52(); c.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL ); p1.getChildColumns().add( c ); dt.getConditions().add( p1 ); ActionSetFieldCol52 asf = new ActionSetFieldCol52(); asf.setBoundName( "x" ); asf.setFactField( "age" ); asf.setType( DataType.TYPE_STRING ); dt.getActionCols().add( asf ); String[][] data = new String[][]{ new String[]{ "1", "desc", "y", "old" } }; dt.setData( DataUtilities.makeDataLists( data ) ); String drl = GuidedDTDRLPersistence.getInstance().marshal( dt ); assertTrue( drl.indexOf( "Context( )" ) > -1 ); assertTrue( drl.indexOf( "x.setAge" ) > drl.indexOf( "Context( )" ) ); assertFalse( drl.indexOf( "update( x );" ) > -1 ); dt.setData( DataUtilities.makeDataLists( new String[][]{ new String[]{ "1", "desc", "", "old" } } ) ); drl = GuidedDTDRLPersistence.getInstance().marshal( dt ); assertEquals( -1, drl.indexOf( "Context( )" ) ); }
private ActionSetFieldCol52 cloneActionSetColumn( ActionSetFieldCol52 col ) { ActionSetFieldCol52 clone = null; if ( col instanceof LimitedEntryActionSetFieldCol52 ) { clone = new LimitedEntryActionSetFieldCol52(); DTCellValue52 dcv = cloneLimitedEntryValue( ( (LimitedEntryCol) col ).getValue() ); ( (LimitedEntryCol) clone ).setValue( dcv ); } else { clone = new ActionSetFieldCol52(); } clone.setBoundName( col.getBoundName() ); clone.setFactField( col.getFactField() ); clone.setHeader( col.getHeader() ); clone.setType( col.getType() ); clone.setValueList( col.getValueList() ); clone.setUpdate( col.isUpdate() ); clone.setDefaultValue( new DTCellValue52( col.getDefaultValue() ) ); clone.setHideColumn( col.isHideColumn() ); return clone; }