當前位置: 首頁>>代碼示例>>Java>>正文


Java ApplicationLauncher類代碼示例

本文整理匯總了Java中com.install4j.api.launcher.ApplicationLauncher的典型用法代碼示例。如果您正苦於以下問題:Java ApplicationLauncher類的具體用法?Java ApplicationLauncher怎麽用?Java ApplicationLauncher使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ApplicationLauncher類屬於com.install4j.api.launcher包,在下文中一共展示了ApplicationLauncher類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: checkNewVersion

import com.install4j.api.launcher.ApplicationLauncher; //導入依賴的package包/類
private void checkNewVersion() {
    threadService.schedule(() -> {
        try {
            if (!editorConfigBean.getAutoUpdate())
                return;

            ApplicationLauncher.launchApplication("504", null, false, new ApplicationLauncher.Callback() {
                        public void exited(int exitValue) {
                            //TODO add your code here (not invoked on event dispatch thread)
                        }

                        public void prepareShutdown() {
                            //TODO add your code here (not invoked on event dispatch thread)
                        }
                    }
            );
        } catch (Exception e) {
            // logger.error("Problem occured while checking new version", e);
        }
    }, 10, TimeUnit.SECONDS);
}
 
開發者ID:asciidocfx,項目名稱:AsciidocFX,代碼行數:22,代碼來源:ApplicationController.java

示例2: apply

import com.install4j.api.launcher.ApplicationLauncher; //導入依賴的package包/類
/**
     * parses the given command and executes it
     *
     * @param np
     * @throws java.io.IOException
     */
    @Override
    public void apply(NexusStreamParser np) throws Exception {
        np.matchIgnoreCase(getSyntax());

        ApplicationDisplayMode applicationDisplayMode = ProgramProperties.isUseGUI() ? ApplicationDisplayMode.GUI : ApplicationDisplayMode.CONSOLE;
        UpdateDescriptor updateDescriptor;
        try {
            updateDescriptor = UpdateChecker.getUpdateDescriptor("http://www-ab.informatik.uni-tuebingen.de/data/software/megan6/download/updates.xml", applicationDisplayMode);
        } catch (Exception e) {
            Basic.caught(e);
            NotificationsInSwing.showInformation(MainViewer.getLastActiveFrame(), "Installed version is up-to-date");
            return;
        }
        if (updateDescriptor.getEntries().length > 0) {
            if (!ProgramProperties.isUseGUI()) {
                UpdateDescriptorEntry entry = updateDescriptor.getEntries()[0];
                NotificationsInSwing.showInformation(MainViewer.getLastActiveFrame(), "New version available: " + entry.getNewVersion()
                        + "\nPlease download from: http://www-ab.informatik.uni-tuebingen.de/data/software/megan6/download/");
                return;
            }
        } else {
            NotificationsInSwing.showInformation(MainViewer.getLastActiveFrame(), "Installed version is up-to-date");
            return;
        }


        // This will return immediately if you call it from the EDT,
// otherwise it will block until the installer application exits
        ApplicationLauncher.launchApplicationInProcess("1691242905", null, new ApplicationLauncher.Callback() {
            public void exited(int exitValue) {
                //TODO add your code here (not invoked on event dispatch thread)
            }

            public void prepareShutdown() {
                ProgramProperties.store();
            }
        }, ApplicationLauncher.WindowMode.FRAME, null);
    }
 
開發者ID:danielhuson,項目名稱:megan-ce,代碼行數:45,代碼來源:ShowCheckForUpdateCommand.java

示例3: actionPerformed

import com.install4j.api.launcher.ApplicationLauncher; //導入依賴的package包/類
/**
     * action to be performed
     *
     * @param ev
     */
    public void actionPerformed(ActionEvent ev) {

        ApplicationDisplayMode applicationDisplayMode = ProgramProperties.isUseGUI() ? ApplicationDisplayMode.GUI : ApplicationDisplayMode.CONSOLE;
        UpdateDescriptor updateDescriptor;
        try {
            updateDescriptor = UpdateChecker.getUpdateDescriptor("http://www-ab.informatik.uni-tuebingen.de/data/software/dendroscope/download/updates.xml", applicationDisplayMode);
        } catch (Exception e) {
            Basic.caught(e);
            new Alert(MultiViewer.getLastActiveFrame(), "Installed version is up-to-date");
            return;
        }
        if (updateDescriptor.getEntries().length > 0) {
            if (!ProgramProperties.isUseGUI()) {
                UpdateDescriptorEntry entry = updateDescriptor.getEntries()[0];
                new Alert(MultiViewer.getLastActiveFrame(), "New version available: " + entry.getNewVersion()
                        + "\nPlease download from: http://www-ab.informatik.uni-tuebingen.de/data/software/dendroscope/download/");
                return;
            }
        } else {
            new Alert(MultiViewer.getLastActiveFrame(), "Installed version is up-to-date");
            return;
        }


        // This will return immediately if you call it from the EDT,
// otherwise it will block until the installer application exits
        ApplicationLauncher.launchApplicationInProcess("1691242312", null, new ApplicationLauncher.Callback() {
            public void exited(int exitValue) {
                //TODO add your code here (not invoked on event dispatch thread)
            }

            public void prepareShutdown() {
                ProgramProperties.store();
            }
        }, ApplicationLauncher.WindowMode.FRAME, null);
    }
 
開發者ID:danielhuson,項目名稱:dendroscope3,代碼行數:42,代碼來源:ShowCheckForUpdateCommand.java


注:本文中的com.install4j.api.launcher.ApplicationLauncher類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。