Class AbstractCompiler
- java.lang.Object
-
- net.emustudio.emulib.plugins.compiler.AbstractCompiler
-
-
Field Summary
Fields Modifier and Type Field Description protected ApplicationApi
applicationApi
emuStudio API.protected long
pluginID
Plugin ID assigned by emuStudioprotected PluginSettings
settings
Compiler 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 void
addCompilerListener(CompilerListener listener)
Adds a listener onto compilerListeners listvoid
destroy()
Does nothing.java.lang.String
getTitle()
Get plugin titlevoid
initialize()
Does nothing.boolean
isShowSettingsSupported()
Return false.protected void
notifyCompileFinish()
This method notifies all compilerListeners that the compiler finished the compile process right now.protected void
notifyCompileStart()
This method notifies all compilerListeners that the compiler is starting the compile process.void
notifyError(int line, int column, java.lang.String msg)
Notifies the error message.void
notifyError(java.lang.String msg)
Notifies the error message.void
notifyInfo(int line, int column, java.lang.String msg)
Notifies information messagevoid
notifyInfo(java.lang.String msg)
Notifies information messagevoid
notifyOnMessage(CompilerMessage compilerMessage)
This method notifies all compilerListeners that the compiler wants to print something out (a message).void
notifyWarning(int line, int column, java.lang.String msg)
Fires warning messagevoid
notifyWarning(java.lang.String msg)
Fires warning messagevoid
removeCompilerListener(CompilerListener listener)
Removes the listener from compilerListeners listvoid
reset()
Does nothing.void
showSettings(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 PluginInitializationException
Does nothing. Should be overridden.- Specified by:
initialize
in 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:
getTitle
in interfacePlugin
- Returns:
- title from the
PluginRoot
annotation
-
showSettings
public void showSettings(javax.swing.JFrame parent)
Does nothing. Should be overridden.- Specified by:
showSettings
in 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:
isShowSettingsSupported
in interfacePlugin
- Returns:
- false
-
addCompilerListener
public void addCompilerListener(CompilerListener listener)
Adds a listener onto compilerListeners list- Specified by:
addCompilerListener
in interfaceCompiler
- Parameters:
listener
- listener object
-
removeCompilerListener
public void removeCompilerListener(CompilerListener listener)
Removes the listener from compilerListeners list- Specified by:
removeCompilerListener
in 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
-
-