if(cx.hasChanged()) {  int result = JOptionPane.showConfirmDialog(getContentPane(), "The configuration for the collection has changed, would you like to save the changes?", "Save Changes", JOptionPane.YES_NO_OPTION);  if(result == JOptionPane.YES_OPTION) {  cx.Save(); } }
saveChanges();
	private void setupComponents()	{		//Dialog Content Panel		GridBagLayout grid = new GridBagLayout();		getContentPane().setLayout(grid);				//Constraints for Layout		GridBagConstraints c = new GridBagConstraints();		c.insets = new Insets(2, 2, 2, 2);		//collection label		JLabel label = new JLabel("Collection");		c.gridx = 0;		c.gridy = 0;		c.gridwidth = 1;		c.anchor = GridBagConstraints.WEST;		c.fill = GridBagConstraints.NONE;		grid.setConstraints(label, c);		getContentPane().add(label);				//get the collections but not system collections		ArrayList alCollections = new ArrayList();        try        {            Collection root = client.getCollection(DBBroker.ROOT_COLLECTION);            ArrayList alAllCollections = getCollections(root, new ArrayList());            for(int i = 0; i < alAllCollections.size(); i++)            {            	if(alAllCollections.get(i).toString().indexOf(DBBroker.CONFIG_COLLECTION)  == -1)            	{            		alCollections.add(alAllCollections.get(i));            	}            }        }        catch (XMLDBException e)        {            //showErrorMessage(e.getMessage(), e);            return;        }                //Create a combobox listing the collections        JComboBox combo = new JComboBox(alCollections.toArray());        combo.addActionListener(new ActionListener(){        	public void actionPerformed(ActionEvent e)        	{        		//the collection has been changed        		if(cx.hasChanged())        		{        			//ask the user if they would like to save the changes        			int result = JOptionPane.showConfirmDialog(getContentPane(), "The configuration for the collection has changed, would you like to save the changes?", "Save Changes", JOptionPane.YES_NO_OPTION);        			        			if(result == JOptionPane.YES_OPTION)        			{        				//save the collection.xconf changes        				cx.Save();        			}        		}        		        		JComboBox cb = (JComboBox)e.getSource();   				actionGetIndexes(cb.getSelectedItem().toString());    		}        });        c.gridx = 1;		c.gridy = 0;		c.gridwidth = 1;		c.anchor = GridBagConstraints.WEST;        c.fill = GridBagConstraints.NONE;        grid.setConstraints(combo, c);        getContentPane().add(combo);        //Panel to hold controls relating to the FullText Index		JPanel panelFullTextIndex = new JPanel();		panelFullTextIndex.setBorder(new TitledBorder("Full Text Index"));		GridBagLayout panelFullTextIndexGrid = new GridBagLayout();		panelFullTextIndex.setLayout(panelFullTextIndexGrid);						//fulltext default all checkbox		chkDefaultAll = new JCheckBox("Default All");		chkDefaultAll.addActionListener(new ActionListener(){			public void actionPerformed(ActionEvent e)			{				cx.setFullTextIndexDefaultAll(chkDefaultAll.isSelected());			}		});		c.gridx = 0;		c.gridy = 0;		c.gridwidth = 1;		c.anchor = GridBagConstraints.WEST;		c.fill = GridBagConstraints.NONE;		panelFullTextIndexGrid.setConstraints(chkDefaultAll, c);		panelFullTextIndex.add(chkDefaultAll);        		//fulltext alphanumeric checkbox		chkAlphanum = new JCheckBox("Alphanumeric");		chkAlphanum.addActionListener(new ActionListener(){			public void actionPerformed(ActionEvent e)			{				cx.setFullTextIndexAlphanum(chkAlphanum.isSelected());			}		});		c.gridx = 0;		c.gridy = 1;		c.gridwidth = 1;		c.anchor = GridBagConstraints.WEST;		c.fill = GridBagConstraints.NONE;		panelFullTextIndexGrid.setConstraints(chkAlphanum, c);		panelFullTextIndex.add(chkAlphanum);		//fulltext attributes checkbox		chkAttributes = new JCheckBox("Attributes");		chkAttributes.addActionListener(new ActionListener(){			public void actionPerformed(ActionEvent e)			{				cx.setFullTextIndexAttributes(chkAttributes.isSelected());			}		});		c.gridx = 0;		c.gridy = 2;		c.gridwidth = 1;		c.anchor = GridBagConstraints.WEST;		c.fill = GridBagConstraints.NONE;		panelFullTextIndexGrid.setConstraints(chkAttributes, c);		panelFullTextIndex.add(chkAttributes);		        //Table to hold the FullText Indexes with Sroll bar		fulltextIndexModel = new FullTextIndexTableModel();        tblFullTextIndexes = new JTable(fulltextIndexModel);        tblFullTextIndexes.setAutoResizeMode(JTable.AUTO_RESIZE_NEXT_COLUMN);        tblFullTextIndexes.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);        TableColumn colAction = tblFullTextIndexes.getColumnModel().getColumn(1);        colAction.setCellEditor(new ComboBoxCellEditor(FULLTEXT_INDEX_ACTIONS));        colAction.setCellRenderer(new ComboBoxCellRenderer(FULLTEXT_INDEX_ACTIONS));        JScrollPane scrollFullTextIndexes = new JScrollPane(tblFullTextIndexes);		scrollFullTextIndexes.setPreferredSize(new Dimension(250, 150));		c.gridx = 0;		c.gridy = 3;		c.gridwidth = 2;		c.anchor = GridBagConstraints.WEST;		c.fill = GridBagConstraints.BOTH;		panelFullTextIndexGrid.setConstraints(scrollFullTextIndexes, c);		panelFullTextIndex.add(scrollFullTextIndexes);				//Toolbar with add/delete buttons for FullText Index		Box fulltextIndexToolbarBox = Box.createHorizontalBox();		//add button		JButton btnAddFullTextIndex = new JButton("Add");		btnAddFullTextIndex.addActionListener(new ActionListener(){			public void actionPerformed(ActionEvent e)			{				actionAddFullTextIndex();			}		});		fulltextIndexToolbarBox.add(btnAddFullTextIndex);		//delete button		JButton btnDeleteFullTextIndex = new JButton("Delete");		btnDeleteFullTextIndex.addActionListener(new ActionListener(){			public void actionPerformed(ActionEvent e)			{				actionDeleteFullTextIndex();			}		});		fulltextIndexToolbarBox.add(btnDeleteFullTextIndex);		c.gridx = 0;		c.gridy = 4;		c.gridwidth = 2;		c.anchor = GridBagConstraints.CENTER;		c.fill = GridBagConstraints.BOTH;		panelFullTextIndexGrid.setConstraints(fulltextIndexToolbarBox, c);		panelFullTextIndex.add(fulltextIndexToolbarBox);				//add fulltext panel to content frame		c.gridx = 0;		c.gridy = 1;		c.gridwidth = 2;		c.anchor = GridBagConstraints.WEST;	    c.fill = GridBagConstraints.BOTH;	    grid.setConstraints(panelFullTextIndex, c);		getContentPane().add(panelFullTextIndex);				        //Panel to hold controls relating to the Range Indexes		JPanel panelRangeIndexes = new JPanel();		panelRangeIndexes.setBorder(new TitledBorder("Range Indexes"));		GridBagLayout panelRangeIndexesGrid = new GridBagLayout();		panelRangeIndexes.setLayout(panelRangeIndexesGrid);                //Table to hold the Range Indexes with Sroll bar		rangeIndexModel = new RangeIndexTableModel();        tblRangeIndexes = new JTable(rangeIndexModel);        tblRangeIndexes.setAutoResizeMode(JTable.AUTO_RESIZE_NEXT_COLUMN);        tblRangeIndexes.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);        TableColumn colxsType = tblRangeIndexes.getColumnModel().getColumn(1);        colxsType.setCellEditor(new ComboBoxCellEditor(INDEX_TYPES));        colxsType.setCellRenderer(new ComboBoxCellRenderer(INDEX_TYPES));        JScrollPane scrollRangeIndexes = new JScrollPane(tblRangeIndexes);		scrollRangeIndexes.setPreferredSize(new Dimension(350, 150));		c.gridx = 0;		c.gridy = 0;		c.gridwidth = 2;		c.anchor = GridBagConstraints.WEST;		c.fill = GridBagConstraints.BOTH;		panelRangeIndexesGrid.setConstraints(scrollRangeIndexes, c);		panelRangeIndexes.add(scrollRangeIndexes);        		//Toolbar with add/delete buttons for Range Index		Box rangeIndexToolbarBox = Box.createHorizontalBox();		//add button		JButton btnAddRangeIndex = new JButton("Add");		btnAddRangeIndex.addActionListener(new ActionListener(){			public void actionPerformed(ActionEvent e)			{				actionAddRangeIndex();			}		});		rangeIndexToolbarBox.add(btnAddRangeIndex);		//delete button		JButton btnDeleteRangeIndex = new JButton("Delete");		btnDeleteRangeIndex.addActionListener(new ActionListener(){			public void actionPerformed(ActionEvent e)			{				actionDeleteRangeIndex();			}		});		rangeIndexToolbarBox.add(btnDeleteRangeIndex);		c.gridx = 0;		c.gridy = 1;		c.gridwidth = 2;		c.anchor = GridBagConstraints.CENTER;		c.fill = GridBagConstraints.BOTH;		panelRangeIndexesGrid.setConstraints(rangeIndexToolbarBox, c);		panelRangeIndexes.add(rangeIndexToolbarBox);		//add range index panel to content frame		c.gridx = 0;		c.gridy = 2;		c.gridwidth = 2;		c.anchor = GridBagConstraints.WEST;	    c.fill = GridBagConstraints.BOTH;	    grid.setConstraints(panelRangeIndexes, c);		getContentPane().add(panelRangeIndexes);				//Panel to hold controls relating to the QName Indexes		JPanel panelQNameIndexes = new JPanel();		panelQNameIndexes.setBorder(new TitledBorder("QName Indexes"));		GridBagLayout panelQNameIndexesGrid = new GridBagLayout();		panelQNameIndexes.setLayout(panelQNameIndexesGrid);                //Table to hold the qname Indexes with Sroll bar		qnameIndexModel = new QNameIndexTableModel();        tblQNameIndexes = new JTable(qnameIndexModel);        tblQNameIndexes.setAutoResizeMode(JTable.AUTO_RESIZE_NEXT_COLUMN);        tblQNameIndexes.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);        JScrollPane scrollQNameIndexes = new JScrollPane(tblQNameIndexes);		scrollQNameIndexes.setPreferredSize(new Dimension(350, 150));		c.gridx = 0;		c.gridy = 0;		c.gridwidth = 2;		c.anchor = GridBagConstraints.WEST;		c.fill = GridBagConstraints.BOTH;		panelQNameIndexesGrid.setConstraints(scrollQNameIndexes, c);		panelQNameIndexes.add(scrollQNameIndexes);        		//Toolbar with add/delete buttons for qname Index		Box qnameIndexToolbarBox = Box.createHorizontalBox();		//add button		JButton btnAddQNameIndex = new JButton("Add");		btnAddQNameIndex.addActionListener(new ActionListener(){			public void actionPerformed(ActionEvent e)			{				actionAddQNameIndex();			}		});		qnameIndexToolbarBox.add(btnAddQNameIndex);		//delete button		JButton btnDeleteQNameIndex = new JButton("Delete");		btnDeleteQNameIndex.addActionListener(new ActionListener(){			public void actionPerformed(ActionEvent e)			{				actionDeleteQNameIndex();			}		});		qnameIndexToolbarBox.add(btnDeleteQNameIndex);		c.gridx = 0;		c.gridy = 1;		c.gridwidth = 2;		c.anchor = GridBagConstraints.CENTER;		c.fill = GridBagConstraints.BOTH;		panelQNameIndexesGrid.setConstraints(qnameIndexToolbarBox, c);		panelQNameIndexes.add(qnameIndexToolbarBox);		//add qname panel to content frame		c.gridx = 0;		c.gridy = 3;		c.gridwidth = 2;		c.anchor = GridBagConstraints.WEST;	    c.fill = GridBagConstraints.BOTH;	    grid.setConstraints(panelQNameIndexes, c);		getContentPane().add(panelQNameIndexes);				pack();	}