private void buildControl ( ) { buildControlPanel . reset ( ) ; buildTargetPanel . reset ( ) ; // Setup Trigger setupTrigger ( ) ; // Create target SubordinateTarget target = setupTarget ( ) ; // Create Actions com . github . bordertech . wcomponents . subordinate . Action trueAction ; com . github . bordertech . wcomponents . subordinate . Action falseAction ; switch ( ( ControlActionType ) drpActionType . getSelected ( ) ) { case ENABLE_DISABLE : trueAction = new Enable ( target ) ; falseAction = new Disable ( target ) ; break ; case SHOW_HIDE : trueAction = new Show ( target ) ; falseAction = new Hide ( target ) ; break ; case MAN_OPT : trueAction = new Mandatory ( target ) ; falseAction = new Optional ( target ) ; break ; case SHOWIN_HIDEIN : trueAction = new ShowInGroup ( target , targetGroup ) ; falseAction = new HideInGroup ( target , targetGroup ) ; break ; case ENABLEIN_DISABLEIN : trueAction = new EnableInGroup ( target , targetGroup ) ; falseAction = new DisableInGroup ( target , targetGroup ) ; break ; default : throw new SystemException ( "ControlAction type not valid" ) ; } // Create Condition Condition condition = createCondition ( ) ; if ( cbNot . isSelected ( ) ) { condition = new Not ( condition ) ; } // Create Rule Rule rule = new Rule ( condition , trueAction , falseAction ) ; // Create Subordinate WSubordinateControl control = new WSubordinateControl ( ) ; control . addRule ( rule ) ; buildControlPanel . add ( control ) ; if ( targetCollapsible . getDecoratedLabel ( ) != null ) { targetCollapsible . getDecoratedLabel ( ) . setTail ( new WText ( control . toString ( ) ) ) ; } control = new WSubordinateControl ( ) ; rule = new Rule ( new Equal ( cbClientDisableTrigger , true ) , new Disable ( ( SubordinateTarget ) trigger ) , new Enable ( ( SubordinateTarget ) trigger ) ) ; control . addRule ( rule ) ; buildControlPanel . add ( control ) ; }
Build the subordinate control .