sysmodelmgr/com.symbian.smt.gui/src/com/symbian/smt/gui/AbstractPersistentDataStore.java
changeset 0 522a326673b6
equal deleted inserted replaced
-1:000000000000 0:522a326673b6
       
     1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 package com.symbian.smt.gui;
       
    17 
       
    18 import java.util.ArrayList;
       
    19 import java.util.List;
       
    20 
       
    21 public abstract class AbstractPersistentDataStore implements PersistentSettings {
       
    22 
       
    23 	final static String SEPARATOR = "|";
       
    24 
       
    25 	private void concatenateAndWriteString(PersistentSettingsEnums theEnum,
       
    26 			String separator, String[] items) {
       
    27 		write(theEnum, Helper.concatenateString(separator, items));
       
    28 	}
       
    29 
       
    30 	/**
       
    31 	 * Gets the list of advanced options from the persistent data store
       
    32 	 * 
       
    33 	 * @return String
       
    34 	 */
       
    35 	public String[] getAdvancedOptions() {
       
    36 		return readAndSplitString(PersistentSettingsEnums.ADVANCED_OPTIONS,
       
    37 				SEPARATOR);
       
    38 	}
       
    39 
       
    40 	/**
       
    41 	 * Gets the border shapes file location from the persistent data store
       
    42 	 * 
       
    43 	 * @return String
       
    44 	 */
       
    45 	public String[] getBorderShapesFiles() {
       
    46 		return readAndSplitString(PersistentSettingsEnums.BORDER_SHAPES_FILES,
       
    47 				SEPARATOR);
       
    48 	}
       
    49 
       
    50 	/**
       
    51 	 * Gets the border styles file location from the persistent data store
       
    52 	 * 
       
    53 	 * @return String
       
    54 	 */
       
    55 	public String[] getBorderStylesFiles() {
       
    56 		return readAndSplitString(PersistentSettingsEnums.BORDER_STYLES_FILES,
       
    57 				SEPARATOR);
       
    58 	}
       
    59 
       
    60 	/**
       
    61 	 * Gets the colours file location from the persistent data store
       
    62 	 * 
       
    63 	 * @return String
       
    64 	 */
       
    65 	public String[] getColoursFiles() {
       
    66 		return readAndSplitString(PersistentSettingsEnums.COLOURS_FILES,
       
    67 				SEPARATOR);
       
    68 	}
       
    69 
       
    70 	/**
       
    71 	 * Gets the copyright text from the persistent data store
       
    72 	 * 
       
    73 	 * @return String
       
    74 	 */
       
    75 	public String getCopyrightText() {
       
    76 		return read(PersistentSettingsEnums.COPYRIGHT_TEXT);
       
    77 	}
       
    78 
       
    79 	/**
       
    80 	 * Gets the System Model Managers default border shapes files location from
       
    81 	 * the plug-in default persistent data store
       
    82 	 * 
       
    83 	 * @return String[]
       
    84 	 */
       
    85 	public String[] getDefaultBorderShapesFiles() {
       
    86 		return readAndSplitString(
       
    87 				PersistentSettingsEnums.BORDER_SHAPES_FILES_DEFAULT, SEPARATOR);
       
    88 	}
       
    89 
       
    90 	/**
       
    91 	 * Gets the System Model Managers default border styles files location from
       
    92 	 * the plug-in default persistent data store
       
    93 	 * 
       
    94 	 * @return String[]
       
    95 	 */
       
    96 	public String[] getDefaultBorderStylesFiles() {
       
    97 		return readAndSplitString(
       
    98 				PersistentSettingsEnums.BORDER_STYLES_FILES_DEFAULT, SEPARATOR);
       
    99 	}
       
   100 
       
   101 	/**
       
   102 	 * Gets the System Model Managers default colours files location from the
       
   103 	 * plug-in default persistent data store
       
   104 	 * 
       
   105 	 * @return String[]
       
   106 	 */
       
   107 	public String[] getDefaultColoursFiles() {
       
   108 		return readAndSplitString(
       
   109 				PersistentSettingsEnums.COLOURS_FILES_DEFAULT, SEPARATOR);
       
   110 	}
       
   111 
       
   112 	/**
       
   113 	 * Gets the System Model Managers default dependencies files location from
       
   114 	 * the plug-in default persistent data store
       
   115 	 * 
       
   116 	 * @return String[]
       
   117 	 */
       
   118 	public String[] getDefaultDependenciesFiles() {
       
   119 		return readAndSplitString(
       
   120 				PersistentSettingsEnums.DEPENDENCIES_FILES_DEFAULT, SEPARATOR);
       
   121 	}
       
   122 
       
   123 	/**
       
   124 	 * Gets the System Model Managers default distribution text from the plug-in
       
   125 	 * default persistent data store
       
   126 	 * 
       
   127 	 * @return String
       
   128 	 */
       
   129 	public String getDefaultDistributionText() {
       
   130 		return read(PersistentSettingsEnums.DISTRIBUTION_TEXT_DEFAULT);
       
   131 	}
       
   132 
       
   133 	/**
       
   134 	 * Gets the System Model Managers default levels files location from the
       
   135 	 * plug-in default persistent data store
       
   136 	 * 
       
   137 	 * @return String[]
       
   138 	 */
       
   139 	public String[] getDefaultLevelsFiles() {
       
   140 		return readAndSplitString(PersistentSettingsEnums.LEVELS_FILES_DEFAULT,
       
   141 				SEPARATOR);
       
   142 	}
       
   143 
       
   144 	/**
       
   145 	 * Gets the System Model Managers default localisation files location from
       
   146 	 * the plug-in default persistent data store
       
   147 	 * 
       
   148 	 * @return String[]
       
   149 	 */
       
   150 	public String[] getDefaultLocalisationFiles() {
       
   151 		return readAndSplitString(
       
   152 				PersistentSettingsEnums.LOCALISATION_FILES_DEFAULT, SEPARATOR);
       
   153 	}
       
   154 
       
   155 	/**
       
   156 	 * Gets the default model version text from the persistent data store
       
   157 	 * 
       
   158 	 * @return String
       
   159 	 */
       
   160 	public String getDefaultModelVersionText() {
       
   161 		return read(PersistentSettingsEnums.MODEL_VERSION_TEXT_DEFAULT);
       
   162 	}
       
   163 
       
   164 	/**
       
   165 	 * Gets the System Model Managers default patterns files location from the
       
   166 	 * plug-in default persistent data store
       
   167 	 * 
       
   168 	 * @return String[]
       
   169 	 */
       
   170 	public String[] getDefaultPatternsFiles() {
       
   171 		return readAndSplitString(
       
   172 				PersistentSettingsEnums.PATTERNS_FILES_DEFAULT, SEPARATOR);
       
   173 	}
       
   174 
       
   175 	/**
       
   176 	 * Gets the System Model Managers default printed DPI from the plug-in
       
   177 	 * default persistent data store
       
   178 	 * 
       
   179 	 * @return String
       
   180 	 */
       
   181 	public String getDefaultPrintedDpi() {
       
   182 		return read(PersistentSettingsEnums.PRINTED_DPI_DEFAULT);
       
   183 	}
       
   184 
       
   185 	/**
       
   186 	 * Gets the System Model Managers default S12 XML files location from the
       
   187 	 * plug-in default persistent data store
       
   188 	 * 
       
   189 	 * @return String[]
       
   190 	 */
       
   191 	public String[] getDefaultS12XmlFiles() {
       
   192 		return readAndSplitString(
       
   193 				PersistentSettingsEnums.S12_XML_FILES_DEFAULT, SEPARATOR);
       
   194 	}
       
   195 
       
   196 	/**
       
   197 	 * Gets the System Model Managers default shapes files location from the
       
   198 	 * plug-in default persistent data store
       
   199 	 * 
       
   200 	 * @return String[]
       
   201 	 */
       
   202 	public String[] getDefaultShapesFiles() {
       
   203 		return readAndSplitString(PersistentSettingsEnums.SHAPES_FILES_DEFAULT,
       
   204 				SEPARATOR);
       
   205 	}
       
   206 
       
   207 	/**
       
   208 	 * Gets the System Model Managers default system info files location from
       
   209 	 * the plug-in default persistent data store
       
   210 	 * 
       
   211 	 * @return String[]
       
   212 	 */
       
   213 	public String[] getDefaultSystemInfoFiles() {
       
   214 		return readAndSplitString(
       
   215 				PersistentSettingsEnums.SYSTEM_INFO_FILES_DEFAULT, SEPARATOR);
       
   216 	}
       
   217 
       
   218 	/**
       
   219 	 * Gets the dependencies files location from the persistent data store
       
   220 	 * 
       
   221 	 * @return String[]
       
   222 	 */
       
   223 	public String[] getDependenciesFiles() {
       
   224 		return readAndSplitString(PersistentSettingsEnums.DEPENDENCIES_FILES,
       
   225 				SEPARATOR);
       
   226 	}
       
   227 
       
   228 	/**
       
   229 	 * Gets the distribution text values from the persistent data store
       
   230 	 * 
       
   231 	 * @return String[]
       
   232 	 */
       
   233 	public String[] getDistributionTexts() {
       
   234 		return readAndSplitString(PersistentSettingsEnums.DISTRIBUTION_TEXTS,
       
   235 				SEPARATOR);
       
   236 	}
       
   237 
       
   238 	/**
       
   239 	 * Gets the list of filter has items from the persistent data store
       
   240 	 * 
       
   241 	 * @return String
       
   242 	 */
       
   243 	public String[] getFilterHasItems() {
       
   244 		return readAndSplitString(PersistentSettingsEnums.FILTER_HAS_ITEMS,
       
   245 				SEPARATOR);
       
   246 	}
       
   247 
       
   248 	/**
       
   249 	 * Gets the list of filter items from the persistent data store
       
   250 	 * 
       
   251 	 * @return String
       
   252 	 */
       
   253 	public String[] getFilterItems() {
       
   254 		return readAndSplitString(PersistentSettingsEnums.FILTER_ITEMS,
       
   255 				SEPARATOR);
       
   256 	}
       
   257 
       
   258 	/**
       
   259 	 * Gets the fix item size option from the persistent data store
       
   260 	 * 
       
   261 	 * @return a Boolean value indicating whether or not the fix item size
       
   262 	 *         option is checked
       
   263 	 */
       
   264 	public Boolean getFixItemSize() {
       
   265 		String fixItemSize = read(PersistentSettingsEnums.FIX_ITEM_SIZE);
       
   266 
       
   267 		if (fixItemSize.equalsIgnoreCase("true")) {
       
   268 			return true;
       
   269 		} else {
       
   270 			return false;
       
   271 		}
       
   272 	}
       
   273 
       
   274 	/**
       
   275 	 * Gets the highlight core OS option from the persistent data store
       
   276 	 * 
       
   277 	 * @return String
       
   278 	 */
       
   279 	public Boolean getHighlightCoreOS() {
       
   280 		String highlightCoreOS = read(PersistentSettingsEnums.HIGHTLIGHT_CORE_OS);
       
   281 
       
   282 		if (highlightCoreOS.equalsIgnoreCase("true")) {
       
   283 			return true;
       
   284 		} else {
       
   285 			return false;
       
   286 		}
       
   287 	}
       
   288 
       
   289 	/**
       
   290 	 * Gets the list of ignore items from the persistent data store
       
   291 	 * 
       
   292 	 * @return List<String[]>
       
   293 	 */
       
   294 	public List<String[]> getIgnoreItems() {
       
   295 		ArrayList<String[]> ignoreItems = new ArrayList<String[]>();
       
   296 
       
   297 		String result = read(PersistentSettingsEnums.IGNORE_ITEMS);
       
   298 
       
   299 		if (result != null && result.length() > 0) {
       
   300 			// Split on ;'s
       
   301 			for (String ignoreItem : result.split(";")) {
       
   302 				if (ignoreItem != null && ignoreItem.length() > 0) {
       
   303 					// Then split on !'s
       
   304 					String[] itemData = ignoreItem.split(":");
       
   305 					// and add to the list
       
   306 					ignoreItems.add(itemData);
       
   307 				}
       
   308 			}
       
   309 		}
       
   310 		return ignoreItems;
       
   311 	}
       
   312 
       
   313 	/**
       
   314 	 * Gets the level of detail from the persistent data store
       
   315 	 * 
       
   316 	 * @return String
       
   317 	 */
       
   318 	public String getLevelOfDetail() {
       
   319 		return read(PersistentSettingsEnums.LEVEL_OF_DETAIL);
       
   320 	}
       
   321 
       
   322 	/**
       
   323 	 * Gets the levels file location from the persistent data store
       
   324 	 * 
       
   325 	 * @return String
       
   326 	 */
       
   327 	public String[] getLevelsFiles() {
       
   328 		return readAndSplitString(PersistentSettingsEnums.LEVELS_FILES,
       
   329 				SEPARATOR);
       
   330 	}
       
   331 
       
   332 	/**
       
   333 	 * Gets the localisation file location from the persistent data store
       
   334 	 * 
       
   335 	 * @return String
       
   336 	 */
       
   337 	public String[] getLocalisationFiles() {
       
   338 		return readAndSplitString(PersistentSettingsEnums.LOCALISATION_FILES,
       
   339 				SEPARATOR);
       
   340 	}
       
   341 
       
   342 	/**
       
   343 	 * Gets the model name from the persistent data store
       
   344 	 * 
       
   345 	 * @return String
       
   346 	 */
       
   347 	public String getModelName() {
       
   348 		return read(PersistentSettingsEnums.MODEL_NAME);
       
   349 	}
       
   350 
       
   351 	/**
       
   352 	 * Gets the model version from the persistent data store
       
   353 	 * 
       
   354 	 * @return String
       
   355 	 */
       
   356 	public String getModelVersion() {
       
   357 		return read(PersistentSettingsEnums.MODEL_VERSION);
       
   358 	}
       
   359 
       
   360 	/**
       
   361 	 * Gets the model version texts from the persistent data store
       
   362 	 * 
       
   363 	 * @return String
       
   364 	 */
       
   365 	public String[] getModelVersionTexts() {
       
   366 		return readAndSplitString(PersistentSettingsEnums.MODEL_VERSION_TEXTS,
       
   367 				SEPARATOR);
       
   368 	}
       
   369 
       
   370 	public String getOutputFilename() {
       
   371 		return read(PersistentSettingsEnums.OUTPUT_NAME);
       
   372 	}
       
   373 
       
   374 	/**
       
   375 	 * Gets the patterns file location from the persistent data store
       
   376 	 * 
       
   377 	 * @return String
       
   378 	 */
       
   379 	public String[] getPatternsFiles() {
       
   380 		return readAndSplitString(PersistentSettingsEnums.PATTERNS_FILES,
       
   381 				SEPARATOR);
       
   382 	}
       
   383 
       
   384 	/**
       
   385 	 * Gets the selected printed DPI value from the persistent data store
       
   386 	 * 
       
   387 	 * @return String
       
   388 	 */
       
   389 	public String[] getPrintedDpis() {
       
   390 		return readAndSplitString(PersistentSettingsEnums.PRINTED_DPIS,
       
   391 				SEPARATOR);
       
   392 	}
       
   393 
       
   394 	public String[] getS12XmlFiles() {
       
   395 		return readAndSplitString(PersistentSettingsEnums.S12_XML_FILES,
       
   396 				SEPARATOR);
       
   397 	}
       
   398 
       
   399 	public String[] getSelectedBorderShapesFiles() {
       
   400 		return readAndSplitString(
       
   401 				PersistentSettingsEnums.BORDER_SHAPES_FILES_SELECTED, SEPARATOR);
       
   402 	}
       
   403 
       
   404 	public String[] getSelectedBorderStylesFiles() {
       
   405 		return readAndSplitString(
       
   406 				PersistentSettingsEnums.BORDER_STYLES_FILES_SELECTED, SEPARATOR);
       
   407 	}
       
   408 
       
   409 	public String[] getSelectedColoursFiles() {
       
   410 		return readAndSplitString(
       
   411 				PersistentSettingsEnums.COLOURS_FILES_SELECTED, SEPARATOR);
       
   412 	}
       
   413 
       
   414 	public String[] getSelectedDependenciesFiles() {
       
   415 		return readAndSplitString(
       
   416 				PersistentSettingsEnums.DEPENDENCIES_FILES_SELECTED, SEPARATOR);
       
   417 	}
       
   418 
       
   419 	/**
       
   420 	 * Gets the selected distribution text value from the persistent data store
       
   421 	 * 
       
   422 	 * @return String
       
   423 	 */
       
   424 	public String getSelectedDistributionText() {
       
   425 		return read(PersistentSettingsEnums.DISTRIBUTION_TEXT_SELECTED);
       
   426 	}
       
   427 
       
   428 	public String[] getSelectedLevelsFiles() {
       
   429 		return readAndSplitString(
       
   430 				PersistentSettingsEnums.LEVELS_FILES_SELECTED, SEPARATOR);
       
   431 	}
       
   432 
       
   433 	public String[] getSelectedLocalisationFiles() {
       
   434 		return readAndSplitString(
       
   435 				PersistentSettingsEnums.LOCALISATION_FILES_SELECTED, SEPARATOR);
       
   436 	}
       
   437 
       
   438 	/**
       
   439 	 * Gets the selected model version text value from the persistent data store
       
   440 	 * 
       
   441 	 * @return String
       
   442 	 */
       
   443 	public String getSelectedModelVersionText() {
       
   444 		return read(PersistentSettingsEnums.MODEL_VERSION_TEXT_SELECTED);
       
   445 	}
       
   446 
       
   447 	public String[] getSelectedPatternsFiles() {
       
   448 		return readAndSplitString(
       
   449 				PersistentSettingsEnums.PATTERNS_FILES_SELECTED, SEPARATOR);
       
   450 	}
       
   451 
       
   452 	/**
       
   453 	 * Gets the selected printed DPI value from the persistent data store
       
   454 	 * 
       
   455 	 * @return String
       
   456 	 */
       
   457 	public String getSelectedPrintedDpi() {
       
   458 		return read(PersistentSettingsEnums.PRINTED_DPI_SELECTED);
       
   459 	}
       
   460 
       
   461 	public String[] getSelectedS12XmlFiles() {
       
   462 		return readAndSplitString(
       
   463 				PersistentSettingsEnums.S12_XML_FILES_SELECTED, SEPARATOR);
       
   464 	}
       
   465 
       
   466 	public String[] getSelectedShapesFiles() {
       
   467 		return readAndSplitString(
       
   468 				PersistentSettingsEnums.SHAPES_FILES_SELECTED, SEPARATOR);
       
   469 	}
       
   470 
       
   471 	public String[] getSelectedSystemInfoFiles() {
       
   472 		return readAndSplitString(
       
   473 				PersistentSettingsEnums.SYSTEM_INFO_FILES_SELECTED, SEPARATOR);
       
   474 	}
       
   475 
       
   476 	/**
       
   477 	 * Gets the shapes file location from the persistent data store
       
   478 	 * 
       
   479 	 * @return String
       
   480 	 */
       
   481 	public String[] getShapesFiles() {
       
   482 		return readAndSplitString(PersistentSettingsEnums.SHAPES_FILES,
       
   483 				SEPARATOR);
       
   484 	}
       
   485 
       
   486 	public Boolean getSuppressMouseOverEffect() {
       
   487 		String makeModelStatic = read(PersistentSettingsEnums.SUPPRESS_MOUSE_OVER_EFFECT);
       
   488 
       
   489 		if (makeModelStatic.equalsIgnoreCase("true")) {
       
   490 			return true;
       
   491 		} else {
       
   492 			return false;
       
   493 		}
       
   494 	}
       
   495 
       
   496 	/**
       
   497 	 * Gets the list of system definition files from the persistent data store
       
   498 	 * 
       
   499 	 * @return String[]
       
   500 	 */
       
   501 	public String[] getSystemDefinitionFiles() {
       
   502 		return readAndSplitString(
       
   503 				PersistentSettingsEnums.SYSTEM_DEFINITION_FILES, SEPARATOR);
       
   504 	}
       
   505 
       
   506 	/**
       
   507 	 * Gets the system info file location from the persistent data store
       
   508 	 * 
       
   509 	 * @return String
       
   510 	 */
       
   511 	public String[] getSystemInfoFiles() {
       
   512 		return readAndSplitString(PersistentSettingsEnums.SYSTEM_INFO_FILES,
       
   513 				SEPARATOR);
       
   514 	}
       
   515 
       
   516 	/**
       
   517 	 * Gets the system name from the persistent data store
       
   518 	 * 
       
   519 	 * @return String
       
   520 	 */
       
   521 	public String getSystemName() {
       
   522 		return read(PersistentSettingsEnums.SYSTEM_NAME);
       
   523 	}
       
   524 
       
   525 	/**
       
   526 	 * Gets the system version from the persistent data store
       
   527 	 * 
       
   528 	 * @return String
       
   529 	 */
       
   530 	public String getSystemVersion() {
       
   531 		return read(PersistentSettingsEnums.SYSTEM_VERSION);
       
   532 	}
       
   533 
       
   534 	/**
       
   535 	 * Gets the warning level to use from the persistent data store
       
   536 	 * 
       
   537 	 * @return String
       
   538 	 */
       
   539 	public String getWarningLevel() {
       
   540 		return read(PersistentSettingsEnums.WARNING_LEVELS);
       
   541 	}
       
   542 
       
   543 	public abstract String read(PersistentSettingsEnums key);
       
   544 
       
   545 	private String[] readAndSplitString(PersistentSettingsEnums theEnum,
       
   546 			String separator) {
       
   547 		String result = read(theEnum);
       
   548 
       
   549 		return Helper.splitString(result, separator);
       
   550 	}
       
   551 
       
   552 	/**
       
   553 	 * Writes the list of advanced options to the persistent data store
       
   554 	 * 
       
   555 	 * @param advancedOptionsList
       
   556 	 *            List of advanced options
       
   557 	 * @return void
       
   558 	 */
       
   559 	public void setAdvancedOptions(String[] advancedOptionsList) {
       
   560 		concatenateAndWriteString(PersistentSettingsEnums.ADVANCED_OPTIONS,
       
   561 				SEPARATOR, advancedOptionsList);
       
   562 	}
       
   563 
       
   564 	/**
       
   565 	 * Writes the border shapes file location to the persistent data store
       
   566 	 * 
       
   567 	 * @param borderShapesFile
       
   568 	 *            Location of the border shapes file
       
   569 	 * @return void
       
   570 	 */
       
   571 	public void setBorderShapesFiles(String[] borderShapesFile) {
       
   572 		concatenateAndWriteString(PersistentSettingsEnums.BORDER_SHAPES_FILES,
       
   573 				SEPARATOR, borderShapesFile);
       
   574 	}
       
   575 
       
   576 	/**
       
   577 	 * Writes the border styles file location to the persistent data store
       
   578 	 * 
       
   579 	 * @param borderStylesFile
       
   580 	 *            Location of the border styles file
       
   581 	 * @return void
       
   582 	 */
       
   583 	public void setBorderStylesFiles(String[] borderStylesFile) {
       
   584 		concatenateAndWriteString(PersistentSettingsEnums.BORDER_STYLES_FILES,
       
   585 				SEPARATOR, borderStylesFile);
       
   586 	}
       
   587 
       
   588 	/**
       
   589 	 * Writes the colours file location to the persistent data store
       
   590 	 * 
       
   591 	 * @param coloursFile
       
   592 	 *            Location of the colours file
       
   593 	 * @return void
       
   594 	 */
       
   595 	public void setColoursFiles(String[] coloursFile) {
       
   596 		concatenateAndWriteString(PersistentSettingsEnums.COLOURS_FILES,
       
   597 				SEPARATOR, coloursFile);
       
   598 	}
       
   599 
       
   600 	/**
       
   601 	 * Writes the copyright text to the persistent data store
       
   602 	 * 
       
   603 	 * @param copyrightText
       
   604 	 *            String to be used for the copyright text
       
   605 	 * @return void
       
   606 	 */
       
   607 	public void setCopyrightText(String copyrightText) {
       
   608 		write(PersistentSettingsEnums.COPYRIGHT_TEXT, copyrightText);
       
   609 	}
       
   610 
       
   611 	/**
       
   612 	 * Writes the dependencies file location to the persistent data store
       
   613 	 * 
       
   614 	 * @param dependenciesFile
       
   615 	 *            Location of the dependencies file
       
   616 	 * @return void
       
   617 	 */
       
   618 	public void setDependenciesFiles(String[] dependenciesFile) {
       
   619 		concatenateAndWriteString(PersistentSettingsEnums.DEPENDENCIES_FILES,
       
   620 				SEPARATOR, dependenciesFile);
       
   621 	}
       
   622 
       
   623 	/**
       
   624 	 * Writes the distribution text values to the persistent data store
       
   625 	 * 
       
   626 	 * @param distributionTexts
       
   627 	 *            String[] to be used for the distribution text values
       
   628 	 * @return void
       
   629 	 */
       
   630 	public void setDistributionTexts(String[] distributionTexts) {
       
   631 		concatenateAndWriteString(PersistentSettingsEnums.DISTRIBUTION_TEXTS,
       
   632 				SEPARATOR, distributionTexts);
       
   633 	}
       
   634 
       
   635 	/**
       
   636 	 * Writes the list of filter has items to the persistent data store
       
   637 	 * 
       
   638 	 * @param filterHasItemsList
       
   639 	 *            List of filter has names
       
   640 	 * @return void
       
   641 	 */
       
   642 	public void setFilterHasItems(String[] filterHasItemsList) {
       
   643 		concatenateAndWriteString(PersistentSettingsEnums.FILTER_HAS_ITEMS,
       
   644 				SEPARATOR, filterHasItemsList);
       
   645 	}
       
   646 
       
   647 	/**
       
   648 	 * Writes the list of filter items to the persistent data store
       
   649 	 * 
       
   650 	 * @param filterItemsList
       
   651 	 *            List of filter names
       
   652 	 * @return void
       
   653 	 */
       
   654 	public void setFilterItems(String[] filterItemsList) {
       
   655 		concatenateAndWriteString(PersistentSettingsEnums.FILTER_ITEMS,
       
   656 				SEPARATOR, filterItemsList);
       
   657 	}
       
   658 
       
   659 	/**
       
   660 	 * Writes the fix item size option to the persistent data store
       
   661 	 * 
       
   662 	 * @param fixItemSize
       
   663 	 *            Boolean to represent the fix item size option
       
   664 	 * @return void
       
   665 	 */
       
   666 	public void setFixItemSize(Boolean fixItemSize) {
       
   667 		write(PersistentSettingsEnums.FIX_ITEM_SIZE, fixItemSize.toString());
       
   668 	}
       
   669 
       
   670 	/**
       
   671 	 * Writes the highlight core OS option to the persistent data store
       
   672 	 * 
       
   673 	 * @param highlightCoreOS
       
   674 	 *            Boolean to represent the highlight core OS option
       
   675 	 * @return void
       
   676 	 */
       
   677 	public void setHighlightCoreOS(Boolean highlightCoreOS) {
       
   678 		write(PersistentSettingsEnums.HIGHTLIGHT_CORE_OS, highlightCoreOS
       
   679 				.toString());
       
   680 	}
       
   681 
       
   682 	/**
       
   683 	 * Writes the list of ignore items to the persistent data store
       
   684 	 * 
       
   685 	 * @param ignoreItems
       
   686 	 *            List of ignore items
       
   687 	 * @return void
       
   688 	 */
       
   689 	public void setIgnoreItems(List<String[]> ignoreItemsList) {
       
   690 		StringBuilder ignoreItems = new StringBuilder();
       
   691 
       
   692 		for (String[] ignoreItem : ignoreItemsList) {
       
   693 			ignoreItems.append(ignoreItem[0]);
       
   694 			ignoreItems.append(":");
       
   695 			ignoreItems.append(ignoreItem[1]);
       
   696 			ignoreItems.append(";");
       
   697 		}
       
   698 
       
   699 		write(PersistentSettingsEnums.IGNORE_ITEMS, ignoreItems.toString());
       
   700 	}
       
   701 
       
   702 	/**
       
   703 	 * Writes the level of detail to the persistent data store
       
   704 	 * 
       
   705 	 * @param levelOfDetail
       
   706 	 *            String to be used for the level of detail
       
   707 	 * @return void
       
   708 	 */
       
   709 	public void setLevelOfDetail(String levelOfDetail) {
       
   710 		write(PersistentSettingsEnums.LEVEL_OF_DETAIL, levelOfDetail);
       
   711 	}
       
   712 
       
   713 	/**
       
   714 	 * Writes the levels file location to the persistent data store
       
   715 	 * 
       
   716 	 * @param levelsFile
       
   717 	 *            Location of the levels file
       
   718 	 * @return void
       
   719 	 */
       
   720 	public void setLevelsFiles(String[] levelsFile) {
       
   721 		concatenateAndWriteString(PersistentSettingsEnums.LEVELS_FILES,
       
   722 				SEPARATOR, levelsFile);
       
   723 	}
       
   724 
       
   725 	/**
       
   726 	 * Writes the localisation file location to the persistent data store
       
   727 	 * 
       
   728 	 * @param localisationFile
       
   729 	 *            Location of the localisation file
       
   730 	 * @return void
       
   731 	 */
       
   732 	public void setLocalisationFiles(String[] localisationFiles) {
       
   733 		concatenateAndWriteString(PersistentSettingsEnums.LOCALISATION_FILES,
       
   734 				SEPARATOR, localisationFiles);
       
   735 	}
       
   736 
       
   737 	/**
       
   738 	 * Writes the model name to the persistent data store
       
   739 	 * 
       
   740 	 * @param modelName
       
   741 	 *            String to be used for the model name
       
   742 	 * @return void
       
   743 	 */
       
   744 	public void setModelName(String modelName) {
       
   745 		write(PersistentSettingsEnums.MODEL_NAME, modelName);
       
   746 	}
       
   747 
       
   748 	/**
       
   749 	 * Writes the model version to the persistent data store
       
   750 	 * 
       
   751 	 * @param modelVersion
       
   752 	 *            String to be used for the model version
       
   753 	 * @return void
       
   754 	 */
       
   755 	public void setModelVersion(String modelVersion) {
       
   756 		write(PersistentSettingsEnums.MODEL_VERSION, modelVersion);
       
   757 	}
       
   758 
       
   759 	/**
       
   760 	 * Writes the model version text values to the persistent data store
       
   761 	 * 
       
   762 	 * @param modelVersionTexts
       
   763 	 *            String[] to be used for the model version text values
       
   764 	 * @return void
       
   765 	 */
       
   766 	public void setModelVersionTexts(String[] modelVersionTexts) {
       
   767 		concatenateAndWriteString(PersistentSettingsEnums.MODEL_VERSION_TEXTS,
       
   768 				SEPARATOR, modelVersionTexts);
       
   769 	}
       
   770 
       
   771 	public void setOutputFilename(String filename) {
       
   772 		write(PersistentSettingsEnums.OUTPUT_NAME, filename);
       
   773 	}
       
   774 
       
   775 	/**
       
   776 	 * Writes the patterns file location to the persistent data store
       
   777 	 * 
       
   778 	 * @param patternsFile
       
   779 	 *            Location of the patterns file
       
   780 	 * @return void
       
   781 	 */
       
   782 	public void setPatternsFiles(String[] patternsFile) {
       
   783 		concatenateAndWriteString(PersistentSettingsEnums.PATTERNS_FILES,
       
   784 				SEPARATOR, patternsFile);
       
   785 	}
       
   786 
       
   787 	/**
       
   788 	 * Writes the printed DPI values to the persistent data store
       
   789 	 * 
       
   790 	 * @param dpi
       
   791 	 *            String array to be used for the printed DPI values
       
   792 	 * @return void
       
   793 	 */
       
   794 	public void setPrintedDpis(String[] dpis) {
       
   795 		concatenateAndWriteString(PersistentSettingsEnums.PRINTED_DPIS,
       
   796 				SEPARATOR, dpis);
       
   797 	}
       
   798 
       
   799 	public void setS12XmlFiles(String[] s12XmlFiles) {
       
   800 		concatenateAndWriteString(PersistentSettingsEnums.S12_XML_FILES,
       
   801 				SEPARATOR, s12XmlFiles);
       
   802 	}
       
   803 
       
   804 	public void setSelectedBorderShapesFiles(String[] borderShapesFiles) {
       
   805 		concatenateAndWriteString(
       
   806 				PersistentSettingsEnums.BORDER_SHAPES_FILES_SELECTED,
       
   807 				SEPARATOR, borderShapesFiles);
       
   808 	}
       
   809 
       
   810 	public void setSelectedBorderStylesFiles(String[] borderStylesFiles) {
       
   811 		concatenateAndWriteString(
       
   812 				PersistentSettingsEnums.BORDER_STYLES_FILES_SELECTED,
       
   813 				SEPARATOR, borderStylesFiles);
       
   814 	}
       
   815 
       
   816 	public void setSelectedColoursFiles(String[] coloursFiles) {
       
   817 		concatenateAndWriteString(
       
   818 				PersistentSettingsEnums.COLOURS_FILES_SELECTED, SEPARATOR,
       
   819 				coloursFiles);
       
   820 	}
       
   821 
       
   822 	public void setSelectedDependenciesFiles(String[] dependenciesFiles) {
       
   823 		concatenateAndWriteString(
       
   824 				PersistentSettingsEnums.DEPENDENCIES_FILES_SELECTED, SEPARATOR,
       
   825 				dependenciesFiles);
       
   826 	}
       
   827 
       
   828 	/**
       
   829 	 * Writes the selected distribution text value to the persistent data store
       
   830 	 * 
       
   831 	 * @param distributionText
       
   832 	 *            String to be used for the selected distribution text value
       
   833 	 * @return void
       
   834 	 */
       
   835 	public void setSelectedDistributionText(String distributionText) {
       
   836 		write(PersistentSettingsEnums.DISTRIBUTION_TEXT_SELECTED,
       
   837 				distributionText);
       
   838 	}
       
   839 
       
   840 	public void setSelectedLevelsFiles(String[] levelsFiles) {
       
   841 		concatenateAndWriteString(
       
   842 				PersistentSettingsEnums.LEVELS_FILES_SELECTED, SEPARATOR,
       
   843 				levelsFiles);
       
   844 	}
       
   845 
       
   846 	public void setSelectedLocalisationFiles(String[] localisationFiles) {
       
   847 		concatenateAndWriteString(
       
   848 				PersistentSettingsEnums.LOCALISATION_FILES_SELECTED, SEPARATOR,
       
   849 				localisationFiles);
       
   850 	}
       
   851 
       
   852 	/**
       
   853 	 * Writes the selected model version text value to the persistent data store
       
   854 	 * 
       
   855 	 * @param dpi
       
   856 	 *            String to be used for the selected model version text value
       
   857 	 * @return void
       
   858 	 */
       
   859 	public void setSelectedModelVersionText(String modelVersionText) {
       
   860 		write(PersistentSettingsEnums.MODEL_VERSION_TEXT_SELECTED,
       
   861 				modelVersionText);
       
   862 	}
       
   863 
       
   864 	public void setSelectedPatternsFiles(String[] patternsFiles) {
       
   865 		concatenateAndWriteString(
       
   866 				PersistentSettingsEnums.PATTERNS_FILES_SELECTED, SEPARATOR,
       
   867 				patternsFiles);
       
   868 	}
       
   869 
       
   870 	/**
       
   871 	 * Writes the selected printed DPI value to the persistent data store
       
   872 	 * 
       
   873 	 * @param dpi
       
   874 	 *            String to be used for the selected printed DPI value
       
   875 	 * @return void
       
   876 	 */
       
   877 	public void setSelectedPrintedDpi(String dpi) {
       
   878 		write(PersistentSettingsEnums.PRINTED_DPI_SELECTED, dpi);
       
   879 	}
       
   880 
       
   881 	public void setSelectedS12XmlFiles(String[] s12XmlFiles) {
       
   882 		concatenateAndWriteString(
       
   883 				PersistentSettingsEnums.S12_XML_FILES_SELECTED, SEPARATOR,
       
   884 				s12XmlFiles);
       
   885 	}
       
   886 
       
   887 	public void setSelectedShapesFiles(String[] shapesFiles) {
       
   888 		concatenateAndWriteString(
       
   889 				PersistentSettingsEnums.SHAPES_FILES_SELECTED, SEPARATOR,
       
   890 				shapesFiles);
       
   891 	}
       
   892 
       
   893 	public void setSelectedSystemInfoFiles(String[] systemInfoFiles) {
       
   894 		concatenateAndWriteString(
       
   895 				PersistentSettingsEnums.SYSTEM_INFO_FILES_SELECTED, SEPARATOR,
       
   896 				systemInfoFiles);
       
   897 	}
       
   898 
       
   899 	/**
       
   900 	 * Writes the shapes file location to the persistent data store
       
   901 	 * 
       
   902 	 * @param shapesFile
       
   903 	 *            Location of the shapes file
       
   904 	 * @return void
       
   905 	 */
       
   906 	public void setShapesFiles(String[] shapesFile) {
       
   907 		concatenateAndWriteString(PersistentSettingsEnums.SHAPES_FILES,
       
   908 				SEPARATOR, shapesFile);
       
   909 	}
       
   910 
       
   911 	public void setSuppressMouseOverEffect(Boolean makeModelStatic) {
       
   912 		write(PersistentSettingsEnums.SUPPRESS_MOUSE_OVER_EFFECT,
       
   913 				makeModelStatic.toString());
       
   914 	}
       
   915 
       
   916 	/**
       
   917 	 * Writes the list of system definition files to the persistent data store
       
   918 	 * 
       
   919 	 * @param sysDefFiles
       
   920 	 *            List of the system definition file locations
       
   921 	 * @return void
       
   922 	 */
       
   923 	public void setSystemDefinitionFiles(String[] sysDefFiles) {
       
   924 		concatenateAndWriteString(
       
   925 				PersistentSettingsEnums.SYSTEM_DEFINITION_FILES, SEPARATOR,
       
   926 				sysDefFiles);
       
   927 	}
       
   928 
       
   929 	/**
       
   930 	 * Writes the system info location to the persistent data store
       
   931 	 * 
       
   932 	 * @param systemInfoFile
       
   933 	 *            Location of the system information file
       
   934 	 * @return void
       
   935 	 */
       
   936 	public void setSystemInfoFiles(String[] systemInfoFile) {
       
   937 		concatenateAndWriteString(PersistentSettingsEnums.SYSTEM_INFO_FILES,
       
   938 				SEPARATOR, systemInfoFile);
       
   939 	}
       
   940 
       
   941 	/**
       
   942 	 * Writes the system name to the persistent data store
       
   943 	 * 
       
   944 	 * @param systemName
       
   945 	 *            String to be used for the system name
       
   946 	 * @return void
       
   947 	 */
       
   948 	public void setSystemName(String systemName) {
       
   949 		write(PersistentSettingsEnums.SYSTEM_NAME, systemName);
       
   950 	}
       
   951 
       
   952 	/**
       
   953 	 * Writes the system version to the persistent data store
       
   954 	 * 
       
   955 	 * @param systemVersion
       
   956 	 *            String to be used for the system version
       
   957 	 * @return void
       
   958 	 */
       
   959 	public void setSystemVersion(String systemVersion) {
       
   960 		write(PersistentSettingsEnums.SYSTEM_VERSION, systemVersion);
       
   961 	}
       
   962 
       
   963 	/**
       
   964 	 * Writes the warning level to the persistent data store
       
   965 	 * 
       
   966 	 * @param warningLevel
       
   967 	 *            An int between 1 and 3 indicating the level of warnings to be
       
   968 	 *            produces
       
   969 	 * @return void
       
   970 	 */
       
   971 	public void setWarningLevel(String warningLevel) {
       
   972 		write(PersistentSettingsEnums.WARNING_LEVELS, warningLevel);
       
   973 	}
       
   974 
       
   975 	public abstract void write(PersistentSettingsEnums key, String value);
       
   976 }