uidesigner/com.nokia.sdt.series60.componentlibrary/components/menu/SystemMenuPane.js
author dan.podwall@nokia.com
Mon, 06 Apr 2009 14:00:50 -0500
changeset 50 9107fae37cee
parent 2 d760517a8095
permissions -rw-r--r--
merge on RCL_2_0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
cawthron
parents:
diff changeset
     1
/*
cawthron
parents:
diff changeset
     2
* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
cawthron
parents:
diff changeset
     3
* All rights reserved.
cawthron
parents:
diff changeset
     4
* This component and the accompanying materials are made available
cawthron
parents:
diff changeset
     5
* under the terms of the License "Eclipse Public License v1.0"
cawthron
parents:
diff changeset
     6
* which accompanies this distribution, and is available
cawthron
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
cawthron
parents:
diff changeset
     8
*
cawthron
parents:
diff changeset
     9
* Initial Contributors:
cawthron
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
cawthron
parents:
diff changeset
    11
*
cawthron
parents:
diff changeset
    12
* Contributors:
cawthron
parents:
diff changeset
    13
*
cawthron
parents:
diff changeset
    14
* Description: 
cawthron
parents:
diff changeset
    15
*
cawthron
parents:
diff changeset
    16
*/
cawthron
parents:
diff changeset
    17
cawthron
parents:
diff changeset
    18
cawthron
parents:
diff changeset
    19
include("../containers/containerLibrary.js")
cawthron
parents:
diff changeset
    20
include("../implLibrary.js")
cawthron
parents:
diff changeset
    21
cawthron
parents:
diff changeset
    22
function SystemMenuPane() {
cawthron
parents:
diff changeset
    23
}
cawthron
parents:
diff changeset
    24
cawthron
parents:
diff changeset
    25
cawthron
parents:
diff changeset
    26
// IQueryContainment
cawthron
parents:
diff changeset
    27
cawthron
parents:
diff changeset
    28
function canContainComponent(instance, component) {
cawthron
parents:
diff changeset
    29
	if (component.id == "com.nokia.sdt.series60.SystemMenuItem")
cawthron
parents:
diff changeset
    30
		return null;
cawthron
parents:
diff changeset
    31
	return buildSimpleContainmentErrorStatus(
cawthron
parents:
diff changeset
    32
			lookupString("systemMenuPaneContainmentErr"), []);			
cawthron
parents:
diff changeset
    33
}
cawthron
parents:
diff changeset
    34
cawthron
parents:
diff changeset
    35
SystemMenuPane.prototype.canContainComponent = function(instance, otherComponent) {
cawthron
parents:
diff changeset
    36
	return canContainComponent(instance, otherComponent);
cawthron
parents:
diff changeset
    37
}
cawthron
parents:
diff changeset
    38
cawthron
parents:
diff changeset
    39
SystemMenuPane.prototype.canContainChild = function(instance, child) {
cawthron
parents:
diff changeset
    40
	return canContainComponent(instance, child.component);
cawthron
parents:
diff changeset
    41
}
cawthron
parents:
diff changeset
    42
cawthron
parents:
diff changeset
    43
SystemMenuPane.prototype.canRemoveChild = function(instance) {
cawthron
parents:
diff changeset
    44
	return false;
cawthron
parents:
diff changeset
    45
}
cawthron
parents:
diff changeset
    46
cawthron
parents:
diff changeset
    47
SystemMenuPane.prototype.isValidComponentInPalette = function(instance, otherComponent) {
cawthron
parents:
diff changeset
    48
	return false;
cawthron
parents:
diff changeset
    49
}
cawthron
parents:
diff changeset
    50
cawthron
parents:
diff changeset
    51
// IComponentValidator
cawthron
parents:
diff changeset
    52
SystemMenuPane.prototype.validate = function(instance) {
cawthron
parents:
diff changeset
    53
	if (instance.properties.systemResourceName == "") {
cawthron
parents:
diff changeset
    54
		var modelMessage = newModelMessage(IStatus.WARNING, 
cawthron
parents:
diff changeset
    55
			formatString(lookupString("NoSystemMenuResource"), 
cawthron
parents:
diff changeset
    56
				[instance.name ]), 
cawthron
parents:
diff changeset
    57
			instance, "systemResourceName", null);
cawthron
parents:
diff changeset
    58
		return [ modelMessage ];
cawthron
parents:
diff changeset
    59
	}
cawthron
parents:
diff changeset
    60
	return null;
cawthron
parents:
diff changeset
    61
}
cawthron
parents:
diff changeset
    62
cawthron
parents:
diff changeset
    63
SystemMenuPane.prototype.queryPropertyChange = function(instance, propertyPath, newValue) {
cawthron
parents:
diff changeset
    64
	return null;
cawthron
parents:
diff changeset
    65
}
cawthron
parents:
diff changeset
    66