Search in sources :

Example 16 with UIRepositoryDirectory

use of org.pentaho.di.ui.repository.repositoryexplorer.model.UIRepositoryDirectory in project pentaho-kettle by pentaho.

the class BrowseController method setRepositoryDirectories.

public void setRepositoryDirectories(List<UIRepositoryDirectory> selectedFolderItems) {
    List<UIRepositoryDirectory> previousVal = null;
    UIRepositoryObjects previousRepoObjects = null;
    try {
        if (repositoryDirectories != null && repositoryDirectories.size() > 0) {
            previousVal = new ArrayList<UIRepositoryDirectory>();
            previousVal.addAll(repositoryDirectories);
            previousRepoObjects = getSelectedRepoDirChildren();
        }
        // Remove children listener
        if (this.repositoryDirectories != null && this.repositoryDirectories.size() > 0) {
            this.repositoryDirectories.get(0).getRepositoryObjects().removePropertyChangeListener(fileChildrenListener);
        }
        this.repositoryDirectories = selectedFolderItems;
        // Add children Listener
        if (this.repositoryDirectories != null && this.repositoryDirectories.size() > 0) {
            this.repositoryDirectories.get(0).getRepositoryObjects().addPropertyChangeListener("children", fileChildrenListener);
        }
    } catch (KettleException e) {
        if (mainController == null || !mainController.handleLostRepository(e)) {
            throw new RuntimeException(e);
        }
    }
    fireFoldersAndItemsChange(previousVal, previousRepoObjects);
}
Also used : UIRepositoryDirectory(org.pentaho.di.ui.repository.repositoryexplorer.model.UIRepositoryDirectory) KettleException(org.pentaho.di.core.exception.KettleException) UIRepositoryObjects(org.pentaho.di.ui.repository.repositoryexplorer.model.UIRepositoryObjects)

Aggregations

UIRepositoryDirectory (org.pentaho.di.ui.repository.repositoryexplorer.model.UIRepositoryDirectory)16 UIRepositoryObject (org.pentaho.di.ui.repository.repositoryexplorer.model.UIRepositoryObject)10 KettleException (org.pentaho.di.core.exception.KettleException)9 ControllerInitializationException (org.pentaho.di.ui.repository.repositoryexplorer.ControllerInitializationException)7 XulException (org.pentaho.ui.xul.XulException)7 ArrayList (java.util.ArrayList)5 UIObjectCreationException (org.pentaho.di.ui.repository.repositoryexplorer.model.UIObjectCreationException)5 UIRepositoryContent (org.pentaho.di.ui.repository.repositoryexplorer.model.UIRepositoryContent)5 List (java.util.List)2 RepositoryDirectoryInterface (org.pentaho.di.repository.RepositoryDirectoryInterface)2 ILockObject (org.pentaho.di.ui.repository.pur.repositoryexplorer.ILockObject)2 Binding (org.pentaho.ui.xul.binding.Binding)2 BindingConvertor (org.pentaho.ui.xul.binding.BindingConvertor)2 PropertyChangeEvent (java.beans.PropertyChangeEvent)1 PropertyChangeListener (java.beans.PropertyChangeListener)1 Callable (java.util.concurrent.Callable)1 Point (org.eclipse.swt.graphics.Point)1 Shell (org.eclipse.swt.widgets.Shell)1 Before (org.junit.Before)1 ObjectId (org.pentaho.di.repository.ObjectId)1