Java Code Examples for org.eclipse.swt.widgets.MessageBox#setText()
The following examples show how to use
org.eclipse.swt.widgets.MessageBox#setText() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ActionWaitForSqlDialog.java From hop with Apache License 2.0 | 6 votes |
private void ok() { if ( Utils.isEmpty( wName.getText() ) ) { MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR ); mb.setMessage( "Please give this action a name." ); mb.setText( "Enter the name of the action" ); mb.open(); return; } action.setName( wName.getText() ); action.setDatabase( workflowMeta.findDatabase( wConnection.getText() ) ); action.schemaname = wSchemaname.getText(); action.tablename = wTablename.getText(); action.successCondition = ActionWaitForSql.getSuccessConditionByDesc( wSuccessCondition.getText() ); action.rowsCountValue = wRowsCountValue.getText(); action.iscustomSql = wcustomSql.getSelection(); action.isUseVars = wUseSubs.getSelection(); action.isAddRowsResult = wAddRowsToResult.getSelection(); action.isClearResultList = wClearResultList.getSelection(); action.customSql = wSql.getText(); action.setMaximumTimeout( wMaximumTimeout.getText() ); action.setCheckCycleTime( wCheckCycleTime.getText() ); action.setSuccessOnTimeout( wSuccesOnTimeout.getSelection() ); dispose(); }
Example 2
Source File: ActionEvalTableContentDialog.java From hop with Apache License 2.0 | 6 votes |
private void getTableName() { String databaseName = wConnection.getText(); if ( StringUtils.isNotEmpty( databaseName ) ) { DatabaseMeta databaseMeta = workflowMeta.findDatabase( databaseName ); if ( databaseMeta != null ) { DatabaseExplorerDialog std = new DatabaseExplorerDialog( shell, SWT.NONE, databaseMeta, workflowMeta.getDatabases() ); std.setSelectedSchemaAndTable( wSchemaname.getText(), wTablename.getText() ); if ( std.open() ) { wTablename.setText( Const.NVL( std.getTableName(), "" ) ); } } else { MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR ); mb.setMessage( BaseMessages.getString( PKG, "ActionEvalTableContent.ConnectionError2.DialogMessage" ) ); mb.setText( BaseMessages.getString( PKG, "System.Dialog.Error.Title" ) ); mb.open(); } } }
Example 3
Source File: HelpUtils.java From hop with Apache License 2.0 | 6 votes |
public static ShowHelpDialog openHelpDialog( Shell shell, IPlugin plugin ) { if ( shell == null || plugin == null ) { return null; } if ( isPluginDocumented( plugin ) ) { return openHelpDialog( shell, getHelpDialogTitle( plugin ), plugin.getDocumentationUrl(), plugin.getName() ); } else { MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR ); String msg = ""; // TODO currently support only Transform and Action - extend if required. if ( plugin.getPluginType().equals( TransformPluginType.class ) ) { msg = BaseMessages.getString( PKG, "System.ShowHelpDialog.Transform.HelpIsNotAvailable", plugin.getName()); } else { msg = BaseMessages.getString( PKG, "System.ShowHelpDialog.Action.HelpIsNotAvailable", plugin.getName()); } mb.setMessage(msg ); mb.setText( BaseMessages.getString( PKG, "System.Dialog.Error.Title" ) ); mb.open(); } return null; }
Example 4
Source File: ActionMssqlBulkLoadDialog.java From hop with Apache License 2.0 | 6 votes |
private void getTableName() { String connectionName = wConnection.getText(); if ( StringUtils.isEmpty( connectionName ) ) { return; } DatabaseMeta databaseMeta = workflowMeta.findDatabase( connectionName ); if ( databaseMeta != null ) { DatabaseExplorerDialog std = new DatabaseExplorerDialog( shell, SWT.NONE, databaseMeta, workflowMeta.getDatabases() ); std.setSelectedSchemaAndTable( wSchemaname.getText(), wTablename.getText() ); if ( std.open() ) { wTablename.setText( Const.NVL( std.getTableName(), "" ) ); } } else { MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR ); mb.setMessage( BaseMessages.getString( PKG, "JobMssqlBulkLoad.ConnectionError2.DialogMessage" ) ); mb.setText( BaseMessages.getString( PKG, "System.Dialog.Error.Title" ) ); mb.open(); } }
Example 5
Source File: ActionTableExistsDialog.java From hop with Apache License 2.0 | 6 votes |
private void getTableName() { String databaseName = wConnection.getText(); if ( StringUtils.isNotEmpty( databaseName ) ) { DatabaseMeta databaseMeta = workflowMeta.findDatabase( databaseName ); if ( databaseMeta != null ) { DatabaseExplorerDialog std = new DatabaseExplorerDialog( shell, SWT.NONE, databaseMeta, workflowMeta.getDatabases() ); std.setSelectedSchemaAndTable( wSchemaname.getText(), wTablename.getText() ); if ( std.open() ) { wSchemaname.setText( Const.NVL( std.getSchemaName(), "" ) ); wTablename.setText( Const.NVL( std.getTableName(), "" ) ); } } else { MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR ); mb.setMessage( BaseMessages.getString( PKG, "System.Dialog.ConnectionError.DialogMessage" ) ); mb.setText( BaseMessages.getString( PKG, "System.Dialog.Error.Title" ) ); mb.open(); } } }
Example 6
Source File: ActionSuccessDialog.java From hop with Apache License 2.0 | 5 votes |
private void ok() { if ( Utils.isEmpty( wName.getText() ) ) { MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR ); mb.setText( BaseMessages.getString( PKG, "System.TransformActionNameMissing.Title" ) ); mb.setMessage( BaseMessages.getString( PKG, "System.ActionNameMissing.Msg" ) ); mb.open(); return; } action.setName( wName.getText() ); dispose(); }
Example 7
Source File: VCS.java From hop with Apache License 2.0 | 5 votes |
@VisibleForTesting void showMessageBox( String title, String message ) { MessageBox messageBox = new MessageBox( shell, SWT.OK ); messageBox.setText( title ); messageBox.setMessage( message == null ? "" : message ); messageBox.open(); }
Example 8
Source File: ActionDelayDialog.java From hop with Apache License 2.0 | 5 votes |
private void ok() { if ( Utils.isEmpty( wName.getText() ) ) { MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR ); mb.setText( BaseMessages.getString( PKG, "System.TransformActionNameMissing.Title" ) ); mb.setMessage( BaseMessages.getString( PKG, "System.ActionNameMissing.Msg" ) ); mb.open(); return; } action.setName( wName.getText() ); action.setMaximumTimeout( wMaximumTimeout.getText() ); action.scaleTime = wScaleTime.getSelectionIndex(); dispose(); }
Example 9
Source File: ActionFtpPutDialog.java From hop with Apache License 2.0 | 5 votes |
private void test() { if ( connectToFtp( false, null ) ) { MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_INFORMATION ); mb.setMessage( BaseMessages.getString( PKG, "JobFTPPUT.Connected.OK", wServerName.getText() ) + Const.CR ); mb.setText( BaseMessages.getString( PKG, "JobFTPPUT.Connected.Title.Ok" ) ); mb.open(); } }
Example 10
Source File: HopGuiWorkflowHopDelegate.java From hop with Apache License 2.0 | 5 votes |
/** * @param workflowMeta workflow meta * @param newHop hop to be checked * @return true when the hop was added, false if there was an error */ public boolean performNewWorkflowHopChecks( WorkflowMeta workflowMeta, WorkflowHopMeta newHop ) { boolean ok = true; if ( workflowMeta.hasLoop( newHop.getToAction() ) ) { MessageBox mb = new MessageBox( hopGui.getShell(), SWT.OK | SWT.ICON_ERROR ); mb.setMessage( BaseMessages.getString( PKG, "WorkflowGraph.Dialog.HopCausesLoop.Message" ) ); mb.setText( BaseMessages.getString( PKG, "WorkflowGraph.Dialog.HopCausesLoop.Title" ) ); mb.open(); ok = false; } return ok; }
Example 11
Source File: ActionTableExistsDialog.java From hop with Apache License 2.0 | 5 votes |
private void ok() { if ( Utils.isEmpty( wName.getText() ) ) { MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR ); mb.setText( BaseMessages.getString( PKG, "System.TransformActionNameMissing.Title" ) ); mb.setMessage( BaseMessages.getString( PKG, "System.ActionNameMissing.Msg" ) ); mb.open(); return; } action.setName( wName.getText() ); action.setDatabase( workflowMeta.findDatabase( wConnection.getText() ) ); action.setTablename( wTablename.getText() ); action.setSchemaname( wSchemaname.getText() ); dispose(); }
Example 12
Source File: ActionFtpDialog.java From hop with Apache License 2.0 | 5 votes |
private void checkRemoteFolder( boolean FtpFolfer, boolean checkMoveFolder, String foldername ) { if ( !Utils.isEmpty( foldername ) ) { if ( connectToFtp( FtpFolfer, checkMoveFolder ) ) { MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_INFORMATION ); mb.setMessage( BaseMessages.getString( PKG, "JobFTP.FolderExists.OK", foldername ) + Const.CR ); mb.setText( BaseMessages.getString( PKG, "JobFTP.FolderExists.Title.Ok" ) ); mb.open(); } } }
Example 13
Source File: ActionColumnsExistDialog.java From hop with Apache License 2.0 | 5 votes |
/** * Get a list of columns */ private void getListColumns() { if ( !Utils.isEmpty( wTablename.getText() ) ) { DatabaseMeta databaseMeta = workflowMeta.findDatabase( wConnection.getText() ); if ( databaseMeta != null ) { Database database = new Database( loggingObject, databaseMeta ); database.shareVariablesWith( workflowMeta ); try { database.connect(); IRowMeta row = database.getTableFieldsMeta( workflowMeta.environmentSubstitute( wSchemaname.getText() ), workflowMeta.environmentSubstitute( wTablename.getText() ) ); if ( row != null ) { String[] available = row.getFieldNames(); wFields.removeAll(); for ( int i = 0; i < available.length; i++ ) { wFields.add( available[ i ] ); } wFields.removeEmptyRows(); wFields.setRowNums(); } else { MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR ); mb.setMessage( BaseMessages.getString( PKG, "ActionColumnsExist.GetListColumsNoRow.DialogMessage" ) ); mb.setText( BaseMessages.getString( PKG, "System.Dialog.Error.Title" ) ); mb.open(); } } catch ( Exception e ) { new ErrorDialog( shell, BaseMessages.getString( PKG, "System.Dialog.Error.Title" ), BaseMessages .getString( PKG, "ActionColumnsExist.ConnectionError2.DialogMessage", wTablename.getText() ), e ); } finally { database.disconnect(); } } } }
Example 14
Source File: ActionCreateFolderDialog.java From hop with Apache License 2.0 | 5 votes |
private void ok() { if ( Utils.isEmpty( wName.getText() ) ) { MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR ); mb.setText( BaseMessages.getString( PKG, "System.TransformActionNameMissing.Title" ) ); mb.setMessage( BaseMessages.getString( PKG, "System.ActionNameMissing.Msg" ) ); mb.open(); return; } action.setName( wName.getText() ); action.setFoldername( wFoldername.getText() ); action.setFailOfFolderExists( wAbortExists.getSelection() ); dispose(); }
Example 15
Source File: ActionWebServiceAvailableDialog.java From hop with Apache License 2.0 | 5 votes |
private void ok() { if ( Utils.isEmpty( wName.getText() ) ) { MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR ); mb.setText( BaseMessages.getString( PKG, "System.TransformActionNameMissing.Title" ) ); mb.setMessage( BaseMessages.getString( PKG, "System.ActionNameMissing.Msg" ) ); mb.open(); return; } action.setName( wName.getText() ); action.setURL( wURL.getText() ); action.setConnectTimeOut( wConnectTimeOut.getText() ); action.setReadTimeOut( wReadTimeOut.getText() ); dispose(); }
Example 16
Source File: TransformFieldsDialog.java From hop with Apache License 2.0 | 5 votes |
private void edit() { int idx = wFields.table.getSelectionIndex(); if ( idx >= 0 ) { transformName = wFields.table.getItem( idx ).getText( 5 ); dispose(); } else { transformName = null; MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR ); mb.setText( BaseMessages.getString( PKG, "TransformFieldsDialog.OriginTransform.Title" ) ); mb.setMessage( BaseMessages.getString( PKG, "TransformFieldsDialog.OriginTransform.Message" ) ); mb.open(); } }
Example 17
Source File: ActionFtpsGetDialog.java From hop with Apache License 2.0 | 4 votes |
private boolean connectToFtps(boolean checkfolder, boolean checkmoveToFolder ) { boolean retval = true; String realServername = null; try { if ( connection == null ) { // Create FTPS client to host:port ... realServername = workflowMeta.environmentSubstitute( wServerName.getText() ); int port = Const.toInt( workflowMeta.environmentSubstitute( wPort.getText() ), 0 ); String realUsername = workflowMeta.environmentSubstitute( wUserName.getText() ); String realPassword = Utils.resolvePassword( workflowMeta, wPassword.getText() ); connection = new FtpsConnection( FtpsConnection.getConnectionTypeByDesc( wConnectionType.getText() ), realServername, port, realUsername, realPassword ); if ( !Utils.isEmpty( wProxyHost.getText() ) ) { // Set proxy String realProxy_host = workflowMeta.environmentSubstitute( wProxyHost.getText() ); String realProxy_user = workflowMeta.environmentSubstitute( wProxyUsername.getText() ); String realProxy_pass = Utils.resolvePassword( workflowMeta, wProxyPassword.getText() ); connection.setProxyHost( realProxy_host ); int proxyport = Const.toInt( workflowMeta.environmentSubstitute( wProxyPort.getText() ), 990 ); if ( proxyport != 0 ) { connection.setProxyPort( proxyport ); } if ( !Utils.isEmpty( realProxy_user ) ) { connection.setProxyUser( realProxy_user ); } if ( !Utils.isEmpty( realProxy_pass ) ) { connection.setProxyPassword( realProxy_pass ); } } // login to FTPS host ... connection.connect(); // pwdFolder=connection.getWorkingDirectory(); } String realFTPSDirectory = null; if ( !Utils.isEmpty( wFtpsDirectory.getText() ) ) { realFTPSDirectory = workflowMeta.environmentSubstitute( wFtpsDirectory.getText() ); } if ( checkfolder ) { // if(pwdFolder!=null) connection.changeDirectory(pwdFolder); // move to spool dir ... if ( !Utils.isEmpty( realFTPSDirectory ) ) { // connection.changeDirectory(realFTPSDirectory); retval = connection.isDirectoryExists( realFTPSDirectory ); } } if ( checkmoveToFolder ) { // if(pwdFolder!=null) connection.changeDirectory(pwdFolder); // move to folder ... if ( !Utils.isEmpty( wMoveToDirectory.getText() ) ) { String realMoveDirectory = workflowMeta.environmentSubstitute( wMoveToDirectory.getText() ); // realMoveDirectory=realFTPSDirectory+"/"+realMoveDirectory; // connection.changeDirectory(realMoveDirectory); retval = connection.isDirectoryExists( realMoveDirectory ); } } } catch ( Exception e ) { retval = false; if ( connection != null ) { try { connection.disconnect(); } catch ( Exception ignored ) { // We've tried quitting the FTPS Client exception // nothing else to be done if the FTPS Client was already disconnected } connection = null; } MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR ); mb.setMessage( BaseMessages.getString( PKG, "JobFTPS.ErrorConnect.NOK", realServername, e.getMessage() ) + Const.CR ); mb.setText( BaseMessages.getString( PKG, "JobFTPS.ErrorConnect.Title.Bad" ) ); mb.open(); } return retval; }
Example 18
Source File: ActionMssqlBulkLoadDialog.java From hop with Apache License 2.0 | 4 votes |
private void ok() { if ( Utils.isEmpty( wName.getText() ) ) { MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR ); mb.setText( BaseMessages.getString( PKG, "System.TransformActionNameMissing.Title" ) ); mb.setMessage( BaseMessages.getString( PKG, "System.ActionNameMissing.Msg" ) ); mb.open(); return; } action.setName( wName.getText() ); action.setDatabase( workflowMeta.findDatabase( wConnection.getText() ) ); action.setSchemaname( wSchemaname.getText() ); action.setTablename( wTablename.getText() ); action.setFilename( wFilename.getText() ); action.setDataFileType( wDataFiletype.getText() ); action.setFieldTerminator( wFieldTerminator.getText() ); action.setLineterminated( wLineterminated.getText() ); action.setCodePage( wCodePage.getText() ); action.setSpecificCodePage( wSpecificCodePage.getText() ); action.setFormatFilename( wFormatFilename.getText() ); action.setFireTriggers( wFireTriggers.getSelection() ); action.setCheckConstraints( wCheckConstraints.getSelection() ); action.setKeepNulls( wKeepNulls.getSelection() ); action.setKeepIdentity( wKeepIdentity.getSelection() ); action.setTablock( wTablock.getSelection() ); action.setStartFile( Const.toInt( wStartFile.getText(), 0 ) ); action.setEndFile( Const.toInt( wEndFile.getText(), 0 ) ); action.setOrderBy( wOrderBy.getText() ); if ( wOrderDirection.getSelectionIndex() == 0 ) { action.setOrderDirection( "Asc" ); } else { action.setOrderDirection( "Desc" ); } action.setErrorFilename( wErrorFilename.getText() ); action.setMaxErrors( Const.toInt( wMaxErrors.getText(), 0 ) ); action.setBatchSize( Const.toInt( wBatchSize.getText(), 0 ) ); action.setRowsPerBatch( Const.toInt( wRowsPerBatch.getText(), 0 ) ); action.setAddDatetime( wAddDateTime.getSelection() ); action.setAddFileToResult( wAddFileToResult.getSelection() ); action.setTruncate( wTruncate.getSelection() ); dispose(); }
Example 19
Source File: ActionEvalFilesMetricsDialog.java From hop with Apache License 2.0 | 4 votes |
private void ok() { if ( Utils.isEmpty( wName.getText() ) ) { MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR ); mb.setText( BaseMessages.getString( PKG, "System.TransformActionNameMissing.Title" ) ); mb.setMessage( BaseMessages.getString( PKG, "System.ActionNameMissing.Msg" ) ); mb.open(); return; } action.setName( wName.getText() ); action.setResultFilenamesWildcard( wResultFilenamesWildcard.getText() ); action.setResultFieldFile( wResultFieldFile.getText() ); action.setResultFieldWildcard( wResultFieldWildcard.getText() ); action.setResultFieldIncludeSubfolders( wResultFieldIncludeSubFolders.getText() ); action.sourceFiles = ActionEvalFilesMetrics.getSourceFilesByDesc( wSourceFiles.getText() ); action.evaluationType = ActionEvalFilesMetrics.getEvaluationTypeByDesc( wEvaluationType.getText() ); action.scale = ActionEvalFilesMetrics.getScaleByDesc( wScale.getText() ); action.setSuccessConditionType( ActionEvalFilesMetrics.getSuccessNumberConditionByDesc( wSuccessNumberCondition.getText() ) ); action.setCompareValue( wCompareValue.getText() ); action.setMinValue( wMinValue.getText() ); action.setMaxValue( wMaxValue.getText() ); int nritems = wFields.nrNonEmpty(); int nr = 0; for ( int i = 0; i < nritems; i++ ) { String arg = wFields.getNonEmpty( i ).getText( 1 ); if ( arg != null && arg.length() != 0 ) { nr++; } } String[] sourceFileFolder = new String[ nr ]; String[] sourceWildcard = new String[ nr ]; String[] sourceIncludeSubfolders = new String[ nr ]; nr = 0; for ( int i = 0; i < nritems; i++ ) { String source = wFields.getNonEmpty( i ).getText( 1 ); String wild = wFields.getNonEmpty( i ).getText( 2 ); String includeSubFolders = wFields.getNonEmpty( i ).getText( 3 ); if ( source != null && source.length() != 0 ) { sourceFileFolder[ nr ] = source; sourceWildcard[ nr ] = wild; sourceIncludeSubfolders[ nr ] = ActionEvalFilesMetrics.getIncludeSubFolders( includeSubFolders ); nr++; } } action.setSourceFileFolder( sourceFileFolder ); action.setSourceWildcard( sourceWildcard ); action.setSourceIncludeSubfolders( sourceIncludeSubfolders ); dispose(); }
Example 20
Source File: ActionDosToUnixDialog.java From hop with Apache License 2.0 | 4 votes |
private void ok() { if ( Utils.isEmpty( wName.getText() ) ) { MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR ); mb.setMessage( "Please give this action a name!" ); mb.setText( "No name" ); mb.open(); return; } action.setName( wName.getText() ); action.setIncludeSubfolders( wIncludeSubfolders.getSelection() ); action.setArgFromPrevious( wPrevious.getSelection() ); action.setNrErrorsLessThan( wNrErrorsLessThan.getText() ); if ( wSuccessCondition.getSelectionIndex() == 1 ) { action.setSuccessCondition( ActionDosToUnix.SUCCESS_IF_AT_LEAST_X_FILES_PROCESSED ); } else if ( wSuccessCondition.getSelectionIndex() == 2 ) { action.setSuccessCondition( ActionDosToUnix.SUCCESS_IF_ERROR_FILES_LESS ); } else { action.setSuccessCondition( ActionDosToUnix.SUCCESS_IF_NO_ERRORS ); } if ( wAddFilenameToResult.getSelectionIndex() == 1 ) { action.setResultFilenames( ActionDosToUnix.ADD_PROCESSED_FILES_ONLY ); } else if ( wAddFilenameToResult.getSelectionIndex() == 2 ) { action.setResultFilenames( ActionDosToUnix.ADD_ERROR_FILES_ONLY ); } else if ( wAddFilenameToResult.getSelectionIndex() == 3 ) { action.setResultFilenames( ActionDosToUnix.ADD_ALL_FILENAMES ); } else { action.setResultFilenames( ActionDosToUnix.ADD_NOTHING ); } int nritems = wFields.nrNonEmpty(); int nr = 0; for ( int i = 0; i < nritems; i++ ) { String arg = wFields.getNonEmpty( i ).getText( 1 ); if ( arg != null && arg.length() != 0 ) { nr++; } } action.source_filefolder = new String[ nr ]; action.wildcard = new String[ nr ]; action.conversionTypes = new int[ nr ]; nr = 0; for ( int i = 0; i < nritems; i++ ) { String source = wFields.getNonEmpty( i ).getText( 1 ); String wild = wFields.getNonEmpty( i ).getText( 2 ); if ( source != null && source.length() != 0 ) { action.source_filefolder[ nr ] = source; action.wildcard[ nr ] = wild; action.conversionTypes[ nr ] = ActionDosToUnix.getConversionTypeByDesc( wFields.getNonEmpty( i ).getText( 3 ) ); nr++; } } dispose(); }