View Javadoc

1   package org.lsst.ccs.plugin.jas3.jms;
2   
3   import javax.swing.JComponent;
4   import org.freehep.jas.services.PreferencesTopic;
5   
6   /**
7    * A JAS preferences topic, which allows the restful server location to be controlled
8    * from the JAS preferences panel.
9    * @author turri
10   */
11  class JmsPreferencesTopic implements PreferencesTopic {
12  
13      private final String[] jmsPreferencesPath = {"LSST","Messaging","JMS"};
14      private final JmsPreferences prefs;
15      
16      JmsPreferencesTopic(JmsPreferences prefs) {
17          this.prefs = prefs;
18      }
19      
20      @Override
21      public boolean apply(JComponent panel) {
22          JmsPreferencesPanel jp = (JmsPreferencesPanel) panel;
23          jp.apply();
24          return true;
25      }
26  
27  
28      @Override
29      public String[] path() {
30          return jmsPreferencesPath;
31      }
32  
33      @Override
34      public JComponent component() {
35          return new JmsPreferencesPanel(prefs);
36      } 
37  }