com.businessobjects.crystalreports.designer.sdk.util
Class EditorUtilities

java.lang.Object
  extended by com.businessobjects.crystalreports.designer.sdk.util.EditorUtilities

public final class EditorUtilities
extends java.lang.Object

This class implements a collection of utility methods used with the Crystal Reports editor.

See Also:
ICrystalReportsEditor

Constructor Summary
EditorUtilities()
           
 
Method Summary
static ICrystalDocumentSaveBehavior getDefaultSaveBehavior()
          Returns the default save behavior.
static ICrystalReportsEditor getEditorFrom(IEditorReference ref, boolean restore)
          Returns the editor referenced by this object.
static ICrystalReportsEditor openEditor(IWorkbenchPage page, IEditorInput input, boolean activate)
          Opens an editor on the given input.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EditorUtilities

public EditorUtilities()
Method Detail

openEditor

public static ICrystalReportsEditor openEditor(IWorkbenchPage page,
                                               IEditorInput input,
                                               boolean activate)
                                        throws PartInitException
Opens an editor on the given input. This method is similar to the org.eclipse.ui.IWorkbenchPage#openEditor method, but waits until the document is loaded.

Parameters:
page - an IWorkbenchPage to open the editor with
input - the editor input to open
activate - specifies whether or not to activate the editor
Returns:
the new ICrystalReportsEditor object, or null if an external editor was opened
Throws:
PartInitException - if there was an error opening the editor

getEditorFrom

public static ICrystalReportsEditor getEditorFrom(IEditorReference ref,
                                                  boolean restore)
                                           throws PartInitException
Returns the editor referenced by this object. This method is similar to the org.eclipse.ui.IEditorReference.getEditor method, but waits until the document is loaded.

Parameters:
ref - the IEditorReference to get the editor from
restore - specifies whether to restore the editor
Returns:
the editor if it was an ICrystalReportsEditor and was successfully retrieved, null otherwise
Throws:
PartInitException - if there was an error getting the editor

getDefaultSaveBehavior

public static ICrystalDocumentSaveBehavior getDefaultSaveBehavior()
Returns the default save behavior. You can implement this method to override the default behavior. For example, you can create a save behavior that saves a report to a custom location.

Returns:
the save behavior