Java Doc for InteractionsDocument.java in  » IDE » DrJava » edu » rice » cs » drjava » model » repl » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » IDE » DrJava » edu.rice.cs.drjava.model.repl 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   edu.rice.cs.util.text.ConsoleDocument
      edu.rice.cs.drjava.model.repl.InteractionsDocument

InteractionsDocument
public class InteractionsDocument extends ConsoleDocument (Code)
A GUI toolkit-agnostic document that supports console-like interaction with a Java interpreter. This class assumes that the embedded document supports readers/writers locking and uses that locking protocol to ensure the integrity of the data added in this class
version:
   $Id: InteractionsDocument.java 4264 2007-11-15 01:33:48Z mgricken $


Field Summary
final public static  StringCHARACTER_RETURN_STYLE
    
final public static  StringDEBUGGER_STYLE
    
final public static  StringDEFAULT_PROMPT
     Default prompt.
final public static  StringERROR_STYLE
    
final public static  StringNUMBER_RETURN_STYLE
    
final public static  StringOBJECT_RETURN_STYLE
    
final public static  StringSTRING_RETURN_STYLE
    

Constructor Summary
public  InteractionsDocument(ConsoleDocumentInterface document, String banner)
     Reset the document on startUp.
public  InteractionsDocument(ConsoleDocumentInterface document, int maxHistorySize, String banner)
     Reset the document on startUp.
public  InteractionsDocument(ConsoleDocumentInterface document, History history, String banner)
     Creates and resets the interactions document on DrJava startUp.

Method Summary
public  voidaddToHistory(String text)
     Adds the given text to the history of commands.
public  voidappendExceptionResult(String exceptionClass, String message, String stackTrace, String styleName)
     Inserts the given exception data into the document with the given style.
public  voidappendSyntaxErrorResult(String message, String interaction, int startRow, int startCol, int endRow, int endCol, String styleName)
    
public  voidclearCurrentInteraction()
     Clears the current input text and then moves to the end of the command history.
public  voidclearHistory()
    
public  voidforwardHistorySearch(String searchString)
     Forward searches the history for the given string.
public  voidforwardSearchInteractionsInHistory()
     Forward searches the history for interactions that started with the current interaction.
public  StringgetCurrentInteraction()
     Returns the string that the user has entered at the current prompt.
public  StringgetDefaultStyle()
    
protected  HistorygetHistory()
    
public  StringgetHistoryAsString()
     Returns the entire history as a single string.
public  StringgetHistoryAsStringWithSemicolons()
     Returns the entire history as a single string.
public  OptionListener<Integer>getHistoryOptionListener()
     Accessor method for the history of commands.
public  booleanhasHistoryNext()
     Returns whether there is a next command in the history.
public  booleaninProgress()
     Returns whether an interaction is currently in progress.
public  StringlastEntry()
    
public  voidmoveHistoryNext(String entry)
     Puts the next line from the history on the current line and moves the history forward one line.
public  voidmoveHistoryPrevious(String entry)
     Puts the previous line from the history on the current line and moves the history back one line.
public  voidpreparePrintJob()
     This method tells the document to prepare all the DrJavaBook and PagePrinter objects.
public  booleanrecallNextInteractionInHistory()
     Gets the next interaction in the history and replaces whatever is on the current interactions input line with this interaction.
public  booleanrecallPreviousInteractionInHistory()
     Gets the previous interaction in the history and replaces whatever is on the current interactions input line with this interaction.
public  StringremoveLastFromHistory()
     Returns the last history item and then removes it, or returns null if the history is empty.
public  voidreset(String banner)
     Resets the document to a clean state.
public  voidreverseHistorySearch(String searchString)
     Reverse searches the history for the given string.
public  voidreverseSearchInteractionsInHistory()
     Reverse searches the history for interactions that started with the current interaction.
public  voidsaveHistory(FileSaveSelector selector)
    
public  voidsaveHistory(FileSaveSelector selector, String editedVersion)
     Saves the edited version of the current history to a file
Parameters:
  selector - File to save to
Parameters:
  editedVersion - Edited verison of the history which will besaved to file instead of the lines saved in the history.
public  voidsetInProgress(boolean inProgress)
     Lets this document know whether an interaction is in progress.

Field Detail
CHARACTER_RETURN_STYLE
final public static String CHARACTER_RETURN_STYLE(Code)



DEBUGGER_STYLE
final public static String DEBUGGER_STYLE(Code)
Style for debugger messages



DEFAULT_PROMPT
final public static String DEFAULT_PROMPT(Code)
Default prompt.



ERROR_STYLE
final public static String ERROR_STYLE(Code)
Style for error messages



NUMBER_RETURN_STYLE
final public static String NUMBER_RETURN_STYLE(Code)



OBJECT_RETURN_STYLE
final public static String OBJECT_RETURN_STYLE(Code)



STRING_RETURN_STYLE
final public static String STRING_RETURN_STYLE(Code)




Constructor Detail
InteractionsDocument
public InteractionsDocument(ConsoleDocumentInterface document, String banner)(Code)
Reset the document on startUp. Uses a history with configurable size.
Parameters:
  document - the edit document to use for the model



InteractionsDocument
public InteractionsDocument(ConsoleDocumentInterface document, int maxHistorySize, String banner)(Code)
Reset the document on startUp. Uses a history with the given maximum size. This history will not use the config framework.
Parameters:
  document - EditDocumentInterface to use for the model
Parameters:
  maxHistorySize - Number of commands to remember in the history



InteractionsDocument
public InteractionsDocument(ConsoleDocumentInterface document, History history, String banner)(Code)
Creates and resets the interactions document on DrJava startUp. Uses the given history.
Parameters:
  document - EditDocumentInterface to use for the model
Parameters:
  history - History of commands




Method Detail
addToHistory
public void addToHistory(String text)(Code)
Adds the given text to the history of commands.



appendExceptionResult
public void appendExceptionResult(String exceptionClass, String message, String stackTrace, String styleName)(Code)
Inserts the given exception data into the document with the given style.
Parameters:
  exceptionClass - Name of the exception that was thrown
Parameters:
  message - Message contained in the exception
Parameters:
  stackTrace - String representation of the stack trace
Parameters:
  styleName - name of the style for formatting the exception



appendSyntaxErrorResult
public void appendSyntaxErrorResult(String message, String interaction, int startRow, int startCol, int endRow, int endCol, String styleName)(Code)



clearCurrentInteraction
public void clearCurrentInteraction()(Code)
Clears the current input text and then moves to the end of the command history.



clearHistory
public void clearHistory()(Code)
Clears the history



forwardHistorySearch
public void forwardHistorySearch(String searchString)(Code)
Forward searches the history for the given string.
Parameters:
  searchString - the string to search for



forwardSearchInteractionsInHistory
public void forwardSearchInteractionsInHistory()(Code)
Forward searches the history for interactions that started with the current interaction.



getCurrentInteraction
public String getCurrentInteraction()(Code)
Returns the string that the user has entered at the current prompt. Forwards to getCurrentInput().



getDefaultStyle
public String getDefaultStyle()(Code)



getHistory
protected History getHistory()(Code)



getHistoryAsString
public String getHistoryAsString()(Code)
Returns the entire history as a single string. Commands should be separated by semicolons.



getHistoryAsStringWithSemicolons
public String getHistoryAsStringWithSemicolons()(Code)
Returns the entire history as a single string. Commands should be separated by semicolons. If an entire command does not end in a semicolon, one is added.



getHistoryOptionListener
public OptionListener<Integer> getHistoryOptionListener()(Code)
Accessor method for the history of commands.



hasHistoryNext
public boolean hasHistoryNext()(Code)
Returns whether there is a next command in the history. Assumes that WriteLock is already held!



inProgress
public boolean inProgress()(Code)
Returns whether an interaction is currently in progress. Should use ReadLock?



lastEntry
public String lastEntry()(Code)



moveHistoryNext
public void moveHistoryNext(String entry)(Code)
Puts the next line from the history on the current line and moves the history forward one line.
Parameters:
  entry - the current entry (perhaps edited from what is in history)



moveHistoryPrevious
public void moveHistoryPrevious(String entry)(Code)
Puts the previous line from the history on the current line and moves the history back one line.
Parameters:
  entry - the current entry (perhaps edited from what is in history)



preparePrintJob
public void preparePrintJob()(Code)
This method tells the document to prepare all the DrJavaBook and PagePrinter objects.



recallNextInteractionInHistory
public boolean recallNextInteractionInHistory()(Code)
Gets the next interaction in the history and replaces whatever is on the current interactions input line with this interaction.



recallPreviousInteractionInHistory
public boolean recallPreviousInteractionInHistory()(Code)
Gets the previous interaction in the history and replaces whatever is on the current interactions input line with this interaction. Assumes that the WriteLock is already held!



removeLastFromHistory
public String removeLastFromHistory()(Code)
Returns the last history item and then removes it, or returns null if the history is empty.



reset
public void reset(String banner)(Code)
Resets the document to a clean state. Does not reset the history.



reverseHistorySearch
public void reverseHistorySearch(String searchString)(Code)
Reverse searches the history for the given string.
Parameters:
  searchString - the string to search for



reverseSearchInteractionsInHistory
public void reverseSearchInteractionsInHistory()(Code)
Reverse searches the history for interactions that started with the current interaction.



saveHistory
public void saveHistory(FileSaveSelector selector) throws IOException(Code)
Saves the unedited version of the current history to a file
Parameters:
  selector - File to save to



saveHistory
public void saveHistory(FileSaveSelector selector, String editedVersion) throws IOException(Code)
Saves the edited version of the current history to a file
Parameters:
  selector - File to save to
Parameters:
  editedVersion - Edited verison of the history which will besaved to file instead of the lines saved in the history. The savedfile will still include any tags needed to recognize it as a savedinteractions file.



setInProgress
public void setInProgress(boolean inProgress)(Code)
Lets this document know whether an interaction is in progress.
Parameters:
  inProgress - whether an interaction is in progress



Fields inherited from edu.rice.cs.util.text.ConsoleDocument
final public static String DEFAULT_CONSOLE_PROMPT(Code)(Java Doc)
final public static String DEFAULT_STYLE(Code)(Java Doc)
final public static String SYSTEM_ERR_STYLE(Code)(Java Doc)
final public static String SYSTEM_IN_STYLE(Code)(Java Doc)
final public static String SYSTEM_OUT_STYLE(Code)(Java Doc)
protected volatile Runnable _beep(Code)(Java Doc)
protected volatile DrJavaBook _book(Code)(Java Doc)
final protected ConsoleDocumentInterface _document(Code)(Java Doc)
protected volatile String _prompt(Code)(Java Doc)

Methods inherited from edu.rice.cs.util.text.ConsoleDocument
protected void _clearCurrentInputText()(Code)(Java Doc)
public void _forceInsertText(int offs, String str, String style) throws EditDocumentException(Code)(Java Doc)
public void _insertText(int offs, String str, String style) throws EditDocumentException(Code)(Java Doc)
public void _removeText(int offs, int len) throws EditDocumentException(Code)(Java Doc)
public void acquireReadLock()(Code)(Java Doc)
public void acquireWriteLock()(Code)(Java Doc)
public void append(String str, String style) throws EditDocumentException(Code)(Java Doc)
public void cleanUpPrintJob()(Code)(Java Doc)
public void clearCurrentInput()(Code)(Java Doc)
public void disablePrompt()(Code)(Java Doc)
public void forceInsertText(int offs, String str, String style) throws EditDocumentException(Code)(Java Doc)
public void forceRemoveText(int offs, int len) throws EditDocumentException(Code)(Java Doc)
public String getCurrentInput()(Code)(Java Doc)
public String getDefaultStyle()(Code)(Java Doc)
public String getDocText(int offs, int len) throws EditDocumentException(Code)(Java Doc)
public DocumentEditCondition getEditCondition()(Code)(Java Doc)
public int getLength()(Code)(Java Doc)
public Pageable getPageable() throws IllegalStateException(Code)(Java Doc)
public String getPrompt()(Code)(Java Doc)
public int getPromptPos()(Code)(Java Doc)
public String getText()(Code)(Java Doc)
public boolean hasPrompt()(Code)(Java Doc)
public void insertBeforeLastPrompt(String text, String style)(Code)(Java Doc)
public void insertNewLine(int pos)(Code)(Java Doc)
public void insertPrompt()(Code)(Java Doc)
public void insertText(int offs, String str, String style) throws EditDocumentException(Code)(Java Doc)
public void preparePrintJob()(Code)(Java Doc)
public void print() throws PrinterException(Code)(Java Doc)
public void releaseReadLock()(Code)(Java Doc)
public void releaseWriteLock()(Code)(Java Doc)
public void removeText(int offs, int len) throws EditDocumentException(Code)(Java Doc)
public void reset(String banner)(Code)(Java Doc)
public void setBeep(Runnable beep)(Code)(Java Doc)
public void setEditCondition(DocumentEditCondition condition)(Code)(Java Doc)
public void setHasPrompt(boolean val)(Code)(Java Doc)
public void setPrompt(String prompt)(Code)(Java Doc)
public void setPromptPos(int newPos)(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.