// _StructureSimpleChooser_EOArchive.java
// Generated by EnterpriseObjects palette at jeudi 28 juin 2007 15 h 39 Europe/Paris

package Structure.client;

import Structure.client.JTreeController;
import com.webobjects.eoapplication.*;
import com.webobjects.eocontrol.*;
import com.webobjects.eointerface.*;
import com.webobjects.eointerface.swing.*;
import com.webobjects.eointerface.swing.EOTable._EOTableColumn;
import com.webobjects.foundation.*;
import java.awt.*;
import javax.swing.*;
import javax.swing.border.*;
import javax.swing.table.*;
import javax.swing.text.*;

public class _StructureSimpleChooser_EOArchive extends com.webobjects.eoapplication.EOArchive {
    Structure.client.JTreeController _jTreeController0;
    com.webobjects.eocontrol.EODataSource _eoDataSource0, _eoDataSource1;
    com.webobjects.eocontrol.EODetailDataSource _eoDetailDataSource0;
    com.webobjects.eocontrol.EOEditingContext _eoEditingContext0;
    com.webobjects.eointerface.EOActionAssociation _eoActionAssociation0, _eoActionAssociation1;
    com.webobjects.eointerface.EODisplayGroup _eoDisplayGroup0, _eoDisplayGroup1, _eoDisplayGroup2, _eoDisplayGroup3;
    com.webobjects.eointerface.EOMasterDetailAssociation _eoMasterDetailAssociation0;
    com.webobjects.eointerface.EOTableAssociation _eoTableAssociation0;
    com.webobjects.eointerface.EOTableColumnAssociation _eoTableColumnAssociation0;
    com.webobjects.eointerface.swing.EOFrame _eoFrame0;
    com.webobjects.eointerface.swing.EOTable _nsTableView0;
    com.webobjects.eointerface.swing.EOTable._EOTableColumn _eoTableColumn0;
    javax.swing.JButton _nsButton0, _nsButton1, _nsButton2;
    javax.swing.JPanel _nsView0;
    javax.swing.JScrollPane _nsCustomView0;

    public _StructureSimpleChooser_EOArchive(Object owner, NSDisposableRegistry registry) {
        super(owner, registry);
    }

    protected void _construct() {
        Object owner = _owner();
        EOArchive._ObjectInstantiationDelegate delegate = (owner instanceof EOArchive._ObjectInstantiationDelegate) ? (EOArchive._ObjectInstantiationDelegate)owner : null;
        Object replacement;

        super._construct();

        _nsButton2 = (javax.swing.JButton)_registered(new javax.swing.JButton("Rafraichir"), "NSButton31142");

        if ((delegate != null) && ((replacement = delegate.objectForOutletPath(this, "treeController.editingContext")) != null)) {
            _eoEditingContext0 = (replacement == EOArchive._ObjectInstantiationDelegate.NullObject) ? null : (com.webobjects.eocontrol.EOEditingContext)replacement;
            _replacedObjects.setObjectForKey(replacement, "_eoEditingContext0");
        } else {
            _eoEditingContext0 = ((com.webobjects.eocontrol.EOEditingContext.substitutionEditingContext() != null) ? com.webobjects.eocontrol.EOEditingContext.substitutionEditingContext() : (com.webobjects.eocontrol.EOEditingContext)_registered(new com.webobjects.eocontrol.EOEditingContext(), "EditingContext"));
        }

        if ((delegate != null) && ((replacement = delegate.objectForOutletPath(this, "treeController.treeDG.dataSource")) != null)) {
            _eoDataSource0 = (replacement == EOArchive._ObjectInstantiationDelegate.NullObject) ? null : (com.webobjects.eocontrol.EODataSource)replacement;
            _replacedObjects.setObjectForKey(replacement, "_eoDataSource0");
        } else {
            _eoDataSource0 = (com.webobjects.eocontrol.EODataSource)_registered(com.webobjects.eoapplication.EODataSourceFactory.defaultDataSourceFactory().newMasterDataSource(_eoEditingContext0, "VStructureRoots", null), "DataSource");
        }

        _eoDetailDataSource0 = (com.webobjects.eocontrol.EODetailDataSource)_registered(new com.webobjects.eocontrol.EODetailDataSource(_eoDataSource0, "toStructuresFilles"), "DataSource");

        if ((delegate != null) && ((replacement = delegate.objectForOutletPath(this, "treeController.treeDG.delegate.fillesDG")) != null)) {
            _eoDisplayGroup0 = (replacement == EOArchive._ObjectInstantiationDelegate.NullObject) ? null : (com.webobjects.eointerface.EODisplayGroup)replacement;
            _replacedObjects.setObjectForKey(replacement, "_eoDisplayGroup0");
        } else {
            _eoDisplayGroup0 = (com.webobjects.eointerface.EODisplayGroup)_registered(new com.webobjects.eointerface.EODisplayGroup(), "ST_Filles");
        }

        _eoMasterDetailAssociation0 = (com.webobjects.eointerface.EOMasterDetailAssociation)_registered(new com.webobjects.eointerface.EOMasterDetailAssociation(_eoDisplayGroup0), "");

        if ((delegate != null) && ((replacement = delegate.objectForOutletPath(this, "treeController.peerDG")) != null)) {
            _eoDisplayGroup3 = (replacement == EOArchive._ObjectInstantiationDelegate.NullObject) ? null : (com.webobjects.eointerface.EODisplayGroup)replacement;
            _replacedObjects.setObjectForKey(replacement, "_eoDisplayGroup3");
        } else {
            _eoDisplayGroup3 = (com.webobjects.eointerface.EODisplayGroup)_registered(new com.webobjects.eointerface.EODisplayGroup(), "STStructureUlr");
        }

        _eoDataSource1 = (com.webobjects.eocontrol.EODataSource)_registered(com.webobjects.eoapplication.EODataSourceFactory.defaultDataSourceFactory().newMasterDataSource(_eoEditingContext0, "STStructureUlr", null), "DataSource");
        _nsButton1 = (javax.swing.JButton)_registered(new javax.swing.JButton("<"), "NSButton3111");
        _eoActionAssociation1 = (com.webobjects.eointerface.EOActionAssociation)_registered(new com.webobjects.eointerface.EOActionAssociation(_nsButton1), "");
        _nsButton0 = (javax.swing.JButton)_registered(new javax.swing.JButton("<"), "NSButton311");
        _eoActionAssociation0 = (com.webobjects.eointerface.EOActionAssociation)_registered(new com.webobjects.eointerface.EOActionAssociation(_nsButton0), "");
        _eoTableColumn0 = (com.webobjects.eointerface.swing.EOTable._EOTableColumn)_registered(new com.webobjects.eointerface.swing.EOTable._EOTableColumn(), "NSTableColumn1");
        _nsTableView0 = (com.webobjects.eointerface.swing.EOTable)_registered(new com.webobjects.eointerface.swing.EOTable(), "NSTableView");
        _eoTableColumnAssociation0 = (com.webobjects.eointerface.EOTableColumnAssociation)_registered(new com.webobjects.eointerface.EOTableColumnAssociation(_eoTableColumn0, _nsTableView0), "");
        _eoTableAssociation0 = (com.webobjects.eointerface.EOTableAssociation)_registered(new com.webobjects.eointerface.EOTableAssociation(_nsTableView0), "");

        if ((delegate != null) && ((replacement = delegate.objectForOutletPath(this, "treeController.controllerDG")) != null)) {
            _eoDisplayGroup2 = (replacement == EOArchive._ObjectInstantiationDelegate.NullObject) ? null : (com.webobjects.eointerface.EODisplayGroup)replacement;
            _replacedObjects.setObjectForKey(replacement, "_eoDisplayGroup2");
        } else {
            _eoDisplayGroup2 = (com.webobjects.eointerface.EODisplayGroup)_registered(new com.webobjects.eointerface.EODisplayGroup(), "OtherKeysValues");
        }

        if ((delegate != null) && ((replacement = delegate.objectForOutletPath(this, "treeController.treeDG")) != null)) {
            _eoDisplayGroup1 = (replacement == EOArchive._ObjectInstantiationDelegate.NullObject) ? null : (com.webobjects.eointerface.EODisplayGroup)replacement;
            _replacedObjects.setObjectForKey(replacement, "_eoDisplayGroup1");
        } else {
            _eoDisplayGroup1 = (com.webobjects.eointerface.EODisplayGroup)_registered(new com.webobjects.eointerface.EODisplayGroup(), "ParcoursStruct");
        }

        if ((delegate != null) && ((replacement = delegate.objectForOutletPath(this, "treeController.treeDG.delegate")) != null)) {
            _jTreeController0 = (replacement == EOArchive._ObjectInstantiationDelegate.NullObject) ? null : (Structure.client.JTreeController)replacement;
            _replacedObjects.setObjectForKey(replacement, "_jTreeController0");
        } else {
            _jTreeController0 = (Structure.client.JTreeController)_registered(new Structure.client.JTreeController(), "JTreeController");
        }

        if ((delegate != null) && ((replacement = delegate.objectForOutletPath(this, "treeController.scrollPane")) != null)) {
            _nsCustomView0 = (replacement == EOArchive._ObjectInstantiationDelegate.NullObject) ? null : (javax.swing.JScrollPane)replacement;
            _replacedObjects.setObjectForKey(replacement, "_nsCustomView0");
        } else {
            _nsCustomView0 = (javax.swing.JScrollPane)_registered(new javax.swing.JScrollPane(), "View");
        }

        if ((delegate != null) && ((replacement = delegate.objectForOutletPath(this, "component")) != null)) {
            _eoFrame0 = (replacement == EOArchive._ObjectInstantiationDelegate.NullObject) ? null : (com.webobjects.eointerface.swing.EOFrame)replacement;
            _replacedObjects.setObjectForKey(replacement, "_eoFrame0");
        } else {
            _eoFrame0 = (com.webobjects.eointerface.swing.EOFrame)_registered(new com.webobjects.eointerface.swing.EOFrame(), "ChoixStructures");
        }

        _nsView0 = (JPanel)_eoFrame0.getContentPane();
    }

    protected void _awaken() {
        super._awaken();

        if (_replacedObjects.objectForKey("_eoDisplayGroup1") == null) {
            _connect(_owner(), _eoDisplayGroup1, "displayGroup");
        }

        if (_replacedObjects.objectForKey("_eoDisplayGroup2") == null) {
            _connect(_owner(), _eoDisplayGroup2, "controllerDisplayGroup");
        }

        if (_replacedObjects.objectForKey("_eoDisplayGroup1") == null) {
            _connect(_owner(), _eoDisplayGroup1, "treeDG");
        }

        if (_replacedObjects.objectForKey("_jTreeController0") == null) {
            _connect(_owner(), _jTreeController0, "treeController");
        }

        if (_replacedObjects.objectForKey("_eoFrame0") == null) {
            _connect(_owner(), _eoFrame0, "component");
        }

        if (_replacedObjects.objectForKey("_eoEditingContext0") == null) {
            _connect(_owner(), _eoEditingContext0, "editingContext");
        }
    }

    protected void _init() {
        super._init();
        _setFontForComponent(_nsButton2, "Lucida Grande", 10, Font.PLAIN);
        _nsButton2.setMargin(new Insets(0, 2, 0, 2));
        _nsButton2.addActionListener((com.webobjects.eointerface.swing.EOControlActionAdapter)_registered(new com.webobjects.eointerface.swing.EOControlActionAdapter(_jTreeController0, "refresh", _nsButton2), ""));

        if (_replacedObjects.objectForKey("_jTreeController0") == null) {
            _connect(_jTreeController0, _eoDisplayGroup0, "fillesDG");
        }

        if (_replacedObjects.objectForKey("_eoDisplayGroup0") == null) {
            _connect(_eoDisplayGroup0, _eoDetailDataSource0, "dataSource");
        }

        if (_replacedObjects.objectForKey("_eoDisplayGroup0") == null) {
            _eoDisplayGroup0.setValidatesChangesImmediately(true);
            _eoDisplayGroup0.setFetchesOnLoad(false);
            _eoDisplayGroup0.setUsesOptimisticRefresh(false);
            _eoDisplayGroup0.setSelectsFirstObjectAfterFetch(true);
            _eoDisplayGroup0.setLocalKeys(new com.webobjects.foundation.NSArray(new Object[] {"isLeaf", "delete"}));
        }

        _eoMasterDetailAssociation0.bindAspect(com.webobjects.eointerface.EOAssociation.ParentAspect, _eoDisplayGroup1, "toStructuresFilles");
        _eoMasterDetailAssociation0.establishConnection();

        if (_replacedObjects.objectForKey("_eoDisplayGroup1") == null) {
            _connect(_eoDisplayGroup1, _jTreeController0, "delegate");
        }

        if (_replacedObjects.objectForKey("_jTreeController0") == null) {
            _connect(_jTreeController0, _eoDisplayGroup3, "peerDG");
        }

        if (_replacedObjects.objectForKey("_eoDisplayGroup3") == null) {
            _eoDisplayGroup3.setValidatesChangesImmediately(false);
            _eoDisplayGroup3.setFetchesOnLoad(false);
            _eoDisplayGroup3.setUsesOptimisticRefresh(false);
            _eoDisplayGroup3.setSelectsFirstObjectAfterFetch(true);
            _eoDisplayGroup3.setLocalKeys(new com.webobjects.foundation.NSArray(new Object[] {"isleaf", "llStructureRecur"}));
        }

        if (_replacedObjects.objectForKey("_eoDisplayGroup3") == null) {
            _connect(_eoDisplayGroup3, _eoDataSource1, "dataSource");
        }

        _connect(_eoDataSource1, _eoEditingContext0, "editingContext");

        if (_replacedObjects.objectForKey("_eoDataSource0") == null) {
            _connect(_eoDataSource0, _eoEditingContext0, "editingContext");
        }

        if (_replacedObjects.objectForKey("_jTreeController0") == null) {
            _connect(_jTreeController0, _eoEditingContext0, "editingContext");
        }

        if (_replacedObjects.objectForKey("_jTreeController0") == null) {
            _connect(_jTreeController0, _eoDisplayGroup2, "controllerDG");
        }

        _setFontForComponent(_nsButton1, "Lucida Grande", 10, Font.PLAIN);
        _nsButton1.setMargin(new Insets(0, 2, 0, 2));
        _eoActionAssociation1.bindAspect(com.webobjects.eointerface.EOAssociation.ActionAspect, _eoDisplayGroup2, "setSenderStructureFromRoots");
        _eoActionAssociation1.establishConnection();
        _setFontForComponent(_nsButton0, "Lucida Grande", 10, Font.PLAIN);
        _nsButton0.setMargin(new Insets(0, 2, 0, 2));
        _eoActionAssociation0.bindAspect(com.webobjects.eointerface.EOAssociation.ActionAspect, _eoDisplayGroup2, "setSenderStructureFromTree");
        _eoActionAssociation0.bindAspect(com.webobjects.eointerface.EOAssociation.EnabledAspect, _eoDisplayGroup2, "structureSelectionAllowed");
        _eoActionAssociation0.establishConnection();
        _eoTableColumnAssociation0.bindAspect(com.webobjects.eointerface.EOAssociation.ValueAspect, _eoDisplayGroup1, "llStructure");
        _eoTableColumnAssociation0.establishConnection();
        _eoTableColumn0.setMinWidth(45);
        _eoTableColumn0.setMaxWidth(1600);
        _eoTableColumn0.setPreferredWidth(473);
        _eoTableColumn0.setWidth(473);
        _eoTableColumn0.setResizable(true);
        _eoTableColumn0.setHeaderValue("Racines");
        if ((_eoTableColumn0.getHeaderRenderer() != null)) {
        	((DefaultTableCellRenderer)(_eoTableColumn0.getHeaderRenderer())).setHorizontalAlignment(javax.swing.JTextField.LEFT);
        }
        _nsTableView0.table().addColumn(_eoTableColumn0);
        _setFontForComponent(_nsTableView0.table().getTableHeader(), "Lucida Grande", 11, Font.PLAIN);
        _nsTableView0.table().setRowHeight(20);
        _eoTableAssociation0.bindAspect(com.webobjects.eointerface.EOAssociation.SourceAspect, _eoDisplayGroup1, "");
        _eoTableAssociation0.bindAspect(com.webobjects.eointerface.EOAssociation.EnabledAspect, _eoDisplayGroup2, "alwaysDisabled");
        _eoTableAssociation0.setSortsByColumnOrder(true);
        _eoTableAssociation0.establishConnection();

        if (_replacedObjects.objectForKey("_eoDisplayGroup2") == null) {
            _eoDisplayGroup2.setValidatesChangesImmediately(true);
            _eoDisplayGroup2.setFetchesOnLoad(false);
            _eoDisplayGroup2.setUsesOptimisticRefresh(false);
            _eoDisplayGroup2.setSelectsFirstObjectAfterFetch(true);
            _eoDisplayGroup2.setLocalKeys(new com.webobjects.foundation.NSArray(new Object[] {"alwaysDisabled", "setSenderStructureFromTree", "setSenderStructureFromRoots", "structureSelectionAllowed"}));
        }

        if (_replacedObjects.objectForKey("_eoDisplayGroup1") == null) {
            _connect(_eoDisplayGroup1, _eoDataSource0, "dataSource");
        }

        if (_replacedObjects.objectForKey("_eoDisplayGroup1") == null) {
            _eoDisplayGroup1.setValidatesChangesImmediately(true);
            _eoDisplayGroup1.setFetchesOnLoad(false);
            _eoDisplayGroup1.setUsesOptimisticRefresh(false);
            _eoDisplayGroup1.setSelectsFirstObjectAfterFetch(true);
            _eoDisplayGroup1.setLocalKeys(new com.webobjects.foundation.NSArray(new Object[] {"isleaf"}));
        }

        if (_replacedObjects.objectForKey("_jTreeController0") == null) {
            _connect(_jTreeController0, _eoDisplayGroup1, "treeDG");
        }

        if (_replacedObjects.objectForKey("_jTreeController0") == null) {
            _connect(_jTreeController0, _nsCustomView0, "scrollPane");
        }

        if (!(_nsView0.getLayout() instanceof EOViewLayout)) { _nsView0.setLayout(new EOViewLayout()); }
        _nsCustomView0.setSize(493, 446);
        _nsCustomView0.setLocation(33, 109);
        ((EOViewLayout)_nsView0.getLayout()).setAutosizingMask(_nsCustomView0, EOViewLayout.WidthSizable | EOViewLayout.HeightSizable);
        _nsView0.add(_nsCustomView0);
        _nsTableView0.setSize(493, 87);
        _nsTableView0.setLocation(33, 14);
        ((EOViewLayout)_nsView0.getLayout()).setAutosizingMask(_nsTableView0, EOViewLayout.WidthSizable | EOViewLayout.MaxYMargin);
        _nsView0.add(_nsTableView0);
        _nsButton0.setSize(24, 448);
        _nsButton0.setLocation(-3, 107);
        ((EOViewLayout)_nsView0.getLayout()).setAutosizingMask(_nsButton0, EOViewLayout.MaxXMargin | EOViewLayout.HeightSizable);
        _nsView0.add(_nsButton0);
        _nsButton1.setSize(24, 89);
        _nsButton1.setLocation(-3, 12);
        ((EOViewLayout)_nsView0.getLayout()).setAutosizingMask(_nsButton1, EOViewLayout.MaxXMargin | EOViewLayout.MaxYMargin);
        _nsView0.add(_nsButton1);
        _nsButton2.setSize(66, 22);
        _nsButton2.setLocation(463, 566);
        ((EOViewLayout)_nsView0.getLayout()).setAutosizingMask(_nsButton2, EOViewLayout.MinXMargin | EOViewLayout.MinYMargin);
        _nsView0.add(_nsButton2);

        if (_replacedObjects.objectForKey("_eoFrame0") == null) {
            _nsView0.setSize(539, 593);
            _eoFrame0.setTitle("Choix d'une Structure");
            _eoFrame0.setLocation(447, 359);
            _eoFrame0.setSize(539, 593);
        }
    }
}
