public class SketchCode
extends Object
Constructor and Description |
---|
SketchCode(File file,
String extension) |
Modifier and Type | Method and Description |
---|---|
void |
addPreprocOffset(int extra) |
void |
copyTo(File dest) |
Document |
getDocument() |
String |
getDocumentText() |
String |
getExtension() |
File |
getFile() |
String |
getFileName() |
long |
getLastModified()
Used to determine whether this file was modified externally
|
int |
getLineCount() |
int |
getPreprocOffset() |
String |
getPrettyName() |
String |
getProgram()
get the current text for this tab
|
String |
getSavedProgram()
get the last version saved of this tab
|
int |
getScrollPosition() |
int |
getSelectionStart() |
int |
getSelectionStop() |
UndoManager |
getUndo() |
boolean |
isExtension(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(File newFile)
Save this file to another location, used by Sketch.saveAs()
|
void |
setDocument(Document d) |
void |
setFolder(File sketchFolder)
Called when the sketch folder name/location has changed.
|
void |
setLastModified()
Set the last known modification time, so that we're not re-firing
"hey, this is modified!" events incessantly.
|
void |
setModified(boolean modified) |
void |
setPreprocOffset(int preprocOffset) |
void |
setProgram(String replacement)
set the current text for this tab
|
public File getFile()
public void copyTo(File dest) throws IOException
IOException
public String getFileName()
public String getPrettyName()
public String getExtension()
public boolean isExtension(String what)
public String getProgram()
public void setProgram(String replacement)
public 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 Document getDocument()
public String getDocumentText() throws BadLocationException
BadLocationException
public void setDocument(Document d)
public UndoManager getUndo()
public int getSelectionStart()
public int getSelectionStop()
public int getScrollPosition()
public long lastVisited()
public void load() throws IOException
IOException
public void save() throws IOException
IOException
public void saveAs(File newFile) throws IOException
IOException
public void setFolder(File sketchFolder)
public void setLastModified()
public long getLastModified()