Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.4.0)

E13403-05

oracle.ide.editor
Class OpenEditorOptions

java.lang.Object
  extended by oracle.ide.editor.OpenEditorOptions

public class OpenEditorOptions
extends java.lang.Object

This class is used to specify how to open an editor.

See Also:
EditorManager.openEditor(oracle.ide.editor.OpenEditorOptions)

Field Summary
static int EXPLICIT
          This flag indicates that the file should always be shown in the "Recent Files" dialog
static int FOCUS
          Use this flag to put the focus in the editor after it has been created.
static int RAISE
          Use this flag to activate the editor after it has been created.
static int VALIDATE
          Use this flag if you want the editor to be sized right away.
 
Constructor Summary
OpenEditorOptions()
           
OpenEditorOptions(Context context)
           
OpenEditorOptions(Context context, java.lang.Class editorClass)
           
 
Method Summary
 Context getContext()
           
 java.lang.Class getEditorClass()
           
 int getFlags()
           
 int getPosition()
           
 EditorPath getPositionReference()
           
 void setContext(Context context)
          Sets the file to be opened.
 void setEditorClass(java.lang.Class editorClass)
          The editor type that will be up when the editor is activated.
 void setFlags(int flags)
          Sets the flags used to open the file
 void setFlags(int flags, boolean set)
          Sets/clears flags.
 void setPosition(EditorPath reference, int position)
          Sets the position of the new document relative to another.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RAISE

public static final int RAISE
Use this flag to activate the editor after it has been created. If the RAISE flag is not set, no editor is created which is a performance improvement. Since the editor is not created, the openEditor() returns null.

See Also:
Constant Field Values

VALIDATE

public static final int VALIDATE
Use this flag if you want the editor to be sized right away. It is preferable to not use the flag if you want to open more than one document at a time so that only the last one will validate()ed. It is necessary to use this flag if you need the window size right away, for example if you want to go to a line because the editor needs to know his size to ensure that the line is visible.

See Also:
Constant Field Values

FOCUS

public static final int FOCUS
Use this flag to put the focus in the editor after it has been created.

See Also:
Constant Field Values

EXPLICIT

public static final int EXPLICIT
This flag indicates that the file should always be shown in the "Recent Files" dialog

See Also:
Constant Field Values
Constructor Detail

OpenEditorOptions

public OpenEditorOptions(Context context)

OpenEditorOptions

public OpenEditorOptions(Context context,
                         java.lang.Class editorClass)

OpenEditorOptions

public OpenEditorOptions()
Method Detail

setContext

public void setContext(Context context)
Sets the file to be opened.

Parameters:
context -

getContext

public Context getContext()

getFlags

public int getFlags()

setFlags

public void setFlags(int flags)
Sets the flags used to open the file

See Also:
RAISE, VALIDATE, FOCUS, EXPLICIT

setFlags

public void setFlags(int flags,
                     boolean set)
Sets/clears flags.

Parameters:
flags - the flags to change
set - true to set, false to clear
See Also:
setFlags(int)

getEditorClass

public java.lang.Class getEditorClass()

setEditorClass

public void setEditorClass(java.lang.Class editorClass)
The editor type that will be up when the editor is activated. Editor class being null means the default editor.

Parameters:
editorClass -

setPosition

public void setPosition(EditorPath reference,
                        int position)
Sets the position of the new document relative to another. The following code opens an editor above another document:
 final EditorPath editorPath = editorManager.searchEditor(document);
 openEditorOptions.setPosition(editorPath, IdeConstants.NORTH);
 openEditorOptions.setFlags(OpenEditorOptions.RAISE | OpenEditorOptions.VALIDATE);

Parameters:
reference - The reference can be obtained with EditorManager#searchEditor(oracle.ide.model.Document)
position - Valid values are IdeConstants.WEST, IdeConstants.NORTH, IdeConstants.EAST, IdeConstants.SOUTH and IdeConstants.TABBED

getPositionReference

public EditorPath getPositionReference()

getPosition

public int getPosition()

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.4.0)

E13403-05

Copyright © 1997, 2011, Oracle. All rights reserved.