Cross Reference: CMenuItem.m
xref
: /
openjdk7
/
jdk
/
src
/
macosx
/
native
/
sun
/
awt
/
CMenuItem.m
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
4632
N/A
/*
6072
N/A
* Copyright (c) 2011, 2013, Oracle
and
/
or
its affiliates. All rights reserved.
4632
N/A
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4632
N/A
*
4632
N/A
* This code is free software; you can redistribute it
and
/
or
modify it
4632
N/A
* under the terms of the GNU General Public License version 2 only, as
4632
N/A
* published by the Free Software Foundation. Oracle designates this
4632
N/A
* particular file as subject to the "Classpath" exception as provided
4632
N/A
* by Oracle in the LICENSE file that accompanied this code.
4632
N/A
*
4632
N/A
* This code is distributed in the hope that it will be useful, but WITHOUT
4632
N/A
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
4632
N/A
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
4632
N/A
* version 2 for more details (a copy is included in the LICENSE file that
4632
N/A
* accompanied this code).
4632
N/A
*
4632
N/A
* You should have received a copy of the GNU General Public License version
4632
N/A
* 2 along with this work; if not, write to the Free Software Foundation,
4632
N/A
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
4632
N/A
*
4632
N/A
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
4632
N/A
* or visit www.oracle.com if you need additional information or have any
4632
N/A
* questions.
4632
N/A
*/
4632
N/A
4632
N/A
#
import
<
JavaNativeFoundation/JavaNativeFoundation.h
>
4632
N/A
4632
N/A
#
import
"CMenuItem.h"
4632
N/A
#
import
"CMenu.h"
4632
N/A
#
import
"AWTEvent.h"
4632
N/A
#
import
"ThreadUtilities.h"
4632
N/A
4632
N/A
#
import
"java_awt_Event.h"
4632
N/A
#
import
"java_awt_event_KeyEvent.h"
4632
N/A
#
import
"sun_lwawt_macosx_CMenuItem.h"
4632
N/A
4632
N/A
#
define
NOT_A_CHECKBOXMENU
-
2
4632
N/A
4632
N/A
4632
N/A
@
implementation
CMenuItem
4632
N/A
4632
N/A
- (
id
)
initWithPeer
:(
jobject
)
peer
asSeparator
: (
NSNumber
*)
asSeparator
{
4632
N/A
AWT_ASSERT_APPKIT_THREAD
;
4632
N/A
self
= [
super
initWithPeer
:
peer
];
4632
N/A
if
(
self
) {
4632
N/A
if
([
asSeparator
boolValue
]) {
4632
N/A
fMenuItem
= (
NSMenuItem
*)[
NSMenuItem
separatorItem
];
4632
N/A
[
fMenuItem
retain
];
4632
N/A
}
else
{
4632
N/A
fMenuItem
= [[
NSMenuItem
alloc
]
init
];
4632
N/A
[
fMenuItem
setAction
:@
selector
(
handleAction
:)];
4632
N/A
[
fMenuItem
setTarget
:
self
];
4632
N/A
}
4632
N/A
fIsCheckbox
=
NO
;
4632
N/A
fIsEnabled
=
YES
;
4632
N/A
}
4632
N/A
return
self
;
4632
N/A
}
4632
N/A
4632
N/A
// This is because NSApplication doesn't check the target's window when sending
4632
N/A
// actions; they only check the target itself. We always return YES,
4632
N/A
// since we shouldn't even be installed unless our window is active.
4632
N/A
- (
BOOL
)
worksWhenModal
{
4632
N/A
return
YES
;
4632
N/A
}
4632
N/A
4632
N/A
// Events
4632
N/A
- (
void
)
handleAction
:(
NSMenuItem
*)
sender
{
4632
N/A
AWT_ASSERT_APPKIT_THREAD
;
4632
N/A
JNIEnv
*
env
= [
ThreadUtilities
getJNIEnv
];
4632
N/A
JNF_COCOA_ENTER
(
env
);
Error!
Full Search
Definition
Symbol
File Path
History
In Project(s)
select all
invert selection
ast
bind-9.11.3
bind-9.6-ESV-R11
dovecot
ec
forgerock
gkrellm-k10addon
glassfish
glassfish-3.1.2
glassfish.hg
hets
httpd
illumos-gate
inkscape
javamail
k10sensor
libmicro
lucene-3.6.0
lxc
ontohub
opengrok
opengrok-jel
opengrok-sun
openjdk7
osnet-11
owl-s
pkg
scfdot
sendmail
solaris-desktop
solaris-userland
solaris-userland-s11u3
solaris-x11-s11
solaris-x11-s12
sssd
sssd-io
systemd
vbox
yui3
Search
Clear
Help
There was an error!
null
java.lang.NullPointerException