package com.onaro.sanscreen.client.prefs; import com.onaro.commons.prefs.PreferencesWrapper; import com.onaro.sanscreen.client.view.ViewDirector; /** * We are moving to a contribution based model. * * Declare the preferences nodes in the class you are using them. */ public final class ClientPrefs { private static final String CLIENT_NODE = "com/onaro/sanscreen/client"; //$NON-NLS-1$ private static final String VIEW_NODE = "com/onaro/sanscreen/client/view"; //$NON-NLS-1$ private static final String VIEW_ACTIONS_NODE = "/com/onaro/sanscreen/client/view/actions"; //$NON-NLS-1$ private static final String VIEW_ANALAYZE_NODE = "/com/onaro/sanscreen/client/view/actions/analyzeviolation"; //$NON-NLS-1$ private static final String VIEW_DATASOURCE_NODE = "/com/onaro/sanscreen/client/view/actions/datasource"; //$NON-NLS-1$ private static final String VIEW_CHANGES_NODE = "/com/onaro/sanscreen/client/view/changes"; //$NON-NLS-1$ private static final String VIEW_NOTIFICATION_NODE = "/com/onaro/sanscreen/client/view/notifications"; //$NON-NLS-1$ private static final String VIEW_REFRESH_NODE = "/com/onaro/sanscreen/client/view/refresh"; //$NON-NLS-1$ private static final String VIEW_TABULAR_NODE = "/com/onaro/sanscreen/client/view/tabular"; //$NON-NLS-1$ private static final String VIEW_TEMPLATE_ADDHOST_NODE = "/com/onaro/sanscreen/client/view/task/template/addhost"; //$NON-NLS-1$ private static final String VIEW_DASHBOARD_NODE = "/com/onaro/sanscreen/client/view/dashboard"; //$NON-NLS-1$ private static final String VIEW_MIGRATION_NODE = "/com/onaro/sanscreen/client/view/migration"; //$NON-NLS-1$ private static final String VIEW_HOST_VIRTUALIZATION_NODE = "/com/onaro/sanscreen/client/hostvirtualization"; //$NON-NLS-1$ private static final String SETTINGS_NODE = "com/onaro/sanscreen/client/settings"; //$NON-NLS-1$ public static PreferencesWrapper getClient() { return PreferencesWrapper.userRoot().node(CLIENT_NODE); } public static PreferencesWrapper getView() { return PreferencesWrapper.userRoot().node(VIEW_NODE); } public static PreferencesWrapper getViewActions() { return PreferencesWrapper.userRoot().node(VIEW_ACTIONS_NODE); } public static PreferencesWrapper getViewAnalayze() { return PreferencesWrapper.userRoot().node(VIEW_ANALAYZE_NODE); } public static PreferencesWrapper getViewDatasource() { return PreferencesWrapper.userRoot().node(VIEW_DATASOURCE_NODE); } public static PreferencesWrapper getViewChanges() { return PreferencesWrapper.userRoot().node(VIEW_CHANGES_NODE); } public static PreferencesWrapper getViewNotifications() { return PreferencesWrapper.userRoot().node(VIEW_NOTIFICATION_NODE); } public static PreferencesWrapper getViewRefresh() { return PreferencesWrapper.userRoot().node(VIEW_REFRESH_NODE); } public static PreferencesWrapper getViewTabular() { return PreferencesWrapper.userRoot().node(VIEW_TABULAR_NODE); } public static PreferencesWrapper getViewTemplateAddHost() { return PreferencesWrapper.userRoot().node(VIEW_TEMPLATE_ADDHOST_NODE); } public static PreferencesWrapper getViewDashboard() { return PreferencesWrapper.userRoot().node(VIEW_DASHBOARD_NODE); } public static PreferencesWrapper getViewMigration() { return PreferencesWrapper.userRoot().node(VIEW_MIGRATION_NODE); } public static PreferencesWrapper getHostVirtualization() { return PreferencesWrapper.userRoot().node(VIEW_HOST_VIRTUALIZATION_NODE); } public static PreferencesWrapper getSettings() { return PreferencesWrapper.userRoot().node(SETTINGS_NODE); } public static PreferencesWrapper getViewNode(ViewDirector view) { return PreferencesWrapper.userRoot().node(VIEW_NODE + "/" + view.getName().replace('.', '/')); //$NON-NLS-1$ } }