use of org.jkiss.dbeaver.model.connection.DBPConnectionEventType in project dbeaver by dbeaver.
the class ConnectionPageShellCommands method getActiveCommand.
private DBRShellCommand getActiveCommand() {
DBPConnectionEventType eventType = getSelectedEventType();
if (eventType != null) {
DBRShellCommand command = eventsCache.get(eventType);
if (command == null) {
// $NON-NLS-1$
command = new DBRShellCommand("");
eventsCache.put(eventType, command);
}
return command;
}
return null;
}
use of org.jkiss.dbeaver.model.connection.DBPConnectionEventType in project dbeaver by serge-rider.
the class ConnectionPageGeneral method configureEvents.
private void configureEvents() {
DataSourceDescriptor dataSource = getActiveDataSource();
EditShellCommandsDialog dialog = new EditShellCommandsDialog(getShell(), dataSource);
if (dialog.open() == IDialogConstants.OK_ID) {
eventsButton.setFont(getFont());
for (DBPConnectionEventType eventType : dataSource.getConnectionConfiguration().getDeclaredEvents()) {
if (dataSource.getConnectionConfiguration().getEvent(eventType).isEnabled()) {
eventsButton.setFont(boldFont);
break;
}
}
}
}
use of org.jkiss.dbeaver.model.connection.DBPConnectionEventType in project dbeaver by dbeaver.
the class EditShellCommandsDialogPage method getActiveCommand.
private DBRShellCommand getActiveCommand() {
DBPConnectionEventType eventType = getSelectedEventType();
if (eventType != null) {
DBRShellCommand command = eventsCache.get(eventType);
if (command == null) {
// $NON-NLS-1$
command = new DBRShellCommand("");
eventsCache.put(eventType, command);
}
return command;
}
return null;
}
use of org.jkiss.dbeaver.model.connection.DBPConnectionEventType in project dbeaver by dbeaver.
the class ConnectionPageShellCommands method updateEvent.
private void updateEvent(boolean commandChange) {
DBPConnectionEventType eventType = getSelectedEventType();
DBRShellCommand command = getActiveCommand();
if (command != null) {
boolean prevEnabled = command.isEnabled();
if (commandChange) {
command.setCommand(commandText.getText());
} else {
TableItem item = getEventItem(eventType);
if (item != null) {
command.setEnabled(item.getChecked());
}
command.setShowProcessPanel(showProcessCheck.getSelection());
command.setWaitProcessFinish(waitFinishCheck.getSelection());
waitFinishTimeoutMs.setEnabled(waitFinishCheck.getSelection());
command.setWaitProcessTimeoutMs(waitFinishTimeoutMs.getSelection());
command.setTerminateAtDisconnect(terminateCheck.getSelection());
command.setPauseAfterExecute(pauseAfterExecute.getSelection());
command.setWorkingDirectory(workingDirectory.getText());
if (prevEnabled != command.isEnabled()) {
selectEventType(eventType);
}
}
} else if (!commandChange) {
selectEventType(null);
}
}
use of org.jkiss.dbeaver.model.connection.DBPConnectionEventType in project dbeaver by serge-rider.
the class ConnectionPageShellCommands method updateEvent.
private void updateEvent(boolean commandChange) {
DBPConnectionEventType eventType = getSelectedEventType();
DBRShellCommand command = getActiveCommand();
if (command != null) {
boolean prevEnabled = command.isEnabled();
if (commandChange) {
command.setCommand(commandText.getText());
} else {
TableItem item = getEventItem(eventType);
if (item != null) {
command.setEnabled(item.getChecked());
}
command.setShowProcessPanel(showProcessCheck.getSelection());
command.setWaitProcessFinish(waitFinishCheck.getSelection());
waitFinishTimeoutMs.setEnabled(waitFinishCheck.getSelection());
command.setWaitProcessTimeoutMs(waitFinishTimeoutMs.getSelection());
command.setTerminateAtDisconnect(terminateCheck.getSelection());
command.setPauseAfterExecute(pauseAfterExecute.getSelection());
command.setWorkingDirectory(workingDirectory.getText());
if (prevEnabled != command.isEnabled()) {
selectEventType(eventType);
}
}
} else if (!commandChange) {
selectEventType(null);
}
}
Aggregations