use of org.pentaho.ui.xul.binding.DefaultBindingFactory in project pentaho-kettle by pentaho.
the class AbstractPermissionsController method init.
protected void init(Repository rep) throws Exception {
if (rep != null && rep.hasService(RepositorySecurityProvider.class)) {
service = (RepositorySecurityProvider) rep.getService(RepositorySecurityProvider.class);
} else {
throw new ControllerInitializationException(BaseMessages.getString(PKG, "PermissionsController.ERROR_0001_UNABLE_TO_INITIAL_REPOSITORY_SERVICE", // $NON-NLS-1$
RepositorySecurityManager.class));
}
// $NON-NLS-1$
messageBox = (XulMessageBox) document.createElement("messagebox");
viewAclsModel = new UIRepositoryObjectAcls();
manageAclsModel = new UIRepositoryObjectAclModel(viewAclsModel);
bf = new DefaultBindingFactory();
bf.setDocument(this.getXulDomContainer().getDocumentRoot());
mainController = (MainController) this.getXulDomContainer().getEventHandler("mainController");
// $NON-NLS-1$
confirmBox = (XulConfirmBox) document.createElement("confirmbox");
// $NON-NLS-1$
confirmBox.setTitle(BaseMessages.getString(PKG, "PermissionsController.RemoveAclWarning"));
// $NON-NLS-1$
confirmBox.setMessage(BaseMessages.getString(PKG, "PermissionsController.RemoveAclWarningText"));
// $NON-NLS-1$
confirmBox.setAcceptLabel(BaseMessages.getString(PKG, "Dialog.Ok"));
// $NON-NLS-1$
confirmBox.setCancelLabel(BaseMessages.getString(PKG, "Dialog.Cancel"));
confirmBox.addDialogCallback(new XulDialogCallback<Object>() {
public void onClose(XulComponent sender, Status returnCode, Object retVal) {
if (returnCode == Status.ACCEPT) {
viewAclsModel.removeSelectedAcls();
}
}
public void onError(XulComponent sender, Throwable t) {
}
});
}
use of org.pentaho.ui.xul.binding.DefaultBindingFactory in project pentaho-kettle by pentaho.
the class RepositoryLockController method init.
public void init(Repository rep) throws ControllerInitializationException {
try {
if (rep != null && rep.hasService(ILockService.class)) {
repository = rep;
service = (ILockService) rep.getService(ILockService.class);
} else {
throw new ControllerInitializationException(BaseMessages.getString(PKG, "RepositoryLockController.ERROR_0001_UNABLE_TO_INITIAL_REPOSITORY_SERVICE", // $NON-NLS-1$
ILockService.class));
}
bindingFactory = new DefaultBindingFactory();
bindingFactory.setDocument(getXulDomContainer().getDocumentRoot());
// $NON-NLS-1$
XulEventHandler eventHandler = getXulDomContainer().getEventHandler("browseController");
if (eventHandler instanceof BrowseController) {
browseController = (BrowseController) eventHandler;
}
// Disable row dragging if it is locked and the user does not have permissions
// $NON-NLS-1$
fileTable = (XulTree) getXulDomContainer().getDocumentRoot().getElementById("file-table");
// $NON-NLS-1$
folderTree = (XulTree) document.getElementById("folder-tree");
// $NON-NLS-1$
lockFileMenuItem = (XulMenuitem) getXulDomContainer().getDocumentRoot().getElementById("file-context-lock");
// $NON-NLS-1$
deleteFileMenuItem = (XulMenuitem) getXulDomContainer().getDocumentRoot().getElementById("file-context-delete");
// $NON-NLS-1$
renameFileMenuItem = (XulMenuitem) getXulDomContainer().getDocumentRoot().getElementById("file-context-rename");
// $NON-NLS-1$
messageBox = (XulMessageBox) document.createElement("messagebox");
createBindings();
} catch (Exception e) {
throw new RuntimeException(e);
}
}
use of org.pentaho.ui.xul.binding.DefaultBindingFactory in project pentaho-kettle by pentaho.
the class ConnectionsController method doLazyInit.
@Override
protected boolean doLazyInit() {
try {
mainController = (MainController) this.getXulDomContainer().getEventHandler("mainController");
} catch (XulException e) {
return false;
}
try {
setRepReadOnly(this.repository.getRepositoryMeta().getRepositoryCapabilities().isReadOnly());
// Load the SWT Shell from the explorer dialog
shell = ((SwtDialog) document.getElementById("repository-explorer-dialog")).getShell();
bf = new DefaultBindingFactory();
bf.setDocument(this.getXulDomContainer().getDocumentRoot());
if (bf != null) {
createBindings();
}
enableButtons(true, false, false);
return true;
} catch (Exception e) {
if (mainController == null || !mainController.handleLostRepository(e)) {
return false;
}
}
return false;
}
Aggregations