1 23 24 29 30 package com.sun.enterprise.tools.admingui; 31 32 import java.util.Hashtable ; 33 import java.util.ResourceBundle ; 34 import java.lang.reflect.Method ; 35 36 public class ConfigProperties extends Hashtable { 37 38 public static ConfigProperties getInstance() { 39 return _instance; 40 } 41 42 public void setViewXMLFileName(String viewXMLFile) { 43 put(VIEW_XML_FILE, viewXMLFile); 44 } 45 46 public void setTreeXMLFileName(String treeXMLFile, String treeType) { 47 put(TREE_XML_FILE+treeType, treeXMLFile); 48 } 49 50 public String getViewXMLFileName() { 51 return (String )(get(VIEW_XML_FILE)); 52 } 53 54 public String getTreeXMLFileName(String treeType) { 55 return (String )(get(TREE_XML_FILE+treeType)); 56 } 57 58 public void setDefaultDisplayURLDir(String defaultDisplayURLDir) { 59 put(DEFAULT_DISPLAY_URL_DIR, defaultDisplayURLDir); 60 } 61 62 public String getDefaultDisplayURLDir() { 63 return (String )(get(DEFAULT_DISPLAY_URL_DIR)); 64 } 65 66 public void setLoggerName(String loggerName) { 67 put(LOGGER_NAME, loggerName); 68 } 69 70 public String getLoggerName() { 71 return (String )(get(LOGGER_NAME)); 72 } 73 74 public void setInitialRightPage(String page) { 75 put(INITIAL_RIGHT_PAGE, page); 76 } 77 78 public String getInitialRightPage() { 79 return (String )(get(INITIAL_RIGHT_PAGE)); 80 } 81 82 public void setConsoleTitleKey(String consoleTitleKey) { 83 put(CONSOLE_TITLE_KEY, consoleTitleKey); 84 } 85 86 public String getConsoleTitleKey() { 87 return (String )(get(CONSOLE_TITLE_KEY)); 88 } 89 90 public String getConsoleTitle() { 91 ResourceBundle bundle = 92 ResourceBundle.getBundle("com.sun.enterprise.tools.admingui.resources.Resources"); 93 try { 94 return bundle.getString((String )get(CONSOLE_TITLE_KEY)); 95 } catch (Exception ex) { 96 return (String )get(CONSOLE_TITLE_KEY); 97 } 98 } 99 100 public void setTargetSupported(Boolean targetSupported) { 101 put(TARGET_SUPPORTED, targetSupported); 102 } 103 104 public Boolean getTargetSupported() { 105 return (Boolean )(get(TARGET_SUPPORTED)); 106 } 107 108 public String getDefaultTarget() { 109 return (String )(get(DEFAULT_TARGET)); 110 } 111 112 public void setDefaultTarget(String defaultTarget) { 113 put(DEFAULT_TARGET, defaultTarget); 114 } 115 116 static public boolean isHCIAdmin22() { 117 try { 118 Class clazz = Class.forName("com.sun.web.ui.common.CCSystem"); 119 Method method = clazz.getMethod("getServerInterface", (Class [])null); 120 if (method == null) 121 return false; 122 } catch (Exception e) { 123 return false; 124 } 125 return true; 126 } 127 128 private static ConfigProperties _instance = new ConfigProperties(); 129 130 private static final String VIEW_XML_FILE = "ViewXMLFile"; 131 private static final String TREE_XML_FILE = "TreeXMLFile"; 132 private static final String DEFAULT_DISPLAY_URL_DIR = "DefaultDisplayURLDir"; 133 private static final String LOGGER_NAME = "LoggerName"; 134 private static final String INITIAL_RIGHT_PAGE = "InitialRightPage"; 135 private static final String TARGET_SUPPORTED = "Target"; 136 private static final String CONSOLE_TITLE_KEY = "ConsoleTitleKey"; 137 private static final String DEFAULT_TARGET = "DefaultTarget"; 138 139 } 140 | Popular Tags |