private DatasetEditor datasetEditor;
public DatasetEditorForm(DatasetEditor datasetEditor) {
this.datasetEditor = datasetEditor;
DBDataset dataset = getDataset();
try {
datasetEditorTable = new DatasetEditorTable(datasetEditor);
datasetTableScrollPane.setViewportView(datasetEditorTable);
datasetTableScrollPane.setRowHeaderView(datasetEditorTable.getTableGutter());
JPanel panel = new JPanel();
panel.setBorder(UIUtil.getTableHeaderCellBorder());
datasetTableScrollPane.setCorner(ScrollPaneConstants.UPPER_LEFT_CORNER, panel);
ActionToolbar actionToolbar = ActionUtil.createActionToolbar("", true, "DBNavigator.ActionGroup.DataEditor");
actionToolbar.setTargetComponent(actionsPanel);
actionsPanel.add(actionToolbar.getComponent(), BorderLayout.WEST);
loadingIconPanel.add(new AsyncProcessIcon("Loading"), BorderLayout.CENTER);
hideLoadingHint();
ActionUtil.registerDataProvider(actionsPanel, datasetEditor.getDataProvider(), true);
Disposer.register(this, autoCommitLabel);
Disposer.register(this, datasetEditorTable);
} catch (SQLException e) {
MessageDialog.showErrorDialog(
datasetEditor.getProject(),
"Error opening data editor for " + dataset.getQualifiedNameWithType(), e.getMessage(), false);
}
if (dataset.isEditable(DBContentType.DATA)) {
ConnectionHandler connectionHandler = getConnectionHandler();
autoCommitLabel.setConnectionHandler(connectionHandler);
}
}