本文整理汇总了Java中org.pentaho.ui.xul.XulException类的典型用法代码示例。如果您正苦于以下问题:Java XulException类的具体用法?Java XulException怎么用?Java XulException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
XulException类属于org.pentaho.ui.xul包,在下文中一共展示了XulException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addRepo
import org.pentaho.ui.xul.XulException; //导入依赖的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();
}
}
示例2: reset
import org.pentaho.ui.xul.XulException; //导入依赖的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();
}
示例3: createBranch
import org.pentaho.ui.xul.XulException; //导入依赖的package包/类
public void createBranch() throws XulException {
XulPromptBox promptBox = (XulPromptBox) document.createElement( "promptbox" );
promptBox.setTitle( BaseMessages.getString( PKG, "Git.Dialog.Branch.Create.Title" ) );
promptBox.setButtons( new DialogConstant[] { DialogConstant.OK, DialogConstant.CANCEL } );
promptBox.setMessage( BaseMessages.getString( PKG, "Git.Dialog.Branch.Create.Message" ) );
promptBox.addDialogCallback( (XulDialogLambdaCallback<String>) ( component, status, value ) -> {
if ( status.equals( Status.ACCEPT ) ) {
String branch = getBranch();
if ( vcs.createBranch( value ) ) {
showMessageBox( BaseMessages.getString( PKG, "Dialog.Success" ), BaseMessages.getString( PKG, "Dialog.Success" ) );
if ( !branch.equals( getBranch() ) ) { // Creating a branch involves checkingout that branch in Git
fireSourceChanged();
}
}
}
} );
promptBox.open();
}
示例4: deleteBranch
import org.pentaho.ui.xul.XulException; //导入依赖的package包/类
public void deleteBranch() throws XulException {
DeleteBranchDialog dialog = new DeleteBranchDialog( getShell() );
List<String> branches = vcs.getLocalBranches();
branches.remove( vcs.getBranch() );
dialog.setBranches( branches );
if ( dialog.open() == Window.OK ) {
String branch = dialog.getSelectedBranch();
boolean isForce = dialog.isForce();
if ( branch == null ) {
return;
}
if ( vcs.deleteBranch( branch, isForce ) ) {
showMessageBox( BaseMessages.getString( PKG, "Dialog.Success" ), BaseMessages.getString( PKG, "Dialog.Success" ) );
}
}
}
示例5: editRemote
import org.pentaho.ui.xul.XulException; //导入依赖的package包/类
public void editRemote() {
try {
XulPromptBox promptBox = (XulPromptBox) document.createElement( "promptbox" );
promptBox.setTitle( "Remote repository" );
promptBox.setButtons( new DialogConstant[] { DialogConstant.OK, DialogConstant.CANCEL } );
promptBox.setMessage( "URL/path (The remote name will be \"" + Constants.DEFAULT_REMOTE_NAME + "\")" );
promptBox.setValue( vcs.getRemote() );
promptBox.addDialogCallback( (XulDialogLambdaCallback<String>) ( component, status, value ) -> {
if ( status.equals( Status.ACCEPT ) ) {
vcs.addRemote( value );
}
} );
promptBox.open();
} catch ( XulException e ) {
e.printStackTrace();
}
}
示例6: apply
import org.pentaho.ui.xul.XulException; //导入依赖的package包/类
public void apply(XulDomContainer container) throws XulException {
this.container = container;
container.registerClassLoader(getClass().getClassLoader());
for(XulEventHandler handler:handlers) {
container.addEventHandler(handler);
}
for (XulOverlay overlay : overlays) {
if(overlay instanceof RepositoryExplorerDefaultXulOverlay) {
container.loadOverlay(overlay.getOverlayUri(), new XulSpoonResourceBundle(((RepositoryExplorerDefaultXulOverlay) overlay).getPackageClass()));
} else {
container.loadOverlay(overlay.getOverlayUri(), overlay.getResourceBundleUri());
}
}
}
示例7: initializeXul
import org.pentaho.ui.xul.XulException; //导入依赖的package包/类
private void initializeXul() throws XulException {
SwtXulLoader loader = new SwtXulLoader();
loader.registerClassLoader(getClass().getClassLoader());
loader.setSettingsManager(XulSpoonSettingsManager.getInstance());
loader.setOuterContext(parentShell);
container = loader.loadXul( xulFile, new XulSpoonResourceBundle(getClassForMessages()));
bf.setDocument(container.getDocumentRoot());
for(XulEventHandler h : getEventHandlers()){
container.addEventHandler(h);
}
runner = new SwtXulRunner();
runner.addContainer(container);
// try and get the dialog
xulDialog = (XulDialog) container.getDocumentRoot().getRootElement();
dialogShell = (Shell) xulDialog.getRootObject();
runner.initialize();
}
示例8: runXulChangedWarningDialog
import org.pentaho.ui.xul.XulException; //导入依赖的package包/类
protected XulMessageBox runXulChangedWarningDialog(String fileName) throws IllegalArgumentException, XulException {
container = Spoon.getInstance().getMainSpoonContainer();
XulMessageBox messageBox = (XulMessageBox) container.getDocumentRoot().createElement("messagebox"); //$NON-NLS-1$
messageBox.setTitle(BaseMessages.getString(PKG, "Spoon.Dialog.PromptSave.Title")); //$NON-NLS-1$
if(fileName != null) {
messageBox.setMessage(BaseMessages.getString(PKG, "Spoon.Dialog.PromptToSave.Message", fileName)); //$NON-NLS-1$
} else {
messageBox.setMessage(BaseMessages.getString(PKG, "Spoon.Dialog.PromptSave.Message")); //$NON-NLS-1$
}
messageBox.setButtons(new Integer[] {SWT.YES, SWT.NO, SWT.CANCEL});
return messageBox;
}
示例9: displayRowCount
import org.pentaho.ui.xul.XulException; //导入依赖的package包/类
public void displayRowCount() {
if (this.model.getTable() == null) {
return;
}
try {
GetTableSizeProgressDialog pd = new GetTableSizeProgressDialog(this.dbExplorerDialog.getShell(), this.model.getDatabaseMeta(), this.model.getTable(), model.getSchema());
Long theCount = pd.open();
if (theCount != null) {
XulMessageBox theMessageBox = (XulMessageBox) document.createElement("messagebox");
theMessageBox.setModalParent(this.dbExplorerDialog.getShell());
theMessageBox.setTitle(BaseMessages.getString(PKG,"DatabaseExplorerDialog.TableSize.Title"));
theMessageBox.setMessage(BaseMessages.getString(PKG,"DatabaseExplorerDialog.TableSize.Message", this.model.getTable(), theCount.toString()));
theMessageBox.open();
}
} catch (XulException e) {
logger.error(e);
}
}
示例10: createTab
import org.pentaho.ui.xul.XulException; //导入依赖的package包/类
public XulTabAndPanel createTab(){
try {
XulTab tab = (XulTab) document.createElement("tab");
if(name != null){
tab.setLabel(name);
}
XulTabpanel panel = (XulTabpanel) document.createElement("tabpanel"); //$NON-NLS-1
panel.setSpacing(0);
panel.setPadding(0);
tabs.addChild(tab);
panels.addChild(panel);
tabbox.setSelectedIndex(panels.getChildNodes().indexOf(panel));
return new XulTabAndPanel(tab, panel);
} catch (XulException e) {
e.printStackTrace();
}
return null;
}
示例11: onFileClose
import org.pentaho.ui.xul.XulException; //导入依赖的package包/类
public boolean onFileClose() {
int idx = tabbox.getSelectedIndex();
if (idx == -1 || idx >= tabbox.getTabs().getChildNodes().size()) {
return false;
}
try {
if (onTabClose(idx)) {
XulComponent panel = panels.getChildNodes().get(idx);
XulComponent tab = tabs.getChildNodes().get(idx);
panels.removeChild(panel);
tabs.removeChild(tab);
return true;
}
} catch (XulException e) {
e.printStackTrace();
}
return false;
}
示例12: onTabClose
import org.pentaho.ui.xul.XulException; //导入依赖的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;
}
示例13: handleException
import org.pentaho.ui.xul.XulException; //导入依赖的package包/类
public void handleException(BindingException t) {
PublishException ex = extractPublishException(t);
if(ex == null){
logger.error("Unknown Exception", t);
t.printStackTrace();
return;
}
logger.error("Unknown exception", ex);
try {
XulMessageBox msg = (XulMessageBox) document.createElement("messagebox");
msg.setTitle(BaseMessages.getString(getClass(), "connection.error.title"));
msg.setMessage(BaseMessages.getString(getClass(), "connection.error.message", ex.getMessage()));
msg.setIcon(SWT.ERROR_IO);
msg.open();
} catch (XulException e) {
}
}
示例14: handleOverwriteNotification
import org.pentaho.ui.xul.XulException; //导入依赖的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;
}
示例15: applyToContainer
import org.pentaho.ui.xul.XulException; //导入依赖的package包/类
public void applyToContainer(String category, XulDomContainer container) throws XulException {
container.registerClassLoader(getClass().getClassLoader());
if(category.equals("spoon")){
container.loadOverlay("org/pentaho/agilebi/spoon/spoon_overlays.xul", bundle);
container.addEventHandler(ModelerHelper.getInstance());
} else if(category.equals("job-graph")){
container.loadOverlay("org/pentaho/agilebi/spoon/job_overlay.xul", bundle);
container.addEventHandler(ModelerHelper.getInstance());
} else if(category.equals("trans-graph")){
container.loadOverlay("org/pentaho/agilebi/spoon/trans_overlay.xul", bundle);
container.addEventHandler(ModelerHelper.getInstance());
} else if(category.equals("database_dialog")){
container.loadOverlay("org/pentaho/agilebi/spoon/database_dialog_overlay.xul", bundle);
container.addEventHandler(new AgileBiDatabaseController());
}
}