org.jpedal.pdf.plugins.eclipse.editors
Class PDFEditor

java.lang.Object
  extended by org.eclipse.core.commands.common.EventManager
      extended by org.eclipse.ui.part.WorkbenchPart
          extended by org.eclipse.ui.part.EditorPart
              extended by org.eclipse.ui.part.MultiPageEditorPart
                  extended by org.jpedal.pdf.plugins.eclipse.editors.PDFEditor
All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable, org.eclipse.core.runtime.IExecutableExtension, org.eclipse.jface.dialogs.IPageChangeProvider, org.eclipse.ui.IEditorPart, org.eclipse.ui.ISaveablePart, org.eclipse.ui.IWorkbenchPart, org.eclipse.ui.IWorkbenchPart2, org.eclipse.ui.IWorkbenchPart3, org.eclipse.ui.part.IWorkbenchPartOrientation

public class PDFEditor
extends org.eclipse.ui.part.MultiPageEditorPart


Field Summary
static boolean debug
          used in development
static java.lang.String ID
           
static boolean useViewer
          flag to switch to Viewer
 
Fields inherited from interface org.eclipse.ui.IEditorPart
PROP_DIRTY, PROP_INPUT
 
Fields inherited from interface org.eclipse.ui.IWorkbenchPart
PROP_TITLE
 
Constructor Summary
PDFEditor()
          initial setup from Eclipse
 
Method Summary
 void clearSearchHighlights()
          used by search to remove highlights
 void decodePageFromOutline(int pageNumber, java.awt.Point p)
           
 void doSave(org.eclipse.core.runtime.IProgressMonitor monitor)
          not needed us PDF but part of interface
 void doSaveAs()
          not needed us PDF but part of interface
 java.lang.Object getAdapter(java.lang.Class key)
          part of interface used to handle our PDF outline
 org.jpedal.examples.simpleviewer.gui.swing.SwingOutline getOutline()
           
 int getPage()
          make currently displayed page available for other views to access
 java.awt.Rectangle getPageRectangle()
           
 org.jpedal.PdfDecoder getPDF()
          allow external access to PDfDecoder for Search access
 org.jpedal.grouping.PdfGroupingAlgorithms getPdfGroupingObject(int i)
          raw text for the page
 int getPDFPageCount()
          pages in this file (first page is 1) (there is an internal eclipse method called getPageCount() so do not over-ride
 float getScale()
          make it available externally (ie for Search outline)
 java.lang.Object getSearchWindow()
           
 org.jpedal.examples.simpleviewer.gui.generic.GUIThumbnailPanel getThumbnail()
           
 java.lang.String getURI()
           
 org.jpedal.examples.simpleviewer.SimpleViewer getViewer()
           
 void handleAction(java.lang.String Aref)
          modified version of gotoDest in DefaultActionHandler - if you use PDFdecoder (if you use SimpleViewer you do not need to both with all this
 void init(org.eclipse.ui.IEditorSite site, org.eclipse.ui.IEditorInput input)
          setup path of PDF ready to use later
 boolean isDirty()
          not needed us PDF but part of interface
 boolean isOpen()
           
 boolean isSaveAsAllowed()
          not needed us PDF but part of interface
 void lastPage()
          goto last page
 void repaintPDF()
          ensure redrawn
 void setAnnotationHandler(org.jpedal.AnnotationHandler ah)
           
 void setFocus()
          Passing the focus request to the viewer's control.
 void setHighlight(java.awt.Rectangle highlight, int nextPage)
          highlight an area on screen (assumes current page)
 void setPage(int newPage)
          set page number from search or outline and decode/display new page
 void setPage(int newPage, float scaling)
          set page number from search or outline and decode/display new page
 void setPageCounter()
          update page number display
 void setSearchWindow(PDFSearch search)
           
 void stopSearch()
          Kill the thread, that is performing the search, safely
 
Methods inherited from class org.eclipse.ui.part.MultiPageEditorPart
addPage, addPage, addPage, addPage, addPageChangedListener, createPartControl, dispose, findEditors, getActivePage, getSelectedPage, removePage, removePageChangedListener, setActiveEditor
 
Methods inherited from class org.eclipse.ui.part.EditorPart
getEditorInput, getEditorSite, getTitleToolTip, isSaveOnCloseNeeded, setInitializationData
 
Methods inherited from class org.eclipse.ui.part.WorkbenchPart
addPartPropertyListener, addPropertyListener, getContentDescription, getOrientation, getPartName, getPartProperties, getPartProperty, getSite, getTitle, getTitleImage, removePartPropertyListener, removePropertyListener, setPartProperty, showBusy
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.ui.IWorkbenchPart
addPropertyListener, getSite, getTitle, getTitleImage, removePropertyListener
 

Field Detail

ID

public static final java.lang.String ID
See Also:
Constant Field Values

debug

public static final boolean debug
used in development

See Also:
Constant Field Values

useViewer

public static boolean useViewer
flag to switch to Viewer

Constructor Detail

PDFEditor

public PDFEditor()
initial setup from Eclipse

Method Detail

stopSearch

public void stopSearch()
Kill the thread, that is performing the search, safely


doSave

public void doSave(org.eclipse.core.runtime.IProgressMonitor monitor)
not needed us PDF but part of interface

Specified by:
doSave in interface org.eclipse.ui.ISaveablePart
Specified by:
doSave in class org.eclipse.ui.part.EditorPart

doSaveAs

public void doSaveAs()
not needed us PDF but part of interface

Specified by:
doSaveAs in interface org.eclipse.ui.ISaveablePart
Specified by:
doSaveAs in class org.eclipse.ui.part.EditorPart

init

public void init(org.eclipse.ui.IEditorSite site,
                 org.eclipse.ui.IEditorInput input)
          throws org.eclipse.ui.PartInitException
setup path of PDF ready to use later

Specified by:
init in interface org.eclipse.ui.IEditorPart
Overrides:
init in class org.eclipse.ui.part.MultiPageEditorPart
Throws:
org.eclipse.ui.PartInitException

isDirty

public boolean isDirty()
not needed us PDF but part of interface

Specified by:
isDirty in interface org.eclipse.ui.ISaveablePart
Overrides:
isDirty in class org.eclipse.ui.part.MultiPageEditorPart

isSaveAsAllowed

public boolean isSaveAsAllowed()
not needed us PDF but part of interface

Specified by:
isSaveAsAllowed in interface org.eclipse.ui.ISaveablePart
Specified by:
isSaveAsAllowed in class org.eclipse.ui.part.EditorPart

getThumbnail

public org.jpedal.examples.simpleviewer.gui.generic.GUIThumbnailPanel getThumbnail()

getOutline

public org.jpedal.examples.simpleviewer.gui.swing.SwingOutline getOutline()

decodePageFromOutline

public void decodePageFromOutline(int pageNumber,
                                  java.awt.Point p)

handleAction

public void handleAction(java.lang.String Aref)
modified version of gotoDest in DefaultActionHandler - if you use PDFdecoder (if you use SimpleViewer you do not need to both with all this


lastPage

public void lastPage()
goto last page


getPDFPageCount

public int getPDFPageCount()
pages in this file (first page is 1) (there is an internal eclipse method called getPageCount() so do not over-ride


getPage

public int getPage()
make currently displayed page available for other views to access


setFocus

public void setFocus()
Passing the focus request to the viewer's control.

Specified by:
setFocus in interface org.eclipse.ui.IWorkbenchPart
Overrides:
setFocus in class org.eclipse.ui.part.MultiPageEditorPart

getPDF

public org.jpedal.PdfDecoder getPDF()
allow external access to PDfDecoder for Search access

Returns:

getAdapter

public java.lang.Object getAdapter(java.lang.Class key)
part of interface used to handle our PDF outline

Specified by:
getAdapter in interface org.eclipse.core.runtime.IAdaptable
Overrides:
getAdapter in class org.eclipse.ui.part.MultiPageEditorPart

setPage

public void setPage(int newPage)
set page number from search or outline and decode/display new page


setPage

public void setPage(int newPage,
                    float scaling)
set page number from search or outline and decode/display new page


setPageCounter

public void setPageCounter()
update page number display


repaintPDF

public void repaintPDF()
ensure redrawn


getScale

public float getScale()
make it available externally (ie for Search outline)


getSearchWindow

public java.lang.Object getSearchWindow()

setSearchWindow

public void setSearchWindow(PDFSearch search)

isOpen

public boolean isOpen()

setHighlight

public void setHighlight(java.awt.Rectangle highlight,
                         int nextPage)
highlight an area on screen (assumes current page)

Parameters:
highlight -
nextPage -

clearSearchHighlights

public void clearSearchHighlights()
used by search to remove highlights


getPdfGroupingObject

public org.jpedal.grouping.PdfGroupingAlgorithms getPdfGroupingObject(int i)
                                                               throws java.lang.Exception
raw text for the page

Parameters:
i -
Returns:
Throws:
java.lang.Exception

getPageRectangle

public java.awt.Rectangle getPageRectangle()

setAnnotationHandler

public void setAnnotationHandler(org.jpedal.AnnotationHandler ah)

getViewer

public org.jpedal.examples.simpleviewer.SimpleViewer getViewer()

getURI

public java.lang.String getURI()