MetaDone
metadone.client.grasyla2.swing.JOptionGroupEngine Class Reference
Inheritance diagram for metadone.client.grasyla2.swing.JOptionGroupEngine:
Collaboration diagram for metadone.client.grasyla2.swing.JOptionGroupEngine:

List of all members.

Public Member Functions

 JOptionGroupEngine (GrasylaContext context, ConcreteObject expression, Engine parent) throws BadPreCondition

Protected Member Functions

Component<?extends JComponent > evaluateComponent (BootstrapGrasyla grasyla) throws BadPreCondition
void reselect (String value)
void disposeInternal ()
void notifyChildChanged (Engine child, ChildComponent comp)

Private Member Functions

Component<?extends JComponent > rebuild () throws BadPreCondition

Private Attributes

final ActionListener listener
boolean enabled = true
ButtonGroup group

Detailed Description

Builds an option group.

Attributes

Contents

The different possibilities as String.

Result

A component containing a JRadioButton for each possibility.

Actions
"validate"
Author:
kma

Constructor & Destructor Documentation

metadone.client.grasyla2.swing.JOptionGroupEngine.JOptionGroupEngine ( GrasylaContext  context,
ConcreteObject  expression,
Engine  parent 
) throws BadPreCondition

Initializes this engine.

Parameters:
contextThe context
expressionThe expression
parentThe parent or null
Exceptions:
BadPreCondition

References metadone.client.grasyla2.swing.JOptionGroupEngine.enabled, metadone.client.grasyla2.swing.GrasylaSwingHelper.registerAttributeHandlers(), and metadone.client.grasyla2.swing.JOptionGroupEngine.reselect().


Member Function Documentation

void metadone.client.grasyla2.swing.JOptionGroupEngine.disposeInternal ( ) [protected]
Component<? extends JComponent> metadone.client.grasyla2.swing.JOptionGroupEngine.evaluateComponent ( BootstrapGrasyla  grasyla) throws BadPreCondition [protected]
void metadone.client.grasyla2.swing.JOptionGroupEngine.notifyChildChanged ( Engine  child,
ChildComponent  comp 
) [protected]
Component<? extends JComponent> metadone.client.grasyla2.swing.JOptionGroupEngine.rebuild ( ) throws BadPreCondition [private]
void metadone.client.grasyla2.swing.JOptionGroupEngine.reselect ( String  value) [protected]

Reselects the value.

If no component has this value, the selection is cleared.

Parameters:
valueThe value to select

References metadone.util.Objects.equal().

Referenced by metadone.client.grasyla2.swing.JOptionGroupEngine.JOptionGroupEngine().


Member Data Documentation

Initial value:
 new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            if (isBuilding() || e == null) {
                return;
            } else {
                final String value = e.getActionCommand();
                final UserValueChangeEvent<?> event = new UserValueChangeEvent<String>(JOptionGroupEngine.this, e, value, "validate");
                event.trigger(true);

                
                for (final GrasylaEngine ch : getChildren()) {
                    final ChildComponent cc = getChildComponent(ch);
                    if (cc != null && "selected".equals(cc.getAttribute())) {
                        building(true);
                        try {
                            final String selected = cc.getComponent(String.class).reduceComponent();
                            reselect(selected);
                        } catch (final IrreductibleException ex) {
                            logger.error("Failed to reduce the build component for selected", ex);
                        } finally {
                            building(false);
                        }
                        break;
                    }
                }
            }
        }
    }

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations