public MethodExecutionForm(MethodExecutionInput executionInput, boolean showHeader, boolean debug) {
this.executionInput = executionInput;
this.debug = debug;
DBMethod method = executionInput.getMethod();
ConnectionHandler connectionHandler = executionInput.getConnectionHandler();
DatabaseCompatibilityInterface compatibilityInterface = DatabaseCompatibilityInterface.getInstance(connectionHandler);
if (compatibilityInterface.supportsFeature(DatabaseFeature.AUTHID_METHOD_EXECUTION)) {
//ActionToolbar actionToolbar = ActionUtil.createActionToolbar("", true, new SetExecutionSchemaComboBoxAction(executionInput));
executionSchemaActionPanel.add(new SchemaSelector(), BorderLayout.CENTER);
} else {
executionSchemaActionPanel.setVisible(false);
executionSchemaLabel.setVisible(false);
}
connectionLabel.setText(connectionHandler.getPresentableText());
connectionLabel.setIcon(connectionHandler.getIcon());
autoCommitLabel.setConnectionHandler(connectionHandler);
//objectPanel.add(new ObjectDetailsPanel(method).getComponent(), BorderLayout.NORTH);
if (showHeader) {
String headerTitle = method.getQualifiedName();
Icon headerIcon = method.getIcon();
Color headerBackground = UIUtil.getPanelBackground();
if (getEnvironmentSettings(method.getProject()).getVisibilitySettings().getDialogHeaders().value()) {
headerBackground = method.getEnvironmentType().getColor();
}
DBNHeaderForm headerForm = new DBNHeaderForm(
headerTitle,
headerIcon,
headerBackground);
headerPanel.add(headerForm.getComponent(), BorderLayout.CENTER);
}
headerPanel.setVisible(showHeader);
argumentsPanel.setLayout(new BoxLayout(argumentsPanel, BoxLayout.Y_AXIS));
int[] metrics = new int[]{0, 0};
//topSeparator.setVisible(false);
spacer.setVisible(false);
List<DBArgument> arguments = new ArrayList(method.getArguments());
noArgumentsLabel.setVisible(arguments.size() == 0);
for (DBArgument argument: arguments) {
if (argument.isInput()) {
spacer.setVisible(true);
metrics = addArgumentPanel(argument, metrics);
//topSeparator.setVisible(true);
}
}
for (MethodExecutionArgumentForm component : argumentForms) {
component.adjustMetrics(metrics);
}
if (argumentForms.size() > 0) {
argumentsScrollPane.getVerticalScrollBar().setUnitIncrement(argumentForms.get(0).getScrollUnitIncrement());
}
Dimension preferredSize = mainPanel.getPreferredSize();
int width = (int) preferredSize.getWidth() + 24;
int height = (int) Math.min(preferredSize.getHeight(), 380);
mainPanel.setPreferredSize(new Dimension(width, height));
commitCheckBox.setSelected(executionInput.isCommitAfterExecution());
commitCheckBox.setEnabled(!connectionHandler.isAutoCommit());
usePoolConnectionCheckBox.setSelected(executionInput.isUsePoolConnection());
for (MethodExecutionArgumentForm argumentComponent : argumentForms){
argumentComponent.addDocumentListener(documentListener);
}