DisplayTextLibrary.java :  » Source-Control » sourcejammer » org » sourcejammer » client » Java Open Source

Java Open Source » Source Control » sourcejammer 
sourcejammer » org » sourcejammer » client » DisplayTextLibrary.java
/*
 *  Copyright (C) 2001, 2002 Robert MacGrogan
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public
 *  License as published by the Free Software Foundation; either
 *  version 2.1 of the License, or (at your option) any later version.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 *  Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public
 *  License along with this library; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 *
 *
 * $Archive: SourceJammer$
 * $FileName: DisplayTextLibrary.java$
 * $FileID: 4200$
 *
 * Last change:
 * $AuthorName: Timo Haberkern$
 * $Date: 9/11/03 5:36 AM$
 * $Comment: $
 */

package org.sourcejammer.client;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Hashtable;
import java.util.Properties;
import java.util.StringTokenizer;

import org.sourcejammer.util.AppConfig;
import org.w3c.dom.Document;
import org.w3c.dom.Element;

/**
 * Title:   $FileName: DisplayTextLibrary.java$
 * @version $VerNum: 23$
 * @author $AuthorName: Timo Haberkern$<br><br>
 * 
 * $Description: $<br>
 * $KeyWordsOff: $
 */
public class DisplayTextLibrary {

  private Hashtable mhshArrays = new Hashtable();

  private static final String ARRAY_PARSE_CHAR = "|";

  private static final String ROOT_NODE = "TextLookup";

  public static final String MENU_CONNECTION = "menu_connection";
  public static final String MENU_PROJECT = "menu_project";
  public static final String MENU_FILE = "menu_file";
  public static final String MENU_VIEW = "menu_view";
  public static final String MENU_TOOLS = "menu_tools";
  public static final String MENU_CONTROLLER = "menu_controller";
  public static final String MENU_ADMIN = "menu_admin";
  public static final String MENU_HELP = "menu_help";
  public static final String MENU_ARCHIVE = "menu_archive";
  public static final String MENU_PLUGIN = "menu_plugin";

  public static final String ACT_EXIT = "act_exit";
  public static final String ACT_CONNECT = "act_connect";
  public static final String ACT_DISCONNECT = "act_disconnect";
  public static final String ACT_MAINTAIN_CONNECTIONS = "act_maint_connections";
  public static final String ACT_ADD_FILE = "act_add_file";
  public static final String ACT_MAKE_PROJ = "act_mk_proj";
  public static final String ACT_REFRESH_PROJ = "act_refresh_proj";
  public static final String ACT_GET_PROJ = "act_get_proj";
  public static final String ACT_SET_DEF_DIR = "act_set_def_dir";
  public static final String ACT_RENAME_PROJ = "act_rename_proj";
  public static final String ACT_VIEW_REMOVED = "act_view_removed";
  public static final String ACT_REMOVE_PROJ = "act_remove_proj";
  public static final String ACT_RESTORE = "act_restore";
  public static final String ACT_MOVE_COPY_PROJECT = "act_move_copy_project";

  public static final String ACT_FILE_DETAILS = "act_file_details";
  public static final String ACT_GET_FILES = "act_get_files";
  public static final String ACT_CHECK_OUT = "act_checkout";
  public static final String ACT_CHECK_IN = "act_checkin";
  public static final String ACT_RENAME_FILE = "act_rename_file";
  public static final String ACT_REMOVE_FILE = "act_remove_file";
  public static final String ACT_UNDO_CHECKOUT = "act_undo_checkout";
  public static final String ACT_MOVE_COPY_FILE = "act_move_copy_file";
  public static final String ACT_FORCE_CHECK_IN = "act_force_checkin";

  public static final String ACT_CLEAR_MESSAGES = "act_clear_messages";
  public static final String ACT_WINDOWS_LAF = "act_win_laf";
  public static final String ACT_MOTIF_LAF = "act_motif_laf";
  public static final String ACT_METAL_LAF = "act_metal_laf";
  public static final String ACT_PLASTIC_LAF = "act_plastic_laf";
  public static final String ACT_METOUIA_LAF = "act_metouia_laf";
  public static final String ACT_KUNSTOFF_LAF = "act_kunstoff_laf";

  public static final String ACT_VIEW_LABELED_VER = "act_view_lbl_ver";
  public static final String ACT_GET_LABELED_VER = "act_get_lbl_ver";
  public static final String ACT_CHANGE_PASSWORD = "act_change_pwd";

  public static final String ACT_DELETE_REMOVED = "act_delete_removed";
  public static final String ACT_MAKE_LABELED_VER = "act_make_lbl_ver";
  public static final String ACT_MAINT_ARCH_USERS = "act_maint_arch_users";
  public static final String ACT_REBUILD_LABELED_VER = "act_rebuild_lbl_ver";

  public static final String ACT_MAINT_USERS = "act_maint_users";
  public static final String ACT_MAKE_ARCHIVE = "act_make_archive";
  public static final String ACT_LIST_ARCH = "act_list_arch";
  public static final String ACT_DELETE_ARCH = "act_delete_arch";

  public static final String ACT_ABOUT = "act_about";

  public static final String ACT_VDIFF = "act_vdiff";
  public static final String ACT_VIEW_FILE = "act_view_file";
  public static final String ACT_CHECK_OUT_RPT = "act_check_out_rpt";

  public static final String ACT_USER_GUIDE = "act_user_guide";
  public static final String ACT_SHOW_ARCHIVE_PROPERTIES = "act_arch_props";

  public static final String act_PROXY_SETTINGS = "act_proxy_settings";
  public static final String act_SET_FILE_DESCRIPTION = "act_set_file_description";
  public static final String act_LOCAL_REMOTE_SYNC_VIEW = "act_local_remote_sync_view";
  public static final String act_DELETE_LOCAL_FILE = "act_delete_local_file";

  public static final String ACT_SHARE_FILE = "act_share_file";
  public static final String ACT_SHARE_PROJECT = "act_share_project";
  public static final String ACT_BRANCH_FILE = "act_branch_file";
  public static final String ACT_BRANCH_PROJECT = "act_branch_project";
  public static final String ACT_REMOVE_FILE_SHARE = "act_remove_file_share";
  public static final String ACT_REMOVE_PROJECT_SHARE = "act_remove_project_share";
  public static final String ACT_SHOW_PREFERENCES = "act_show_preferences";
  

  //Table column lables
  public static final String COL_NAME = "col_name";
  public static final String COL_DATE = "col_date";
  public static final String COL_VER = "col_ver";
  public static final String COL_CK_OUT_TO = "col_ck_out_to";
  public static final String COL_CK_OUT_DATE = "col_ck_out_date";
  public static final String COL_PATH = "col_path";
  public static final String COL_VER_NUMBER = "col_ver_number";
  public static final String COL_USER = "col_user";

  //Dialog messages
  public static final String MSG_DISCONNECT = "msg_disconnect";
  public static final String MSG_CONNECTIONS_DLG_HELP = "msg_connections_dlg_help";
  public static final String MSG_UPDATE_CN_DLG_HELP = "msg_update_cn_dlg_help";
  public static final String MSG_GET_PROJ_NO_DIR_1 = "msg_get_proj_no_dir_1";
  public static final String MSG_GET_PROJ_NO_DIR_2 = "msg_get_proj_no_dir_2";
  public static final String MSG_GET_PROJ_NO_DIR_3 = "msg_get_proj_no_dir_3";
  public static final String MSG_REMOVE_PROJ = "msg_remove_proj";
  public static final String MSG_REMOVE_FILE = "msg_remove_file";
  public static final String MSG_DELETE_ARCH = "msg_delete_arch";
  public static final String MSG_ARCHIVE_DELETED = "msg_archive_deleted";
  public static final String MSG_ARCH_NOT_DELETED = "msg_arch_not_deleted";
  public static final String MSG_CONFIRM_ROLLBACK1 = "msg_confirm_rollback1";
  public static final String MSG_CONFIRM_ROLLBACK2 = "msg_confirm_rollback2";
  public static final String MSG_CONFIRM_ROLLBACK3 = "msg_confirm_rollback3";
  public static final String MSG_CONFIRM_ROLLBACK4 = "msg_confirm_rollback4";
  public static final String MSG_ROLLBACK_CANCELED = "msg_rollback_canceled";
  public static final String MSG_CREATE_DIR1 = "msg_create_dir1";
  public static final String MSG_CREATE_DIR2 = "msg_create_dir2";
  public static final String MSG_TEXT_ADDED = "msg_text_added";
  public static final String MSG_TEXT_CHANGED = "msg_text_changed";
  public static final String MSG_TEXT_REMOVED = "msg_text_removed";
  public static final String MSG_NO_MORE_DIFF = "msg_no_more_diff";
  public static final String MSG_NO_PREV_DIFF = "msg_no_prev_diff";
  public static final String MSG_ADD_COMPLETE = "msg_add_complete";
  public static final String MSG_GET_PROJ_COMPLETE = "msg_get_proj_complete";
  public static final String MSG_GET_LBL_COMPLETE = "msg_get_lbl_complete";
  public static final String MSG_TOO_BIG_1 = "msg_too_big_1";
  public static final String MSG_TOO_BIG_2 = "msg_too_big_2";
  public static final String MSG_NONE_CHECKED_OUT = "msg_none_checked_out";
  public static final String MSG_FILE_CHANGED = "msg_file_changed";
  public static final String MSG_OVERWRITE_FILE = "msg_overwrite_file";
  public static final String MSG_CONFIRM_DELETE_LOCAL_FILE = "msg_confirm_delete_local_file";
  public static final String MSG_DIFFERENT_CHECK_OUT_DIR ="msg_different_check_out_dir";
  public static final String MSG_CONFIRM_REMOVE_FILE_SHARE = "msg_confirm_remove_file_share";
  public static final String MSG_CONFIRM_REMOVE_PROJECT_SHARE = "msg_confirm_remove_project_share";
  public static final String MSG_REMOVE_SHARED_FILE = "msg_remove_shared_file";
  public static final String MSG_REMOVE_PROJECT_WITH_SHARED_FILE = "msg_remove_project_with_shared_file";
  public static final String MSG_SURE = "msg_sure";
  public static final String MSG_DELETE_NODE_WITH_SHARED_FILE = "msg_delete_node_with_shared_file";
  

  //Labels
  public static final String LBL_STORE_USER_PASSWORD="lbl_store_user_password";
  public static final String LBL_PASSWORD = "lbl_password";
  public static final String LBL_MESSAGE = "lbl_message";
  public static final String LBL_CONFIRM_DISCONNECT = "lbl_confirm_disconnect";
  public static final String LBL_CONNECTIONS = "lbl_connections";
  public static final String LBL_ABOUT_CONNECTIONS = "lbl_about_connections";
  public static final String LBL_CONNECTION_UPDATE = "lbl_connection_update";
  public static final String LBL_CONNECTION_ALIAS = "lbl_cn_alias";
  public static final String LBL_SJ_URL = "lbl_sj_url";
  public static final String LBL_ARCHIVE_NAME = "lbl_archive_name";
  public static final String LBL_ABOUT_CN_INFO = "lbl_about_cn_info";
  public static final String LBL_USER = "lbl_user";
  public static final String LBL_CONNECT_TO_ARCH = "lbl_connect_to_arch";
  public static final String LBL_ADD_FILES = "lbl_add_files";
  public static final String LBL_HIST_TYPE = "lbl_hist_type";
  public static final String LBL_FILE_DESC = "lbl_file_desc";
  public static final String LBL_ADD_FILES_TO = "lbl_add_files_to";
  public static final String LBL_DEFAULT_DIR = "lbl_default_dir";
  public static final String LBL_PROJECT = "lbl_project";
  public static final String LBL_ENTER_PROJ_NAME = "lbl_enter_proj_name";
  public static final String LBL_GET_PROJECT = "lbl_get_project";
  public static final String LBL_CREATE_DIR = "lbl_create_dir";
  public static final String LBL_MULTIPLE = "lbl_multiple";
  public static final String LBL_TO_LOC = "lbl_to_loc";
  public static final String LBL_EOL_TYPE = "lbl_eol_type";
  public static final String LBL_GET = "lbl_get";
  public static final String LBL_GET_FILES = "lbl_get_files";
  public static final String LBL_SELECT_DIR = "lbl_select_dir";
  public static final String LBL_SELECT_FILE = "lbl_select_file";
  public static final String LBL_SEL_DEFAULT_DIR = "lbl_sel_default_dir";
  public static final String LBL_NEW_NAME = "lbl_new_name";
  public static final String LBL_RENAME_PROJ = "lbl_rename_proj";
  public static final String LBL_RENAME_FILE = "lbl_rename_file";
  public static final String LBL_REMOVED = "lbl_removed";
  public static final String LBL_ABOUT_REMOVED = "lbl_about_removed";
  public static final String LBL_REMOVE_PROJ = "lbl_remove_proj";
  public static final String LBL_FILE_DETAILS = "lbl_file_details";
  public static final String LBL_FILE_INFO = "lbl_file_info";
  public static final String LBL_HISTORY = "lbl_history";
  public static final String LBL_TREE = "lbl_tree";
  public static final String LBL_NAME = "lbl_name";
  public static final String LBL_FILE_SIZE = "lbl_file_size";
  public static final String LBL_FILE_TYPE = "lbl_file_type";
  public static final String LBL_CREATED_DATE = "lbl_created_date";
  public static final String LBL_CHECK_IN_FILES = "lbl_check_in_files";
  public static final String LBL_ENTER_COMMENT = "lbl_enter_comment";
  public static final String LBL_CHECKING_IN = "lbl_checking_in";
  public static final String LBL_REMOVE_FILES = "lbl_remove_files";
  public static final String LBL_UNDO_CHECKOUT = "lbl_undo_checkout";
  public static final String LBL_ABOUT_UNDO_CHECKOUT = "lbl_about_undo_checkout";
  public static final String LBL_LABELED_VERSIONS = "lbl_labeled_versions";
  public static final String LBL_ABOUT_LABELED_VERSIONS = "lbl_about_labeled_versions";
  public static final String LBL_LABEL_INFO = "lbl_label_info";
  public static final String LBL_DESCRIPTION = "lbl_description";
  public static final String LBL_ROOT_PROJ = "lbl_root_proj";
  public static final String LBL_PWD_TWICE = "lbl_pwd_twice";
  public static final String LBL_MAKE_LABEL = "lbl_make_label";
  public static final String LBL_MAINT_ARCH_USERS = "lbl_maint_arch_users";
  public static final String LBL_ARCH_USERS = "lbl_arch_users";
  public static final String LBL_CONTROLLERS = "lbl_controllers";
  public static final String LBL_ABOUT_CONTROLLERS = "lbl_about_controllers";
  public static final String LBL_ALL_USERS = "lbl_all_users";
  public static final String LBL_FULL_NAME = "lbl_full_name";
  public static final String LBL_USER_MGMT = "lbl_user_mgmt";
  public static final String LBL_ARCH_CONTROLLERS = "lbl_arch_controllers";
  public static final String LBL_ARCH_NAME = "lbl_arch_name";
  public static final String LBL_MAKE_ARCHIVE = "lbl_make_archve";
  public static final String LBL_SERVER_URL = "lbl_server_url";
  public static final String LBL_ARCHIVES_ON_SVR = "lbl_archives_on_svr";
  public static final String LBL_ABOUT_ARCHIVES_ON = "lbl_about_archives_on";
  public static final String LBL_DELETE_ARCH = "lbl_delete_arch";
  public static final String LBL_CONF = "lbl_conf";
  public static final String LBL_ROLLBACK = "lbl_rollback";
  public static final String LBL_VERSION = "lbl_version";
  public static final String LBL_PREV_DIFF = "lbl_prev_diff";
  public static final String LBL_NEXT_DIFF = "lbl_next_diff";
  public static final String LBL_TOP = "lbl_top";
  public static final String LBL_CONNECTED_TO = "lbl_connected_to";
  public static final String LBL_DISCONNECTED = "lbl_disconnected";
  public static final String LBL_SAVED_FILE = "lbl_saved_file";
  public static final String LBL_FILE_NOT_SAVED = "lbl_file_not_saved";
  public static final String LBL_LOCAL_IS_CURRENT = "lbl_local_is_current";
  public static final String LBL_MAKING_DIR = "lbl_making_dir";
  public static final String LBL_DIR_NOT_EXIST = "lbl_dir_not_exist";
  public static final String LBL_SKIPPING_PROJ = "lbl_skipping_proj";
  public static final String LBL_ERROR = "lbl_error";
  public static final String LBL_ABOUT_VDIFF = "lbl_vdiff";
  public static final String LBL_WARNING = "lbl_warn";
  public static final String LBL_SKIP = "lbl_skip";
  public static final String LBL_COPY_MOVE_FILES = "lbl_copy_move_files";
  public static final String LBL_COPY_MOVE = "lbl_copy_move";
  public static final String LBL_FORCE_CHECKIN = "lbl_force_checkin";
  public static final String LBL_ID = "lbl_id";
  public static final String LBL_REBUILD_LABEL = "lbl_rebuild_lbl";
  public static final String LBL_CHECK_OUT_RPT = "lbl_check_out_rpt";
  public static final String LBL_CHECK_OUT_RPT_TITLE = "lbl_check_out_rpt_title";
  public static final String LBL_SOURCEJAMMER_HELP = "lbl_sj_help";
  public static final String LBL_ARCHIVE_PROPS = "lbl_arch_props";
  public static final String LBL_ARCHIVE_ROOT_PATH = "lbl_arch_root_path";
  public static final String LBL_KEYWORD_EXT = "lbl_keyword_ext";
  public static final String LBL_FILE_NOT_CHANGED = "lbl_file_not_changed";
  public static final String LBL_HOW_PROCEDE = "lbl_how_procede";
  public static final String LBL_AFTER_ADD = "lbl_after_add";
  public static final String LBL_AFTER_CHECK_IN = "lbl_after_checkin";
  public static final String LBL_AFTER_GET = "lbl_after_get";
  public static final String LBL_FILE_TYPE_OPTIONS = "lbl_file_type_options";
  public static final String LBL_GET_LABEL = "lbl_get_label";
  
  public static final String LBL_ENABLE_PROXY = "lbl_enable_proxy";
  public static final String LBL_PROXY_HOST = "lbl_proxy_host";
  public static final String LBL_PROXY_PORT = "lbl_proxy_port";
  public static final String LBL_PROXY_SETTINGS = "lbl_proxy_settings";
  public static final String LBL_PROXY_USER = "lbl_proxy_user";
  public static final String LBL_PROXY_PASSWORD_REQUIRED = "lbl_proxy_pwd_required";
  public static final String LBL_PROXY_PASSWORD = "lbl_proxy_password";
  public static final String LBL_SET_FILE_DESCRIPTION = "lbl_set_file_description";
  public static final String LBL_OVERWRITE_FILE = "lbl_overwrite_file";
  public static final String LBL_SAVE_CHANGELIST = "lbl_save_changelist";
  public static final String LBL_CHECKED_OUT_TO = "lbl_checked_out_to";
  public static final String LBL_CHECKING_IN_FROM = "lbl_checking_in_from";
  public static final String LBL_FILE_NAME = "lbl_file_name";
  public static final String LBL_REMOVE_FILE_SHARES = "lbl_remove_file_shares";
  public static final String LBL_REMOVE_PROJECT_SHARES = "lbl_remove_project_shares";
  public static final String LBL_CONFIRM_DELETE = "lbl_confirm_delete";
  public static final String LBL_BRANCH_ID = "lbl_branch_id";

  public static final String LBL_COLORS = "lbl_colors";
  public static final String LBL_DIFF_VIEW = "lbl_diff_view";
  public static final String LBL_DELETED_COLOR = "lbl_deleted_color";
  public static final String LBL_ADDED_COLOR = "lbl_added_color";
  public static final String LBL_MODIFIED_COLOR = "lbl_modified_color";
  public static final String LBL_NOT_IN_ARCH_COLOR = "lbl_not_in_arch_color";
  public static final String LBL_NOT_IN_LOCAL_COLOR = "lbl_not_in_local_color";
  public static final String LBL_NOT_IN_SYNC_COLOR = "lbl_not_in_sync_color";
  public static final String LBL_DEFAULT_LOCAL_FILE_ACTIONS = "lbl_default_local_file_actions";
  public static final String LBL_FILE_ACTIONS = "lbl_file_actions";
  public static final String LBL_ON_CHECKIN = "lbl_on_checkin";
  public static final String LBL_ON_GET = "lbl_on_get";
  public static final String LBL_ON_ADD = "lbl_on_add";
  public static final String LBL_MODIFIED_ON_CHECKIN = "lbl_modified_on_checkin";
  public static final String LBL_LANGUAGE_FILE = "lbl_language_file";
  public static final String LBL_TEXT_VIEW_FONT = "lbl_text_view_font";
  public static final String LBL_FILE_DIALOG_TYPE = "lbl_file_dialog_type";
  public static final String LBL_LOOK_AND_FEEL = "lbl_look_and_feel";
  public static final String LBL_TEXT_VIEW_TAB = "lbl_text_view_tab";
  public static final String LBL_MAKE_WRITABLE = "lbl_make_writable";
  public static final String LBL_HIDE_CMD = "lbl_hide_cmd";
  public static final String LBL_UNHIDE_CMD = "lbl_unhide_cmd";
  public static final String LBL_MAX_CHUNK_SIZE = "lbl_max_chunk_size";
  public static final String LBL_MIN_ZIP_SIZE = "lbl_min_zip_size";
  public static final String LBL_DEFAULT_EOL = "lbl_default_eol";
  public static final String LBL_ADVANCED_WARNING = "lbl_advanced_warning";
  public static final String LBL_PREFERENCES = "lbl_preferences";
  public static final String LBL_ADVANCED = "lbl_advanced";
  public static final String LBL_KEYSTORE_FILE = "lbl_keystore_file";
  public static final String LBL_FILE_TYPES = "lbl_file_types";
  public static final String LBL_IGNORE_LIST = "lbl_ignore_list";
  public static final String LBL_DEFAULT = "lbl_default";
  public static final String LBL_BUILD_CHANGELIST = "lbl_bld_changelist";
  public static final String LBL_NEW_USER = "lbl_new_user";

  //Button Labels
  public static final String BTN_OK = "btn_ok";
  public static final String BTN_CANCEL = "btn_cancel";
  public static final String BTN_CONNECT = "btn_connect";
  public static final String BTN_EDIT = "btn_edit";
  public static final String BTN_NEW = "btn_new";
  public static final String BTN_DELETE = "btn_delete";
  public static final String BTN_HELP = "btn_help";
  public static final String BTN_ADD = "btn_add";
  public static final String BTN_PROJECT_ADD = "btn_add_project";
  public static final String BTN_BROWSE = "btn_browse";
  public static final String BTN_SELECT = "btn_select";
  public static final String BTN_RENAME = "btn_rename";
  public static final String BTN_RESTORE = "btn_restore";
  public static final String BTN_DONE = "btn_done";
  public static final String BTN_GET_VER = "btn_get_ver";
  public static final String BTN_DIFF = "btn_diff";
  public static final String BTN_ROLLBACK = "btn_rollback";
  public static final String BTN_VIEW_COMMENT = "btn_view_comment";
  public static final String BTN_GET = "btn_get";
  public static final String BTN_CHECK_OUT = "btn_checkout";
  public static final String BTN_UNDO = "btn_undo";
  public static final String BTN_UNDO_ALL = "btn_undo_all";
  public static final String BTN_VIEW = "btn_view";
  public static final String BTN_MAKE = "btn_make";
  public static final String BTN_TOGGLE_ADMIN = "btn_toggle_admin";
  public static final String BTN_CHANGE_PWD = "btn_change_pwd";
  public static final String BTN_SKIP = "btn_skip";
  public static final String BTN_SKIP_ALL = "btn_skip_all";
  public static final String BTN_DONT_SKIP = "btn_dont_skip";
  public static final String BTN_SKIP_NONE = "btn_skip_none";
  public static final String BTN_TOP = "btn_top";
  public static final String BTN_GET_LABEL = "btn_get_label";
  public static final String BTN_CHECK_IN = "btn_check_in";
  public static final String BTN_CHECK_IN_ALL = "btn_check_in_all";
  public static final String BTN_ADVANCED = "btn_advanced";
  public static final String BTN_FORCE_CHECK_IN = "btn_force_check_in";
  public static final String BTN_YES = "btn_yes";
  public static final String BTN_NO = "btn_no";
  public static final String BTN_YES_ALL = "btn_yes_all";
  public static final String BTN_NO_ALL = "btn_no_all";
  public static final String BTN_CHANGE_LIST = "btn_change_list";
  public static final String BTN_REMOVE_FROM_THIS_PROJECT = "btn_remove_from_this_project";
  public static final String BTN_REMOVE_FROM_ALL_PROJECTS = "btn_remove_from_all_projects";
  public static final String BTN_DONT_DELETE = "btn_dont_delete";
  public static final String BTN_DELETE_FROM_THIS_PROJECT = "btn_delete_from_this_project";
  public static final String BTN_DELETE_ALL_SHARES = "btn_delete_all_shares";


  //Options
  public static final String OPT_DIFF = "opt_diff";
  public static final String OPT_ZIP = "opt_zip";
  public static final String OPT_FULL = "opt_full";
  public static final String OPT_CURR = "opt_curr";
  public static final String OPT_ADD_RECURSIVE = "opt_add_recursive";
  public static final String OPT_STORE_AS_TEXT = "opt_store_text";
  public static final String OPT_STORE_AS_BIN = "opt_store_bin";
  public static final String OPT_BUILD_SUB = "opt_build_sub";
  public static final String OPT_WIN_EOL = "opt_win_eol";
  public static final String OPT_UNIX_EOL = "opt_unix_eol";
  public static final String OPT_MAC_EOL = "opt_mac_eol";
  public static final String OPT_RECURSIVE = "opt_recursive";
  public static final String OPT_SHOW_HIDDEN = "opt_show_hidden";
  public static final String OPT_BINARY = "opt_binary";
  public static final String OPT_TEXT = "opt_text";
  public static final String OPT_CONFIRM_TEXT = "opt_confirm_text";
  public static final String OPT_OVERRIDE_HIST_TYPES = "opt_override_hist_types";
  public static final String OPT_MOVE = "opt_move";
  public static final String OPT_COPY = "opt_copy";
  public static final String OPT_LABEL = "opt_label";
  public static final String OPT_ARCH_RESTRICTED = "opt_arch_restricted";
  public static final String OPT_KEYWORDS_ENABLED = "opt_keywords_enabled";
  public static final String OPT_SET_LOCAL_COPY_READ_ONLY = "opt_set_local_copy_read_only";
  public static final String OPT_LOCAL_COPY_REMOVE = "opt_local_copy_remove";
  public static final String OPT_NO_ACTION = "opt_no_action";
  public static final String OPT_DOWNLOAD_LATEST = "opt_download_latest";
  public static final String OPT_SURE_ALL = "opt_sure_all";
  public static final String OPT_SAME_ALL = "opt_same_all";
  public static final String OPT_METAL = "opt_metal";
  public static final String OPT_PLASTIC = "opt_plastic";
  public static final String OPT_METOUIA = "opt_metouia";
  public static final String OPT_MOTIF = "opt_motif";
  public static final String OPT_KUNSTSTOFF = "opt_kunststoff";
  public static final String OPT_WINDOWS = "opt_windows";
  

  //Error messages
  public static final String ERR_NO_DEFAULT_DIR = "err_no_default_dir";
  public static final String ERR_DIR_NO_EXIST = "err_dir_no_exist";
  public static final String ERR_CANT_DELETE_ROOT = "err_cant_delete_root";
  public static final String ERR_MUST_SEL_TWO_VER = "err_must_sel_two_ver";
  public static final String ERR_NO_SEL_VER = "err_no_sel_ver";
  public static final String ERR_MUST_SEL_ONE_VER = "err_must_sel_one_ver";
  public static final String ERR_CANT_DETERMINE_VER = "err_cant_determine_ver";
  public static final String ERR_DEST_NOT_DIR = "err_dest_not_dir";
  public static final String ERR_NO_SEL_FILE = "err_no_sel_file";
  public static final String ERR_NO_SEL_FILE_REM = "err_no_sel_file_rem";
  public static final String ERR_NO_SEL_FILE_CO = "err_no_sel_file_co";
  public static final String ERR_CONFIG_FILE = "err_config_file";
  public static final String ERR_PWD_NO_MATCH = "err_pwd_no_match";
  public static final String ERR_NO_SEL_USER = "err_no_sel_user";
  public static final String ERR_NO_DETERMINE_USER = "err_no_determine_user";
  public static final String ERR_CONNECTION = "err_connection";
  public static final String ERR_UNEXP_ROLLBACK = "err_unexpected_rollback";
  public static final String ERR_LOGIN_EXPIRED = "err_login_expired";
  public static final String ERR_FILE_TYPE_INVALID = "err_file_type_invalid";
  public static final String ERR_CANT_GET_VER_ID = "err_cant_get_ver_id";
  public static final String ERR_CANT_MAKE_DIR = "err_cant_make_dir";
  public static final String ERR_NOT_DIR = "err_not_dir";
  public static final String ERR_SEL_ONE_FILE = "err_sel_one_file";
  public static final String ERR_NOT_LABEL = "err_not_label";
  public static final String ERR_NO_SEL_LABEL = "err_no_sel_label";
  public static final String ERR_NOT_SOAP = "err_not_soap";
  public static final String ERR_SOAP_PROBLEM = "err_soap_problem";
  public static final String ERR_WRONG_JVM = "err_wrong_jvm";
  public static final String ERR_CANT_DELETE_CHECKED_OUT = "err_cant_delete_checked_out";

  private Document lookupDoc = null;
  private Element elmRoot = null;

  private Properties props = null;

  public static DisplayTextLibrary instance = null;

  private DisplayTextLibrary(String fileName)
          throws IOException /*, SAXException*/{
    File fl = new File(AppConfig.getInstance().getConfigFilePath(), fileName);
    props = new Properties();
    FileInputStream inStr = new FileInputStream(fl);
    try{
      props.load(inStr);
    }
    finally{
      inStr.close();
    }
    //lookupDoc = XMLUtil.getXMLDoc(fl);
    //elmRoot = lookupDoc.getDocumentElement();
  }

  public static DisplayTextLibrary initializeInstance(String fileName)
          throws IOException /*, SAXException */{
    instance = new DisplayTextLibrary(fileName);
    return instance;
  }

  public static DisplayTextLibrary getInstance(){
    return instance;
  }

  public static String displayText(String key){
    return instance.getDisplayText(key);
  }

  public String getDisplayText(String key){
    String s = props.getProperty(key);
    if (s == null){
      throw new org.sourcejammer.util.ConfigurationException("No value found in .props file for " + key + ".");
    }
    return s;
    //return XMLUtil.getValue(key, elmRoot);
  }

  /**
   * Returns value as a string array.
   */
  public String[] getDisplayTextArray(String key){
    //First check hashtable
    String[] saReturn = (String[])mhshArrays.get(key);
    if (saReturn == null){
      //Check xml file.
      saReturn = getArrayFromXMLNode(key);
      if (saReturn != null){
        //Add to hashtable
        mhshArrays.put(key, saReturn);
      }
    }
    return saReturn;
  }

  public String[] getArrayFromXMLNode(String key){
  String[] sArray = null;
    //String sUnparsed = XMLUtil.getValue(key, elmRoot);
    String sUnparsed = props.getProperty(key);
    if (sUnparsed != null){
      StringTokenizer parser = new StringTokenizer(sUnparsed, ARRAY_PARSE_CHAR, false);
      sArray = new String[parser.countTokens()];
      int iCounter = 0;
      while(parser.hasMoreTokens()){
        sArray[iCounter] = parser.nextToken();
        iCounter++;
      }
    }
    return sArray;
  }

}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.