mainPanel = new SForm(); mainPanel.setEncodingType("multipart/form-data");
mainPanel = new SPanel();
    public LdapClient()        throws Exception    {                frame = new SFrame("LDAP Client");        stats = ResourceBundle.getBundle("ldap.AttributeResources", crtLocale);        SContainer contentPane = frame.getContentPane();        tabbedPane = new STabbedPane();        contentPane.setLayout(new SFlowLayout());        //contentPane.setLayout(new STemplateLayout(getClass().getResource("ldapclient.html")));	        settingsForm = new SForm(new SGridLayout(2));        tabbedPane.add(settingsForm, CONNECTIONSETTINGS);	        SLabel descServer = new SLabel("sever:port");        server = new STextField("");        server.setColumns(columns);        server.setText((String)SessionManager.getSession().getProperty("java.naming.provider.url"));        settingsForm.add(descServer);        settingsForm.add(server);	        SLabel descBaseDN = new SLabel("base DN");        baseDN = new STextField();        baseDN.setColumns(columns);        baseDN.setText((String)SessionManager.getSession().getProperty("java.naming.provider.basedn"));        settingsForm.add(descBaseDN);        settingsForm.add(baseDN);	        SLabel descBindDN = new SLabel("bind DN");        bindDN= new STextField();        bindDN.setText((String)SessionManager.getSession().getProperty("java.naming.security.principal"));        bindDN.setColumns(columns);        settingsForm.add(descBindDN);        settingsForm.add(bindDN);	        SLabel descBindDNPassword = new SLabel("password");        bindDNPassword= new SPasswordField();        bindDNPassword.setText((String)SessionManager.getSession().getProperty("java.naming.security.credentials"));        bindDNPassword.setColumns(columns);        settingsForm.add(descBindDNPassword);        settingsForm.add(bindDNPassword);	        connectButton = new SButton("connect");        disconnectButton = new SButton("disconnect");        disconnectButton.setVisible(false);        settingsForm.add(connectButton);        settingsForm.add(disconnectButton);        mainPanel = new SForm();        mainPanel.setEncodingType("multipart/form-data");        try {            mainPanel.setLayout(new STemplateLayout(getClass().getResource("ldapclientlayout.html")));        }        catch(Exception e) {	    logger.log(Level.WARNING, "no template", e);        }        tabbedPane.add(mainPanel, "Browser");        createTreeModel(null);        createTree();        editPanel = new EditObjectPanel();        mainPanel.add(tree,"tree");        mainPanel.add(editPanel, "editor");        addPanel = new AddObjectPanel();        tabbedPane.add(addPanel, "Neues Objekt");        contentPane.add(tabbedPane);        connectButton.addActionListener(new ActionListener() {		public void actionPerformed(ActionEvent e) {		    worker = new LdapWorker(server.getText(),					    baseDN.getText(),					    bindDN.getText(),					    bindDNPassword.getText());		    		    boolean success = worker.getSuccess();		    if (success) {			connectButton.setVisible(false);			server.setVisible(false);			baseDN.setVisible(false);			bindDN.setVisible(false);			bindDNPassword.setVisible(false);						disconnectButton.setVisible(true);			tabbedPane.setSelectedIndex(1);		    }		    else {			connectButton.setVisible(true);			disconnectButton.setVisible(false);		    }		    		    if (success) {			setLdapWorker(worker);			createTreeModel(worker);			tree.setModel(treeModel);		    }		}	    });	        disconnectButton.addActionListener(new ActionListener() {		public void actionPerformed(ActionEvent e) {		    createTreeModel(null);		    tree.setModel(treeModel);		    bindDNPassword.setText("");		    disconnectButton.setVisible(false);		    connectButton.setVisible(true);		    server.setVisible(true);		    bindDN.setVisible(true);		    bindDNPassword.setVisible(true);		    baseDN.setVisible(true);		    bindDNPassword.setText("");		}	    });        frame.show();        System.out.println(SessionManager.getSession().getServletRequest().getAuthType());            }