Skip to content

Commit

Permalink
updated case study to use ThemePlugin appropriately
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanAldrich committed Jul 17, 2020
1 parent eb8192e commit 7cbbe5e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/text-editor/plugins/darkTheme.wyv
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import uiEffects
module def darkTheme(logger: Logger, uiManager: UIManager): {} Plugin[{logger.Update, uiEffects.PaintUI, uiEffects.SetUILookAndFeel}]
module def darkTheme(logger: Logger, uiManager: UIManager): {} ThemePlugin[{logger.Update, uiEffects.PaintUI, uiEffects.SetUILookAndFeel}]
// N.B.: In Java, once the theme is changed, apparently, there is no way to change it again, so this plugin shouldn't be registered in the menu.

effect Run = {logger.Update, uiEffects.PaintUI, uiEffects.SetUILookAndFeel}
Expand Down
2 changes: 1 addition & 1 deletion examples/text-editor/plugins/lightTheme.wyv
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import uiEffects
module def lightTheme(logger: Logger, uiManager: UIManager): {} Plugin[{logger.Update, uiEffects.PaintUI, uiEffects.SetUILookAndFeel}]
module def lightTheme(logger: Logger, uiManager: UIManager): {} ThemePlugin[{logger.Update, uiEffects.PaintUI, uiEffects.SetUILookAndFeel}]
// N.B.: In Java, once the theme is changed, apparently, there is no way to change it again, so this plugin shouldn't be registered in the menu.

effect Run = {logger.Update, uiEffects.PaintUI, uiEffects.SetUILookAndFeel}
Expand Down
4 changes: 2 additions & 2 deletions examples/text-editor/textEditor.wyv
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ def getAttenuatedNativeJOptionPane(): {} OptionPane

/******* Step 2: Instantiate plugins passing in appropriate resources *******/

val darkTheme: Plugin[{logger.Update, uiEffects.PaintUI, uiEffects.SetUILookAndFeel}] = darkTheme(logger, getAttenuatedNativeUIManager())
val lightTheme: Plugin[{logger.Update, uiEffects.PaintUI, uiEffects.SetUILookAndFeel}] = lightTheme(logger, getAttenuatedNativeUIManager())
val darkTheme: ThemePlugin[{logger.Update, uiEffects.PaintUI, uiEffects.SetUILookAndFeel}] = darkTheme(logger, getAttenuatedNativeUIManager())
val lightTheme: ThemePlugin[{logger.Update, uiEffects.PaintUI, uiEffects.SetUILookAndFeel}] = lightTheme(logger, getAttenuatedNativeUIManager())
val wordCount: Plugin[{logger.Update, uiEffects.ReadTextArea, uiEffects.ShowDialog, uiEffects.GetMessageValue}] = wordCount(logger, getAttenuatedNativeJTextArea(), getAttenuatedNativeJOptionPane()) // Must pass in TextArea and not just String because need to get the latest version of the text
val questionnaireCreator: Plugin[{logger.Update, fs.Write, fs.Append, uiEffects.ReadTextArea}] = questionnaireCreator(logger, getAttenuatedNativeJTextArea(), fs) // Must pass in TextArea and not just String because need to get the latest version of the text

Expand Down

0 comments on commit 7cbbe5e

Please sign in to comment.