boolean compareFileList( List<UIRepositoryObject> ro1, List<UIRepositoryObject> ro2 ) { if ( ro1 != null && ro2 != null ) { if ( ro1.size() != ro2.size() ) { return false; } for ( int i = 0; i < ro1.size(); i++ ) { if ( ro1.get( i ) != null && ro2.get( i ) != null ) { if ( !ro1.get( i ).getName().equals( ro2.get( i ).getName() ) ) { return false; } } } } else { return false; } return true; }
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 int compare( UIRepositoryObject o1, UIRepositoryObject o2 ) { int cat1 = o1.getCategory(); int cat2 = o2.getCategory(); if ( cat1 != cat2 ) { return cat1 - cat2; } String t1 = o1.getName(); String t2 = o2.getName(); if ( t1 == null ) { t1 = ""; } if ( t2 == null ) { t2 = ""; } return t1.compareToIgnoreCase( t2 ); }
public String getPath() { return getParentPath() + "/" + getName(); }
for ( UIRepositoryObject currChild : targetDirectory.getRepositoryObjects() ) { if ( ( currChild instanceof UIRepositoryDirectory ) && ( newChild instanceof UIRepositoryDirectory ) && ( currChild.getName().equalsIgnoreCase( newChild.getName() ) ) ) { messageBox.setTitle( BaseMessages.getString( PKG, "Dialog.Error" ) ); messageBox.setAcceptLabel( BaseMessages.getString( PKG, "Dialog.Ok" ) ); messageBox.setMessage( BaseMessages.getString( PKG, "BrowseController.UnableToMove.DirectoryAlreadyExists", currChild.getPath() ) ); messageBox.open(); result = false; break; } else if ( !( currChild instanceof UIRepositoryDirectory ) && ( currChild.getType().equalsIgnoreCase( newChild.getType() ) ) && ( currChild.getName().equalsIgnoreCase( newChild.getName() ) ) ) { collisionObjects.add( currChild ); o.delete();
protected void deleteContent( UIRepositoryObject repoObject ) throws Exception { repoObject.delete(); if ( repoObject instanceof UIRepositoryDirectory ) { directoryBinding.fireSourceChanged(); if ( repoDir != null ) { repoDir.refresh(); } } selectedItemsBinding.fireSourceChanged(); }
@Override public int compare( UIRepositoryObject o1, UIRepositoryObject o2 ) { Date d1 = o1 != null ? o1.getModifiedDate() : null; Date d2 = o2 != null ? o2.getModifiedDate() : null; long t1 = d1 != null ? d1.getTime() : 0; long t2 = d2 != null ? d2.getTime() : 0; int res = 0; if ( t1 > t2 ) { res = 1; } else if ( t1 < t2 ) { res = -1; } return res; } }
public void onRemove( UIRepositoryObject child ) { List<? extends RepositoryElementMetaInterface> dirRepoObjects = getDirectory().getRepositoryObjects(); if ( dirRepoObjects != null ) { Iterator<? extends RepositoryElementMetaInterface> iter = dirRepoObjects.iterator(); while ( iter.hasNext() ) { RepositoryElementMetaInterface e = iter.next(); if ( child.getObjectId().equals( e.getObjectId() ) ) { iter.remove(); return; } } } } };
repoObject.delete(); } catch ( KettleException ke ) { if ( repoDir != null ) {
private boolean contains( UIRepositoryDirectories directories, UIRepositoryDirectory searchDir ) { for ( int i = 0; i < directories.size(); i++ ) { UIRepositoryObject dir = directories.get( i ); if ( dir instanceof UIRepositoryDirectory ) { if ( dir.getName() != null && dir.getName().equals( searchDir.getName() ) ) { return true; } } } return false; }
final String newName = value; try { repoObject.setName( newName ); } catch ( KettleException ke ) { if ( ke.getCause() instanceof RepositoryObjectAccessException ) {
public boolean contains( String dirName ) { UIRepositoryDirectories directories = getChildren(); UIRepositoryObject dir; for ( int i = 0; i < directories.size(); i++ ) { dir = directories.get( i ); if ( !( dir instanceof UIRepositoryDirectory ) ) { continue; } else if ( dir.getName() == null && dirName == null ) { return true; } else if ( dir.getName().equalsIgnoreCase( dirName ) ) { return true; } } return false; }
protected XulPromptBox promptForName( final UIRepositoryObject object ) throws XulException { XulPromptBox prompt = (XulPromptBox) document.createElement( "promptbox" ); String currentName = ( object == null ) ? BaseMessages.getString( PKG, "BrowserController.NewFolder" ) : object.getName(); prompt.setTitle( BaseMessages.getString( PKG, "BrowserController.Name" ).concat( currentName ) ); prompt.setButtons( new DialogConstant[] { DialogConstant.OK, DialogConstant.CANCEL } ); prompt.setMessage( BaseMessages.getString( PKG, "BrowserController.NameLabel" ).concat( currentName ) ); prompt.setValue( currentName ); return prompt; }
.setValue( BaseMessages.getString( PKG, "AclTab.UserRolePermission", repoObject.getName() ) ); //$NON-NLS-1$ bf.setBindingType( Binding.Type.ONE_WAY ); bf.createBinding( viewAclsModel, "acls", userRoleList, "elements" ); //$NON-NLS-1$ //$NON-NLS-2$ messageBox.setAcceptLabel( BaseMessages.getString( PKG, "Dialog.Ok" ) );//$NON-NLS-1$ messageBox.setMessage( BaseMessages.getString( PKG, "PermissionsController.UnableToGetAcls", repoObject.getName(), ade.getLocalizedMessage() ) );//$NON-NLS-1$ messageBox.setAcceptLabel( BaseMessages.getString( PKG, "Dialog.Ok" ) );//$NON-NLS-1$ messageBox.setMessage( BaseMessages.getString( PKG, "PermissionsController.UnableToGetAcls", repoObject.getName(), e.getLocalizedMessage() ) ); //$NON-NLS-1$ messageBox.open();
for ( UIRepositoryObject uiObj : tempRoot ) { if ( uiObj instanceof UIRepositoryDirectory ) { if ( uiObj.getName().equalsIgnoreCase( homePath[ currentDir ] ) ) {