use of org.pentaho.ui.xul.XulException in project pentaho-kettle by pentaho.
the class StarModelerPerspective method createTab.
public XulTabAndPanel createTab() {
try {
XulTab tab = (XulTab) document.createElement("tab");
if (name != null) {
tab.setLabel(name);
}
XulTabpanel panel = (XulTabpanel) document.createElement("tabpanel");
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;
}
use of org.pentaho.ui.xul.XulException in project pentaho-kettle by pentaho.
the class BrowseController method renameRepositoryObject.
protected void renameRepositoryObject(final UIRepositoryObject object) throws XulException {
XulPromptBox prompt = promptForName(object);
prompt.addDialogCallback(new XulDialogCallback<String>() {
public void onClose(XulComponent component, Status status, String value) {
if (status == Status.ACCEPT) {
try {
object.setName(value);
} catch (Exception e) {
if (mainController == null || !mainController.handleLostRepository(e)) {
throw new RuntimeException(e);
}
}
}
}
public void onError(XulComponent component, Throwable err) {
throw new RuntimeException(err);
}
});
prompt.open();
}
use of org.pentaho.ui.xul.XulException in project pentaho-kettle by pentaho.
the class LazilyInitializedController method showErrorDialog.
private void showErrorDialog(final Exception e) {
XulMessageBox messageBox = null;
try {
messageBox = (XulMessageBox) document.createElement("messagebox");
} catch (XulException xe) {
throw new RuntimeException(xe);
}
messageBox.setTitle(BaseMessages.getString(PKG, "Dialog.Error"));
messageBox.setAcceptLabel(BaseMessages.getString(PKG, "Dialog.Ok"));
if (e != null) {
messageBox.setMessage(BaseMessages.getString(PKG, "LazilyInitializedController.Message.UnableToInitWithParam", e.getLocalizedMessage()));
} else {
messageBox.setMessage(BaseMessages.getString(PKG, "LazilyInitializedController.Message.UnableToInit"));
}
messageBox.open();
}
use of org.pentaho.ui.xul.XulException in project pentaho-kettle by pentaho.
the class AbstractRepositoryExplorerUISupport method initControllers.
public void initControllers(Repository rep) throws ControllerInitializationException {
for (String name : controllerNames) {
try {
IUISupportController controller = (IUISupportController) container.getEventHandler(name);
controller.init(rep);
} catch (XulException e) {
throw new ControllerInitializationException(e);
}
}
}
use of org.pentaho.ui.xul.XulException in project pentaho-kettle by pentaho.
the class RepositoriesController method login.
public void login() {
if (loginModel.isValid() == false) {
return;
}
KettleWaitBox box;
try {
box = (KettleWaitBox) document.createElement("iconwaitbox");
box.setIndeterminate(true);
box.setCanCancel(false);
box.setIcon("ui/images/kettle_logo_small.svg");
box.setTitle(BaseMessages.getString(PKG, "RepositoryExplorerDialog.Connection.Wait.Title"));
box.setMessage(BaseMessages.getString(PKG, "RepositoryExplorerDialog.Connection.Wait.Message"));
final Shell loginShell = (Shell) loginDialog.getRootObject();
final Display display = loginShell.getDisplay();
box.setDialogParent(loginShell);
box.setRunnable(new WaitBoxRunnable(box) {
@Override
public void run() {
try {
helper.loginToRepository();
waitBox.stop();
display.syncExec(new Runnable() {
public void run() {
loginDialog.hide();
okButton.setDisabled(false);
cancelButton.setDisabled(false);
if (helper.getConnectedRepository().getConnectMessage() != null) {
getMessageBox().setTitle(BaseMessages.getString(PKG, "ConnectMessageTitle"));
getMessageBox().setMessage(helper.getConnectedRepository().getConnectMessage());
getMessageBox().open();
}
getCallback().onSuccess(helper.getConnectedRepository());
}
});
} catch (final Throwable th) {
waitBox.stop();
try {
display.syncExec(new Runnable() {
public void run() {
getCallback().onError(th);
okButton.setDisabled(false);
cancelButton.setDisabled(false);
}
});
} catch (Exception e) {
e.printStackTrace();
}
}
}
@Override
public void cancel() {
}
});
okButton.setDisabled(true);
cancelButton.setDisabled(true);
box.start();
} catch (XulException e1) {
getCallback().onError(e1);
}
}
Aggregations