001package jmri.util.prefs; 002 003 004import jmri.InstanceManagerAutoDefault; 005import jmri.util.swing.JmriAbstractAction; 006import jmri.util.swing.JmriPanel; 007 008/** 009 * This class provides a method to create an action that launches 010 * preferences. The default implementation provides a no-op action. 011 * Applications that have a preferences interface should install a 012 * version of this factory in the InstanceManager that provides the 013 * desired preferences action. 014 * 015 * @author Paul Bender Copyright (C) 2020 016 */ 017public class JmriPreferencesActionFactory implements InstanceManagerAutoDefault { 018 019 public JmriAbstractAction getDefaultAction() { 020 return new JmriAbstractAction("No-op"){ 021 @Override 022 public JmriPanel makePanel() { 023 return null; 024 } 025 }; 026 } 027 028 public JmriAbstractAction getNamedAction(String name){ 029 return new JmriAbstractAction(name){ 030 @Override 031 public JmriPanel makePanel() { 032 return null; 033 } 034 }; 035 } 036 037 public JmriAbstractAction getCategorizedAction(String name,String category){ 038 return new JmriAbstractAction(name){ 039 @Override 040 public JmriPanel makePanel() { 041 return null; 042 } 043 }; 044 } 045 046 public JmriAbstractAction getCategorizedAction(String name,String category,String subCategory){ 047 return new JmriAbstractAction(name){ 048 @Override 049 public JmriPanel makePanel() { 050 return null; 051 } 052 }; 053 } 054 055}