public class JavaScriptMode extends Mode
| Modifier and Type | Field and Description |
|---|---|
boolean |
showSizeWarning |
contribLibraries, coreLibraries| Constructor and Description |
|---|
JavaScriptMode(Base base,
java.io.File folder)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
Editor |
createEditor(Base base,
java.lang.String path,
EditorState state)
Called to create the actual editor when needed (once per Sketch)
|
java.lang.String |
getDefaultExtension()
Return the default extension for this mode, same as Java
|
JavaMode |
getDefaultMode() |
Editor |
getEditor()
Called from Base to get the Editor for this mode.
|
java.io.File[] |
getExampleCategoryFolders()
Fetch and return examples from JS and Java mode
|
java.lang.String[] |
getExtensions()
Return allowed extensions
|
java.lang.String[] |
getIgnorable()
Return list of file- / folder-names that should be ignored when
sketch is being copied or saved as
|
java.io.File[] |
getKeywordFiles()
To add additional keywords, or to grab them from another mode, override
this function.
|
Library |
getLibrary(java.lang.String pkgName)
Override Mode.getLibrary to add our own discovery of JS-only libraries.
|
java.lang.String |
getTitle()
Return pretty title of this mode for menu listing and such
|
boolean |
handleExport(Sketch sketch)
Build and export a sketch
|
buildExamplesTree, getBoolean, getClassLoader, getColor, getContentFile, getContentStream, getCoreLibrary, getExamplesFolder, getFont, getIdentifier, getImportMenu, getInteger, getLibrariesFolder, getReferenceFolder, getStyle, getTokenMarker, getToolbarMenu, hideExtension, insertToolbarRecentMenu, isDefaultExtension, isDefaultExtension, loadImage, lookupReference, prepareExportFolder, rebuildImportMenu, rebuildLibraryList, removeToolbarRecentMenu, resetExamples, setClassLoader, setupGUI, showExamplesFrame, validExtensionpublic JavaScriptMode(Base base, java.io.File folder)
base - the Processing editor basefolder - the folder that this mode is started frompublic Editor createEditor(Base base, java.lang.String path, EditorState state)
createEditor in class Modepublic Editor getEditor()
public JavaMode getDefaultMode()
public java.io.File[] getKeywordFiles()
ModegetKeywordFiles in class Modepublic java.lang.String getTitle()
public java.io.File[] getExampleCategoryFolders()
getExampleCategoryFolders in class Modepublic java.lang.String getDefaultExtension()
getDefaultExtension in class Modepublic java.lang.String[] getExtensions()
getExtensions in class Modepublic java.lang.String[] getIgnorable()
getIgnorable in class Modepublic Library getLibrary(java.lang.String pkgName) throws SketchException
getLibrary in class ModeSketchExceptionpublic boolean handleExport(Sketch sketch) throws java.io.IOException, SketchException
java.io.IOExceptionSketchException