Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.port80.draw2d.imageviewer.views
Class ImageViewer  view ImageViewer download ImageViewer.java

java.lang.Object
  extended byorg.eclipse.ui.part.WorkbenchPart
      extended byorg.eclipse.ui.part.EditorPart
          extended bycom.port80.draw2d.imageviewer.views.ImageViewer
All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable, org.eclipse.ui.IEditorPart, org.eclipse.core.runtime.IExecutableExtension, org.eclipse.ui.ISaveablePart, org.eclipse.ui.IWorkbenchPart, org.eclipse.ui.IWorkbenchPart2

public class ImageViewer
extends org.eclipse.ui.part.EditorPart

An image viewer that construct visible region of the image on the fly.


Nested Class Summary
private  class ImageViewer.DefaultMouseHandler
           
 
Field Summary
private static boolean DEBUG
           
private  FigureCanvas fCanvas
           
private static org.eclipse.swt.graphics.Cursor fCursorWait
           
private  java.lang.String fFilepath
           
private  org.eclipse.swt.graphics.ImageData[] fImageData
           
private  Label fLabel
           
private  float fLoadTime
           
private  ImageViewport fViewport
           
private static java.lang.String NAME
           
 
Fields inherited from class org.eclipse.ui.part.EditorPart
 
Fields inherited from class org.eclipse.ui.part.WorkbenchPart
 
Fields inherited from interface org.eclipse.ui.IEditorPart
PROP_DIRTY, PROP_INPUT
 
Fields inherited from interface org.eclipse.ui.IWorkbenchPart
PROP_TITLE
 
Constructor Summary
ImageViewer()
          Creates a multi-page editor example.
 
Method Summary
private static java.lang.String _(java.lang.String s)
           
 void createPartControl(org.eclipse.swt.widgets.Composite parent)
          Creates the SWT controls for this workbench part.
 void displayImage(org.eclipse.swt.graphics.ImageData imagedata)
           
 void doSave(org.eclipse.core.runtime.IProgressMonitor monitor)
          Saves the contents of this part.
 void doSaveAs()
          Saves the contents of this part to another object.
(package private)  FigureCanvas getCanvas()
           
(package private)  org.eclipse.swt.graphics.ImageData getImageData()
           
 void gotoMarker(org.eclipse.core.resources.IMarker marker)
           
 void init(org.eclipse.ui.IEditorSite site, org.eclipse.ui.IEditorInput input)
          Initializes this editor with the given editor site and input.
 boolean isDirty()
          Returns whether the contents of this part have changed since the last save operation.
 boolean isSaveAsAllowed()
          Returns whether the "Save As" operation is supported by this part.
 void openFile(java.lang.String filename)
           
 void setFocus()
          Asks this part to take focus within the workbench.
private  void showErrorDialog(java.lang.String title, java.lang.String message)
           
 
Methods inherited from class org.eclipse.ui.part.EditorPart
getEditorInput, getEditorSite, getTitleToolTip, isSaveOnCloseNeeded, setContentDescription, setInitializationData, setInput, setPartName
 
Methods inherited from class org.eclipse.ui.part.WorkbenchPart
addPropertyListener, dispose, firePropertyChange, getAdapter, getConfigurationElement, getContentDescription, getDefaultImage, getPartName, getSite, getTitle, getTitleImage, removePropertyListener, setSite, setTitle, setTitleImage, setTitleToolTip, showBusy
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.ui.IWorkbenchPart
addPropertyListener, dispose, getSite, getTitle, getTitleImage, removePropertyListener
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 

Field Detail

NAME

private static final java.lang.String NAME
See Also:
Constant Field Values

DEBUG

private static final boolean DEBUG
See Also:
Constant Field Values

fCursorWait

private static final org.eclipse.swt.graphics.Cursor fCursorWait

fCanvas

private FigureCanvas fCanvas

fLabel

private Label fLabel

fImageData

private org.eclipse.swt.graphics.ImageData[] fImageData

fViewport

private ImageViewport fViewport

fFilepath

private java.lang.String fFilepath

fLoadTime

private float fLoadTime
Constructor Detail

ImageViewer

public ImageViewer()
Creates a multi-page editor example.

Method Detail

init

public void init(org.eclipse.ui.IEditorSite site,
                 org.eclipse.ui.IEditorInput input)
          throws org.eclipse.ui.PartInitException
Description copied from interface: org.eclipse.ui.IEditorPart
Initializes this editor with the given editor site and input.

This method is automatically called shortly after the part is instantiated. It marks the start of the part's lifecycle. The IWorkbenchPart.dispose 55 method will be called automically at the end of the lifecycle. Clients must not call this method.

Implementors of this method must examine the editor input object type to determine if it is understood. If not, the implementor must throw a PartInitException


isDirty

public boolean isDirty()
Description copied from interface: org.eclipse.ui.ISaveablePart
Returns whether the contents of this part have changed since the last save operation. If this value changes the part must fire a property listener event with PROP_DIRTY.


isSaveAsAllowed

public boolean isSaveAsAllowed()
Description copied from interface: org.eclipse.ui.ISaveablePart
Returns whether the "Save As" operation is supported by this part.


createPartControl

public void createPartControl(org.eclipse.swt.widgets.Composite parent)
Description copied from interface: org.eclipse.ui.IWorkbenchPart
Creates the SWT controls for this workbench part.

Clients should not call this method (the workbench calls this method when it needs to, which may be never).

For implementors this is a multi-step process:

  1. Create one or more controls within the parent.
  2. Set the parent layout as needed.
  3. Register any global actions with the IActionService.
  4. Register any popup menus with the IActionService.
  5. Register a selection provider with the ISelectionService (optional).


setFocus

public void setFocus()
Description copied from interface: org.eclipse.ui.IWorkbenchPart
Asks this part to take focus within the workbench.

Clients should not call this method (the workbench calls this method at appropriate times). To have the workbench activate a part, use IWorkbenchPage.activate(IWorkbenchPart) instead.


doSave

public void doSave(org.eclipse.core.runtime.IProgressMonitor monitor)
Description copied from interface: org.eclipse.ui.ISaveablePart
Saves the contents of this part.

If the save is successful, the part should fire a property changed event reflecting the new dirty state (PROP_DIRTY property).

If the save is cancelled through user action, or for any other reason, the part should invoke setCancelled on the IProgressMonitor to inform the caller.

This method is long-running; progress and cancellation are provided by the given progress monitor.


doSaveAs

public void doSaveAs()
Description copied from interface: org.eclipse.ui.ISaveablePart
Saves the contents of this part to another object.

Implementors are expected to open a "Save As" dialog where the user will be able to select a new name for the contents. After the selection is made, the contents should be saved to that new name. During this operation a IProgressMonitor should be used to indicate progress.

If the save is successful, the part fires a property changed event reflecting the new dirty state (PROP_DIRTY property).


gotoMarker

public void gotoMarker(org.eclipse.core.resources.IMarker marker)

openFile

public void openFile(java.lang.String filename)

displayImage

public void displayImage(org.eclipse.swt.graphics.ImageData imagedata)

showErrorDialog

private final void showErrorDialog(java.lang.String title,
                                   java.lang.String message)

_

private static final java.lang.String _(java.lang.String s)

getCanvas

FigureCanvas getCanvas()

getImageData

org.eclipse.swt.graphics.ImageData getImageData()