FileDialog dialog = new FileDialog( UIUtil.getDefaultShell( ), SWT.OPEN ); dialog.setFilterExtensions( new String[]{ "*.rptlibrary" } ); String filename; try
ResourceFileFolderSelectionDialog dialog = new ResourceFileFolderSelectionDialog( true, new String[]{ "*.rptlibrary" } ); if ( dialog.open( ) == Window.OK )
	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 );			}		}	}