本文整理匯總了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);
}
示例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);
}
示例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);
}