creatorextension/com.nokia.s60tools.creator/src/com/nokia/s60tools/creator/components/savedpage/SavedPageFolderValue.java
changeset 0 61163b28edca
equal deleted inserted replaced
-1:000000000000 0:61163b28edca
       
     1 /*
       
     2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17  
       
    18 package com.nokia.s60tools.creator.components.savedpage;
       
    19 
       
    20 import com.nokia.s60tools.creator.components.AbstractValue;
       
    21 import com.nokia.s60tools.creator.core.CreatorEditorSettings;
       
    22 
       
    23 /**
       
    24  * One row of data of saved page folder
       
    25  */
       
    26 public class SavedPageFolderValue extends AbstractValue {
       
    27 
       
    28 	/**
       
    29 	 * Creates new Value.
       
    30 	 * @param value
       
    31 	 * @param randomType
       
    32 	 * @param amount
       
    33 	 */
       
    34 	public SavedPageFolderValue(String value, ModeTypes randomType, int amount) {
       
    35 		this();
       
    36 		setValue(value);
       
    37 		setModeType(randomType);
       
    38 		setAmount(amount);
       
    39 	}
       
    40 	
       
    41 	/**
       
    42 	 * Creates new Value.
       
    43 	 * @param value
       
    44 	 * @param amount
       
    45 	 */
       
    46 	public SavedPageFolderValue(String value, int amount) {
       
    47 		this();
       
    48 		setValue(value);
       
    49 		setModeType(ModeTypes.RandomTypeNotRandom);
       
    50 		setAmount(amount);
       
    51 	}
       
    52 
       
    53 
       
    54 	/**
       
    55 	 * Creates new NoteValue.
       
    56 	 * 
       
    57 	 * @param value
       
    58 	 * @param isRandom if false, random type is set to {@link ModeTypes#RandomTypeNotRandom}
       
    59 	 * if true random type is set to {@link ModeTypes#RandomTypeDefaultLength}
       
    60 	 * @param amount
       
    61 	 */
       
    62 	public SavedPageFolderValue(String value, boolean isRandom, int amount) {
       
    63 		this();
       
    64 		if(!isRandom){
       
    65 			setModeType(ModeTypes.RandomTypeNotRandom);			
       
    66 		}
       
    67 		else{
       
    68 			setModeType(ModeTypes.RandomTypeDefaultLength);
       
    69 		}
       
    70 		setValue(value);
       
    71 		setAmount(amount);
       
    72 	}
       
    73 	
       
    74 	/**
       
    75 	 * Creates new NoteValue with no random and no amount.
       
    76 	 * random value is set to {@link ModeTypes#RandomTypeNotRandom} and
       
    77 	 * amount is set to 0.
       
    78 	 * @param value
       
    79 	 */
       
    80 	public SavedPageFolderValue(String value) {
       
    81 		this();
       
    82 		setValue(value);
       
    83 		setModeType(ModeTypes.RandomTypeNotRandom);
       
    84 		setAmount(0);
       
    85 	}	
       
    86 	
       
    87 	/**
       
    88 	 * Creates new NoteValue.
       
    89 	 * Attributes is set by default;
       
    90 	 *  - random value is set to {@link ModeTypes#RandomTypeDefaultLength}
       
    91 	 *  - random is set to true
       
    92 	 *  - value is set to EMPTY_STRING 
       
    93 	 *  - amount is set to 0.
       
    94 	 */
       
    95 	public SavedPageFolderValue() {
       
    96 		super(CreatorEditorSettings.TYPE_SAVED_PAGE_FOLDER);
       
    97 	}	
       
    98 
       
    99 }