54 private class DataSourceTab {
68 DataSourceTab(String
tabTitle, BaseDataSourceSummaryPanel panel) {
69 this(
tabTitle, panel, panel::setDataSource, panel::close, panel::init);
87 DataSourceTab(String tabTitle, Component component, Consumer<DataSource> onDataSource,
88 Runnable onClose, Runnable onInit) {
89 this.tabTitle = tabTitle;
90 this.component = component;
91 this.onDataSource = onDataSource;
92 this.onClose = onClose;
106 Component getComponent() {
113 Consumer<DataSource> getOnDataSource() {
142 private final List<DataSourceTab>
tabs = Arrays.asList(
143 new DataSourceTab(Bundle.DataSourceSummaryTabbedPane_typesTab_title(),
new TypesPanel()),
152 Bundle.DataSourceSummaryTabbedPane_ingestHistoryTab_title(),
154 ingestHistoryPanel::setDataSource,
157 new DataSourceTab(Bundle.DataSourceSummaryTabbedPane_detailsTab_title(),
new ContainerPanel())
195 void setParentCloseListener(Runnable parentCloseAction) {
196 notifyParentClose = parentCloseAction;
208 tabbedPane.addTab(tab.getTabTitle(), tab.getComponent());
211 Runnable onInitMethod = tab.getOnInit();
212 if (onInitMethod !=
null) {
239 if (tab.getOnDataSource() !=
null) {
244 if (this.dataSource ==
null) {
256 if (tab.getOnClose() !=
null) {
257 tab.getOnClose().run();
269 @SuppressWarnings(
"unchecked")
273 javax.swing.JPanel noDataSourcePane =
new javax.swing.JPanel();
274 javax.swing.JLabel noDataSourceLabel =
new javax.swing.JLabel();
275 javax.swing.JPanel tabContentPane =
new javax.swing.JPanel();
278 setLayout(
new java.awt.CardLayout());
280 noDataSourcePane.setLayout(
new java.awt.BorderLayout());
282 noDataSourceLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
283 org.openide.awt.Mnemonics.setLocalizedText(noDataSourceLabel, org.openide.util.NbBundle.getMessage(
DataSourceSummaryTabbedPane.class,
"DataSourceSummaryTabbedPane.noDataSourceLabel.text"));
284 noDataSourcePane.add(noDataSourceLabel, java.awt.BorderLayout.CENTER);
286 add(noDataSourcePane,
"noDataSourcePane");
288 tabContentPane.setLayout(
new java.awt.BorderLayout());
289 tabContentPane.add(
tabbedPane, java.awt.BorderLayout.CENTER);
291 add(tabContentPane,
"tabbedPane");