Search in sources :

Example 6 with DefaultBindingFactory

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) {
        }
    });
}
Also used : UIRepositoryObjectAcls(org.pentaho.di.ui.repository.pur.repositoryexplorer.model.UIRepositoryObjectAcls) RepositorySecurityProvider(org.pentaho.di.repository.RepositorySecurityProvider) DefaultBindingFactory(org.pentaho.ui.xul.binding.DefaultBindingFactory) RepositorySecurityManager(org.pentaho.di.repository.RepositorySecurityManager) ControllerInitializationException(org.pentaho.di.ui.repository.repositoryexplorer.ControllerInitializationException) IAclObject(org.pentaho.di.ui.repository.pur.repositoryexplorer.IAclObject) XulComponent(org.pentaho.ui.xul.XulComponent) UIRepositoryObjectAclModel(org.pentaho.di.ui.repository.pur.repositoryexplorer.model.UIRepositoryObjectAclModel)

Example 7 with DefaultBindingFactory

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);
    }
}
Also used : DefaultBindingFactory(org.pentaho.ui.xul.binding.DefaultBindingFactory) ControllerInitializationException(org.pentaho.di.ui.repository.repositoryexplorer.ControllerInitializationException) AbstractXulEventHandler(org.pentaho.ui.xul.impl.AbstractXulEventHandler) XulEventHandler(org.pentaho.ui.xul.impl.XulEventHandler) ILockService(org.pentaho.di.ui.repository.pur.services.ILockService) BrowseController(org.pentaho.di.ui.repository.repositoryexplorer.controllers.BrowseController) XulException(org.pentaho.ui.xul.XulException) KettleException(org.pentaho.di.core.exception.KettleException) ControllerInitializationException(org.pentaho.di.ui.repository.repositoryexplorer.ControllerInitializationException)

Example 8 with DefaultBindingFactory

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;
}
Also used : DefaultBindingFactory(org.pentaho.ui.xul.binding.DefaultBindingFactory) XulException(org.pentaho.ui.xul.XulException) XulException(org.pentaho.ui.xul.XulException) KettleException(org.pentaho.di.core.exception.KettleException) ControllerInitializationException(org.pentaho.di.ui.repository.repositoryexplorer.ControllerInitializationException) UIObjectCreationException(org.pentaho.di.ui.repository.repositoryexplorer.model.UIObjectCreationException)

Aggregations

DefaultBindingFactory (org.pentaho.ui.xul.binding.DefaultBindingFactory)8 KettleException (org.pentaho.di.core.exception.KettleException)6 ControllerInitializationException (org.pentaho.di.ui.repository.repositoryexplorer.ControllerInitializationException)6 XulException (org.pentaho.ui.xul.XulException)4 MalformedURLException (java.net.MalformedURLException)1 FileObject (org.apache.commons.vfs2.FileObject)1 FileSystemException (org.apache.commons.vfs2.FileSystemException)1 SWTException (org.eclipse.swt.SWTException)1 SashForm (org.eclipse.swt.custom.SashForm)1 DropTarget (org.eclipse.swt.dnd.DropTarget)1 DropTargetEvent (org.eclipse.swt.dnd.DropTargetEvent)1 DropTargetListener (org.eclipse.swt.dnd.DropTargetListener)1 FileTransfer (org.eclipse.swt.dnd.FileTransfer)1 ImageTransfer (org.eclipse.swt.dnd.ImageTransfer)1 Transfer (org.eclipse.swt.dnd.Transfer)1 Cursor (org.eclipse.swt.graphics.Cursor)1 FormAttachment (org.eclipse.swt.layout.FormAttachment)1 FormData (org.eclipse.swt.layout.FormData)1 FormLayout (org.eclipse.swt.layout.FormLayout)1 GridData (org.eclipse.swt.layout.GridData)1