+ }
+ }
+ updateDbStatus(srcs, forcedFirstChild);
+ selection = srcs;
+ }
+
+ private void _revertSelectionState()
+ {
+ handleSelections = false;
+ if (selection == null || selection.size() == 0)
+ {
+ dbviews.clearSelection();
+ }
+ else
+ {
+ dbviews.setSelectionPaths(tsel);
+ }
+ handleSelections = true;
+ }
+
+ private void updateDbStatus(List<DbSourceProxy> srcs,
+ boolean forcedFirstChild)
+ {
+ int x = 0;
+ String nm = "", qr = "";
+ for (DbSourceProxy dbs : srcs)
+ {
+ String tq = dbs.getTestQuery();
+ nm = dbs.getDbName();
+ if (tq != null && tq.trim().length() > 0 && dbs.isValidReference(tq))
+ {
+ qr = tq;
+ x++;
+ }
+ }
+
+ dbstatex.setText(" ");
+ if (allowMultiSelections)
+ {
+ dbstatus.setText(MessageManager.formatMessage(
+ "label.selected_database_to_fetch_from", new String[] {
+ Integer.valueOf(srcs.size()).toString(),
+ (srcs.size() == 1 ? "" : "s"),
+ (srcs.size() > 0 ? " with " + x + " test quer"
+ + (x == 1 ? "y" : "ies") : ".") }));
+ }
+ else
+ {
+ if (nm.length() > 0)
+ {
+ dbstatus.setText(MessageManager.formatMessage(
+ "label.database_param", new String[] { nm }));
+ if (qr.length() > 0)