當前位置: 首頁>>代碼示例>>Java>>正文


Java BaseMessages類代碼示例

本文整理匯總了Java中org.pentaho.di.i18n.BaseMessages的典型用法代碼示例。如果您正苦於以下問題:Java BaseMessages類的具體用法?Java BaseMessages怎麽用?Java BaseMessages使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


BaseMessages類屬於org.pentaho.di.i18n包,在下文中一共展示了BaseMessages類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: init

import org.pentaho.di.i18n.BaseMessages; //導入依賴的package包/類
@Override
public boolean init( StepMetaInterface smi, StepDataInterface sdi ) {
  if ( !super.init( smi, sdi ) ) {
    return false;
  }
  meta = (ZendeskInputMeta) smi;
  data = (ZendeskInputData) sdi;

  String subDomain = environmentSubstitute( meta.getSubDomain() );
  String username = environmentSubstitute( meta.getUsername() );
  String password = Encr.decryptPasswordOptionallyEncrypted( environmentSubstitute( meta.getPassword() ) );

  if ( Const.isEmpty( subDomain ) || Const.isEmpty( username ) || Const.isEmpty( password ) ) {
    logError( BaseMessages.getString( PKG, "ZendeskInput.Error.MissingCredentials" ) );
    return false;
  }

  data.conn = createConnection( subDomain, username, password, meta.isToken() );
  if ( data.conn == null || data.conn.isClosed() ) {
    return false;
  }
  return true;
}
 
開發者ID:matthewtckr,項目名稱:pdi-zendesk-plugin,代碼行數:24,代碼來源:ZendeskInput.java

示例2: initLifecycleListeners

import org.pentaho.di.i18n.BaseMessages; //導入依賴的package包/類
/**
 * 提醒所有生命周期的插件水壺環境。 初始化。
 * 
 * @throws KettleException
 *             當一個生命周期偵聽器拋出一個異常
 */
private static void initLifecycleListeners() throws KettleException {
	final KettleLifecycleSupport s = new KettleLifecycleSupport();
	s.onEnvironmentInit();
	// 注冊關閉hook監聽的調用OnExit()方法
	Runtime.getRuntime().addShutdownHook(new Thread() {
		public void run() {
			try {
				s.onEnvironmentShutdown();
			} catch (Throwable t) {
				System.err.println(BaseMessages
						.getString(PKG,
								"LifecycleSupport.ErrorInvokingKettleEnvironmentShutdownListeners"));
				t.printStackTrace();
			}
		};
	});

}
 
開發者ID:jiangzongyao,項目名稱:kettle_support_kettle8.0,代碼行數:25,代碼來源:KettleEnvironment.java

示例3: setCompressionTooltips

import org.pentaho.di.i18n.BaseMessages; //導入依賴的package包/類
public static void setCompressionTooltips(CCombo wCompression, Class dialogClass)
{
    switch (ConnectionCompression.fromString(wCompression.getText())) {
        case NONE:
            wCompression.setToolTipText(BaseMessages.getString(dialogClass, "CompressionNone.TipText"));
            break;
        case SNAPPY:
            wCompression.setToolTipText(BaseMessages.getString(dialogClass, "CompressionSnappy.TipText"));
            break;
        case PIEDPIPER:
            wCompression.setToolTipText(BaseMessages.getString(dialogClass, "CompressionPiedPiper.TipText"));
            break;
        default:
            wCompression.setToolTipText(BaseMessages.getString(dialogClass, "CompressionNotAvailable.TipText"));
    }
}
 
開發者ID:bcolas,項目名稱:pentaho-cassandra-plugin,代碼行數:17,代碼來源:CommonDialog.java

示例4: addRepo

import org.pentaho.di.i18n.BaseMessages; //導入依賴的package包/類
public void addRepo() throws MetaStoreException, XulException {
  MetaStoreFactory<GitRepository> repoFactory = getRepoFactory();
  GitRepository repo = new GitRepository();
  EditRepositoryDialog dialog = new EditRepositoryDialog( getShell(), repo );
  if ( dialog.open() == Window.OK ) {
    repoFactory.saveElement( repo );

    XulConfirmBox confirmBox = (XulConfirmBox) document.createElement( "confirmbox" );
    confirmBox.setTitle( "Success" );
    confirmBox.setMessage( "Open now?" );
    confirmBox.setAcceptLabel( BaseMessages.getString( PKG, "Dialog.Ok" ) );
    confirmBox.setCancelLabel( BaseMessages.getString( PKG, "Dialog.Cancel" ) );
    confirmBox.addDialogCallback( (XulDialogLambdaCallback<Object>) ( sender, returnCode, retVal ) -> {
      if ( returnCode == Status.ACCEPT ) {
        gitController.openGit( repo );
      }
    } );
    confirmBox.open();
  }
}
 
開發者ID:HiromuHota,項目名稱:pdi-git-plugin,代碼行數:21,代碼來源:GitSpoonMenuController.java

示例5: add

import org.pentaho.di.i18n.BaseMessages; //導入依賴的package包/類
@Override
public void add( String name ) {
  try {
    if ( name.matches( ".*\\.mine$|.*\\.r\\d+$" ) ) { // Resolve a conflict
      File conflicted = new File( directory + File.separator + FilenameUtils.separatorsToSystem( FilenameUtils.removeExtension( name ) ) );
      FileUtils.rename( new File( directory, name ),
          conflicted,
          StandardCopyOption.REPLACE_EXISTING );
      svnClient.resolved( conflicted );
    } else {
      svnClient.addFile( new File( directory, name ) );
    }
  } catch ( Exception e ) {
    showMessageBox( BaseMessages.getString( PKG, "Dialog.Error" ), e.getMessage() );
  }
}
 
開發者ID:HiromuHota,項目名稱:pdi-git-plugin,代碼行數:17,代碼來源:SVN.java

示例6: getUnstagedFiles

import org.pentaho.di.i18n.BaseMessages; //導入依賴的package包/類
@Override
public List<UIFile> getUnstagedFiles() {
  List<UIFile> files = new ArrayList<UIFile>();
  try {
    svnClient.getStatus( root, true, false, false,
      false, false, ( String path, ISVNStatus status ) -> {
        if ( status.getTextStatus().equals( SVNStatusKind.UNVERSIONED )
            || status.getTextStatus().equals( SVNStatusKind.MISSING ) ) {
          files.add( new UIFile( path.replaceFirst( directory.replace( "\\", "/" ) + "/", "" ), convertTypeToGit( status.getTextStatus().toString() ), false ) );
        }
      } );
  } catch ( SVNClientException e ) {
    showMessageBox( BaseMessages.getString( PKG, "Dialog.Error" ), e.getMessage() );
  }
  return files;
}
 
開發者ID:HiromuHota,項目名稱:pdi-git-plugin,代碼行數:17,代碼來源:SVN.java

示例7: getStagedFiles

import org.pentaho.di.i18n.BaseMessages; //導入依賴的package包/類
@Override
public List<UIFile> getStagedFiles() {
  List<UIFile> files = new ArrayList<UIFile>();
  try {
    svnClient.getStatus( root, true, false, false,
      false, false, ( String path, ISVNStatus status ) -> {
        if ( !status.getTextStatus().equals( SVNStatusKind.UNVERSIONED )
            && !status.getTextStatus().equals( SVNStatusKind.MISSING ) ) {
          files.add( new UIFile( path.replaceFirst( directory.replace( "\\", "/" ) + "/", "" ), convertTypeToGit( status.getTextStatus().toString() ), true ) );
        }
      } );
  } catch ( SVNClientException e ) {
    showMessageBox( BaseMessages.getString( PKG, "Dialog.Error" ), e.getMessage() );
  }
  return files;
}
 
開發者ID:HiromuHota,項目名稱:pdi-git-plugin,代碼行數:17,代碼來源:SVN.java

示例8: open

import org.pentaho.di.i18n.BaseMessages; //導入依賴的package包/類
@Override
public InputStream open( String file, String commitId ) {
  try {
    if ( commitId.equals( IVCS.WORKINGTREE ) ) {
      return new FileInputStream( new File( directory + File.separator + FilenameUtils.separatorsToSystem( file ) ) );
    } else if ( commitId.equals( Constants.HEAD ) ) {
      return svnClient.getContent( new File( directory + File.separator + FilenameUtils.separatorsToSystem( file ) ),
        SVNRevision.HEAD );
    } else {
      return svnClient.getContent( svnClient.getInfoFromWorkingCopy( root ).getUrl().appendPath( file ),
        new SVNRevision.Number( Long.parseLong( commitId ) ) );
    }
  } catch ( Exception e ) {
    showMessageBox( BaseMessages.getString( PKG, "Dialog.Error" ), e.getMessage() );
  }
  return null;
}
 
開發者ID:HiromuHota,項目名稱:pdi-git-plugin,代碼行數:18,代碼來源:SVN.java

示例9: pull

import org.pentaho.di.i18n.BaseMessages; //導入依賴的package包/類
@Override
public boolean pull() {
  try {
    SVNRevision.Number lastRevision = svnClient.getInfoFromWorkingCopy( root ).getRevision();
    long newLastRevision = svnClient.update( root, SVNRevision.HEAD, true );
    if ( lastRevision.getNumber() == newLastRevision ) {
      showMessageBox( BaseMessages.getString( PKG, "Dialog.Success" ), "Up-to-date" );
    } else {
      showMessageBox( BaseMessages.getString( PKG, "Dialog.Success" ), BaseMessages.getString( PKG, "Dialog.Success" ) );
    }
    return true;
  } catch ( SVNClientException e ) {
    showMessageBox( BaseMessages.getString( PKG, "Dialog.Error" ), e.getMessage() );
  }
  return false;
}
 
開發者ID:HiromuHota,項目名稱:pdi-git-plugin,代碼行數:17,代碼來源:SVN.java

示例10: merge

import org.pentaho.di.i18n.BaseMessages; //導入依賴的package包/類
@Override
public boolean merge() {
  String name = null;
  List<String> names = getBranches();
  EnterSelectionDialog esd = new EnterSelectionDialog( shell, names.toArray( new String[names.size()] ),
    "Select Branch", "Select the branch to be merged (reintegrated) into the current working copy" );
  name = esd.open();
  if ( name == null ) {
    return false;
  }
  try {
    svnClient.mergeReintegrate( new SVNUrl( getRemoteRoot() + File.separator + name ),
        SVNRevision.HEAD, root, false, false );
    return true;
  } catch ( Exception e ) {
    showMessageBox( BaseMessages.getString( PKG, "Dialog.Error" ), e.getMessage() );
  }
  return false;
}
 
開發者ID:HiromuHota,項目名稱:pdi-git-plugin,代碼行數:20,代碼來源:SVN.java

示例11: rollback

import org.pentaho.di.i18n.BaseMessages; //導入依賴的package包/類
@Override
public boolean rollback( String name ) {
  if ( !isClean() ) {
    showMessageBox( BaseMessages.getString( PKG, "Dialog.Error" ), "Dirty working-tree" );
    return false;
  }
  try {
    svnClient.merge( new SVNUrl( getRemote() ),
        null,
        new SVNRevisionRange[] { new SVNRevisionRange(
            svnClient.getInfoFromWorkingCopy( root ).getRevision(),
            new SVNRevision.Number( Long.parseLong( name ) )
            ) },
        root,
        false, 100, true, false, false );
    return true;
  } catch ( Exception e ) {
    showMessageBox( BaseMessages.getString( PKG, "Dialog.Error" ), e.getMessage() );
  }
  return false;
}
 
開發者ID:HiromuHota,項目名稱:pdi-git-plugin,代碼行數:22,代碼來源:SVN.java

示例12: add

import org.pentaho.di.i18n.BaseMessages; //導入依賴的package包/類
@Override
public void add( String filepattern ) {
  try {
    if ( filepattern.endsWith( ".ours" ) || filepattern.endsWith( ".theirs" ) ) {
      FileUtils.rename( new File( directory, filepattern ),
          new File( directory, FilenameUtils.removeExtension( filepattern ) ),
          StandardCopyOption.REPLACE_EXISTING );
      filepattern = FilenameUtils.removeExtension( filepattern );
      org.apache.commons.io.FileUtils.deleteQuietly( new File( directory, filepattern + ".ours" ) );
      org.apache.commons.io.FileUtils.deleteQuietly( new File( directory, filepattern + ".theirs" ) );
    }
    git.add().addFilepattern( filepattern ).call();
  } catch ( Exception e ) {
    showMessageBox( BaseMessages.getString( PKG, "Dialog.Error" ), e.getMessage() );
  }
}
 
開發者ID:HiromuHota,項目名稱:pdi-git-plugin,代碼行數:17,代碼來源:UIGit.java

示例13: processPushResult

import org.pentaho.di.i18n.BaseMessages; //導入依賴的package包/類
private void processPushResult( Iterable<PushResult> resultIterable ) throws Exception {
  resultIterable.forEach( result -> { // for each (push)url
    StringBuilder sb = new StringBuilder();
    result.getRemoteUpdates().stream()
      .filter( update -> update.getStatus() != RemoteRefUpdate.Status.OK )
      .filter( update -> update.getStatus() != RemoteRefUpdate.Status.UP_TO_DATE )
      .forEach( update -> { // for each failed refspec
        sb.append(
          result.getURI().toString()
          + "\n" + update.getSrcRef().toString()
          + "\n" + update.getStatus().toString()
          + ( update.getMessage() == null ? "" : "\n" + update.getMessage() )
          + "\n\n"
        );
      } );
    if ( sb.length() == 0 ) {
      showMessageBox( BaseMessages.getString( PKG, "Dialog.Success" ), BaseMessages.getString( PKG, "Dialog.Success" ) );
    } else {
      showMessageBox( BaseMessages.getString( PKG, "Dialog.Error" ), sb.toString() );
    }
  } );
}
 
開發者ID:HiromuHota,項目名稱:pdi-git-plugin,代碼行數:23,代碼來源:UIGit.java

示例14: cloneRepo

import org.pentaho.di.i18n.BaseMessages; //導入依賴的package包/類
public boolean cloneRepo( String directory, String uri ) {
  CloneCommand cmd = Git.cloneRepository();
  cmd.setDirectory( new File( directory ) );
  cmd.setURI( uri );
  cmd.setCredentialsProvider( credentialsProvider );
  try {
    Git git = cmd.call();
    git.close();
    return true;
  } catch ( Exception e ) {
    if ( ( e instanceof TransportException )
        && ( ( e.getMessage().contains( "Authentication is required but no CredentialsProvider has been registered" )
          || e.getMessage().contains( "not authorized" ) ) ) ) {
      if ( promptUsernamePassword() ) {
        return cloneRepo( directory, uri );
      }
    } else {
      showMessageBox( BaseMessages.getString( PKG, "Dialog.Error" ), e.getMessage() );
    }
  }
  return false;
}
 
開發者ID:HiromuHota,項目名稱:pdi-git-plugin,代碼行數:23,代碼來源:UIGit.java

示例15: revertPath

import org.pentaho.di.i18n.BaseMessages; //導入依賴的package包/類
@Override
public void revertPath( String path ) {
  try {
    // Delete added files
    Status status = git.status().addPath( path ).call();
    if ( status.getUntracked().size() != 0 || status.getAdded().size() != 0 ) {
      resetPath( path );
      org.apache.commons.io.FileUtils.deleteQuietly( new File( directory, path ) );
    }

    /*
     * This is a work-around to discard changes of conflicting files
     * Git CLI `git checkout -- conflicted.txt` discards the changes, but jgit does not
     */
    git.add().addFilepattern( path ).call();

    git.checkout().setStartPoint( Constants.HEAD ).addPath( path ).call();
    org.apache.commons.io.FileUtils.deleteQuietly( new File( directory, path + ".ours" ) );
    org.apache.commons.io.FileUtils.deleteQuietly( new File( directory, path + ".theirs" ) );
  } catch ( Exception e ) {
    showMessageBox( BaseMessages.getString( PKG, "Dialog.Error" ), e.getMessage() );
  }
}
 
開發者ID:HiromuHota,項目名稱:pdi-git-plugin,代碼行數:24,代碼來源:UIGit.java


注:本文中的org.pentaho.di.i18n.BaseMessages類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。