本文整理汇总了Java中org.pentaho.ui.xul.components.XulConfirmBox类的典型用法代码示例。如果您正苦于以下问题:Java XulConfirmBox类的具体用法?Java XulConfirmBox怎么用?Java XulConfirmBox使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
XulConfirmBox类属于org.pentaho.ui.xul.components包,在下文中一共展示了XulConfirmBox类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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 -- <paths></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: shouldInitializeGitOnAccept
import org.pentaho.ui.xul.components.XulConfirmBox; //导入依赖的package包/类
@Test
public void shouldInitializeGitOnAccept() throws Exception {
XulConfirmBox confirm = new XulConfirmBoxMock( XulDialogCallback.Status.ACCEPT );
when( document.createElement( CONFIRMBOX ) ).thenReturn( confirm );
XulMessageBox message = new XulMessageBoxMock( XulDialogCallback.Status.ACCEPT );
when( document.createElement( MESSAGEBOX ) ).thenReturn( message );
controller.initGit( "random-path" );
verify( uiGit ).initRepo( anyString() );
}
开发者ID:HiromuHota,项目名称:pdi-git-plugin,代码行数:12,代码来源:GitControllerTest.java
示例9: shouldNotInitializeGitOnCencel
import org.pentaho.ui.xul.components.XulConfirmBox; //导入依赖的package包/类
@Test
public void shouldNotInitializeGitOnCencel() throws Exception {
XulConfirmBox confirm = new XulConfirmBoxMock( XulDialogCallback.Status.CANCEL );
when( document.createElement( CONFIRMBOX ) ).thenReturn( confirm );
controller.initGit( "random-path" );
verify( uiGit, never() ).initRepo( anyString() );
}
开发者ID:HiromuHota,项目名称:pdi-git-plugin,代码行数:10,代码来源:GitControllerTest.java
示例10: init
import org.pentaho.ui.xul.components.XulConfirmBox; //导入依赖的package包/类
public void init() throws ControllerInitializationException {
// TODO Initialize the Repository Login Dialog
try {
messageBox = (XulMessageBox) document.createElement("messagebox");//$NON-NLS-1$
confirmBox = (XulConfirmBox) document.createElement("confirmbox");//$NON-NLS-1$
} catch (Exception e) {
throw new ControllerInitializationException(e);
}
if (bf != null) {
createBindings();
}
}
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:13,代码来源:RepositoriesController.java
示例11: 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
示例12: init
import org.pentaho.ui.xul.components.XulConfirmBox; //导入依赖的package包/类
public void init() throws ControllerInitializationException {
// TODO Initialize the Repository Login Dialog
try {
messageBox = (XulMessageBox) document.createElement( "messagebox" );
confirmBox = (XulConfirmBox) document.createElement( "confirmbox" );
} catch ( Exception e ) {
throw new ControllerInitializationException( e );
}
if ( bf != null ) {
createBindings();
}
}
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:13,代码来源:RepositoriesController.java
注:本文中的org.pentaho.ui.xul.components.XulConfirmBox类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论