--- title: Component Extensions order: 6 layout: page --- [[components.extensions]] = Component Extensions Components and UIs can have extensions which are attached to the component dynamically. Especially, many add-ons are extensions. How a component is extended depends on the extension. Typically, they have an [methodname]#extend()# method that takes the component to be extended as the parameter. [source, java] ---- TextField tf = new TextField("Hello"); layout.addComponent(tf); // Add a simple extension new CapsLockWarning().extend(tf); // Add an extension that requires some parameters CSValidator validator = new CSValidator(); validator.setRegExp("[0-9]*"); validator.setErrorMessage("Must be a number"); validator.extend(tf); ---- Development of custom extensions is described in <>. The official jQuery user interface library: https://github.com/jquery/jquery-uiwww-data
aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/selectmenu/selectmenu_options.js
blob: 440df04be0ee6f45d09085974bc2e118d84d0270 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
(function ($) {

module("selectmenu: options");

test("appendTo another element", function () {
	expect(2);

	var element = $("#speed").selectmenu();

	ok(element.selectmenu("option", "appendTo", "#qunit-fixture"), "appendTo accepts selector");
	ok($("#qunit-fixture").find(".ui-selectmenu-menu").length, "selectmenu appendedTo other element");
});


test("dropdown: CSS styles", function () {
	expect(2);

	var element = $("#speed").selectmenu(),
		button = element.selectmenu("widget"),
		menu = element.selectmenu("menuWidget");

	element.selectmenu("open");
	ok( button.hasClass("ui-corner-top") && !button.hasClass("ui-corner-all") && button.find("span.ui-icon").hasClass("ui-icon-triangle-1-s"), "button styles dropdown");
	ok( menu.hasClass("ui-corner-bottom") && !menu.hasClass("ui-corner-all"), "menu styles dropdown");
});

test("pop-up: CSS styles", function () {
	expect(2);

	var element = $("#speed").selectmenu({
			dropdown: false
		}),
		button = element.selectmenu("widget"),
		menu = element.selectmenu("menuWidget");

	element.selectmenu("close");
	ok( !button.hasClass("ui-corner-top") && button.hasClass("ui-corner-all") && button.find("span.ui-icon").hasClass("ui-icon-triangle-2-n-s"), "button styles pop-up");
	ok( !menu.hasClass("ui-corner-bottom") && menu.hasClass("ui-corner-all"), "menu styles pop-up");
});

})(jQuery);