public interface PluginHost
AlgorithmPlugin
s.
Modifier and Type | Method and Description |
---|---|
void |
adaptDialog(javax.swing.JDialog dialog)
Adapts the dialog to the host application meaning that the dialog is centered in the host
and the application icon is set to the dialog.
|
boolean |
checkPermission(PluginHost host)
Checks if the given host is accepted by this host.
|
AlgorithmExerciseProvider |
getDefaultExerciseProvider()
Gets the default exercise provider that is implemented by the host system.
|
LanguageFile |
getLanguageFile()
Gets the language file of the host application.
|
java.lang.String |
getLanguageID()
Gets the language id that is used and set in the host application.
|
java.lang.String |
getPluginAssumptions(int index)
Gets the assumptions of a plugin.
|
java.lang.String |
getPluginAuthor(int index)
Gets the author of a plugin.
|
java.lang.String |
getPluginAuthorContact(int index)
Gets the author contact details of a plugin.
|
int |
getPluginCount()
Gets the number of the currently installed plugins in the host application.
|
java.lang.String |
getPluginDescription(int index)
Gets the description of a plugin.
|
java.lang.String |
getPluginInstructions(int index)
Gets the instructions of a plugin.
|
java.lang.String |
getPluginName(int index)
Gets the name of a plugin.
|
java.lang.String |
getPluginProblemAffiliation(int index)
Gets the problem affiliation of a plugin.
|
java.lang.String |
getPluginSubject(int index)
Gets the subject of a plugin.
|
AlgorithmText |
getPluginText(int index)
Gets the algorithm text of a plugin.
|
java.lang.String |
getPluginType(int index)
Gets the type of a plugin.
|
java.lang.String |
getPluginVersion(int index)
Gets the version of a plugin.
|
boolean |
isActivePlugin(AlgorithmPlugin plugin)
Indicates if the given plugin is currently enabled in the host application.
|
void |
rteModeChanged()
Indicates that the mode of the runtime environment of the active plugin changed from normal mode to exercise
mode or the other way around.
|
void |
showMessage(AlgorithmPlugin plugin,
java.lang.String msg,
java.lang.String title,
MessageIcon icon)
Displays a message box in the host application.
|
void |
writeLogMessage(AlgorithmPlugin plugin,
java.lang.String msg,
java.lang.Exception e,
LogType type)
Writes a message to the log file.
|
void |
writeLogMessage(AlgorithmPlugin plugin,
java.lang.String msg,
LogType type)
Writes a message to the log file.
|
java.lang.String getLanguageID()
LanguageFile
,
getLanguageFile()
LanguageFile getLanguageFile()
Resources.LANGUAGE_FILE
)
that means all the language dependent labels of graphical views (like GraphView
and so on) which are part of the LAVESDK
can be requested by using this file.LanguageFile
,
getLanguageID()
boolean isActivePlugin(AlgorithmPlugin plugin)
plugin
- AlgorithmPlugin
true
if plugin is the active one otherwise false
void showMessage(AlgorithmPlugin plugin, java.lang.String msg, java.lang.String title, MessageIcon icon)
plugin
- AlgorithmPlugin
that wants to show a messagemsg
- the message texttitle
- the title of the messageicon
- the icon type of the messagevoid writeLogMessage(AlgorithmPlugin plugin, java.lang.String msg, LogType type)
plugin
- the AlgorithmPlugin
that wants to log a messagemsg
- the messagetype
- the message typeLogFile
void writeLogMessage(AlgorithmPlugin plugin, java.lang.String msg, java.lang.Exception e, LogType type)
plugin
- the AlgorithmPlugin
that wants to log a messagemsg
- the messagee
- the exception that occurredtype
- the message typeLogFile
boolean checkPermission(PluginHost host)
host
- the hosttrue
if the host is accepted by this one otherwise false
(in general it is done by returning host == this
)HostSecurity
AlgorithmExerciseProvider getDefaultExerciseProvider()
ExercisesListView
void rteModeChanged()
void adaptDialog(javax.swing.JDialog dialog)
public void adaptDialog(final JDialog dialog) { dialog.setLocationRelativeTo(this); dialog.setIconImage(this.getIconImage()); }
dialog
- the dialog that should be adaptedint getPluginCount()
java.lang.String getPluginName(int index) throws java.lang.IndexOutOfBoundsException
index
- the index of the pluginjava.lang.IndexOutOfBoundsException
- index < 0 || index >= getPluginCount()
)AlgorithmPlugin.getName()
java.lang.String getPluginDescription(int index) throws java.lang.IndexOutOfBoundsException
index
- the index of the pluginjava.lang.IndexOutOfBoundsException
- index < 0 || index >= getPluginCount()
)AlgorithmPlugin.getDescription()
java.lang.String getPluginType(int index) throws java.lang.IndexOutOfBoundsException
index
- the index of the pluginjava.lang.IndexOutOfBoundsException
- index < 0 || index >= getPluginCount()
)AlgorithmPlugin.getType()
java.lang.String getPluginAuthor(int index) throws java.lang.IndexOutOfBoundsException
index
- the index of the pluginjava.lang.IndexOutOfBoundsException
- index < 0 || index >= getPluginCount()
)AlgorithmPlugin.getAuthor()
java.lang.String getPluginAuthorContact(int index) throws java.lang.IndexOutOfBoundsException
index
- the index of the pluginjava.lang.IndexOutOfBoundsException
- index < 0 || index >= getPluginCount()
)AlgorithmPlugin.getAuthorContact()
java.lang.String getPluginAssumptions(int index) throws java.lang.IndexOutOfBoundsException
index
- the index of the pluginjava.lang.IndexOutOfBoundsException
- index < 0 || index >= getPluginCount()
)AlgorithmPlugin.getAssumptions()
java.lang.String getPluginProblemAffiliation(int index) throws java.lang.IndexOutOfBoundsException
index
- the index of the pluginjava.lang.IndexOutOfBoundsException
- index < 0 || index >= getPluginCount()
)AlgorithmPlugin.getProblemAffiliation()
java.lang.String getPluginSubject(int index) throws java.lang.IndexOutOfBoundsException
index
- the index of the pluginjava.lang.IndexOutOfBoundsException
- index < 0 || index >= getPluginCount()
)AlgorithmPlugin.getSubject()
java.lang.String getPluginInstructions(int index) throws java.lang.IndexOutOfBoundsException
index
- the index of the pluginjava.lang.IndexOutOfBoundsException
- index < 0 || index >= getPluginCount()
)AlgorithmPlugin.getInstructions()
java.lang.String getPluginVersion(int index) throws java.lang.IndexOutOfBoundsException
index
- the index of the pluginjava.lang.IndexOutOfBoundsException
- index < 0 || index >= getPluginCount()
)AlgorithmPlugin.getVersion()
AlgorithmText getPluginText(int index) throws java.lang.IndexOutOfBoundsException
index
- the index of the pluginjava.lang.IndexOutOfBoundsException
- index < 0 || index >= getPluginCount()
)AlgorithmPlugin.getText()