1 11 package org.eclipse.help.internal.webapp.data; 12 13 import org.eclipse.core.runtime.*; 14 import org.eclipse.help.internal.base.*; 15 import org.eclipse.help.internal.util.ProductPreferences; 16 17 20 public class WebappPreferences { 21 Preferences prefs; 22 25 public WebappPreferences() { 26 prefs = HelpBasePlugin.getDefault().getPluginPreferences(); 27 } 28 31 public String getBanner() { 32 return prefs.getString("banner"); } 34 35 public String getBannerHeight() { 36 return prefs.getString("banner_height"); } 38 39 public String getHelpHome() { 40 return prefs.getString("help_home"); } 42 43 public boolean isIndexView() { 44 return ProductPreferences.getBoolean(HelpBasePlugin.getDefault(), "indexView"); } 46 47 public boolean isBookmarksView() { 48 return BaseHelpSystem.getMode() != BaseHelpSystem.MODE_INFOCENTER 49 && ProductPreferences.getBoolean(HelpBasePlugin.getDefault(), "bookmarksView"); } 51 52 public boolean isBookmarksAction() { 53 return ProductPreferences.getBoolean(HelpBasePlugin.getDefault(), "bookmarksView"); } 55 56 public boolean isLinksView() { 57 boolean winfopop = prefs.getBoolean(IHelpBaseConstants.P_KEY_WINDOW_INFOPOP); 59 boolean dinfopop = prefs.getBoolean(IHelpBaseConstants.P_KEY_DIALOG_INFOPOP); 60 return BaseHelpSystem.getMode() != BaseHelpSystem.MODE_INFOCENTER 61 && ProductPreferences.getBoolean(HelpBasePlugin.getDefault(), "linksView") && (winfopop || dinfopop); 63 } 64 65 public String getImagesDirectory() { 66 String imagesDirectory = prefs.getString("imagesDirectory"); if (imagesDirectory != null && imagesDirectory.startsWith("/")) imagesDirectory = UrlUtil.getHelpURL(imagesDirectory); 69 return imagesDirectory; 70 71 } 72 73 public String getToolbarBackground() { 74 return prefs.getString("advanced.toolbarBackground"); } 76 77 public String getBasicToolbarBackground() { 78 return prefs.getString("basic.toolbarBackground"); } 80 81 public String getToolbarFont() { 82 return prefs.getString("advanced.toolbarFont"); } 84 85 public String getViewBackground() { 86 return prefs.getString("advanced.viewBackground"); } 88 89 public String getBasicViewBackground() { 90 return prefs.getString("basic.viewBackground"); } 92 93 public String getViewFont() { 94 return prefs.getString("advanced.viewFont"); } 96 97 public int getBookAtOnceLimit() { 98 return prefs.getInt("loadBookAtOnceLimit"); } 100 101 public int getLoadDepth() { 102 int value = prefs.getInt("dynamicLoadDepthsHint"); if (value < 1) { 104 return 1; 105 } 106 return value; 107 } 108 public boolean isWindowTitlePrefix() { 109 return ProductPreferences.getBoolean(HelpBasePlugin.getDefault(), "windowTitlePrefix"); } 111 public boolean isDontConfirmShowAll() { 112 return prefs.getBoolean("dontConfirmShowAll"); } 114 public void setDontConfirmShowAll(boolean dontconfirm) { 115 prefs.setValue("dontConfirmShowAll", dontconfirm); } 117 public boolean isActiveHelp() { 118 return ProductPreferences.getBoolean(HelpBasePlugin.getDefault(), "activeHelp"); } 120 121 public boolean isIndexInstruction() { 122 return ProductPreferences.getBoolean(HelpBasePlugin.getDefault(), "indexInstruction"); } 124 125 public boolean isIndexButton() { 126 return ProductPreferences.getBoolean(HelpBasePlugin.getDefault(), "indexButton"); } 128 129 public boolean isIndexPlusMinus() { 130 return ProductPreferences.getBoolean(HelpBasePlugin.getDefault(), "indexPlusMinus"); } 132 133 public boolean isIndexExpandAll() { 134 return ProductPreferences.getBoolean(HelpBasePlugin.getDefault(), "indexExpandAll"); } 136 public boolean isHighlightDefault() { 137 return prefs.getBoolean("default_highlight"); } 139 public void setHighlightDefault(boolean highlight) { 140 prefs.setValue("default_highlight", highlight); } 142 143 public boolean useNewTocView() { 144 return prefs.getBoolean("newTocView"); } 146 } 147 | Popular Tags |