Class com.symantec.itools.vcafe.openapi.SourceFile
All Packages  Class Hierarchy  This Package  Previous  Next  Index
  Class com.symantec.itools.vcafe.openapi.SourceFile
Object
   |
   +----com.symantec.itools.vcafe.openapi.SourceFile
  -  public abstract class SourceFile
  
-  extends Object
  
The API used to represent and access a Visual Cafe source file.
  -  Version:
  
 -  1.0
  
 -  Author:
  
 -  Symantec Internet Tools Division
  
 -  Since:
  
 -  VCafe 3.0
    
 -  See Also:
    
 -  VisualProject, ProjectFile, Range
 
  
  -  
	com.symantec.itools.vcafe.openapi.SourceFile()
   -  
 
  
  -  
	addSourceFileListener(SourceFileListener)
   -   Add a listener to this 
SourceFile.
   -  
	close(boolean)
   -   Closes this 
SourceFile's editor window, and optionally save its contents.
   -  
	edit()
   -   Activates this 
SourceFile's editor window.
   -  
	equals(SourceFile)
   -   Determine if two 
SourceFile objects represent the same file.
   -  
	getFile()
   -   Gets the 
File associated with this SourceFile.
   -  
	getFullName()
   -   Gets the pathname of the 
File associated with this SourceFile.
   -  
	getInsertionPoint()
   -   Gets the current insertion point, in zero-based bytes.
  
 -  
	getName()
   -   Gets the base name of the 
File associated with this SourceFile.
   -  
	getProjectFile()
   -   Gets the 
ProjectFile associated with this SourceFile.
   -  
	getRangeText(Range)
   -   Gets the text within the specified 
Range.
   -  
	getRangeTextString(Range)
   -   Gets the text within the specified 
Range as a String.
   -  
	getSelectionRange()
   -   Gets the 
Range of the currently selected text.
   -  
	getText()
   -   Gets this 
SourceFile's entire contents.
   -  
	getTextString()
   -   Gets this 
SourceFile's entire contents as a String.
   -  
	isLocked()
   -   Determines whether this 
SourceFile is locked (on disk, or locked in source control).
   -  
	isModified()
   -   Determines whether this 
SourceFile has been modified.
   -  
	isOpen()
   -   Determines if this 
SourceFile is open in an editor window.
   -  
	removeSourceFileListener(SourceFileListener)
   -   Remove a listener from this 
SourceFile.
   -  
	revertToSaved()
   -   Refreshes this 
SourceFile's editor window with the contents on disk.
   -  
	save()
   -   Saves the contents of this 
SourceFile to disk.
   -  
	setModified(boolean)
   -   Set the modified flag of this 
SourceFile.
   -  
	setRangeText(StringBuffer, Range)
   -   Replaces the text in the given 
Range with the new text.
   -  
	setRangeText(String, Range)
   -   Replaces the text in the given 
Range with the new text String.
   -  
	setSelectionRange(Range)
   -   Sets the range of the currently selected text.
  
 -  
	setText(StringBuffer)
   -   Replaces the 
SourceFile's entire contents.
   -  
	setText(String)
   -   Replaces the 
SourceFile's entire contents with the contents of a String.
   -  
	toString()
   -   Gets a 
String that represents this object.
 
  
SourceFile
public SourceFile()
  
addSourceFileListener
public abstract void addSourceFileListener(SourceFileListener listener)
  -  Add a listener to this 
SourceFile.
 All changes to this SourceFile are broadcast to the listeners registered with it.
   
 
    -  Parameters:
    
 -  listener - the object that receives notifications of changes to the 
SourceFile.
     -  See Also:
    
 -  SourceFileListener, removeSourceFileListener, addSourceFileListener
  
 
 
 
close
public abstract void close(boolean saveChanges)
  -  Closes this 
SourceFile's editor window, and optionally save its contents.
   
 
    -  Parameters:
    
 -  saveChanges - 
true to save this file's contents, false to discard any changes made to
 this SourceFile.
   
 
 
edit
public abstract void edit()
  -  Activates this 
SourceFile's editor window.
 If this SourceFile isn't open yet, it is opened.
   
 
equals
public abstract boolean equals(SourceFile sourceFile)
  -  Determine if two 
SourceFile objects represent the same file.
   
 
getFile
public abstract java.io.File getFile()
  -  Gets the 
File associated with this SourceFile.
 This method never returns null, but the actual file may not exist on disk 
 (i.e. File.exists() == false).
   
 
    -  Returns:
    
 -  the 
File associated with this SourceFile.
   
 
 
getFullName
public abstract java.lang.String getFullName()
  -  Gets the pathname of the 
File associated with this SourceFile.
   
 
    -  Returns:
    
 -  the complete filename of this 
SourceFile.
   
 
 
getInsertionPoint
public abstract int getInsertionPoint()
  -  Gets the current insertion point, in zero-based bytes.
  
 
 
    -  Returns:
    
 -  the current insertion point, in zero-based bytes, or 0 if the 
SourceFile is not
  currently open.
   
 
 
getName
public abstract java.lang.String getName()
  -  Gets the base name of the 
File associated with this SourceFile.
 The base name is everything in the pathname after the last occurrence of the
 separator character (i.e. no directory information).
   
 
    -  Returns:
    
 -  this file's base filename.
  
 
 
 
getProjectFile
public abstract com.symantec.itools.vcafe.openapi.ProjectFile getProjectFile()
  -  Gets the 
ProjectFile associated with this SourceFile.  If this file
 is not in a project, returns null.
   
 
    -  Returns:
    
 -  The 
ProjectFile, or null if this file is not in a project.
     -  See Also:
    
 -  ProjectFile
  
 
 
 
getRangeText
public abstract java.lang.StringBuffer getRangeText(Range theRange)
  -  Gets the text within the specified 
Range.
 The current selection range of this SourceFile is not changed by this method.
   
 
    -  Parameters:
    
 -  theRange - the 
Range from which to get the text.
     -  Returns:
    
 -  a 
StringBuffer containing the in-range text.
   
 
 
getRangeTextString
public abstract java.lang.String getRangeTextString(Range theRange)
  -  Gets the text within the specified 
Range as a String.
 The current selection range of this SourceFile is not changed by this method.
   
 
    -  Parameters:
    
 -  theRange - the 
Range from which to get the text.
     -  Returns:
    
 -  a 
String containing the in-range text.
   
 
 
getSelectionRange
public abstract com.symantec.itools.vcafe.openapi.Range getSelectionRange()
  -  Gets the 
Range of the currently selected text.
   
 
    -  Returns:
    
 -  the current text selection range, or 
null if the SourceFile is not
  currently open.
   
 
 
getText
public abstract java.lang.StringBuffer getText()
  -  Gets this 
SourceFile's entire contents.
   
 
    -  Returns:
    
 -  a 
StringBuffer containing the entire SourceFile contents.
   
 
 
getTextString
public abstract java.lang.String getTextString()
  -  Gets this 
SourceFile's entire contents as a String.
   
 
    -  Returns:
    
 -  a 
String containing the entire SourceFile contents.
   
 
 
isLocked
public abstract boolean isLocked()
  -  Determines whether this 
SourceFile is locked (on disk, or locked in source control).
   
 
    -  Returns:
    
 -  
true if locked either on disk or in source control, false if it is not locked.
   
 
 
isModified
public abstract boolean isModified()
  -  Determines whether this 
SourceFile has been modified.
   
 
    -  Returns:
    
 -  
true if it has been modified, false otherwise.
   
 
 
isOpen
public abstract boolean isOpen()
  -  Determines if this 
SourceFile is open in an editor window.
   
 
    -  Returns:
    
 -  
true if the file is open, false otherwise.
   
 
 
removeSourceFileListener
public abstract void removeSourceFileListener(SourceFileListener listener)
  -  Remove a listener from this 
SourceFile.
 The listener stops receiving notifications of changes to this SourceFile.
   
 
    -  Parameters:
    
 -  listener - the object that was receiving notifications.
    
 -  See Also:
    
 -  SourceFileListener, addSourceFileListener, removeSourceFileListener
  
 
 
 
revertToSaved
public abstract void revertToSaved()
  -  Refreshes this 
SourceFile's editor window with the contents on disk.
   
 
save
public abstract void save()
  -  Saves the contents of this 
SourceFile to disk.
   
 
setModified
public abstract boolean setModified(boolean modified)
  -  Set the modified flag of this 
SourceFile.
 
 Note: Use this method ONLY for marking the SourceFile as modified when
 the changes haven't been set with setRangeText() or setText().
 Note: Use of this method does not result in listeners being notified of the change.
 This can be useful when making a change that hasn't been committed, so
 that if the user closes the SourceFile's editor window, the user is
 prompted to save the changes.  You can then flush or commit your changes.
 You should listen for other changes to the SourceFile, so you don't inadvertantly
 set the SourceFile as unmodified, when it has been modified elsewhere.
   
 
    -  Parameters:
    
 -  modified - the new modified state of this 
SourceFile.
     -  Returns:
    
 -  the previous modified state of the 
SourceFile.
     -  See Also:
    
 -  SourceFileListener
  
 
 
 
setRangeText
public abstract void setRangeText(StringBuffer newText,
                                  Range theRange)
  -  Replaces the text in the given 
Range with the new text. The resulting new Range is then
 returned in theRange.
   
 
    -  Parameters:
    
 -  newText - the new replacement text.
    
-  theRange - on input, the range of text to be replaced.  On output, the
 newly resulting range.
  
  
 
 
setRangeText
public abstract void setRangeText(String newText,
                                  Range theRange)
  -  Replaces the text in the given 
Range with the new text String.
 The resulting new Range is then returned in theRange.
   
 
    -  Parameters:
    
 -  newText - the new replacement text.
    
-  theRange - on input, the range of text to be replaced.  On output, the
 newly resulting range.
  
  
 
 
setSelectionRange
public abstract void setSelectionRange(Range newRange)
  -  Sets the range of the currently selected text.
  
 
 
    -  Parameters:
    
 -  the - new text selection range.
  
 
 
 
setText
public abstract void setText(StringBuffer newText)
  -  Replaces the 
SourceFile's entire contents.
   
 
    -  Parameters:
    
 -  newText - the new contents of this 
SourceFile.
   
 
 
setText
public abstract void setText(String newText)
  -  Replaces the 
SourceFile's entire contents with the contents of a String.
   
 
    -  Parameters:
    
 -  newText - the new contents of this 
SourceFile.
   
 
 
toString
public java.lang.String toString()
  -  Gets a 
String that represents this object.
   
 
    -  Returns:
    
 -  the 
String.
     -  Overrides:
    
 -  toString in class Object
  
 
 
 
All Packages  Class Hierarchy  This Package  Previous  Next  Index