private boolean isNonActiveJDBCDataSourceSelected(ActionContext c) {
		BSimServerInfo serverInfo = serverTable.getSelectedRowObject();
		if (serverInfo == null) {
			return false;
		}

		// TODO: May need connection listener on dataSource to facilitate GUI update,
		// although modal dialog avoids the issue somewhat

		dbConnectionAction.setDescription(dbConnectionAction.getName());

		ConnectionPoolStatus status = serverTableModel.getConnectionPoolStatus(serverInfo);
		if (status.isActive) {

			// Show connected icon
			dbConnectionAction
					.setToolBarData(new ToolBarData(new GIcon("icon.bsim.connected"), null));
			dbConnectionAction.setSelected(true);
			dbConnectionAction.setDescription("Disconnect idle BSim Database connection");

			// disconnect permitted when no active connections
			return status.activeCount == 0;
		}

		// Show disconnected icon (elastic always shown as disconnected)
		dbConnectionAction
				.setToolBarData(new ToolBarData(new GIcon("icon.bsim.disconnected"), null));
		dbConnectionAction.setSelected(false);
		dbConnectionAction.setDescription("Connect BSim Database");

		// Action never enabled for elastic DB (i.e., does not use pooled JDBC data source)
		return serverInfo.getDBType() != DBType.elastic;
	}
Dialog for managing BSim database server definitions
Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/gui/search/dialog/BSimServerDialog.java