Source code: com/arranger/jarl/shell/views/mainShellPanes/BaseMSP.java
1 package com.arranger.jarl.shell.views.mainShellPanes;
2
3 import com.arranger.jarl.shell.JarlShell;
4 import com.arranger.jarl.shell.models.JarlContextModel;
5 import com.arranger.jarl.shell.models.ViewPrefModel;
6 import com.arranger.jarl.shell.models.BaseModel;
7
8 /**
9 * BaseMSP serves as a handy base class and
10 * many of these are the based on the {@link com.arranger.jarl.shell.commands.BaseCommand}s
11 */
12 public abstract class BaseMSP implements IMainShellPane {
13
14 protected JarlShell m_jarlShell;
15
16 /**
17 * Initializes with the jarl shell
18 * @param jarlShell
19 */
20 public void init(JarlShell jarlShell) {
21 m_jarlShell = jarlShell;
22 }
23
24 /**
25 * Events have been fired
26 * @param baseModel
27 * @param propertyName
28 */
29 public void onChange(BaseModel baseModel, String propertyName) {
30 //no op
31 }
32
33 protected JarlContextModel getJarlContextModel() {
34 return (JarlContextModel) m_jarlShell.getModel(JarlContextModel.class.getName());
35 }
36
37 protected ViewPrefModel getViewPrefModel() {
38 return (ViewPrefModel) m_jarlShell.getModel(ViewPrefModel.class.getName());
39 }
40 }