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