|
From: Gerry D. <gd...@us...> - 2002-06-11 18:27:01
|
Update of /cvsroot/swapdv/swapdv/Scheduler/actions
In directory usw-pr-cvs1:/tmp/cvs-serv3068/Scheduler/actions
Modified Files:
actionUtils.java
Log Message:
Replaced deprecated calls, added Util.ReadLine and modified position and sizing for first time Frame displays
Index: actionUtils.java
===================================================================
RCS file: /cvsroot/swapdv/swapdv/Scheduler/actions/actionUtils.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- actionUtils.java 7 Jun 2002 15:39:29 -0000 1.7
+++ actionUtils.java 11 Jun 2002 18:26:58 -0000 1.8
@@ -102,6 +102,26 @@
return null;
}
+
+ public static schdEventActionI selectAction(JComponent theParent) {
+ String actionTypes[] = actionUtils.getKnownActionsTypes();
+ String selectedType;
+
+ // If there are no actions, skip it. If there is only
+ // one, silently pick it. if there is more than one,
+ // let the user choose one
+ if (actionTypes.length == 0) return null;
+ if (actionTypes.length > 1) {
+ selectedType = (String) JOptionPane.showInputDialog(theParent, "Choose which sort of action you wish to add", "Action selection", JOptionPane.QUESTION_MESSAGE, null, actionTypes, actionTypes[0]);
+ if (selectedType == null) return null;
+ } else {
+ selectedType = actionTypes[0];
+ }
+
+ // Allocate and return a class of that type
+ return actionUtils.getNewAction(selectedType);
+ }
+
public static void setLocalGuide(PublicPrivateGuide theGuide) {
localGuide = theGuide;
}
|