~ubuntu-branches/debian/sid/java-gnome/sid

« back to all changes in this revision

Viewing changes to src/bindings/org/gnome/gtk/Menu.java

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2010-04-11 21:28:43 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20100411212843-g18x13q4fn02ox4a
Tags: 4.0.15-1
* Team upload
* New upstream release
* Change maintainers into Maintainers.
* Remove Thomas from Uploaders.
* Switch to source format 3.0.
* Update Standards-Version: 3.8.4.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Menu.java
3
 
 *
4
 
 * Copyright (c) 2007 Operational Dynamics Consulting Pty Ltd, and Others
5
 
 *
6
 
 * The code in this file, and the library it is a part of, are made available
7
 
 * to you by the authors under the terms of the "GNU General Public Licence,
8
 
 * version 2" plus the "Classpath Exception" (you may link to this code as a
9
 
 * library into other programs provided you don't make a derivation of it).
10
 
 * See the LICENCE file for the terms governing usage and redistribution.
 
2
 * java-gnome, a UI library for writing GTK and GNOME programs from Java!
 
3
 *
 
4
 * Copyright © 2007-2010 Operational Dynamics Consulting, Pty Ltd and Others
 
5
 *
 
6
 * The code in this file, and the program it is a part of, is made available
 
7
 * to you by its authors as open source software: you can redistribute it
 
8
 * and/or modify it under the terms of the GNU General Public License version
 
9
 * 2 ("GPL") as published by the Free Software Foundation.
 
10
 *
 
11
 * This program is distributed in the hope that it will be useful, but WITHOUT
 
12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 
13
 * FITNESS FOR A PARTICULAR PURPOSE. See the GPL for more details.
 
14
 *
 
15
 * You should have received a copy of the GPL along with this program. If not,
 
16
 * see http://www.gnu.org/licenses/. The authors of this program may be
 
17
 * contacted through http://java-gnome.sourceforge.net/.
 
18
 *
 
19
 * Linking this library statically or dynamically with other modules is making
 
20
 * a combined work based on this library. Thus, the terms and conditions of
 
21
 * the GPL cover the whole combination. As a special exception (the
 
22
 * "Claspath Exception"), the copyright holders of this library give you
 
23
 * permission to link this library with independent modules to produce an
 
24
 * executable, regardless of the license terms of these independent modules,
 
25
 * and to copy and distribute the resulting executable under terms of your
 
26
 * choice, provided that you also meet, for each linked independent module,
 
27
 * the terms and conditions of the license of that module. An independent
 
28
 * module is a module which is not derived from or based on this library. If
 
29
 * you modify this library, you may extend the Classpath Exception to your
 
30
 * version of the library, but you are not obligated to do so. If you do not
 
31
 * wish to do so, delete this exception statement from your version.
11
32
 */
12
33
package org.gnome.gtk;
13
34
 
46
67
 
47
68
    /**
48
69
     * Construct a new Menu.
 
70
     * 
 
71
     * @since 4.0.3
49
72
     */
50
73
    public Menu() {
51
74
        super(GtkMenu.createMenu());
53
76
 
54
77
    /**
55
78
     * Popup a context menu. Use this when you create a Menu that will be used
56
 
     * for the popup context menu in response to a right-click somewhere. TODO
57
 
     * add example code showing hooking up a mouse button click handler.
 
79
     * for the popup context menu in response to a right-click somewhere. The
 
80
     * menu will appear where the mouse pointer is.
58
81
     * 
59
82
     * <p>
60
83
     * Unlike normal Menus that are part of an application's MenuBar, context
70
93
    }
71
94
 
72
95
    /**
 
96
     * Having constructed a Menu to be used as the context menu, present it at
 
97
     * the specified location. This is useful in conjunction with TextView's
 
98
     * {@link TextView#getLocation(TextIter) getLocation()} if you wish to
 
99
     * place the menu at the "cursor position" rather than where the mouse
 
100
     * pointer is.
 
101
     * 
 
102
     * @since 4.0.15
 
103
     */
 
104
    public void popup(int x, int y) {
 
105
        GtkMenuOverride.popupAtPosition(this, x, y);
 
106
    }
 
107
 
 
108
    /**
73
109
     * A special case for popping up the context menu associated with a
74
110
     * StatusIcon. Having constructed a Menu to be used as the context menu,
75
111
     * you then call this from the <code>StatusIcon.PopupMenu</code> signal