uidesigner/com.nokia.sdt.series60.componentlibrary/components/menu/MenuItemBase.js
author Deepak Modgil <Deepak.Modgil@Nokia.com>
Fri, 03 Apr 2009 23:33:03 +0100
changeset 0 fb279309251b
permissions -rw-r--r--
DP tools release version Revision: 200912

/*
* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of the License "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description: 
*
*/


include("../messageLibrary.js")
include("../implLibrary.js")

function MenuItemBase() {

}

// IComponentValidator
MenuItemBase.prototype.validate = function(instance) {

	var messages = null;
	
	// cannot have a "selected" event if a submenu is present
	if (instance.children.length != 0 && "selected" in instance.events) {
		var messages = new java.util.ArrayList();
		var modelMessage = newModelMessage(IStatus.WARNING, 
			formatString(
				lookupString("selectedEventInCascadingMenuItem"), 
				[ instance.name ]), 
			instance, null, "selected");
		messages.add(modelMessage);
	} 
	return messages;
}

MenuItemBase.prototype.queryPropertyChange = function(instance, propertyId, newValue) {
	return null;
}