类org.eclipse.swt.widgets.MessageBox源码实例Demo

下面列出了怎么用org.eclipse.swt.widgets.MessageBox的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: hop   文件: TableView.java
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
  }
}
 
源代码2 项目: hop   文件: SftpPutDialog.java
@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;
}
 
源代码3 项目: hop   文件: ActionSendNagiosPassiveCheckDialog.java
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();
}
 
源代码4 项目: hop   文件: HopGuiWorkflowActionDelegate.java
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();
}
 
源代码5 项目: hop   文件: HopGuiWorkflowGraph.java
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();
}
 
源代码6 项目: hop   文件: ActionSNMPTrapDialog.java
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();
}
 
源代码7 项目: hop   文件: EnterValueDialog.java
/**
 * 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 );
  }
}
 
源代码8 项目: hop   文件: ActionSqlDialog.java
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();
}
 
源代码9 项目: hop   文件: ActionPingDialog.java
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();
}
 
源代码10 项目: hop   文件: UserDefinedJavaClassDialog.java
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;
}
 
源代码11 项目: hop   文件: UserDefinedJavaClassDialog.java
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;
}
 
源代码12 项目: hop   文件: XBaseInputDialog.java
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();
}
 
源代码13 项目: hop   文件: ActionSyslogDialog.java
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();
}
 
源代码14 项目: hop   文件: HopGitPerspective.java
/**
 * 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();

}
 
源代码15 项目: hop   文件: OraBulkLoaderDialog.java
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();
  }
}
 
源代码16 项目: hop   文件: MySQLBulkLoaderDialog.java
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();
}
 
源代码17 项目: hop   文件: ScriptValuesAddedFunctions.java
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 "";
  }
 
源代码18 项目: hop   文件: ActionMysqlBulkLoadDialog.java
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();
    }
  }
}
 
源代码19 项目: hop   文件: ActionWriteToFileDialog.java
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();
}
 
源代码20 项目: hop   文件: ActionWaitForSqlDialog.java
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();
}
 
源代码21 项目: hop   文件: ActionWaitForSqlDialog.java
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();
    }
  }
}
 
源代码22 项目: hop   文件: ActionFolderIsEmptyDialog.java
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();
}
 
源代码23 项目: hop   文件: ActionTableExistsDialog.java
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();
    }
  }
}
 
源代码24 项目: hop   文件: XsdValidatorDialog.java
private void ok() {
  if ( Utils.isEmpty( wName.getText() ) ) {
    MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR );
    mb.setText( BaseMessages.getString( PKG, "System.StepJobEntryNameMissing.Title" ) );
    mb.setMessage( BaseMessages.getString( PKG, "System.JobEntryNameMissing.Msg" ) );
    mb.open();
    return;
  }
  jobEntry.setName( wName.getText() );
  jobEntry.setAllowExternalEntities( wAllowExternalEntities.getSelection() );
  jobEntry.setxmlFilename( wxmlFilename.getText() );
  jobEntry.setxsdFilename( wxsdFilename.getText() );

  dispose();
}
 
源代码25 项目: hop   文件: HopGuiPipelineHopDelegate.java
/**
 * @param pipelineMeta pipeline's meta
 * @param newHop    hop to be checked
 * @return true when the hop was added, false if there was an error
 */
public boolean checkIfHopAlreadyExists( PipelineMeta pipelineMeta, PipelineHopMeta newHop ) {
  boolean ok = true;
  if ( pipelineMeta.findPipelineHop( newHop.getFromTransform(), newHop.getToTransform() ) != null ) {
    MessageBox mb = new MessageBox( hopGui.getShell(), SWT.OK | SWT.ICON_ERROR );
    mb.setMessage( BaseMessages.getString( PKG, "HopGui.Dialog.HopExists.Message" ) ); // "This hop already exists!"
    mb.setText( BaseMessages.getString( PKG, "HopGui.Dialog.HopExists.Title" ) ); // Error!
    mb.open();
    ok = false;
  }

  return ok;
}
 
源代码26 项目: hop   文件: HopGuiPipelineTransformDelegate.java
public boolean isDefinedSchemaExist( String[] schemaNames ) {
  // Before we start, check if there are any partition schemas defined...
  if ( ( schemaNames == null ) || ( schemaNames.length == 0 ) ) {
    MessageBox box = new MessageBox( hopGui.getShell(), SWT.ICON_ERROR | SWT.OK );
    box.setText( "Create a partition schema" );
    box.setMessage( "You first need to create one or more partition schemas before you can select one!" );
    box.open();
    return false;
  }
  return true;
}
 
源代码27 项目: hop   文件: ActionFtpDialog.java
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();
    }
  }
}
 
源代码28 项目: hop   文件: HopGuiPipelineGraph.java
@GuiContextAction(
  id = "pipeline-graph-transform-12000-sniff-output",
  parentId = HopGuiPipelineTransformContext.CONTEXT_ID,
  type = GuiActionType.Info,
  name = "Sniff output",
  tooltip = "Take a look at 50 rows coming out of the selected transform",
  image = "ui/images/preview.svg"
)
public void sniff( HopGuiPipelineTransformContext context ) {
  TransformMeta transformMeta = context.getTransformMeta();

  if ( pipeline == null ) {
    MessageBox messageBox = new MessageBox( hopShell(), SWT.ICON_INFORMATION | SWT.OK );
    messageBox.setText( BaseMessages.getString( PKG, "PipelineGraph.SniffTestingAvailableWhenRunning.Title" ) );
    messageBox.setMessage( BaseMessages.getString( PKG, "PipelineGraph.SniffTestingAvailableWhenRunning.Message" ) );
    messageBox.open();
    return;
  }
  if ( pipeline.isFinished() ) {
    // Show collected sample data...
    //

  } else {
    try {
      pipeline.retrieveComponentOutput( transformMeta.getName(), 0, 50, ( ( pipelineEngine, rowBuffer ) -> {
        hopDisplay().asyncExec( () -> {
          PreviewRowsDialog dialog = new PreviewRowsDialog( hopShell(), hopGui.getVariables(), SWT.NONE, transformMeta.getName(), rowBuffer.getRowMeta(), rowBuffer.getBuffer() );
          dialog.open();
        } );
      } ) );
    } catch ( HopException e ) {
      new ErrorDialog( hopShell(), "Error", "Error sniffing rows", e );
    }
  }
}
 
源代码29 项目: hop   文件: HopGuiWorkflowHopDelegate.java
/**
 * @param workflowMeta workflow metadata
 * @param newHop  hop to be checked
 * @return true when the hop was added, false if there was an error
 */
public boolean checkIfHopAlreadyExists( WorkflowMeta workflowMeta, WorkflowHopMeta newHop ) {
  boolean ok = true;
  if ( workflowMeta.findWorkflowHop( newHop.getFromAction(), newHop.getToAction() ) != null ) {
    MessageBox mb = new MessageBox( hopGui.getShell(), SWT.OK | SWT.ICON_ERROR );
    mb.setMessage( BaseMessages.getString( PKG, "HopGui.Dialog.HopExists.Message" ) ); // "This hop already exists!"
    mb.setText( BaseMessages.getString( PKG, "HopGui.Dialog.HopExists.Title" ) ); // Error!
    mb.open();
    ok = false;
  }

  return ok;
}
 
源代码30 项目: hop   文件: HopGuiWorkflowHopDelegate.java
/**
 * @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;
}
 
 类所在包
 同包方法