org.eclipse.swt.widgets.MessageBox Java Examples

The following examples show how to use org.eclipse.swt.widgets.MessageBox. 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: TableView.java    From hop with Apache License 2.0 7 votes vote down vote up
public void clearAll( boolean ask ) {
  int id = SWT.YES;
  if ( ask ) {
    MessageBox mb = new MessageBox( parent.getShell(), SWT.YES | SWT.NO | SWT.ICON_QUESTION );
    mb.setMessage( BaseMessages.getString( PKG, "TableView.MessageBox.ClearTable.message" ) );
    mb.setText( BaseMessages.getString( PKG, "TableView.MessageBox.ClearTable.title" ) );
    id = mb.open();
  }

  if ( id == SWT.YES ) {
    table.removeAll();
    new TableItem( table, SWT.NONE );
    if ( !readonly ) {
      parent.getDisplay().asyncExec( new Runnable() {
        @Override
        public void run() {
          edit( 0, 1 );
        }
      } );
    }
    this.setModified(); // timh
  }
}
 
Example #2
Source File: SftpPutDialog.java    From hop with Apache License 2.0 7 votes vote down vote up
@VisibleForTesting
boolean connectToSftp(boolean checkFolder, String Remotefoldername ) {
  boolean retval = true;
  try {
    if ( sftpclient == null || input.hasChanged() ) {
      sftpclient = createSftpClient();
    }
    if ( checkFolder ) {
      retval = sftpclient.folderExists( Remotefoldername );
    }

  } catch ( Exception e ) {
    MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR );
    mb.setMessage( BaseMessages.getString( PKG, "SFTPPUT.ErrorConnect.NOK", wServerName.getText(), e
      .getMessage() )
      + Const.CR );
    mb.setText( BaseMessages.getString( PKG, "SFTPPUT.ErrorConnect.Title.Bad" ) );
    mb.open();
    retval = false;
  }
  return retval;
}
 
Example #3
Source File: OraBulkLoaderDialog.java    From hop with Apache License 2.0 6 votes vote down vote up
private void getTableName() {
  String connectionName = wConnection.getText();
  if ( StringUtils.isEmpty( connectionName ) ) {
    return;
  }
  DatabaseMeta databaseMeta = pipelineMeta.findDatabase( connectionName );
  if ( databaseMeta != null ) {
    if ( log.isDebug() ) {
      logDebug( BaseMessages.getString( PKG, "OraBulkLoaderDialog.Log.LookingAtConnection" ) + databaseMeta.toString() );
    }

    DatabaseExplorerDialog std = new DatabaseExplorerDialog( shell, SWT.NONE, databaseMeta, pipelineMeta.getDatabases() );
    std.setSelectedSchemaAndTable( wSchema.getText(), wTable.getText() );
    if ( std.open() ) {
      wSchema.setText( Const.NVL( std.getSchemaName(), "" ) );
      wTable.setText( Const.NVL( std.getTableName(), "" ) );
      setTableFieldCombo();
    }
  } else {
    MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR );
    mb.setMessage( BaseMessages.getString( PKG, "OraBulkLoaderDialog.InvalidConnection.DialogMessage" ) );
    mb.setText( BaseMessages.getString( PKG, "OraBulkLoaderDialog.InvalidConnection.DialogTitle" ) );
    mb.open();
  }
}
 
Example #4
Source File: ActionSNMPTrapDialog.java    From hop with Apache License 2.0 6 votes vote down vote up
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.setPort( wPort.getText() );
  action.setServerName( wServerName.getText() );
  action.setOID( wOID.getText() );
  action.setTimeout( wTimeout.getText() );
  action.setRetry( wTimeout.getText() );
  action.setComString( wComString.getText() );
  action.setMessage( wMessage.getText() );
  action.setTargetType( wTargetType.getText() );
  action.setUser( wUser.getText() );
  action.setPassPhrase( wPassphrase.getText() );
  action.setEngineID( wEngineID.getText() );
  dispose();
}
 
Example #5
Source File: MySQLBulkLoaderDialog.java    From hop with Apache License 2.0 6 votes vote down vote up
private void ok() {
  if ( Utils.isEmpty( wTransformName.getText() ) ) {
    return;
  }

  // Get the information for the dialog into the input structure.
  getInfo( input );

  if ( input.getDatabaseMeta() == null ) {
    MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR );
    mb.setMessage( BaseMessages.getString( PKG, "MySQLBulkLoaderDialog.InvalidConnection.DialogMessage" ) );
    mb.setText( BaseMessages.getString( PKG, "MySQLBulkLoaderDialog.InvalidConnection.DialogTitle" ) );
    mb.open();
  }

  dispose();
}
 
Example #6
Source File: HopGuiWorkflowGraph.java    From hop with Apache License 2.0 6 votes vote down vote up
public void enableDisableHopsDownstream( WorkflowHopMeta hop, boolean enabled ) {
  if ( hop == null ) {
    return;
  }
  WorkflowHopMeta before = (WorkflowHopMeta) hop.clone();
  hop.setEnabled( enabled );
  WorkflowHopMeta after = (WorkflowHopMeta) hop.clone();
  hopGui.undoDelegate.addUndoChange( workflowMeta, new WorkflowHopMeta[] { before }, new WorkflowHopMeta[] { after }, new int[] { workflowMeta
    .indexOfWorkflowHop( hop ) } );

  Set<ActionCopy> checkedEntries = enableDisableNextHops( hop.getToAction(), enabled, new HashSet<>() );

  if ( checkedEntries.stream().anyMatch( action -> workflowMeta.hasLoop( action ) ) ) {
    MessageBox mb = new MessageBox( hopShell(), SWT.OK | SWT.ICON_WARNING );
    mb.setMessage( BaseMessages.getString( PKG, "WorkflowGraph.Dialog.LoopAfterHopEnabled.Message" ) );
    mb.setText( BaseMessages.getString( PKG, "WorkflowGraph.Dialog.LoopAfterHopEnabled.Title" ) );
    mb.open();
  }

  updateGui();
}
 
Example #7
Source File: ScriptValuesAddedFunctions.java    From hop with Apache License 2.0 6 votes vote down vote up
public static String Alert( Context actualContext, Scriptable actualObject, Object[] ArgList,
                              Function FunctionContext ) {

    HopGui hopGui = HopGui.getInstance();
    if ( ArgList.length == 1 && hopGui != null ) {
      String strMessage = Context.toString( ArgList[ 0 ] );
      MessageBox mb = new MessageBox( hopGui.getShell(), SWT.OK | SWT.ICON_INFORMATION );
      mb.setMessage( strMessage );
      mb.setText(  "alert"  );
      mb.open();
/*
      boolean ok = hopGui.messageBox( strMessage, "Alert", true, Const.INFO );
      if ( !ok ) {
        throw new RuntimeException( "Alert dialog cancelled by user." );
      }
*/
    }

    return "";
  }
 
Example #8
Source File: ActionPingDialog.java    From hop with Apache License 2.0 6 votes vote down vote up
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.setHostname( wHostname.getText() );
  action.setNbrPackets( wNbrPackets.getText() );
  action.setTimeOut( wTimeOut.getText() );
  action.ipingtype = wPingType.getSelectionIndex();
  if ( wPingType.getSelectionIndex() == action.isystemPing ) {
    action.pingtype = action.systemPing;
  } else if ( wPingType.getSelectionIndex() == action.ibothPings ) {
    action.pingtype = action.bothPings;
  } else {
    action.pingtype = action.classicPing;
  }

  dispose();
}
 
Example #9
Source File: ActionMysqlBulkLoadDialog.java    From hop with Apache License 2.0 6 votes vote down vote up
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, "JobMysqlBulkLoad.ConnectionError2.DialogMessage" ) );
      mb.setText( BaseMessages.getString( PKG, "System.Dialog.Error.Title" ) );
      mb.open();
    }
  }
}
 
Example #10
Source File: UserDefinedJavaClassDialog.java    From hop with Apache License 2.0 6 votes vote down vote up
private boolean cancel() {
  if ( input.hasChanged() ) {
    MessageBox box = new MessageBox( shell, SWT.YES | SWT.NO | SWT.APPLICATION_MODAL );
    box.setText( BaseMessages.getString( PKG, "UserDefinedJavaClassDialog.WarningDialogChanged.Title" ) );
    box.setMessage( BaseMessages.getString(
      PKG, "UserDefinedJavaClassDialog.WarningDialogChanged.Message", Const.CR ) );
    int answer = box.open();

    if ( answer == SWT.NO ) {
      return false;
    }
  }
  transformName = null;
  input.setChanged( changed );
  dispose();
  return true;
}
 
Example #11
Source File: UserDefinedJavaClassDialog.java    From hop with Apache License 2.0 6 votes vote down vote up
private boolean checkForTransformClass() {
  boolean hasTransformClass = true;
  // Check if Active Script has set, otherwise Ask
  if ( getCTabItemByName( strActiveScript ) == null ) {
    MessageBox mb = new MessageBox( shell, SWT.OK | SWT.CANCEL | SWT.ICON_ERROR );
    mb.setMessage( BaseMessages.getString( PKG, "UserDefinedJavaClassDialog.NoTransformClassSet" ) );
    mb.setText( BaseMessages.getString( PKG, "UserDefinedJavaClassDialog.ERROR.Label" ) );
    switch ( mb.open() ) {
      case SWT.OK:
        strActiveScript = folder.getItem( 0 ).getText();
        refresh();
        hasTransformClass = true;
        break;
      case SWT.CANCEL:
        hasTransformClass = false;
        break;
      default:
        break;
    }
  }
  return hasTransformClass;
}
 
Example #12
Source File: HopGuiWorkflowActionDelegate.java    From hop with Apache License 2.0 6 votes vote down vote up
public void dupeJobEntry( WorkflowMeta workflowMeta, ActionCopy action ) {
  if ( action == null ) {
    return;
  }

  if ( action.isStart() ) {
    MessageBox mb = new MessageBox( hopGui.getShell(), SWT.OK | SWT.ICON_INFORMATION );
    mb.setMessage( BaseMessages.getString( PKG, "HopGui.Dialog.OnlyUseStartOnce.Message" ) );
    mb.setText( BaseMessages.getString( PKG, "HopGui.Dialog.OnlyUseStartOnce.Title" ) );
    mb.open();
    return;
  }

  ActionCopy copyOfAction = action.clone();
  copyOfAction.setNr( workflowMeta.findUnusedNr( copyOfAction.getName() ) );

  Point p = action.getLocation();
  copyOfAction.setLocation( p.x + 10, p.y + 10 );

  workflowMeta.addAction( copyOfAction );

  workflowGraph.updateGui();
}
 
Example #13
Source File: ActionWriteToFileDialog.java    From hop with Apache License 2.0 6 votes vote down vote up
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.setFilename( wFilename.getText() );
  action.setCreateParentFolder( wCreateParentFolder.getSelection() );
  action.setAppendFile( wAppendFile.getSelection() );
  action.setContent( wContent.getText() );
  action.setEncoding( wEncoding.getText() );

  dispose();
}
 
Example #14
Source File: ActionWaitForSqlDialog.java    From hop with Apache License 2.0 6 votes vote down vote up
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 #15
Source File: ActionWaitForSqlDialog.java    From hop with Apache License 2.0 6 votes vote down vote up
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, "ActionWaitForSQL.ConnectionError2.DialogMessage" ) );
      mb.setText( BaseMessages.getString( PKG, "System.Dialog.Error.Title" ) );
      mb.open();
    }
  }
}
 
Example #16
Source File: XBaseInputDialog.java    From hop with Apache License 2.0 6 votes vote down vote up
private void ok() {
  if ( Utils.isEmpty( wTransformName.getText() ) ) {
    return;
  }

  try {
    transformName = wTransformName.getText(); // return value
    getInfo( input );
  } catch ( HopTransformException e ) {
    MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR );
    mb.setMessage( e.toString() );
    mb.setText( BaseMessages.getString( PKG, "System.Warning" ) );
    mb.open();
  }
  dispose();
}
 
Example #17
Source File: ActionFolderIsEmptyDialog.java    From hop with Apache License 2.0 6 votes vote down vote up
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.setIncludeSubFolders( wIncludeSubFolders.getSelection() );
  action.setSpecifyWildcard( wSpecifyWildcard.getSelection() );
  action.setWildcard( wWildcard.getText() );

  dispose();
}
 
Example #18
Source File: HopGitPerspective.java    From hop with Apache License 2.0 6 votes vote down vote up
/**
 * Discard changes to selected unstaged files.
 * Equivalent to <tt>git checkout -- &lt;paths&gt;</tt>
 *
 * @throws Exception
 */
@GuiToolbarElement(
  root = GUI_PLUGIN_FILES_TOOLBAR_PARENT_ID,
  id = FILES_TOOLBAR_ITEM_FILES_DISCARD,
  label = "Discard",
  toolTip = "Discard changes to the selected files"
)
public void discard() throws Exception {
  MessageBox box = new MessageBox( hopGui.getShell(), SWT.YES | SWT.NO | SWT.ICON_QUESTION );
  box.setText( "Confirm" );
  box.setMessage( "Are you sure you want to discard changes to the selected " + getSelectedChangedFiles().size() + " files?" );
  int answer = box.open();
  if ( ( answer & SWT.YES ) == 0 ) {
    return;
  }

  List<UIFile> contents = getSelectedChangedFiles();
  for ( UIFile content : contents ) {
    vcs.revertPath( content.getName() );
  }
  refresh();

}
 
Example #19
Source File: ActionSyslogDialog.java    From hop with Apache License 2.0 6 votes vote down vote up
private void ok() {
  if ( Utils.isEmpty( wName.getText() ) ) {
    MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR );
    mb.setMessage( BaseMessages.getString( PKG, "ActionSyslog.PleaseGiveActionAName.Message" ) );
    mb.setText( BaseMessages.getString( PKG, "ActionSyslog.PleaseGiveActionAName.Title" ) );
    mb.open();
    return;
  }
  action.setName( wName.getText() );
  action.setPort( wPort.getText() );
  action.setServerName( wServerName.getText() );
  action.setFacility( wFacility.getText() );
  action.setPriority( wPriority.getText() );
  action.setMessage( wMessage.getText() );
  action.addTimestamp( wAddTimestamp.getSelection() );
  action.setDatePattern( wDatePattern.getText() );
  action.addHostName( wAddHostName.getSelection() );
  dispose();
}
 
Example #20
Source File: ActionTableExistsDialog.java    From hop with Apache License 2.0 6 votes vote down vote up
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 #21
Source File: EnterValueDialog.java    From hop with Apache License 2.0 6 votes vote down vote up
/**
 * Test the entered value
 */
public void test() {
  try {
    ValueMetaAndData v = getValue( valueMeta.getName() );
    MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_INFORMATION );

    StringBuilder result = new StringBuilder();
    result.append( Const.CR ).append( Const.CR ).append( "    " ).append( v.toString() );
    result.append( Const.CR ).append( "    " ).append( v.toStringMeta() );

    mb.setMessage( BaseMessages.getString( PKG, "EnterValueDialog.TestResult.Message", result.toString() ) );
    mb.setText( BaseMessages.getString( PKG, "EnterValueDialog.TestResult.Title" ) );
    mb.open();
  } catch ( HopValueException e ) {
    new ErrorDialog( shell, "Error", "There was an error during data type conversion: ", e );
  }
}
 
Example #22
Source File: ActionSendNagiosPassiveCheckDialog.java    From hop with Apache License 2.0 6 votes vote down vote up
private void ok() {
  if ( Utils.isEmpty( wName.getText() ) ) {
    MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR );
    mb.setMessage( BaseMessages.getString( PKG, "System.Error.TransformNameMissing.Message" ) );
    mb.setText( BaseMessages.getString( PKG, "System.Error.TransformNameMissing.Title" ) );
    mb.open();
    return;
  }
  action.setName( wName.getText() );
  action.setPort( wPort.getText() );
  action.setServerName( wServerName.getText() );
  action.setConnectionTimeOut( wConnectionTimeOut.getText() );
  action.setResponseTimeOut( wResponseTimeOut.getText() );
  action.setSenderServerName( wSenderServerName.getText() );
  action.setSenderServiceName( wSenderServiceName.getText() );
  action.setMessage( wMessage.getText() );
  action.setEncryptionMode( ActionSendNagiosPassiveICheck.getEncryptionModeByDesc( wEncryptionMode.getText() ) );
  action.setLevel( ActionSendNagiosPassiveICheck.getLevelByDesc( wLevelMode.getText() ) );
  action.setPassword( wPassword.getText() );

  dispose();
}
 
Example #23
Source File: ActionSqlDialog.java    From hop with Apache License 2.0 6 votes vote down vote up
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.setSql( wSql.getText() );
  action.setUseVariableSubstitution( wUseSubs.getSelection() );
  action.setSqlFromFile( wSqlFromFile.getSelection() );
  action.setSqlFilename( wFilename.getText() );
  action.setSendOneStatement( wSendOneStatement.getSelection() );
  action.setDatabase( workflowMeta.findDatabase( wConnection.getText() ) );
  dispose();
}
 
Example #24
Source File: SynchronizeAfterMergeDialog.java    From hop with Apache License 2.0 5 votes vote down vote up
private void getTableName() {
  String connectionName = wConnection.getText();
  if ( StringUtils.isEmpty( connectionName ) ) {
    return;
  }
  DatabaseMeta databaseMeta = pipelineMeta.findDatabase( connectionName );
  if ( databaseMeta != null ) {
    if ( log.isDebug() ) {
      logDebug( BaseMessages.getString( PKG, "SynchronizeAfterMergeDialog.Log.LookingAtConnection" )
        + databaseMeta.toString() );
    }

    DatabaseExplorerDialog std = new DatabaseExplorerDialog( shell, SWT.NONE, databaseMeta, pipelineMeta.getDatabases() );
    std.setSelectedSchemaAndTable( wSchema.getText(), wTable.getText() );
    if ( std.open() ) {
      wSchema.setText( Const.NVL( std.getSchemaName(), "" ) );
      wTable.setText( Const.NVL( std.getTableName(), "" ) );
      wTable.setFocus();
      setTableFieldCombo();
    }
  } else {
    MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR );
    mb.setMessage( BaseMessages.getString( PKG, "SynchronizeAfterMergeDialog.InvalidConnection.DialogMessage" ) );
    mb.setText( BaseMessages.getString( PKG, "SynchronizeAfterMergeDialog.InvalidConnection.DialogTitle" ) );
    mb.open();
  }
}
 
Example #25
Source File: ActionFtpsPutDialog.java    From hop with Apache License 2.0 5 votes vote down vote up
private void checkRemoteFolder( String remoteFoldername ) {
  if ( !Utils.isEmpty( remoteFoldername ) ) {
    if ( connectToFtp( true, remoteFoldername ) ) {
      MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_INFORMATION );
      mb.setMessage( BaseMessages.getString( PKG, "JobFTPSPUT.FolderExists.OK", remoteFoldername ) + Const.CR );
      mb.setText( BaseMessages.getString( PKG, "JobFTPSPUT.FolderExists.Title.Ok" ) );
      mb.open();
    }
  }
}
 
Example #26
Source File: DatabaseExplorerDialog.java    From hop with Apache License 2.0 5 votes vote down vote up
public void showCount( String tableName ) {
  GetTableSizeProgressDialog pd = new GetTableSizeProgressDialog( shell, dbMeta, tableName );
  Long size = pd.open();
  if ( size != null ) {
    MessageBox mb = new MessageBox( shell, SWT.ICON_INFORMATION | SWT.OK );
    mb.setMessage( BaseMessages.getString( PKG, "DatabaseExplorerDialog.TableSize.Message", tableName, size.toString() ) );
    mb.setText( BaseMessages.getString( PKG, "DatabaseExplorerDialog.TableSize.Title" ) );
    mb.open();
  }
}
 
Example #27
Source File: ActionAbortDialog.java    From hop with Apache License 2.0 5 votes vote down vote up
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.setMessageAbort( wMessageAbort.getText() );
  dispose();
}
 
Example #28
Source File: MetadataManager.java    From hop with Apache License 2.0 5 votes vote down vote up
/**
 * delete an element
 *
 * @param elementName The name of the element to delete
 * @return True if anything was deleted
 */
public boolean deleteMetadata( String elementName ) {

  if ( StringUtils.isEmpty( elementName ) ) {
    return false;
  }

  MessageBox confirmBox = new MessageBox( HopGui.getInstance().getShell(), SWT.ICON_QUESTION | SWT.YES | SWT.NO );
  confirmBox.setText( "Delete?" );
  confirmBox.setMessage( "Are you sure you want to delete element " + elementName + "?" );
  int anwser = confirmBox.open();
  if ( ( anwser & SWT.YES ) == 0 ) {
    return false;
  }

  try {
    IHopMetadataSerializer<T> serializer = getSerializer();

    // delete the metadata object from the metadata
    //
    T object = serializer.delete( elementName );

    // Just to be precise.
    //
    initializeElementVariables( object );

    ExtensionPointHandler.callExtensionPoint( HopGui.getInstance().getLog(), HopExtensionPoint.HopGuiMetadataObjectDeleted.id, object );

    return true;

  } catch ( Exception e ) {
    new ErrorDialog( HopGui.getInstance().getShell(), "Error", "Error deleting metadata element " + elementName, e );
    return false;
  }
}
 
Example #29
Source File: ActionDeleteResultFilenamesDialog.java    From hop with Apache License 2.0 5 votes vote down vote up
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.setSpecifyWildcard( wSpecifyWildcard.getSelection() );
  action.setWildcard( wWildcard.getText() );
  action.setWildcardExclude( wWildcardExclude.getText() );

  dispose();
}
 
Example #30
Source File: FileDefinitionDialog.java    From hop with Apache License 2.0 5 votes vote down vote up
public void ok() {
  if ( StringUtils.isEmpty( wName.getText() ) ) {
    MessageBox box = new MessageBox( shell, SWT.ICON_ERROR | SWT.OK );
    box.setText( BaseMessages.getString( PKG, "FileDefinitionDialog.NoNameDialog.Title" ) );
    box.setMessage( BaseMessages.getString( PKG, "FileDefinitionDialog.NoNameDialog.Message" ) );
    box.open();
    return;
  }
  getInfo( fileDefinition );
  definitionName = fileDefinition.getName();
  dispose();
}