r24958: This is the final text, and the final version. I'll send the release
[jelmer/samba4-debian.git] / webapps / qooxdoo-0.6.5-sdk / frontend / framework / source / class / qx / ui / menu / Separator.js
1 /* ************************************************************************
2
3    qooxdoo - the new era of web development
4
5    http://qooxdoo.org
6
7    Copyright:
8      2004-2007 1&1 Internet AG, Germany, http://www.1and1.org
9
10    License:
11      LGPL: http://www.gnu.org/licenses/lgpl.html
12      EPL: http://www.eclipse.org/org/documents/epl-v10.php
13      See the LICENSE file in the project's top-level directory for details.
14
15    Authors:
16      * Sebastian Werner (wpbasti)
17      * Andreas Ecker (ecker)
18
19 ************************************************************************ */
20
21 /* ************************************************************************
22
23 #module(ui_menu)
24
25 ************************************************************************ */
26
27 qx.OO.defineClass("qx.ui.menu.Separator", qx.ui.layout.CanvasLayout,
28 function()
29 {
30   qx.ui.layout.CanvasLayout.call(this);
31
32   // Fix IE Styling Issues
33   this.setStyleProperty("fontSize", "0");
34   this.setStyleProperty("lineHeight", "0");
35
36   // ************************************************************************
37   //   LINE
38   // ************************************************************************
39
40   this._line = new qx.ui.basic.Terminator;
41   this._line.setAnonymous(true);
42   this._line.setAppearance("menu-separator-line");
43   this.add(this._line);
44
45
46   // ************************************************************************
47   //   EVENTS
48   // ************************************************************************
49
50   // needed to stop the event, and keep the menu showing
51   this.addEventListener("mousedown", this._onmousedown);
52 });
53
54 qx.OO.changeProperty({ name : "appearance", type : "string", defaultValue : "menu-separator" });
55
56 qx.Proto.hasIcon = qx.lang.Function.returnFalse;
57 qx.Proto.hasLabel = qx.lang.Function.returnFalse;
58 qx.Proto.hasShortcut = qx.lang.Function.returnFalse;
59 qx.Proto.hasMenu = qx.lang.Function.returnFalse;
60
61 qx.Proto._onmousedown = function(e) {
62   e.stopPropagation();
63 }
64
65 qx.Proto.dispose = function()
66 {
67   if (this.getDisposed()) {
68     return true;
69   }
70
71   if (this._line)
72   {
73     this._line.dispose();
74     this._line = null;
75   }
76
77   return qx.ui.layout.CanvasLayout.prototype.dispose.call(this);
78 }