Examples of OneInstance


Examples of de.ailis.oneinstance.OneInstance

    {
        // If Xadrian is already running then focus the already running
        // Xadrian and pass command line arguments to it. This allows us
        // to open more complexes in the already running Xadrian by
        // double-clicking the *.x3c files.
        final OneInstance oneInstance = OneInstance.getInstance();
        oneInstance.addListener(new OneInstanceListener()
        {
            @Override
            public boolean newInstanceCreated(final File workingDir, final String[] args)
            {
                SwingUtilities.invokeLater(new Runnable()
                {
                    @Override
                    public void run()
                    {
                        MainFrame.open(workingDir, args);
                    }
                });
                return false;
            }
        });
        if (!oneInstance.register(Main.class, args)) System.exit(0);

        try
        {
            // Set the App user model ID (needed for Windows)
            SwingUtils.setAppUserModelId(APP_USER_MODEL_ID);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.