1 /*****************************************************************************/
2 /* Software Testing Automation Framework (STAF)                              */
3 /* (C) Copyright IBM Corp. 2004, 2005                                        */
4 /*                                                                           */
5 /* This software is licensed under the Eclipse Public License (EPL) V1.0.    */
6 /*****************************************************************************/
7 
8 import com.installshield.wizard.*;
9 import com.installshield.wizard.service.*;
10 import com.installshield.util.*;
11 import com.installshield.product.service.product.*;
12 
13 public class STAFPlatform extends WizardAction
14 {
15     public boolean windows = false;
16     public boolean linux = false;
17     public boolean aix = false;
18     public boolean solaris = false;
19     public boolean unix = false;
20     public boolean hpux = false;
21     public String platformDetails = "";
22 
execute(WizardBeanEvent event)23     public void execute(WizardBeanEvent event)
24     {
25         platformDetails = Platform.currentPlatform.toString();
26 
27         if (platformDetails.indexOf("Windows") > -1)
28         {
29             windows = true;
30         }
31         else if (platformDetails.indexOf("Linux") > -1)
32         {
33             linux = true;
34             unix = true;
35         }
36         else if (platformDetails.indexOf("AIX") > -1)
37         {
38             aix = true;
39             unix = true;
40         }
41         else if (platformDetails.indexOf("SunOS") > -1)
42         {
43             solaris = true;
44             unix = true;
45         }
46         else if (platformDetails.indexOf("HP-UX") > -1)
47         {
48             hpux = true;
49             unix = true;
50         }
51         else
52         {
53             unix = true;
54         }
55     }
56 
getWindows()57     public boolean getWindows()
58     {
59         return windows;
60     }
61 
setWindows(boolean bool)62     public void setWindows(boolean bool)
63     {
64         windows = bool;
65     }
66 
getUnix()67     public boolean getUnix()
68     {
69         return unix;
70     }
71 
setUnix(boolean bool)72     public void setUnix(boolean bool)
73     {
74         unix = bool;
75     }
76 
getLinux()77     public boolean getLinux()
78     {
79         return linux;
80     }
81 
setLinux(boolean bool)82     public void setLinux(boolean bool)
83     {
84         linux = bool;
85     }
86 
getAix()87     public boolean getAix()
88     {
89         return aix;
90     }
91 
setAix(boolean bool)92     public void setAix(boolean bool)
93     {
94         aix = bool;
95     }
96 
getSolaris()97     public boolean getSolaris()
98     {
99         return solaris;
100     }
101 
setSolaris(boolean bool)102     public void setSolaris(boolean bool)
103     {
104         solaris = bool;
105     }
106 
getHpux()107     public boolean getHpux()
108     {
109         return hpux;
110     }
111 
setHpux(boolean bool)112     public void setHpux(boolean bool)
113     {
114         hpux = bool;
115     }
116 
getWinOrLinux()117     public boolean getWinOrLinux()
118     {
119         return windows || linux;
120     }
121 
getWinOrLinuxOrAix()122     public boolean getWinOrLinuxOrAix()
123     {
124         return windows || linux || aix;
125     }
126 
getPlatformDetails()127     public String getPlatformDetails()
128     {
129         return platformDetails;
130     }
131 
setPlatformDetails(String details)132     public void setPlatformDetails(String details)
133     {
134         platformDetails = details;
135     }
136 
137 }