org.opensolaris.opengrok.search.scope
Class Editor

java.lang.Object
  extended by org.opensolaris.opengrok.search.scope.Editor
Direct Known Subclasses:
ExternalEditor, InternalEditor

public abstract class Editor
extends java.lang.Object

The Editor class is used as an interface to hide the details on how to display a file.


Constructor Summary
Editor()
          Creates a new instance of Editor
 
Method Summary
abstract  void displayFile(java.lang.String filename, java.lang.Integer lineno)
          Display a named file in the editor
 java.lang.String getCommand()
          Getter for property command.
 java.lang.String getName()
          Getter for property name.
abstract  boolean isEditable()
          Is it possible to modify the command on this editor or not
 void setCommand(java.lang.String command)
          Setter for property command.
 void setName(java.lang.String name)
          Setter for property name.
 java.lang.String toString()
          Get the textual representation of this object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Editor

public Editor()
Creates a new instance of Editor

Method Detail

toString

public java.lang.String toString()
Get the textual representation of this object

Overrides:
toString in class java.lang.Object
Returns:
The display-name of the editor

getName

public java.lang.String getName()
Getter for property name.

Returns:
Value of property name.

setName

public void setName(java.lang.String name)
Setter for property name.

Parameters:
name - New value of property name.

getCommand

public java.lang.String getCommand()
Getter for property command.

Returns:
Value of property command.

setCommand

public void setCommand(java.lang.String command)
Setter for property command.

Parameters:
command - New value of property command.

isEditable

public abstract boolean isEditable()
Is it possible to modify the command on this editor or not

Returns:
true if the user is able to modify the command used to start this editor or not

displayFile

public abstract void displayFile(java.lang.String filename,
                                 java.lang.Integer lineno)
                          throws java.lang.Exception
Display a named file in the editor

Parameters:
filename - The name of the file to display
lineno - The line number to position the caret at (null if unknown)
Throws:
java.lang.Exception - if an error occurs while starting the editor or reading the file