JDK 17 java.desktop.jmod - Desktop Module

JDK 17 java.desktop.jmod is the JMOD file for JDK 17 Desktop module.

JDK 17 Desktop module compiled class files are stored in \fyicenter\jdk-17.0.5\jmods\java.desktop.jmod.

JDK 17 Desktop module compiled class files are also linked and stored in the \fyicenter\jdk-17.0.5\lib\modules JImage file.

JDK 17 Desktop module source code files are stored in \fyicenter\jdk-17.0.5\lib\src.zip\java.desktop.

You can click and view the content of each source code file in the list below.

✍: FYIcenter

com/apple/eawt/_AppDockIconHandler.java

/*
 * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
 * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 */

package com.apple.eawt;

import java.awt.*;
import java.lang.reflect.*;

import sun.awt.AWTAccessor;
import sun.lwawt.macosx.*;
import sun.lwawt.macosx.CImage.Creator;

class _AppDockIconHandler {
    private static native void nativeSetDockMenu(final long cmenu);
    private static native void nativeSetDockIconImage(final long image);
    private static native void nativeSetDockIconProgress(final int value);
    private static native long nativeGetDockIconImage();
    private static native void nativeSetDockIconBadge(final String badge);

    PopupMenu fDockMenu = null;

    _AppDockIconHandler() { }

    public void setDockMenu(final PopupMenu menu) {
        fDockMenu = menu;

        // clear the menu if explicitly passed null
        if (menu == null) {
            nativeSetDockMenu(0);
            return;
        }

        // check if the menu needs a parent (8343136)
        final MenuContainer container = menu.getParent();
        if (container == null) {
            final MenuBar newParent = new MenuBar();
            newParent.add(menu);
            newParent.addNotify();
        }

        // instantiate the menu peer and set the native fDockMenu ivar
        menu.addNotify();
        CMenu peer = AWTAccessor.getMenuComponentAccessor().getPeer(fDockMenu);
        nativeSetDockMenu(peer.getNativeMenu());
    }

    public PopupMenu getDockMenu() {
        return fDockMenu;
    }

    public void setDockIconImage(final Image image) {
        try {
            final CImage cImage = CImage.createFromImage(image);
            cImage.execute(_AppDockIconHandler::nativeSetDockIconImage);
        } catch (final Throwable e) {
            throw new RuntimeException(e);
        }
    }

    Image getDockIconImage() {
        try {
            final long dockNSImage = nativeGetDockIconImage();
            if (dockNSImage == 0) return null;
            final Method getCreatorMethod = CImage.class.getDeclaredMethod(
                    "getCreator", new Class<?>[]{});
            getCreatorMethod.setAccessible(true);
            Creator imageCreator = (Creator) getCreatorMethod.invoke(null, new Object[]{});
            return imageCreator.createImageUsingNativeSize(dockNSImage);
        } catch (final Throwable e) {
            throw new RuntimeException(e);
        }
    }

    void setDockIconBadge(final String badge) {
        nativeSetDockIconBadge(badge);
    }

    void setDockIconProgress(int value) {
        nativeSetDockIconProgress(value);
    }
}

com/apple/eawt/_AppDockIconHandler.java

 

Or download all of them as a single archive file:

File name: java.desktop-17.0.5-src.zip
File size: 9152233 bytes
Release date: 2022-09-13
Download 

 

JDK 17 java.instrument.jmod - Instrument Module

JDK 17 java.datatransfer.jmod - Data Transfer Module

JDK 17 JMod/Module Files

⇑⇑ FAQ for JDK (Java Development Kit) 17

2023-09-16, 29951👍, 0💬