MCPcopy Create free account
hub / github.com/java-native-access/jna / getComponentID

Method getComponentID

src/com/sun/jna/Native.java:2542–2563  ·  view source on GitHub ↗
(Object o)

Source from the content-addressed store, hash-verified

2540 // Declaring the argument as Object rather than Component avoids class not
2541 // found errors on phoneME foundation profile.
2542 static long getComponentID(Object o) throws HeadlessException {
2543 if (GraphicsEnvironment.isHeadless()) {
2544 throw new HeadlessException("No native windows when headless");
2545 }
2546 Component c = (Component)o;
2547 if (c.isLightweight()) {
2548 throw new IllegalArgumentException("Component must be heavyweight");
2549 }
2550 if (!c.isDisplayable())
2551 throw new IllegalStateException("Component must be displayable");
2552 // On X11 VMs prior to 1.5, the window must be visible
2553 if (Platform.isX11()
2554 && System.getProperty("java.version").startsWith("1.4")) {
2555 if (!c.isVisible()) {
2556 throw new IllegalStateException("Component must be visible");
2557 }
2558 }
2559 // By this point, we're certain that Toolkit.loadLibraries() has
2560 // been called, thus avoiding AWT/JAWT link errors
2561 // (see http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6539705).
2562 return Native.getWindowHandle0(c);
2563 }
2564 }
2565}

Callers 3

getComponentIDMethod · 0.95
getComponentPointerMethod · 0.95
getWindowIDMethod · 0.95

Calls 4

isX11Method · 0.95
getWindowHandle0Method · 0.95
isVisibleMethod · 0.80
getPropertyMethod · 0.65

Tested by

no test coverage detected