new String[]{ "*.rptlibrary" } );
LIBRARY_FILE_PATTERN ); dialog.setTitle( DIALOG_TITLE ); dialog.setMessage( DIALOG_MESSAGE ); ResourceSelectionValidator validator = new ResourceSelectionValidator( LIBRARY_FILE_TYPE ); dialog.setValidator( validator );
	public void run( )	{		// FileDialog dialog = new FileDialog( UIUtil.getDefaultShell( ),		// SWT.OPEN );		// dialog.setFilterExtensions( new String[]{		// "*.rptlibrary" //$NON-NLS-1$		// } );		// String filename;		// try		// {		// filename = dialog.open( );		// }		// catch ( Throwable e )		// {		// return;		// }		// if ( filename != null )		// {		// if ( !( new File( filename ).exists( ) ) )		// {		// ExceptionHandler.openErrorMessageBox( Messages.getString(		// "AddLibraryAction.Error.Title" ), //$NON-NLS-1$		// Messages.getFormattedString( "AddLibraryAction.Error.FileNotFound",		// new String[]{filename} ) ); //$NON-NLS-1$		// return;		// }		// if ( !( filename.endsWith( ".rptlibrary" ) ) )		// {		// ExceptionHandler.openErrorMessageBox( Messages.getString(		// "AddLibraryAction.Error.Title" ), //$NON-NLS-1$		// Messages.getFormattedString(		// "AddLibraryAction.Error.FileIsNotLibrary", new String[]{filename,		// ".rptlibrary"} ) ); //$NON-NLS-1$		// return;		// }		//		// try		// {		// filename = copyToResourceFolder( filename );		// if ( filename != null )		// {		// ModuleHandle moduleHandle = SessionHandleAdapter.getInstance( )		// .getReportDesignHandle( );		// UIUtil.includeLibrary( moduleHandle, filename );		// }		// }		// catch ( Exception e )		// {		// ExceptionHandler.handle( e );		// }		// }		// Bugzilla Bug 160806		ResourceFileFolderSelectionDialog dialog = new ResourceFileFolderSelectionDialog( true,				new String[]{					"*.rptlibrary" //$NON-NLS-1$				} );		if ( dialog.open( ) == Window.OK )		{			try			{				String filename = dialog.getPath( );				ModuleHandle moduleHandle = SessionHandleAdapter.getInstance( )						.getReportDesignHandle( );				UIUtil.includeLibrary( moduleHandle, filename );			}			catch ( Exception e )			{				ExceptionHandler.handle( e );			}		}	}