Java Code Examples for sun.awt.shell.ShellFolder#invoke()

The following examples show how to use sun.awt.shell.ShellFolder#invoke() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DarkFilePaneUIBridge.java    From darklaf with MIT License 5 votes vote down vote up
@Override
public void sort() {
    ShellFolder.invoke((Callable<Void>) () -> {
        DetailsTableRowSorter.super.sort();
        return null;
    });
}
 
Example 2
Source File: WTaskbarPeer.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private static synchronized void init() {
    if (!initExecuted) {
        supported = OSInfo.getWindowsVersion()
                .compareTo(OSInfo.WINDOWS_7) >= 0
                && ShellFolder.invoke(() -> nativeInit());
    }
    initExecuted = true;
}
 
Example 3
Source File: WTaskbarPeer.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void setWindowIconBadge(Window window, final Image image) {
    WWindowPeer wp = AWTAccessor.getComponentAccessor().getPeer(window);
    if (wp != null) {
        int[] buffer = imageToArray(image);
        ShellFolder.invoke(() -> {
           setOverlayIcon(wp.getHWnd(), buffer,
                            buffer != null ? image.getWidth(null) : 0,
                            buffer != null ? image.getHeight(null) : 0);
           return null;
        });
    }
}
 
Example 4
Source File: WTaskbarPeer.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void setWindowProgressValue(Window window, int value) {
    WWindowPeer wp = AWTAccessor.getComponentAccessor().getPeer(window);
    if (wp != null) {
        ShellFolder.invoke(() -> {
            setProgressValue(wp.getHWnd(), value);
            return null;
        });
    }
}
 
Example 5
Source File: WTaskbarPeer.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void setWindowProgressState(Window window, State state) {
    WWindowPeer wp = AWTAccessor.getComponentAccessor().getPeer(window);
    if (wp != null) {
        ShellFolder.invoke(() -> {
            setProgressState(wp.getHWnd(), state);
            return null;
        });
    }
}
 
Example 6
Source File: bug6741890.java    From jdk8u-dev-jdk with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String[] args) throws Exception {
    if (OSInfo.getOSType() != OSInfo.OSType.WINDOWS) {
        System.out.println("The test is applicable only for Windows. Skipped.");

        return;
    }

    String tmpDir = System.getProperty("java.io.tmpdir");

    if (tmpDir.length() == 0) { //'java.io.tmpdir' isn't guaranteed to be defined
        tmpDir = System.getProperty("user.home");
    }

    final ShellFolder tmpFile = ShellFolder.getShellFolder(new File(tmpDir));

    System.out.println("Temp directory: " + tmpDir);

    System.out.println("Stress test was run");

    Thread thread = new Thread() {
        public void run() {
            while (!isInterrupted()) {
                ShellFolder.invoke(new Callable<Void>() {
                    public Void call() throws Exception {
                        synchronized (mux) {
                            tmpFile.isFileSystem();
                            tmpFile.isLink();
                        }

                        return null;
                    }
                });
            }
        }
    };

    thread.start();

    for (int i = 0; i < COUNT; i++) {
        synchronized (mux) {
            clearField(tmpFile, "cachedIsLink");
            clearField(tmpFile, "cachedIsFileSystem");
        }

        tmpFile.isFileSystem();
        tmpFile.isLink();
    }

    thread.interrupt();
    thread.join();

    System.out.println("Test passed successfully");
}
 
Example 7
Source File: bug6741890.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String[] args) throws Exception {
    if (OSInfo.getOSType() != OSInfo.OSType.WINDOWS) {
        System.out.println("The test is applicable only for Windows. Skipped.");

        return;
    }

    String tmpDir = System.getProperty("java.io.tmpdir");

    if (tmpDir.length() == 0) { //'java.io.tmpdir' isn't guaranteed to be defined
        tmpDir = System.getProperty("user.home");
    }

    final ShellFolder tmpFile = ShellFolder.getShellFolder(new File(tmpDir));

    System.out.println("Temp directory: " + tmpDir);

    System.out.println("Stress test was run");

    Thread thread = new Thread() {
        public void run() {
            while (!isInterrupted()) {
                ShellFolder.invoke(new Callable<Void>() {
                    public Void call() throws Exception {
                        synchronized (mux) {
                            tmpFile.isFileSystem();
                            tmpFile.isLink();
                        }

                        return null;
                    }
                });
            }
        }
    };

    thread.start();

    for (int i = 0; i < COUNT; i++) {
        synchronized (mux) {
            clearField(tmpFile, "cachedIsLink");
            clearField(tmpFile, "cachedIsFileSystem");
        }

        tmpFile.isFileSystem();
        tmpFile.isLink();
    }

    thread.interrupt();
    thread.join();

    System.out.println("Test passed successfully");
}
 
Example 8
Source File: bug6741890.java    From jdk8u_jdk with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String[] args) throws Exception {
    if (OSInfo.getOSType() != OSInfo.OSType.WINDOWS) {
        System.out.println("The test is applicable only for Windows. Skipped.");

        return;
    }

    String tmpDir = System.getProperty("java.io.tmpdir");

    if (tmpDir.length() == 0) { //'java.io.tmpdir' isn't guaranteed to be defined
        tmpDir = System.getProperty("user.home");
    }

    final ShellFolder tmpFile = ShellFolder.getShellFolder(new File(tmpDir));

    System.out.println("Temp directory: " + tmpDir);

    System.out.println("Stress test was run");

    Thread thread = new Thread() {
        public void run() {
            while (!isInterrupted()) {
                ShellFolder.invoke(new Callable<Void>() {
                    public Void call() throws Exception {
                        synchronized (mux) {
                            tmpFile.isFileSystem();
                            tmpFile.isLink();
                        }

                        return null;
                    }
                });
            }
        }
    };

    thread.start();

    for (int i = 0; i < COUNT; i++) {
        synchronized (mux) {
            clearField(tmpFile, "cachedIsLink");
            clearField(tmpFile, "cachedIsFileSystem");
        }

        tmpFile.isFileSystem();
        tmpFile.isLink();
    }

    thread.interrupt();
    thread.join();

    System.out.println("Test passed successfully");
}
 
Example 9
Source File: bug6741890.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String[] args) throws Exception {
    if (OSInfo.getOSType() != OSInfo.OSType.WINDOWS) {
        System.out.println("The test is applicable only for Windows. Skipped.");

        return;
    }

    String tmpDir = System.getProperty("java.io.tmpdir");

    if (tmpDir.length() == 0) { //'java.io.tmpdir' isn't guaranteed to be defined
        tmpDir = System.getProperty("user.home");
    }

    final ShellFolder tmpFile = ShellFolder.getShellFolder(new File(tmpDir));

    System.out.println("Temp directory: " + tmpDir);

    System.out.println("Stress test was run");

    Thread thread = new Thread() {
        public void run() {
            while (!isInterrupted()) {
                ShellFolder.invoke(new Callable<Void>() {
                    public Void call() throws Exception {
                        synchronized (mux) {
                            tmpFile.isFileSystem();
                            tmpFile.isLink();
                        }

                        return null;
                    }
                });
            }
        }
    };

    thread.start();

    for (int i = 0; i < COUNT; i++) {
        synchronized (mux) {
            clearField(tmpFile, "cachedIsLink");
            clearField(tmpFile, "cachedIsFileSystem");
        }

        tmpFile.isFileSystem();
        tmpFile.isLink();
    }

    thread.interrupt();
    thread.join();

    System.out.println("Test passed successfully");
}
 
Example 10
Source File: bug6741890.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String[] args) throws Exception {
    if (OSInfo.getOSType() != OSInfo.OSType.WINDOWS) {
        System.out.println("The test is applicable only for Windows. Skipped.");

        return;
    }

    String tmpDir = System.getProperty("java.io.tmpdir");

    if (tmpDir.length() == 0) { //'java.io.tmpdir' isn't guaranteed to be defined
        tmpDir = System.getProperty("user.home");
    }

    final ShellFolder tmpFile = ShellFolder.getShellFolder(new File(tmpDir));

    System.out.println("Temp directory: " + tmpDir);

    System.out.println("Stress test was run");

    Thread thread = new Thread() {
        public void run() {
            while (!isInterrupted()) {
                ShellFolder.invoke(new Callable<Void>() {
                    public Void call() throws Exception {
                        synchronized (mux) {
                            tmpFile.isFileSystem();
                            tmpFile.isLink();
                        }

                        return null;
                    }
                });
            }
        }
    };

    thread.start();

    for (int i = 0; i < COUNT; i++) {
        synchronized (mux) {
            clearField(tmpFile, "cachedIsLink");
            clearField(tmpFile, "cachedIsFileSystem");
        }

        tmpFile.isFileSystem();
        tmpFile.isLink();
    }

    thread.interrupt();
    thread.join();

    System.out.println("Test passed successfully");
}
 
Example 11
Source File: bug6741890.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String[] args) throws Exception {
    if (OSInfo.getOSType() != OSInfo.OSType.WINDOWS) {
        System.out.println("The test is applicable only for Windows. Skipped.");

        return;
    }

    String tmpDir = System.getProperty("java.io.tmpdir");

    if (tmpDir.length() == 0) { //'java.io.tmpdir' isn't guaranteed to be defined
        tmpDir = System.getProperty("user.home");
    }

    final ShellFolder tmpFile = ShellFolder.getShellFolder(new File(tmpDir));

    System.out.println("Temp directory: " + tmpDir);

    System.out.println("Stress test was run");

    Thread thread = new Thread() {
        public void run() {
            while (!isInterrupted()) {
                ShellFolder.invoke(new Callable<Void>() {
                    public Void call() throws Exception {
                        synchronized (mux) {
                            tmpFile.isFileSystem();
                            tmpFile.isLink();
                        }

                        return null;
                    }
                });
            }
        }
    };

    thread.start();

    for (int i = 0; i < COUNT; i++) {
        synchronized (mux) {
            clearField(tmpFile, "cachedIsLink");
            clearField(tmpFile, "cachedIsFileSystem");
        }

        tmpFile.isFileSystem();
        tmpFile.isLink();
    }

    thread.interrupt();
    thread.join();

    System.out.println("Test passed successfully");
}
 
Example 12
Source File: bug6741890.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String[] args) throws Exception {
    if (OSInfo.getOSType() != OSInfo.OSType.WINDOWS) {
        System.out.println("The test is applicable only for Windows. Skipped.");

        return;
    }

    String tmpDir = System.getProperty("java.io.tmpdir");

    if (tmpDir.length() == 0) { //'java.io.tmpdir' isn't guaranteed to be defined
        tmpDir = System.getProperty("user.home");
    }

    final ShellFolder tmpFile = ShellFolder.getShellFolder(new File(tmpDir));

    System.out.println("Temp directory: " + tmpDir);

    System.out.println("Stress test was run");

    Thread thread = new Thread() {
        public void run() {
            while (!isInterrupted()) {
                ShellFolder.invoke(new Callable<Void>() {
                    public Void call() throws Exception {
                        synchronized (mux) {
                            tmpFile.isFileSystem();
                            tmpFile.isLink();
                        }

                        return null;
                    }
                });
            }
        }
    };

    thread.start();

    for (int i = 0; i < COUNT; i++) {
        synchronized (mux) {
            clearField(tmpFile, "cachedIsLink");
            clearField(tmpFile, "cachedIsFileSystem");
        }

        tmpFile.isFileSystem();
        tmpFile.isLink();
    }

    thread.interrupt();
    thread.join();

    System.out.println("Test passed successfully");
}
 
Example 13
Source File: bug6741890.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String[] args) throws Exception {
    if (OSInfo.getOSType() != OSInfo.OSType.WINDOWS) {
        System.out.println("The test is applicable only for Windows. Skipped.");

        return;
    }

    String tmpDir = System.getProperty("java.io.tmpdir");

    if (tmpDir.length() == 0) { //'java.io.tmpdir' isn't guaranteed to be defined
        tmpDir = System.getProperty("user.home");
    }

    final ShellFolder tmpFile = ShellFolder.getShellFolder(new File(tmpDir));

    System.out.println("Temp directory: " + tmpDir);

    System.out.println("Stress test was run");

    Thread thread = new Thread() {
        public void run() {
            while (!isInterrupted()) {
                ShellFolder.invoke(new Callable<Void>() {
                    public Void call() throws Exception {
                        synchronized (mux) {
                            tmpFile.isFileSystem();
                            tmpFile.isLink();
                        }

                        return null;
                    }
                });
            }
        }
    };

    thread.start();

    for (int i = 0; i < COUNT; i++) {
        synchronized (mux) {
            clearField(tmpFile, "cachedIsLink");
            clearField(tmpFile, "cachedIsFileSystem");
        }

        tmpFile.isFileSystem();
        tmpFile.isLink();
    }

    thread.interrupt();
    thread.join();

    System.out.println("Test passed successfully");
}
 
Example 14
Source File: bug6741890.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String[] args) throws Exception {
    if (OSInfo.getOSType() != OSInfo.OSType.WINDOWS) {
        System.out.println("The test is applicable only for Windows. Skipped.");

        return;
    }

    String tmpDir = System.getProperty("java.io.tmpdir");

    if (tmpDir.length() == 0) { //'java.io.tmpdir' isn't guaranteed to be defined
        tmpDir = System.getProperty("user.home");
    }

    final ShellFolder tmpFile = ShellFolder.getShellFolder(new File(tmpDir));

    System.out.println("Temp directory: " + tmpDir);

    System.out.println("Stress test was run");

    Thread thread = new Thread() {
        public void run() {
            while (!isInterrupted()) {
                ShellFolder.invoke(new Callable<Void>() {
                    public Void call() throws Exception {
                        synchronized (mux) {
                            tmpFile.isFileSystem();
                            tmpFile.isLink();
                        }

                        return null;
                    }
                });
            }
        }
    };

    thread.start();

    for (int i = 0; i < COUNT; i++) {
        synchronized (mux) {
            clearField(tmpFile, "cachedIsLink");
            clearField(tmpFile, "cachedIsFileSystem");
        }

        tmpFile.isFileSystem();
        tmpFile.isLink();
    }

    thread.interrupt();
    thread.join();

    System.out.println("Test passed successfully");
}
 
Example 15
Source File: bug6741890.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String[] args) throws Exception {
    if (OSInfo.getOSType() != OSInfo.OSType.WINDOWS) {
        System.out.println("The test is applicable only for Windows. Skipped.");

        return;
    }

    String tmpDir = System.getProperty("java.io.tmpdir");

    if (tmpDir.length() == 0) { //'java.io.tmpdir' isn't guaranteed to be defined
        tmpDir = System.getProperty("user.home");
    }

    final ShellFolder tmpFile = ShellFolder.getShellFolder(new File(tmpDir));

    System.out.println("Temp directory: " + tmpDir);

    System.out.println("Stress test was run");

    Thread thread = new Thread() {
        public void run() {
            while (!isInterrupted()) {
                ShellFolder.invoke(new Callable<Void>() {
                    public Void call() throws Exception {
                        synchronized (mux) {
                            tmpFile.isFileSystem();
                            tmpFile.isLink();
                        }

                        return null;
                    }
                });
            }
        }
    };

    thread.start();

    for (int i = 0; i < COUNT; i++) {
        synchronized (mux) {
            clearField(tmpFile, "cachedIsLink");
            clearField(tmpFile, "cachedIsFileSystem");
        }

        tmpFile.isFileSystem();
        tmpFile.isLink();
    }

    thread.interrupt();
    thread.join();

    System.out.println("Test passed successfully");
}
 
Example 16
Source File: bug6741890.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String[] args) throws Exception {
    if (OSInfo.getOSType() != OSInfo.OSType.WINDOWS) {
        System.out.println("The test is applicable only for Windows. Skipped.");

        return;
    }

    String tmpDir = System.getProperty("java.io.tmpdir");

    if (tmpDir.length() == 0) { //'java.io.tmpdir' isn't guaranteed to be defined
        tmpDir = System.getProperty("user.home");
    }

    final ShellFolder tmpFile = ShellFolder.getShellFolder(new File(tmpDir));

    System.out.println("Temp directory: " + tmpDir);

    System.out.println("Stress test was run");

    Thread thread = new Thread() {
        public void run() {
            while (!isInterrupted()) {
                ShellFolder.invoke(new Callable<Void>() {
                    public Void call() throws Exception {
                        synchronized (mux) {
                            tmpFile.isFileSystem();
                            tmpFile.isLink();
                        }

                        return null;
                    }
                });
            }
        }
    };

    thread.start();

    for (int i = 0; i < COUNT; i++) {
        synchronized (mux) {
            clearField(tmpFile, "cachedIsLink");
            clearField(tmpFile, "cachedIsFileSystem");
        }

        tmpFile.isFileSystem();
        tmpFile.isLink();
    }

    thread.interrupt();
    thread.join();

    System.out.println("Test passed successfully");
}
 
Example 17
Source File: bug6741890.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String[] args) throws Exception {
    if (OSInfo.getOSType() != OSInfo.OSType.WINDOWS) {
        System.out.println("The test is applicable only for Windows. Skipped.");

        return;
    }

    String tmpDir = System.getProperty("java.io.tmpdir");

    if (tmpDir.length() == 0) { //'java.io.tmpdir' isn't guaranteed to be defined
        tmpDir = System.getProperty("user.home");
    }

    final ShellFolder tmpFile = ShellFolder.getShellFolder(new File(tmpDir));

    System.out.println("Temp directory: " + tmpDir);

    System.out.println("Stress test was run");

    Thread thread = new Thread() {
        public void run() {
            while (!isInterrupted()) {
                ShellFolder.invoke(new Callable<Void>() {
                    public Void call() throws Exception {
                        synchronized (mux) {
                            tmpFile.isFileSystem();
                            tmpFile.isLink();
                        }

                        return null;
                    }
                });
            }
        }
    };

    thread.start();

    for (int i = 0; i < COUNT; i++) {
        synchronized (mux) {
            clearField(tmpFile, "cachedIsLink");
            clearField(tmpFile, "cachedIsFileSystem");
        }

        tmpFile.isFileSystem();
        tmpFile.isLink();
    }

    thread.interrupt();
    thread.join();

    System.out.println("Test passed successfully");
}
 
Example 18
Source File: bug6741890.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String[] args) throws Exception {
    if (OSInfo.getOSType() != OSInfo.OSType.WINDOWS) {
        System.out.println("The test is applicable only for Windows. Skipped.");

        return;
    }

    String tmpDir = System.getProperty("java.io.tmpdir");

    if (tmpDir.length() == 0) { //'java.io.tmpdir' isn't guaranteed to be defined
        tmpDir = System.getProperty("user.home");
    }

    final ShellFolder tmpFile = ShellFolder.getShellFolder(new File(tmpDir));

    System.out.println("Temp directory: " + tmpDir);

    System.out.println("Stress test was run");

    Thread thread = new Thread() {
        public void run() {
            while (!isInterrupted()) {
                ShellFolder.invoke(new Callable<Void>() {
                    public Void call() throws Exception {
                        synchronized (mux) {
                            tmpFile.isFileSystem();
                            tmpFile.isLink();
                        }

                        return null;
                    }
                });
            }
        }
    };

    thread.start();

    for (int i = 0; i < COUNT; i++) {
        synchronized (mux) {
            clearField(tmpFile, "cachedIsLink");
            clearField(tmpFile, "cachedIsFileSystem");
        }

        tmpFile.isFileSystem();
        tmpFile.isLink();
    }

    thread.interrupt();
    thread.join();

    System.out.println("Test passed successfully");
}