@Override public Object getData() { if ( !cancelPressed ) { return super.getData(); } else { return null; } }
public void onOK() { DatabaseMeta database = new DatabaseMeta(); this.getInfo( database ); boolean passed = checkPoolingParameters(); if ( !passed ) { return; } String[] remarks = database.checkParameters(); String message = ""; if ( remarks.length != 0 ) { for ( int i = 0; i < remarks.length; i++ ) { message = message.concat( "* " ).concat( remarks[i] ).concat( System.getProperty( "line.separator" ) ); } showMessage( message, false ); } else { if ( databaseMeta == null ) { databaseMeta = new DatabaseMeta(); } this.getInfo( databaseMeta ); databaseMeta.setChanged(); close(); } }
@Override public void propertyChange( PropertyChangeEvent evt ) { if ( "value".equals( evt.getPropertyName() ) ) { disablePortIfInstancePopulated(); } } } );
public Object getData() { if ( databaseMeta == null ) { databaseMeta = new DatabaseMeta(); } if ( !windowClosed() ) { this.getInfo( databaseMeta ); } return databaseMeta; }
public void testDatabaseConnection() { DatabaseMeta database = new DatabaseMeta(); getInfo( database ); String[] remarks = database.checkParameters(); String message = ""; if ( remarks.length != 0 ) { for ( int i = 0; i < remarks.length; i++ ) { message = message.concat( "* " ).concat( remarks[i] ).concat( System.getProperty( "line.separator" ) ); } showMessage( message, message.length() > 300 ); } else { showMessage( database.testConnectionSuccess() ); } }
getControls(); setConnectionSpecificInfo( meta ); loadAccessData(); setOptionsData( meta.getExtraOptions() ); setClusterData( meta.getPartitioningInformation() ); setPoolProperties( meta.getConnectionPoolingProperties() ); setReadOnly( meta.isReadOnly() ); setDeckChildIndex(); onPoolingCheck(); onClusterCheck();
public void loadAccessData() { getControls(); pushCache(); } else { clearOptionsData(); options = database.getDefaultOptions(); setOptionsData( options ); PartitionDatabaseMeta[] clusterInfo = null; if ( this.databaseMeta != null ) { clusterInfo = this.databaseMeta.getPartitioningInformation(); setClusterData( clusterInfo ); popCache();
private void connectionButtonActionPerformed(ActionEvent evt) { if (connectionDialog == null) { dbMeta = getDbMeta(null); connectionDialogController = new DataHandler(); connectionDialogController.setName("dataHandler"); XulDomContainer container = null; try { XulLoader loader = new SwingXulLoader(); container = loader.loadXul( DatabaseConnectionDialog.DIALOG_DEFINITION_FILE, Messages.getBundle()); } catch (XulException e) { throw new RuntimeException("Xul failed to initialize", e); } container.addEventHandler(connectionDialogController); connectionDialogController.loadConnectionData(); connectionDialogController.setData(dbMeta); connectionDialog = (XulDialog) container.getDocumentRoot() .getRootElement(); } connectionDialog.show(); dbMeta = (DatabaseMeta) connectionDialogController.getData(); if (dbMeta.hasChanged()) { dbMeta.clearChanged(); syncToWorkspace(dbMeta); // Enforces the JDBC preferences entered throughout all schemas // currently opened in the workbench. resetWorkbench(); } }
public void clearOptionsData() { getControls(); if ( optionsParameterTree != null ) { optionsParameterTree.getRootChildren().removeAll(); } }
public void setDeckChildIndex() { getControls(); // if pooling selected, check the parameter validity before allowing // a deck panel switch... int originalSelection = ( dialogDeck == null ? -1 : dialogDeck.getSelectedIndex() ); boolean passed = true; if ( originalSelection == 3 ) { passed = checkPoolingParameters(); } if ( passed ) { int selected = deckOptionsBox.getSelectedIndex(); if ( selected < 0 ) { selected = 0; deckOptionsBox.setSelectedIndex( 0 ); } dialogDeck.setSelectedIndex( selected ); } else { dialogDeck.setSelectedIndex( originalSelection ); deckOptionsBox.setSelectedIndex( originalSelection ); } }
protected void getInfo( DatabaseMeta meta ) { getControls(); getConnectionSpecificInfo( meta );
public void onCancel() { close(); }
public void pushCache() { // Database type: if ( connectionBox != null ) { Object connection = connectionBox.getSelectedItem(); if ( connection != null ) { cache.setDatabaseType( (String) connection ); } } getConnectionSpecificInfo( cache ); }
@Override protected void getControls() { super.getControls(); XulTextbox[] boxes = new XulTextbox[] { hostNameBox, databaseNameBox, portNumberBox, userNameBox, passwordBox, customDriverClassBox, customUrlBox, dataTablespaceBox, indexTablespaceBox, poolSizeBox, maxPoolSizeBox, languageBox, systemNumberBox, clientBox, serverInstanceBox }; for ( int i = 0; i < boxes.length; i++ ) { XulTextbox xulTextbox = boxes[i]; if ( ( xulTextbox != null ) && ( xulTextbox instanceof ExtTextbox ) ) { ExtTextbox ext = (ExtTextbox) xulTextbox; ext.setVariableSpace( databaseMeta ); } } XulTree[] trees = new XulTree[] { poolParameterTree, clusterParameterTree, optionsParameterTree }; for ( int i = 0; i < trees.length; i++ ) { XulTree xulTree = trees[i]; if ( xulTree != null ) { xulTree.setData( databaseMeta ); } } }
public void getOptionHelp() { String message = null; DatabaseMeta database = new DatabaseMeta(); getInfo( database ); String url = database.getExtraOptionsHelpText(); if ( ( url == null ) || ( url.trim().length() == 0 ) ) { message = Messages.getString( "DataHandler.USER_NO_HELP_AVAILABLE" ); showMessage( message, false ); return; } Status status = Launch.openURL( url ); if ( status.equals( Status.Failed ) ) { message = Messages.getString( "DataHandler.USER_UNABLE_TO_LAUNCH_BROWSER", url ); showMessage( message, false ); } }
private void setConnectionSpecificInfo( DatabaseMeta meta ) { getControls();