if (os.equals(Constants.OS_WIN32)) ws = Constants.WS_WIN32; else if (os.equals(Constants.OS_LINUX)) ws = Constants.WS_MOTIF; else if (os.equals(Constants.OS_MACOSX)) ws = Constants.WS_CARBON; else if (os.equals(Constants.OS_HPUX)) ws = Constants.WS_MOTIF; else if (os.equals(Constants.OS_AIX)) ws = Constants.WS_MOTIF; else if (os.equals(Constants.OS_SOLARIS)) ws = Constants.WS_MOTIF; else ws = Constants.WS_UNKNOWN;
ws = guessWS(os); System.getProperties().put("osgi.ws", ws);
	private void setupSystemContext() {		// if the user didn't set the locale with a command line argument then		// use the default.		nl = System.getProperty("osgi.nl"); //$NON-NLS-1$		if (nl != null) {			StringTokenizer tokenizer = new StringTokenizer(nl, "_"); //$NON-NLS-1$			int segments = tokenizer.countTokens();			try {				Locale userLocale = null;				switch (segments) {					case 1:						// use the 2 arg constructor to maintain compatibility with 1.3.1						userLocale = new Locale(tokenizer.nextToken(), ""); //$NON-NLS-1$						break;					case 2:						userLocale = new Locale(tokenizer.nextToken(), tokenizer.nextToken());						break;					case 3:						userLocale = new Locale(tokenizer.nextToken(), tokenizer.nextToken(), tokenizer.nextToken());						break;					default:						// if the user passed us in a bogus value then log a message and use the default						System.err.println(EclipseAdaptorMsg.formatter.getString("error.badNL", nl)); //$NON-NLS-1$						userLocale = Locale.getDefault();						break;				}				Locale.setDefault(userLocale);			} catch (NoSuchElementException e) {				// fall through and use the default			}		}		nl = Locale.getDefault().toString();		System.getProperties().put("osgi.nl", nl); //$NON-NLS-1$		// if the user didn't set the operating system with a command line 		// argument then use the default.		os = System.getProperty("osgi.os"); //$NON-NLS-1$		if (os == null) {			String name = System.getProperty("os.name");//$NON-NLS-1$			// check to see if the VM returned "Windows 98" or some other			// flavour which should be converted to win32.			if (name.regionMatches(true, 0, Constants.OS_WIN32, 0, 3))				os = Constants.OS_WIN32;			// EXCEPTION: All mappings of SunOS convert to Solaris			if (os == null)				os = name.equalsIgnoreCase(INTERNAL_OS_SUNOS) ? Constants.OS_SOLARIS : Constants.OS_UNKNOWN;		}		System.getProperties().put("osgi.os", os); //$NON-NLS-1$		// if the user didn't set the window system with a command line 		// argument then use the default.		ws = System.getProperty("osgi.ws"); //$NON-NLS-1$		if (ws == null) {			// setup default values for known OSes if nothing was specified			if (os.equals(Constants.OS_WIN32))				ws = Constants.WS_WIN32;			else if (os.equals(Constants.OS_LINUX))				ws = Constants.WS_MOTIF;			else if (os.equals(Constants.OS_MACOSX))				ws = Constants.WS_CARBON;			else if (os.equals(Constants.OS_HPUX))				ws = Constants.WS_MOTIF;			else if (os.equals(Constants.OS_AIX))				ws = Constants.WS_MOTIF;			else if (os.equals(Constants.OS_SOLARIS))				ws = Constants.WS_MOTIF;			else				ws = Constants.WS_UNKNOWN;		}		System.getProperties().put("osgi.ws", ws); //$NON-NLS-1$		// if the user didn't set the system architecture with a command line 		// argument then use the default.		arch = System.getProperty("osgi.arch"); //$NON-NLS-1$		if (arch == null) {			String name = System.getProperty("os.arch");//$NON-NLS-1$			// Map i386 architecture to x86			arch = name.equalsIgnoreCase(INTERNAL_ARCH_I386) ? Constants.ARCH_X86 : name;		}		System.getProperties().put("osgi.arch", arch); //$NON-NLS-1$	}