private void viewerPanel(JTabbedPane tabbedPane) {
		JPanel xmlFilePanel = new JPanel();
		tabbedPane.addTab("Database Viewer", null, xmlFilePanel, null);
		GridBagLayout gbl_xmlFilePanel = new GridBagLayout();
		gbl_xmlFilePanel.columnWidths = new int[] { 21, 38, 86, 0, 0, 0, 45, 86, 72, 0, 0, 34, 0 };
		gbl_xmlFilePanel.rowHeights = new int[] { 0, 20, 0, 0, 0, 0, 0, 0, 0, 0 };
		gbl_xmlFilePanel.columnWeights = new double[] { 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 1.0,
				1.0, 0.0, 0.0, 1.0,
				Double.MIN_VALUE };
		gbl_xmlFilePanel.rowWeights = new double[] { 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
				0.0 };
		xmlFilePanel.setLayout(gbl_xmlFilePanel);

		tableModel = new ConstanceTableModel();

		JLabel lblTable = new JLabel("Table");
		lblTable.setPreferredSize(new Dimension(40, 14));
		GridBagConstraints gbc_lblTable = new GridBagConstraints();
		gbc_lblTable.gridwidth = 2;
		gbc_lblTable.insets = new Insets(0, 0, 5, 5);
		gbc_lblTable.anchor = GridBagConstraints.EAST;
		gbc_lblTable.gridx = 0;
		gbc_lblTable.gridy = 0;
		xmlFilePanel.add(lblTable, gbc_lblTable);

		comboBoxTable = new JComboBox();
		comboBoxTable.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				String get = (String) comboBoxTable.getSelectedItem();
				if (dbschema != null) {
					DbTable dbtable2 = dbschema.getTable(get);
					if (dbtable2 != null) {
						dbtable = dbtable2;
						tableModel.changeDbTable(dbtable);
						initValueView();
						initFieldView();
						resizeTable(table);
					} else {
						comboBoxTable.setSelectedItem(dbtable.name);
						initValueView();
						initFieldView();
						resizeTable(table);
					}
				}
			}
		});
		comboBoxTable.setModel(new DefaultComboBoxModel());
		GridBagConstraints gbc_comboBox = new GridBagConstraints();
		gbc_comboBox.gridwidth = 3;
		gbc_comboBox.insets = new Insets(0, 0, 5, 5);
		gbc_comboBox.fill = GridBagConstraints.HORIZONTAL;
		gbc_comboBox.gridx = 2;
		gbc_comboBox.gridy = 0;
		xmlFilePanel.add(comboBoxTable, gbc_comboBox);

		comboBoxFields = new CheckComboBox(new HashSet<Object>(), true, "Champs");
		CheckComboBoxSelectionChangedListener listener = new CheckComboBoxSelectionChangedListener() {
			@Override
			public void selectionChanged(int idx) {
				if (idx >= fieldsChecked.length) {
					if (idx == fieldsChecked.length) {
						// all
						for (int i = 0; i < fieldsChecked.length; i++) {
							fieldsChecked[i] = true;
						}
					} else {
						// none
						for (int i = 0; i < fieldsChecked.length; i++) {
							fieldsChecked[i] = false;
						}
					}
				} else {
					fieldsChecked[idx] = !fieldsChecked[idx];
				}
				tableModel.setValidRows(fieldsChecked);
				resizeTable(table);
			}
		};
		comboBoxFields.addSelectionChangedListener(listener);
		GridBagConstraints gbc_comboBox_1 = new GridBagConstraints();
		gbc_comboBox_1.gridwidth = 6;
		gbc_comboBox_1.insets = new Insets(0, 0, 5, 5);
		gbc_comboBox_1.fill = GridBagConstraints.HORIZONTAL;
		gbc_comboBox_1.gridx = 5;
		gbc_comboBox_1.gridy = 0;
		xmlFilePanel.add(comboBoxFields, gbc_comboBox_1);

		table = new JTable(tableModel) {
			private static final long serialVersionUID = -8896530264117717457L;

			protected JTableHeader createDefaultTableHeader() {
				return new JTableHeader(columnModel) {
					private static final long serialVersionUID = -1026143493017837335L;

					public String getToolTipText(MouseEvent e) {
						if (dbtable != null) {
							java.awt.Point p = e.getPoint();
							int index = columnModel.getColumnIndexAtX(p.x);
							int realIndex =
									columnModel.getColumn(index).getModelIndex();
							return dbtable.getField(realIndex).getElement().asXML();
						}
						return null;
					}
				};
			}
		};
		table.setAutoCreateRowSorter(true);
		table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
		table.setShowGrid(true);

		JScrollPane scrollpane = new JScrollPane(table);
		GridBagConstraints gbc_table = new GridBagConstraints();
		gbc_table.gridheight = 8;
		gbc_table.gridwidth = 12;
		gbc_table.insets = new Insets(0, 0, 5, 0);
		gbc_table.fill = GridBagConstraints.BOTH;
		gbc_table.gridx = 0;
		gbc_table.gridy = 1;
		xmlFilePanel.add(scrollpane, gbc_table);

		butNext = new JButton(">>");
		butNext.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				tableModel.next();
				checkButtonView();
				resizeTable(table);
			}
		});

		textPage = new JFormattedTextField(NumberFormat.getIntegerInstance());
		textPage.setMinimumSize(new Dimension(40, 20));
		textPage.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				try {
					int page = Integer.parseInt(textPage.getText());
					tableModel.setPage(page);
					checkButtonView();
					resizeTable(table);
				} catch (NumberFormatException e2) {
					checkButtonView();
					resizeTable(table);
				}
			}
		});

		JLabel lblPage = new JLabel("Page");
		GridBagConstraints gbc_lblPage = new GridBagConstraints();
		gbc_lblPage.insets = new Insets(0, 0, 0, 5);
		gbc_lblPage.anchor = GridBagConstraints.EAST;
		gbc_lblPage.gridx = 3;
		gbc_lblPage.gridy = 9;
		xmlFilePanel.add(lblPage, gbc_lblPage);
		GridBagConstraints gbc_textField = new GridBagConstraints();
		gbc_textField.insets = new Insets(0, 0, 0, 5);
		gbc_textField.fill = GridBagConstraints.HORIZONTAL;
		gbc_textField.gridx = 4;
		gbc_textField.gridy = 9;
		xmlFilePanel.add(textPage, gbc_textField);
		textPage.setColumns(10);

		lblX = new JLabel("/ x");
		GridBagConstraints gbc_lblX = new GridBagConstraints();
		gbc_lblX.anchor = GridBagConstraints.WEST;
		gbc_lblX.insets = new Insets(0, 0, 0, 5);
		gbc_lblX.gridx = 5;
		gbc_lblX.gridy = 9;
		xmlFilePanel.add(lblX, gbc_lblX);
		GridBagConstraints gbc_button_1 = new GridBagConstraints();
		gbc_button_1.insets = new Insets(0, 0, 0, 5);
		gbc_button_1.gridx = 7;
		gbc_button_1.gridy = 9;
		xmlFilePanel.add(butNext, gbc_button_1);

		butPrev = new JButton("<<");
		butPrev.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				tableModel.prev();
				checkButtonView();
				resizeTable(table);
			}
		});
		GridBagConstraints gbc_button = new GridBagConstraints();
		gbc_button.insets = new Insets(0, 0, 0, 5);
		gbc_button.gridx = 2;
		gbc_button.gridy = 9;
		xmlFilePanel.add(butPrev, gbc_button);

		butFirst = new JButton("<|");
		butFirst.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				tableModel.first();
				checkButtonView();
				resizeTable(table);
			}
		});
		GridBagConstraints gbc_button_2 = new GridBagConstraints();
		gbc_button_2.insets = new Insets(0, 0, 0, 5);
		gbc_button_2.gridx = 1;
		gbc_button_2.gridy = 9;
		xmlFilePanel.add(butFirst, gbc_button_2);

		butLast = new JButton("|>");
		butLast.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				tableModel.last();
				checkButtonView();
				resizeTable(table);
			}
		});
		GridBagConstraints gbc_button_3 = new GridBagConstraints();
		gbc_button_3.insets = new Insets(0, 0, 0, 5);
		gbc_button_3.gridx = 8;
		gbc_button_3.gridy = 9;
		xmlFilePanel.add(butLast, gbc_button_3);

		textRowPerPage = new JFormattedTextField(NumberFormat.getIntegerInstance());
		textRowPerPage.setMinimumSize(new Dimension(40, 20));
		textRowPerPage.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				try {
					int page = Integer.parseInt(textRowPerPage.getText());
					tableModel.setRowPerPage(page);
					initValueView();
					resizeTable(table);
				} catch (NumberFormatException e2) {
					initValueView();
					resizeTable(table);
				}
			}
		});

		JLabel lblLignepage = new JLabel("Ligne/Page");
		GridBagConstraints gbc_lblLignepage = new GridBagConstraints();
		gbc_lblLignepage.insets = new Insets(0, 0, 0, 5);
		gbc_lblLignepage.anchor = GridBagConstraints.EAST;
		gbc_lblLignepage.gridx = 9;
		gbc_lblLignepage.gridy = 9;
		xmlFilePanel.add(lblLignepage, gbc_lblLignepage);
		GridBagConstraints gbc_textField_1 = new GridBagConstraints();
		gbc_textField_1.insets = new Insets(0, 0, 0, 5);
		gbc_textField_1.fill = GridBagConstraints.HORIZONTAL;
		gbc_textField_1.gridx = 10;
		gbc_textField_1.gridy = 9;
		xmlFilePanel.add(textRowPerPage, gbc_textField_1);
		textRowPerPage.setColumns(10);

		initValueView();
	}