01: /*
02: * Copyright Javelin Software, All rights reserved.
03: */
04:
05: package com.javelin.swinglets;
06:
07: /**
08: * This class dictates the default policy for mapping browsers to
09: * look and feels.
10: * <p>
11: * The policy is to use WAPLookAndFeel if it is a WAP browser. <br>
12: * To use JSLookAndFeel if the jsVersion is > 0.<br>
13: * Otherwise to use the HTMLLookAndFeel
14: *
15: * @author Robin Sharp
16: */
17:
18: import java.util.*;
19: import java.text.*;
20: import javax.servlet.http.*;
21:
22: import com.javelin.swinglets.plaf.*;
23:
24: public class DefaultBrowserLookAndFeel implements BrowserLookAndFeel {
25: public SLookAndFeel getLookAndFeel(BrowserProfile browserProfile) {
26: if (browserProfile.isWAP) {
27: return SUIManager
28: .getLookAndFeel("com.javelin.swinglets.plaf.wml.WMLLookAndFeel");
29: } else if (browserProfile.jsVer > 0.0) {
30: return SUIManager
31: .getLookAndFeel("com.javelin.swinglets.plaf.javascript.JSLookAndFeel");
32: } else {
33: return SUIManager
34: .getLookAndFeel("com.javelin.swinglets.plaf.html.HTMLLookAndFeel");
35: }
36: }
37: }
|