package com.xoetrope.swing;
//import com.adobe.acrobat.Viewer;
import java.awt.BorderLayout;
import javax.swing.JComponent;
import net.xoetrope.xui.XAttributedComponent;
import net.xoetrope.xui.XProjectManager;
/**
* A Wrapper for the Adobe Acrobat PDF Viewer bean
* @author Luan O'Carroll
* <p> Copyright (c) Xoetrope Ltd., 2002-2006, This software is licensed under
* the GNU Public License (GPL), please see license.txt for more details</p>
*/
public class XPdfViewer extends JComponent implements XAttributedComponent
{
// Viewer viewer;
/** Creates a new instance of XPdfViewer */
public XPdfViewer()
{
setLayout( new BorderLayout());
// try {
// com.adobe.acrobat.gui.ReaderPrefs.initialize();
// com.adobe.acrobat.gui.ReaderPrefs.readerPrefs.setProperty( "com.adobe.acrobat.AcceptedLicAgreement", "true" );
// viewer = (Viewer)Class.forName( "com.adobe.acrobat.Viewer" ).newInstance();
// add( viewer, BorderLayout.CENTER );
// }
// catch (Exception ex)
// {
// ex.printStackTrace();
// }
}
public int setAttribute( String attribName, Object attribValue )
{
// if ( attribName.equalsIgnoreCase( "content" )) {
// try {
// viewer.setDocumentURL( XProjectManager.getCurrentProject().findResource( attribValue.toString()).toExternalForm());
// viewer.activate();
// //viewer.activateWithoutBars();
// }
// catch (Exception ex)
// {
// ex.printStackTrace();
// }
// }
return 0;
}
}
|