]> git.ipfire.org Git - thirdparty/cups.git/blame - scripting/java/example/GLPvars.java
Add missing files for test.
[thirdparty/cups.git] / scripting / java / example / GLPvars.java
CommitLineData
ef416fc2 1
2import java.util.*;
3import javax.swing.*;
4import com.easysw.cups.*;
5
6public class GLPvars
7{
8 // Current selected server name or address.
9 public static String cupsServerName = null;
10
11 // Current selected printer name.
12 public static String selectedPrinterName = null;
13
14 // Current user name and password.
15 public static String cupsUser = "root";
16 public static String cupsPasswd = "Frak998";
17
18 // So we can access the tabs from other classes.
19 public static JTabbedPane mainGLPPanel = null;
20 public static GLPtabs tabs = null;
21
22 // List of servers found using search.
23 protected static List serverList = null;
24
25 // So we can update the search results from the search classes.
26 public static GLPjobTableModel searchTM = null;
27 public static JTable searchTable = null;
28
29 // What kind of jobs to list.
30 public static boolean showMyJobs = false;
31 public static boolean showCompletedJobs = false;
32
33 // Constructor
34 public GLPvars()
35 {
36 cupsServerName = "localhost";
37 serverList = new ArrayList();
38 }
39
40 public static void init()
41 {
42 cupsServerName = "localhost";
43 serverList = new ArrayList();
44 }
45
46
47 public static String getServerName()
48 {
49 return(cupsServerName);
50 }
51
52 public static void setServerName( String name )
53 {
54 cupsServerName = name;
55 }
56
57
58 //
59 // Reset the server list.
60 //
61 public static void clearServerList()
62 {
63 serverList = null;
64 }
65
66
67 //
68 // Add a cups server to the server list.
69 //
70 public static void addToServerList( String serverName )
71 {
72 if (serverList != null)
73 serverList.add(serverName);
74 }
75
76 //
77 // Get the full server list (if any).
78 //
79 public static String[] getServerList()
80 {
81 if (serverList != null)
82 {
83 String[] servers = new String[serverList.size()];
84 for (int i=0; i < serverList.size(); i++)
85 servers[i] = (String)serverList.get(i);
86 return(servers);
87 }
88 return(null);
89 }
90
91
92
93}