当前位置: 首页>>代码示例>>Java>>正文


Java XulConfirmBox.open方法代码示例

本文整理汇总了Java中org.pentaho.ui.xul.components.XulConfirmBox.open方法的典型用法代码示例。如果您正苦于以下问题:Java XulConfirmBox.open方法的具体用法?Java XulConfirmBox.open怎么用?Java XulConfirmBox.open使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.pentaho.ui.xul.components.XulConfirmBox的用法示例。


在下文中一共展示了XulConfirmBox.open方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addRepo

import org.pentaho.ui.xul.components.XulConfirmBox; //导入方法依赖的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

示例2: reset

import org.pentaho.ui.xul.components.XulConfirmBox; //导入方法依赖的package包/类
/**
 * Reset to the selected commit
 * @throws XulException
 */
public void reset() throws XulException {
  XulConfirmBox confirmBox = (XulConfirmBox) document.createElement( "confirmbox" );
  confirmBox.setTitle( BaseMessages.getString( PKG, "Git.ContextMenu.Reset" ) );
  confirmBox.setMessage( "Are you sure?" );
  confirmBox.setAcceptLabel( BaseMessages.getString( PKG, "Dialog.Ok" ) );
  confirmBox.setCancelLabel( BaseMessages.getString( PKG, "Dialog.Cancel" ) );
  confirmBox.addDialogCallback( (XulDialogLambdaCallback<Object>) ( sender, returnCode, retVal ) -> {
    if ( returnCode.equals( Status.ACCEPT ) ) {
      String commitId = getFirstSelectedRevision().getName();
      try {
        vcs.reset( commitId );
        fireSourceChanged();
      } catch ( Exception e ) {
        showMessageBox( BaseMessages.getString( PKG, "Dialog.Error" ), e.getMessage() );
      }
    }
  } );
  confirmBox.open();
}
 
开发者ID:HiromuHota,项目名称:pdi-git-plugin,代码行数:24,代码来源:GitController.java

示例3: discard

import org.pentaho.ui.xul.components.XulConfirmBox; //导入方法依赖的package包/类
/**
 * Discard changes to selected unstaged files.
 * Equivalent to <tt>git checkout -- &lt;paths&gt;</tt>
 * @throws Exception
 */
public void discard() throws Exception {
  XulConfirmBox confirmBox = (XulConfirmBox) document.createElement( "confirmbox" );
  confirmBox.setTitle( BaseMessages.getString( PKG, "Git.ContextMenu.Discard" ) );
  confirmBox.setMessage( "Are you sure?" );
  confirmBox.setAcceptLabel( BaseMessages.getString( PKG, "Dialog.Ok" ) );
  confirmBox.setCancelLabel( BaseMessages.getString( PKG, "Dialog.Cancel" ) );
  confirmBox.addDialogCallback( (XulDialogLambdaCallback<Object>) ( sender, returnCode, retVal ) -> {
    if ( returnCode.equals( Status.ACCEPT ) ) {
      List<UIFile> contents = getSelectedChangedFiles();
      for ( UIFile content : contents ) {
        vcs.revertPath( content.getName() );
      }
      fireSourceChanged();
    }
  } );
  confirmBox.open();
}
 
开发者ID:HiromuHota,项目名称:pdi-git-plugin,代码行数:23,代码来源:GitController.java

示例4: onTabClose

import org.pentaho.ui.xul.components.XulConfirmBox; //导入方法依赖的package包/类
public boolean onTabClose(final int pos) throws XulException {
  
  if(models.get(pos).hasChanged()){
    XulConfirmBox confirm = (XulConfirmBox) document.createElement("confirmbox"); //$NON-NLS-1$
    confirm.setTitle(BaseMessages.getString(this.getClass(), "StarModelerPerspective.unsavedChangesTitle")); //$NON-NLS-1$
    confirm.setMessage(BaseMessages.getString(this.getClass(), "StarModelerPerspective.unsavedChangesMessage")); //$NON-NLS-1$
    
    CloseConfirmXulDialogCallback callback = new CloseConfirmXulDialogCallback();
    confirm.addDialogCallback(callback);
    confirm.open();
    if(callback.closeIt){
      models.remove(pos);
      metas.remove(tabbox.getTabs().getChildNodes().get(pos));
      return true;
    } else {
      return false;
    }
    
  } else {
    models.remove(pos);
    metas.remove(pos);
  }
  return true;
}
 
开发者ID:jjeb,项目名称:kettle-trunk,代码行数:25,代码来源:StarModelerPerspective.java

示例5: onTabClose

import org.pentaho.ui.xul.components.XulConfirmBox; //导入方法依赖的package包/类
public boolean onTabClose(final int pos) throws XulException{
	String contentId = PERSPECTIVE_ID+"\t"+models.get(pos).getFileName(); //$NON-NLS-1$
  if(models.get(pos).isDirty()){
    XulConfirmBox confirm = (XulConfirmBox) document.createElement("confirmbox"); //$NON-NLS-1$
    confirm.setTitle(BaseMessages.getString(this.getClass(), "Modeler.Perspective.unsavedChanges")); //$NON-NLS-1$
    confirm.setMessage(BaseMessages.getString(this.getClass(), "Modeler.Perspective.unsavedChangesMessage")); //$NON-NLS-1$
    
    CloseConfirmXulDialogCallback callback = new CloseConfirmXulDialogCallback();
    confirm.addDialogCallback(callback);
    confirm.open();
    if(!callback.closeIt) {
      return false;
    }
  }

  tabClosed(pos);
  switchToCaller(contentId);

  return true;
}
 
开发者ID:pentaho,项目名称:pdi-agile-bi-plugin,代码行数:21,代码来源:AgileBiModelerPerspective.java

示例6: handleOverwriteNotification

import org.pentaho.ui.xul.components.XulConfirmBox; //导入方法依赖的package包/类
public boolean handleOverwriteNotification(String objName) {
  try {
    XulConfirmBox confirm = (XulConfirmBox) document.createElement("confirmbox");
    confirm.setModalParent(this.getDialog().getRootObject());
    confirm.setTitle(BaseMessages.getString(getClass(), "Publish.Overwrite.Title"));
    confirm.setMessage(BaseMessages.getString(getClass(), "Publish.Overwrite.Message", objName));
    
    if(confirm.open() == SWT.YES){
      return true;
    }
    
  } catch (XulException e) {
    logger.error("Errpr showing overwrite notification", e);
    return false;
  }
  return false;
}
 
开发者ID:pentaho,项目名称:pdi-agile-bi-plugin,代码行数:18,代码来源:XulDialogPublish.java

示例7: onTabClose

import org.pentaho.ui.xul.components.XulConfirmBox; //导入方法依赖的package包/类
public boolean onTabClose(final int pos) throws XulException {

    if(models.get(pos).hasChanged()){
      XulConfirmBox confirm = (XulConfirmBox) document.createElement("confirmbox");
      confirm.setTitle(BaseMessages.getString(this.getClass(), "StarModelerPerspective.unsavedChangesTitle"));
      confirm.setMessage(BaseMessages.getString(this.getClass(), "StarModelerPerspective.unsavedChangesMessage"));

      CloseConfirmXulDialogCallback callback = new CloseConfirmXulDialogCallback();
      confirm.addDialogCallback(callback);
      confirm.open();
      if(callback.closeIt){
        models.remove(pos);
        metas.remove(tabbox.getTabs().getChildNodes().get(pos));
        return true;
      } else {
        return false;
      }

    } else {
      models.remove(pos);
      metas.remove(pos);
    }
    return true;
  }
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:25,代码来源:StarModelerPerspective.java

示例8: onTabClose

import org.pentaho.ui.xul.components.XulConfirmBox; //导入方法依赖的package包/类
public boolean onTabClose(final int pos) throws XulException{
	  AnalyzerVisualizationController controller = (AnalyzerVisualizationController) ((AnalyzerVisualizationMeta)selectedMeta).getController();
	  String contentId = PERSPECTIVE_ID+"\t"+controller.getVisFileLocation(); //$NON-NLS-1$
	  
// TODO - JD - enable this in Spoon
/*
	  String caller = Spoon.getInstance().getCaller(contentId);
	  if( caller == null ) {
		  contentId = PERSPECTIVE_ID+"\t"+controller.toString(); //$NON-NLS-1$
	  }
*/	  
    if(((SaveAwareMeta) this.getActiveMeta()).isDirty()){
      XulConfirmBox confirm = (XulConfirmBox) document.createElement("confirmbox"); //$NON-NLS-1$
      confirm.setTitle(BaseMessages.getString(this.getClass(), "Modeler.Perspective.unsavedChanges")); //$NON-NLS-1$
      confirm.setMessage(BaseMessages.getString(this.getClass(), "Visualization.Perspective.unsavedChangesMessage")); //$NON-NLS-1$
      
      CloseConfirmXulDialogCallback callback = new CloseConfirmXulDialogCallback();
      confirm.addDialogCallback(callback);
      confirm.open();
      if(callback.closeIt){
          switchToCaller(contentId);
        return true;
      } else {
        return false;
      }
      
    }
    switchToCaller(contentId);
    return true;
  }
 
开发者ID:pentaho,项目名称:pdi-agile-bi-plugin,代码行数:31,代码来源:AgileBiVisualizationPerspective.java


注:本文中的org.pentaho.ui.xul.components.XulConfirmBox.open方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。