public void actionPerformed(ActionEvent e) { int i = 0; ArrayList remElements = new ArrayList(); while (obj!=null && i< obj.size()) { System.out.println(obj.get(i)); String o = (String)obj.get(i);  remElements.add(o); SComponent attrField; if (!((String)o).equals("jpegPhoto")) { attrField = new STextField(""); ((STextField)attrField).setColumns(columns); textHashtable.put(o,"uu"); } else { attrField = new SLabel("");
public void actionPerformed(ActionEvent e) { int i = 0; ArrayList remElements = new ArrayList(); while (obj!=null && i< obj.size()) {  String o = (String)obj.get(i); remElements.add(o); SComponent attrField; if (!((String)o).equals("jpegPhoto")) { if (((String)o).equals("userPassword")) { attrField = new SPasswordField(); ((SPasswordField)attrField).setColumns(columns); ((SPasswordField)attrField).setText(""); textHashtable.put(o,""); } else { attrField = new STextField(""); ((STextField)attrField).setColumns(columns); textHashtable.put(o,""); } } else { attrField = new SLabel(""); } componentTable.put(o,attrField); i++; } existentAttrsF.removeAll(); Enumeration compEnum; compEnum = componentTable.keys();  addEditableComponents(componentTable);  for (int l = 0;l<remElements.size();l++) { int j = obj.indexOf(remElements.get(l)); objectAttributes.remove(j); } otherAttrsL.setListData(objectAttributes);
    void initGUI() {        tabbedPane = new STabbedPane();        getFrame().getContentPane().setLayout(new SFlowLayout());        getFrame().getContentPane().add(tabbedPane);        settingsForm = new SForm(new SGridLayout(2));        tabbedPane.add(settingsForm, "Connection Settings");        SLabel descServer = new SLabel("sever:port");        final STextField server = new STextField("");        server.setColumns(30);        server.setText(((PropertyService)getSession()).getProperty("ldap.server.host"));        settingsForm.add(descServer);        settingsForm.add(server);        SLabel descBaseDN = new SLabel("base DN");        final STextField baseDN = new STextField();        baseDN.setColumns(30);        baseDN.setText(((PropertyService)getSession()).getProperty("ldap.server.basedn"));        settingsForm.add(descBaseDN);        settingsForm.add(baseDN);        SLabel descBindDN = new SLabel("bind DN");        final STextField bindDN= new STextField();        bindDN.setText(((PropertyService)getSession()).getProperty("ldap.server.binddn"));        bindDN.setColumns(30);        settingsForm.add(descBindDN);        settingsForm.add(bindDN);        SLabel descBindDNPassword = new SLabel("password");        final SPasswordField bindDNPassword= new SPasswordField();        bindDNPassword.setColumns(30);        settingsForm.add(descBindDNPassword);        settingsForm.add(bindDNPassword);        final SButton connectButton = new SButton("connect");        //final SButton disconnectButton = new SButton("disconnect");        //disconnectButton.setVisible(false);        settingsForm.add(connectButton);        //settingsForm.add(disconnectButton);        try {            mainPanel = new SForm(new STemplateLayout(getClass().getResource("ldapclientlayout.html")));	    mainPanel.setEncodingType("multipart/form-data");        }        catch(Exception e) {            System.err.println("LdapClientSession::initGUI() -> " + e);        }        //mainPanel.setEncodingType("multipart/form-data");	Image img = Toolkit.getDefaultToolkit().createImage(getClass().getResource("images/LDAPworm.gif"));        mainPanel.add(new SImage( img ) ,"BOTTOMIMAGE");        tabbedPane.add(mainPanel, "Browser");        createTreeModel(null);        createTree();	        mainPanel.add(tree,"TREE");		//attrPanel.setLayout(new SGridLayout(2));                existentAttrsF = new SForm(new SGridLayout(2));        existentAttrsF.setEncodingType("multipart/form-data");        otherAttrsF = new SForm(new SFlowDownLayout());        addAttribute = new SButton("add Attribute");        addAttribute.addActionListener(new ActionListener() {            public void actionPerformed(ActionEvent e) {                int i = 0;                ArrayList remElements = new ArrayList();                while (obj!=null && i< obj.size()) {                System.out.println(obj.get(i));                String o = (String)obj.get(i);                		remElements.add(o);		SComponent attrField;		if (!((String)o).equals("jpegPhoto")) {		    attrField = new STextField("");		    ((STextField)attrField).setColumns(columns);		    textHashtable.put(o,"uu");		}		else {		    attrField = new SLabel("");		}				componentTable.put(o,attrField);		i++;                }                existentAttrsF.removeAll();                Enumeration compEnum;                compEnum = componentTable.keys();                addEditableComponents(componentTable);                System.out.println("groesse  " + remElements.size());                for (int l = 0;l<remElements.size();l++) {                int j = obj.indexOf(remElements.get(l));                System.out.println("ausgesucht  " + remElements.get(l));                objectAttributes.remove(j);                }                otherAttrsL.setListData(objectAttributes);            }        });	        mainPanel.add(existentAttrsF,"OBJECTATTRIBUTES");        mainPanel.add(otherAttrsF,"ATTRIBUTELIST");	        commitButton = new SButton("Commit");        commitButton.addActionListener(this);		removeButton = new SButton("Remove entry");	removeButton.addActionListener(this);        addPanel = new AddObjectsPanel();        tabbedPane.add(addPanel, "Add new Object");	disconnectButton = new SButton();	tabbedPane.add(disconnectButton,"Disconnect");	disconnectButton.addActionListener(new ActionListener() {		public void actionPerformed(ActionEvent e) {		    tabbedPane.setSelectedIndex(1);		    System.out.println("disconnect");		}	    });	        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) {			System.out.println("visible false");						settingsForm.setVisible(false);			settingsForm.removeAll();			//connectButton.setVisible(false);						//disconnectButton.setVisible(true);			tabbedPane.setSelectedIndex(1);		    }		    else {			connectButton.setVisible(true);			//disconnectButton.setVisible(false);		    }		    		    if (success) {			setLdapWorker(worker);			createTreeModel(worker);			tree.setModel(treeModel);			addPanel.setWorker(worker);			addPanel.setTree(tree);		    }		}	    });	        /*disconnectButton.addActionListener(new ActionListener() {		public void actionPerformed(ActionEvent e) {		    createTreeModel(null);		    tree.setModel(treeModel);		    //attrPanel.removeAll();		                bindDNPassword.setText("");		                disconnectButton.setVisible(false);		connectButton.setVisible(true);		}		});*/    }