Package xal.app.launcher
Class LaunchModel
- java.lang.Object
-
- xal.app.launcher.LaunchModel
-
- All Implemented Interfaces:
xal.tools.data.DataListener
public class LaunchModel extends Object implements xal.tools.data.DataListener
LaunchModel is the main model. It manages the collections of groups and applications.- Author:
- tap
-
-
Field Summary
Fields Modifier and Type Field Description static StringDATA_LABELDataAdaptor label used in reading and writing
-
Constructor Summary
Constructors Constructor Description LaunchModel()Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddLaunchModelListener(LaunchModelListener listener)Add a listener of LaunchModel events from this instancevoidaddNewRuleAt(int index)add a new rule at the specified index or at the end if the index is invalidStringdataLabel()provides the name used to identify the class in an external data source.voiddeleteRuleAt(int index)delete the rule at the specified indexList<App>getApplications()get the applicationsLaunchergetLauncher()Get the launcherList<Rule>getRules()get rulesvoidlaunchApplication(App application)launch the specified application using the first matching rulevoidpostModifications()post modification noticevoidpreConfigure()preconfigure the model when initializing without a document filevoidrefreshApplications()refresh the list of applicationsvoidremoveLaunchModelListener(LaunchModelListener listener)Remove a listener of LaunchModel events from this instancevoidupdate(xal.tools.data.DataAdaptor adaptor)Instructs the receiver to update its data based on the given adaptor.voidupdateRuleExclusionAt(int index, boolean exclude)update the rule kind at the specified locationvoidupdateRuleKindAt(int index, String kind)update the rule kind at the specified locationvoidupdateRulePatternAt(int index, String pattern)update the rule pattern at the specified locationvoidwrite(xal.tools.data.DataAdaptor adaptor)Instructs the receiver to write its data to the adaptor for external storage.
-
-
-
Field Detail
-
DATA_LABEL
public static final String DATA_LABEL
DataAdaptor label used in reading and writing- See Also:
- Constant Field Values
-
-
Method Detail
-
postModifications
public void postModifications()
post modification notice
-
addNewRuleAt
public void addNewRuleAt(int index)
add a new rule at the specified index or at the end if the index is invalid
-
updateRulePatternAt
public void updateRulePatternAt(int index, String pattern)update the rule pattern at the specified location
-
updateRuleExclusionAt
public void updateRuleExclusionAt(int index, boolean exclude)update the rule kind at the specified location
-
updateRuleKindAt
public void updateRuleKindAt(int index, String kind)update the rule kind at the specified location
-
deleteRuleAt
public void deleteRuleAt(int index)
delete the rule at the specified index
-
refreshApplications
public void refreshApplications()
refresh the list of applications
-
launchApplication
public void launchApplication(App application) throws Exception
launch the specified application using the first matching rule- Throws:
Exception
-
preConfigure
public void preConfigure()
preconfigure the model when initializing without a document file
-
dataLabel
public String dataLabel()
provides the name used to identify the class in an external data source.- Specified by:
dataLabelin interfacexal.tools.data.DataListener- Returns:
- The tag for this data node.
-
update
public void update(xal.tools.data.DataAdaptor adaptor)
Instructs the receiver to update its data based on the given adaptor.- Specified by:
updatein interfacexal.tools.data.DataListener- Parameters:
adaptor- The data adaptor corresponding to this object's data node.
-
write
public void write(xal.tools.data.DataAdaptor adaptor)
Instructs the receiver to write its data to the adaptor for external storage.- Specified by:
writein interfacexal.tools.data.DataListener- Parameters:
adaptor- The data adaptor corresponding to this object's data node.
-
addLaunchModelListener
public void addLaunchModelListener(LaunchModelListener listener)
Add a listener of LaunchModel events from this instance- Parameters:
listener- The listener to add
-
removeLaunchModelListener
public void removeLaunchModelListener(LaunchModelListener listener)
Remove a listener of LaunchModel events from this instance- Parameters:
listener- The listener to remove
-
getLauncher
public Launcher getLauncher()
Get the launcher- Returns:
- launcher
-
-