01: package com.xoetrope.swing;
02:
03: //import com.adobe.acrobat.Viewer;
04: import java.awt.BorderLayout;
05: import javax.swing.JComponent;
06: import net.xoetrope.xui.XAttributedComponent;
07: import net.xoetrope.xui.XProjectManager;
08:
09: /**
10: * A Wrapper for the Adobe Acrobat PDF Viewer bean
11: * @author Luan O'Carroll
12: * <p> Copyright (c) Xoetrope Ltd., 2002-2006, This software is licensed under
13: * the GNU Public License (GPL), please see license.txt for more details</p>
14: */
15: public class XPdfViewer extends JComponent implements
16: XAttributedComponent {
17: // Viewer viewer;
18:
19: /** Creates a new instance of XPdfViewer */
20: public XPdfViewer() {
21: setLayout(new BorderLayout());
22: // try {
23: // com.adobe.acrobat.gui.ReaderPrefs.initialize();
24: // com.adobe.acrobat.gui.ReaderPrefs.readerPrefs.setProperty( "com.adobe.acrobat.AcceptedLicAgreement", "true" );
25: // viewer = (Viewer)Class.forName( "com.adobe.acrobat.Viewer" ).newInstance();
26: // add( viewer, BorderLayout.CENTER );
27: // }
28: // catch (Exception ex)
29: // {
30: // ex.printStackTrace();
31: // }
32: }
33:
34: public int setAttribute(String attribName, Object attribValue) {
35: // if ( attribName.equalsIgnoreCase( "content" )) {
36: // try {
37: // viewer.setDocumentURL( XProjectManager.getCurrentProject().findResource( attribValue.toString()).toExternalForm());
38: // viewer.activate();
39: // //viewer.activateWithoutBars();
40: // }
41: // catch (Exception ex)
42: // {
43: // ex.printStackTrace();
44: // }
45: // }
46:
47: return 0;
48: }
49: }
|