creatorextension/com.nokia.s60tools.creator/src/com/nokia/s60tools/creator/components/note/Note.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.note;
       
    19 
       
    20 
       
    21 import com.nokia.s60tools.creator.components.AbstractComponent;
       
    22 import com.nokia.s60tools.creator.components.AbstractVariables;
       
    23 import com.nokia.s60tools.creator.core.CreatorEditorSettings;
       
    24 
       
    25 
       
    26 /**
       
    27  * Class representing Note
       
    28  */
       
    29 public class Note extends AbstractComponent {
       
    30 
       
    31 
       
    32 	public Note(int id) {
       
    33 		super(id);
       
    34 	}	
       
    35 	
       
    36 	
       
    37 
       
    38 	/* (non-Javadoc)
       
    39 	 * @see com.nokia.s60tools.creator.components.config.AbstractComponent#getType()
       
    40 	 */
       
    41 	public String getType() {
       
    42 		return CreatorEditorSettings.TYPE_NOTE;
       
    43 	}
       
    44 
       
    45 	
       
    46 	/* (non-Javadoc)
       
    47 	 * @see com.nokia.s60tools.creator.components.AbstractComponent#isValid()
       
    48 	 */
       
    49 	public boolean isValid() {
       
    50 		return true;
       
    51 	}
       
    52 
       
    53 	/* (non-Javadoc)
       
    54 	 * @see com.nokia.s60tools.creator.components.AbstractComponent#getIdByValue(java.lang.String)
       
    55 	 */
       
    56 	public String getIdByValue(String value) {		
       
    57 		return NoteVariables.getInstance().getIdByValue(value);
       
    58 	}
       
    59 
       
    60 
       
    61 
       
    62 	
       
    63 	/* (non-Javadoc)
       
    64 	 * @see com.nokia.s60tools.creator.components.AbstractComponent#getValueById(java.lang.String)
       
    65 	 */
       
    66 	public String getValueById(String id) {		
       
    67 		return NoteVariables.getInstance().getValueById(id);
       
    68 	}
       
    69 
       
    70 
       
    71 
       
    72 	
       
    73 	/* (non-Javadoc)
       
    74 	 * @see com.nokia.s60tools.creator.components.AbstractComponent#getXMLElementName()
       
    75 	 */
       
    76 	public String getXMLElementName() {
       
    77 		return CreatorEditorSettings.TYPE_NOTE_XML_ELEMENT;
       
    78 	}
       
    79 	
       
    80 	/* (non-Javadoc)
       
    81 	 * @see com.nokia.s60tools.creator.components.AbstractComponent#getValuesForItemType(java.lang.String)
       
    82 	 */
       
    83 	public String[] getValuesForItemType(String itemType) {
       
    84 		//If there is not this type of item at all
       
    85 		String idByValue = getIdByValue(itemType);
       
    86 		if(idByValue == null){
       
    87 			return null;
       
    88 		}
       
    89 		return NoteVariables.getInstance().getValuesForItemType(idByValue);
       
    90 	}
       
    91 
       
    92 	
       
    93 	/* (non-Javadoc)
       
    94 	 * @see com.nokia.s60tools.creator.components.AbstractComponent#getVariables()
       
    95 	 */
       
    96 	public AbstractVariables getVariables(){
       
    97 		return NoteVariables.getInstance();
       
    98 	}		
       
    99 }