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

List of all members.

Public Member Functions

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

Protected Member Functions

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

Private Member Functions

void clearTabs ()
void updateTabs ()

Private Attributes

final PropertyChangeListener nameChangeListener
JTabbedPane tabs

Detailed Description

Builds a tabbed pane.

Attributes

Contents

Evaluated as JComponent. Each of the swing components will be shown in a separate tab. The name of that tab will be the name of the contained component, see JComponent#getName().

Result
A JTabbedPane.
Author:
kma

Constructor & Destructor Documentation

metadone.client.grasyla2.swing.JTabbedPaneEngine.JTabbedPaneEngine ( 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.GrasylaSwingHelper.registerAttributeHandlers().


Member Function Documentation

void metadone.client.grasyla2.swing.JTabbedPaneEngine.disposeInternal ( ) [protected]
Component<? extends JTabbedPane> metadone.client.grasyla2.swing.JTabbedPaneEngine.evaluateComponent ( BootstrapGrasyla  grasyla) throws BadPreCondition [protected]
void metadone.client.grasyla2.swing.JTabbedPaneEngine.notifyChildChanged ( Engine  child,
ChildComponent  comp 
) [protected]

Member Data Documentation

Initial value:
 new PropertyChangeListener() {
        @Override
        public void propertyChange(PropertyChangeEvent evt) {
            if (!"name".equals(evt.getPropertyName()))
                return;
            JComponent object = Objects.cast(JComponent.class, evt.getSource());
            if (object == null) {
                logger.warn("Failed to update the name as the source is not a JComponent");
                return;
            }
            int index = tabs.indexOfComponent(object);
            if (index >= 0) {
                tabs.setTitleAt(index, object.getName());
            }
        }
    }

Referenced by metadone.client.grasyla2.swing.JTabbedPaneEngine.clearTabs(), and metadone.client.grasyla2.swing.JTabbedPaneEngine.updateTabs().


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