public class SketchCode
extends java.lang.Object
| Constructor and Description |
|---|
SketchCode(java.io.File file,
java.lang.String extension) |
| Modifier and Type | Method and Description |
|---|---|
void |
addPreprocOffset(int extra) |
void |
copyTo(java.io.File dest) |
javax.swing.text.Document |
getDocument() |
java.lang.String |
getExtension() |
java.io.File |
getFile() |
java.lang.String |
getFileName() |
int |
getLineCount() |
int |
getPreprocOffset() |
java.lang.String |
getPrettyName() |
java.lang.String |
getProgram()
get the current text for this tab
|
java.lang.String |
getSavedProgram()
get the last version saved of this tab
|
int |
getScrollPosition() |
int |
getSelectionStart() |
int |
getSelectionStop() |
javax.swing.undo.UndoManager |
getUndo() |
boolean |
isExtension(java.lang.String what) |
boolean |
isModified() |
long |
lastVisited() |
void |
load()
Load this piece of code from a file.
|
void |
save()
Save this piece of code, regardless of whether the modified
flag is set or not.
|
void |
saveAs(java.io.File newFile)
Save this file to another location, used by Sketch.saveAs()
|
void |
setDocument(javax.swing.text.Document d) |
void |
setFolder(java.io.File sketchFolder)
Called when the sketch folder name/location has changed.
|
void |
setModified(boolean modified) |
void |
setPreprocOffset(int preprocOffset) |
void |
setProgram(java.lang.String replacement)
set the current text for this tab
|
public java.io.File getFile()
public void copyTo(java.io.File dest)
throws java.io.IOException
java.io.IOExceptionpublic java.lang.String getFileName()
public java.lang.String getPrettyName()
public java.lang.String getExtension()
public boolean isExtension(java.lang.String what)
public java.lang.String getProgram()
public void setProgram(java.lang.String replacement)
public java.lang.String getSavedProgram()
public int getLineCount()
public void setModified(boolean modified)
public boolean isModified()
public void setPreprocOffset(int preprocOffset)
public int getPreprocOffset()
public void addPreprocOffset(int extra)
public javax.swing.text.Document getDocument()
public void setDocument(javax.swing.text.Document d)
public javax.swing.undo.UndoManager getUndo()
public int getSelectionStart()
public int getSelectionStop()
public int getScrollPosition()
public long lastVisited()
public void load()
throws java.io.IOException
java.io.IOExceptionpublic void save()
throws java.io.IOException
java.io.IOExceptionpublic void saveAs(java.io.File newFile)
throws java.io.IOException
java.io.IOExceptionpublic void setFolder(java.io.File sketchFolder)