Class AbstractCompiler
- java.lang.Object
-
- net.emustudio.emulib.plugins.compiler.AbstractCompiler
-
-
Field Summary
Fields Modifier and Type Field Description protected ApplicationApiapplicationApiemuStudio API.protected longpluginIDPlugin ID assigned by emuStudioprotected PluginSettingssettingsCompiler custom settings.
-
Constructor Summary
Constructors Constructor Description AbstractCompiler(long pluginID, ApplicationApi applicationApi, PluginSettings settings)Creates new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddCompilerListener(CompilerListener listener)Adds a listener onto compilerListeners listvoiddestroy()Does nothing.java.lang.StringgetTitle()Get plugin titlevoidinitialize()Does nothing.booleanisShowSettingsSupported()Return false.protected voidnotifyCompileFinish()This method notifies all compilerListeners that the compiler finished the compile process right now.protected voidnotifyCompileStart()This method notifies all compilerListeners that the compiler is starting the compile process.voidnotifyError(int line, int column, java.lang.String msg)Notifies the error message.voidnotifyError(java.lang.String msg)Notifies the error message.voidnotifyInfo(int line, int column, java.lang.String msg)Notifies information messagevoidnotifyInfo(java.lang.String msg)Notifies information messagevoidnotifyOnMessage(CompilerMessage compilerMessage)This method notifies all compilerListeners that the compiler wants to print something out (a message).voidnotifyWarning(int line, int column, java.lang.String msg)Fires warning messagevoidnotifyWarning(java.lang.String msg)Fires warning messagevoidremoveCompilerListener(CompilerListener listener)Removes the listener from compilerListeners listvoidreset()Does nothing.voidshowSettings(javax.swing.JFrame parent)Does nothing.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.emustudio.emulib.plugins.compiler.Compiler
compile, compile, createLexer, getSourceFileExtensions, isAutomationSupported
-
Methods inherited from interface net.emustudio.emulib.plugins.Plugin
getCopyright, getDescription, getVersion
-
-
-
-
Field Detail
-
pluginID
protected final long pluginID
Plugin ID assigned by emuStudio
-
applicationApi
protected final ApplicationApi applicationApi
emuStudio API.
-
settings
protected final PluginSettings settings
Compiler custom settings.
-
-
Constructor Detail
-
AbstractCompiler
public AbstractCompiler(long pluginID, ApplicationApi applicationApi, PluginSettings settings)Creates new instance.- Parameters:
pluginID- plugin IDapplicationApi- emuStudio APIsettings- plugin custom settings
-
-
Method Detail
-
initialize
public void initialize() throws PluginInitializationExceptionDoes nothing. Should be overridden.- Specified by:
initializein interfacePlugin- Throws:
PluginInitializationException- thrown when initialization process was not successful
-
destroy
public void destroy()
Does nothing. Should be overridden.
-
getTitle
public java.lang.String getTitle()
Get plugin title- Specified by:
getTitlein interfacePlugin- Returns:
- title from the
PluginRootannotation
-
showSettings
public void showSettings(javax.swing.JFrame parent)
Does nothing. Should be overridden.- Specified by:
showSettingsin interfacePlugin- Parameters:
parent- emuStudio main window (if plugin wants to show a dialog which has a parent)
-
isShowSettingsSupported
public boolean isShowSettingsSupported()
Return false. Should be overridden.- Specified by:
isShowSettingsSupportedin interfacePlugin- Returns:
- false
-
addCompilerListener
public void addCompilerListener(CompilerListener listener)
Adds a listener onto compilerListeners list- Specified by:
addCompilerListenerin interfaceCompiler- Parameters:
listener- listener object
-
removeCompilerListener
public void removeCompilerListener(CompilerListener listener)
Removes the listener from compilerListeners list- Specified by:
removeCompilerListenerin interfaceCompiler- Parameters:
listener- listener object
-
notifyCompileStart
protected void notifyCompileStart()
This method notifies all compilerListeners that the compiler is starting the compile process.This method should be called whenever the compiler begins to run.
-
notifyCompileFinish
protected void notifyCompileFinish()
This method notifies all compilerListeners that the compiler finished the compile process right now.This method should be called whenever the compiler ends the execution.
-
notifyOnMessage
public void notifyOnMessage(CompilerMessage compilerMessage)
This method notifies all compilerListeners that the compiler wants to print something out (a message).This method should be called when the compiler wants to notify the user about some warning or error during compilation; or wants to inform the user of something else (e.g. copyright information).
- Parameters:
compilerMessage- The message
-
notifyError
public void notifyError(java.lang.String msg)
Notifies the error message.- Parameters:
msg- text of the message
-
notifyError
public void notifyError(int line, int column, java.lang.String msg)Notifies the error message.- Parameters:
line- line in the source codecolumn- column in the source codemsg- text of the message
-
notifyInfo
public void notifyInfo(java.lang.String msg)
Notifies information message- Parameters:
msg- text of the message
-
notifyInfo
public void notifyInfo(int line, int column, java.lang.String msg)Notifies information message- Parameters:
line- line in the source codecolumn- column in the source codemsg- text of the message
-
notifyWarning
public void notifyWarning(java.lang.String msg)
Fires warning message- Parameters:
msg- text of the message
-
notifyWarning
public void notifyWarning(int line, int column, java.lang.String msg)Fires warning message- Parameters:
line- line in the source codecolumn- column in the source codemsg- text of the message
-
-