| 1 | |
package liquibase.util.ui; |
| 2 | |
|
| 3 | |
import javax.swing.JOptionPane; |
| 4 | |
|
| 5 | |
import liquibase.database.Database; |
| 6 | |
import liquibase.exception.DatabaseException; |
| 7 | |
import liquibase.util.StreamUtil; |
| 8 | |
|
| 9 | 0 | public class SwingUIFacade implements UIFacade { |
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
@Override |
| 15 | |
public boolean promptForNonLocalDatabase(Database database) throws DatabaseException { |
| 16 | 0 | return JOptionPane.showConfirmDialog( |
| 17 | |
null, |
| 18 | |
"You are running a database migration against a non-local database." + StreamUtil.getLineSeparator() |
| 19 | |
+ "Database URL is: " + database.getConnection().getURL() + StreamUtil.getLineSeparator() |
| 20 | |
+ "Username is: " + database.getConnection().getConnectionUserName() |
| 21 | |
+ StreamUtil.getLineSeparator() + StreamUtil.getLineSeparator() |
| 22 | |
+ "Area you sure you want to do this?", "Confirm", JOptionPane.YES_NO_OPTION, |
| 23 | |
JOptionPane.WARNING_MESSAGE) == JOptionPane.NO_OPTION; |
| 24 | |
} |
| 25 | |
|
| 26 | |
} |