ActionFormList afl=new ActionFormList();
ActionsList afl=new ActionsList();
	public ManageButtonWindow(MainFrame mainFrame,ArrayList buttons) {		this.buttons = buttons;		/*if (buttons.get(buttons.size()-1).equals("Configurer la toolbar")){			buttons.remove(buttons.size()-1);		}*/		ActionFormList afl=new ActionFormList();		this.mainFrame = mainFrame;		operationOk = false;		lm = new GridBagLayout();		gbc = new GridBagConstraints();		final JFrame frame = new JFrame("ToolBar Manager");		//frame.setIconImage(Action.getImage("logo.gif"));		final RefListModel model_g = new RefListModel();		final JList list_g = new JList(model_g);		list_g.setToolTipText("Liste d'lments ajoutable");		JScrollPane sc_g = new JScrollPane();		sc_g.getViewport().setView(list_g);		final ButtonListModel model_d = new ButtonListModel(buttons);		list_d = new JList(model_d);		list_d.setToolTipText("Contenu de la barre");		JScrollPane sc_d = new JScrollPane();		sc_d.getViewport().setView(list_d);		JButton add = new JButton(new AddButton(mainFrame));		add.setText("");		add.setToolTipText((String) add.getAction().getValue(AbstractAction.NAME));		JButton rem = new JButton(new RemoveButton(mainFrame));		rem.setText("");		rem.setToolTipText((String) rem.getAction().getValue(AbstractAction.NAME));		JButton up = new JButton(new MoveUpButton(mainFrame));		up.setText("");		up.setToolTipText((String) up.getAction().getValue(AbstractAction.NAME));		JButton dw = new JButton(new MoveDownButton(mainFrame));		dw.setText("");		dw.setToolTipText((String) dw.getAction().getValue(AbstractAction.NAME));		JButton ok = new JButton("OK");		add.addActionListener(new ActionListener() {			public void actionPerformed(ActionEvent arg0) {			    int index = list_g.getSelectedIndex();			    if (index == ActionFormList.ACTIONS.size())			        model_d.add(null);			    else {					Action tmp = (Action) ActionFormList.ACTIONS.get(index);					if (tmp != null)						model_d.add(tmp);			    }			}		});		rem.addActionListener(new ActionListener() {			public void actionPerformed(ActionEvent e) {				int index = list_d.getSelectedIndex();				if (index != -1)					model_d.del(index);			}		});		up.addActionListener(new ActionListener() {			public void actionPerformed(ActionEvent e) {				int index = list_d.getSelectedIndex();				if (index != 0 && index != -1) {					model_d.up(index);					list_d.setSelectedIndex(index - 1);				}			}		});		dw.addActionListener(new ActionListener() {			public void actionPerformed(ActionEvent e) {				int index = list_d.getSelectedIndex();				if (index != model_d.getSize() && index != -1) {					model_d.dw(index);					list_d.setSelectedIndex(index + 1);				}			}		});		ok.addActionListener(new ActionListener() {			public void actionPerformed(ActionEvent e) {				operationOk = true;				listenerDone.actionPerformed(new ActionEvent(this, 0, "Done"));				frame.dispose();				return;			}		});		JPanel panel = new JPanel();		panel.setLayout(lm);		gbc.gridy = 0;		gbc.gridx = 0;		gbc.gridheight = 6;		gbc.gridwidth = 3;		addComponent(panel, sc_g, lm, gbc);		gbc.gridx = 6;		addComponent(panel, sc_d, lm, gbc);		gbc.gridy = 1;		gbc.gridx = 4;		gbc.gridheight = 1;		gbc.gridwidth = 1;		addComponent(panel, up, lm, gbc);		gbc.gridy = 2;		gbc.gridx = 3;		addComponent(panel, rem, lm, gbc);		gbc.gridy = 2;		gbc.gridx = 5;		addComponent(panel, add, lm, gbc);		gbc.gridy = 3;		gbc.gridx = 4;		addComponent(panel, dw, lm, gbc);		gbc.gridy = 5;		gbc.gridx = 4;		addComponent(panel, ok, lm, gbc);		frame.setContentPane(panel);		frame.pack();		Dimension d = Toolkit.getDefaultToolkit().getScreenSize();		int x = (int) ((d.getWidth() - frame.getWidth()) / 2);		int y = (int) ((d.getHeight() - frame.getHeight()) / 2);		frame.setLocation(x, y);		frame.setResizable(true);		frame.setVisible(true);	}