本文整理汇总了Java中org.eclipse.swt.program.Program.launch方法的典型用法代码示例。如果您正苦于以下问题:Java Program.launch方法的具体用法?Java Program.launch怎么用?Java Program.launch使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.swt.program.Program
的用法示例。
在下文中一共展示了Program.launch方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: displayHelp
import org.eclipse.swt.program.Program; //导入方法依赖的package包/类
private void displayHelp() {
String curLang = CommonFunction.getSystemLanguage();
StringBuffer sbHelp = new StringBuffer("help");
if (Util.isWindows()) {
sbHelp.append(File.separator).append("csv2tbxdoc").append(File.separator);
if (curLang.equalsIgnoreCase("zh")) {
sbHelp.append("tbxmaker_zh-cn.chm");
} else {
sbHelp.append("tbxmaker.chm");
}
Program.launch(PluginUtil.getConfigurationFilePath(sbHelp.toString()));
} else {
sbHelp.append(File.separator).append("csv2tbxdoc").append(File.separator);
if (curLang.equalsIgnoreCase("zh")) {
sbHelp.append("zh-cn");
} else {
sbHelp.append("en");
}
sbHelp.append(File.separator).append("toc.xml");
PluginHelpDialog dialog = new PluginHelpDialog(getShell(), PluginUtil.getConfigurationFilePath(sbHelp.toString()),
Messages.getString("dialog.TBXMakerDialog.helpDialogTitle"));
dialog.open();
}
}
示例2: startEditLocal
import org.eclipse.swt.program.Program; //导入方法依赖的package包/类
private void startEditLocal(Object object, ILocalDocumentService service, Shell parentShell){
Optional<File> file = service.add(object, new IConflictHandler() {
@Override
public Result getResult(){
if (MessageDialog.openQuestion(parentShell,
Messages.StartEditLocalDocumentHandler_conflicttitle,
Messages.StartEditLocalDocumentHandler_conflictmessage)) {
return Result.KEEP;
} else {
return Result.OVERWRITE;
}
}
});
if (file.isPresent()) {
Program.launch(file.get().getAbsolutePath());
} else {
MessageDialog.openError(parentShell, Messages.StartEditLocalDocumentHandler_errortitle,
Messages.StartEditLocalDocumentHandler_errormessage);
}
}
示例3: doXRef
import org.eclipse.swt.program.Program; //导入方法依赖的package包/类
public boolean doXRef(String refProvider, String refID){
try {
int r = refID.lastIndexOf('.');
String ext = ""; //$NON-NLS-1$
if (r != -1) {
ext = refID.substring(r + 1);
}
Program proggie = Program.findProgram(ext);
if (proggie != null) {
proggie.execute(refID);
} else {
if (Program.launch(refID) == false) {
Runtime.getRuntime().exec(refID);
}
}
} catch (Exception ex) {
ElexisStatus status =
new ElexisStatus(ElexisStatus.ERROR, Hub.PLUGIN_ID, ElexisStatus.CODE_NONE,
Messages.ExternalLink_CouldNotStartFile, ex);
StatusManager.getManager().handle(status);
}
return true;
}
示例4: exportEMediplanPdf
import org.eclipse.swt.program.Program; //导入方法依赖的package包/类
@Test
public void exportEMediplanPdf() throws FileNotFoundException, IOException{
EMediplanServiceImpl impl = new EMediplanServiceImpl();
List<Patient> patients = TestData.getTestSzenarioInstance().getPatients();
ByteArrayOutputStream output = new ByteArrayOutputStream();
impl.exportEMediplanPdf(
TestData.getTestSzenarioInstance().getMandator(), patients.get(0),
getPatientMedication(patients.get(0)), output);
if (WRITE_AND_OPEN) {
try (FileOutputStream fout = new FileOutputStream(
new File(CoreHub.getWritableUserDir(), "emediplan_test.pdf"))) {
fout.write(output.toByteArray());
}
Program.launch(CoreHub.getWritableUserDir().getAbsolutePath() + File.separator
+ "emediplan_test.pdf");
}
assertTrue(output.size() > 100);
}
示例5: execute
import org.eclipse.swt.program.Program; //导入方法依赖的package包/类
/**
* Run a program to view an external file
*
* @param filename
*/
public void execute(String filename){
try {
int r = filename.lastIndexOf('.');
String ext = ""; //$NON-NLS-1$
if (r != -1) {
ext = filename.substring(r + 1);
}
Program proggie = Program.findProgram(ext);
if (proggie != null) {
proggie.execute(filename);
} else {
if (Program.launch(filename) == false) {
Runtime.getRuntime().exec(filename);
}
}
} catch (Exception ex) {
ExHandler.handle(ex);
SWTHelper.showError(Messages.NotesDetail_couldNotLaunch, ex.getMessage());
}
}
示例6: run
import org.eclipse.swt.program.Program; //导入方法依赖的package包/类
@Override
public void run(){
// get actual fix medication of the patient
Prescription medication =
(Prescription) ElexisEventDispatcher.getSelected(Prescription.class);
String ean = null;
String num = "";
if (medication != null) {
ean = medication.getArtikel().getEAN();
}
if (ean != null && !ean.isEmpty() && ean.length() >= 9) {
num = ean.substring(4, 9);
}
String url = "http://www.swissmedicinfo.ch/ShowText.aspx?textType=FI&lang=DE&authNr=" + num; //$NON-NLS-1$
Program.launch(url);
}
示例7: execute
import org.eclipse.swt.program.Program; //导入方法依赖的package包/类
public void execute(){
try {
String ext = StringConstants.SPACE; //""; //$NON-NLS-1$
File temp = createTemporaryFile(null);
Program proggie = Program.findProgram(ext);
if (proggie != null) {
proggie.execute(temp.getAbsolutePath());
} else {
if (Program.launch(temp.getAbsolutePath()) == false) {
Runtime.getRuntime().exec(temp.getAbsolutePath());
}
}
} catch (Exception ex) {
ExHandler.handle(ex);
SWTHelper.showError(Messages.DocHandle_runErrorHeading, ex.getMessage());
}
}
示例8: run
import org.eclipse.swt.program.Program; //导入方法依赖的package包/类
public void run(IAction action) {
try {
lastAuthToken = UUID.randomUUID().toString();
lastAuthTokenExpiration = System.currentTimeMillis() + 5000;
Program.launch(EnginePropertiesManager.PropertyName.APPLICATION_SERVER_CONVERTIGO_URL.getDefaultValue() + "/admin/login.html#authToken=" + lastAuthToken);
} catch (Exception e) {
ConvertigoPlugin.logException(e, "Error while opening the Convertigo administration page");
}
}
示例9: run
import org.eclipse.swt.program.Program; //导入方法依赖的package包/类
public void run(IAction action) {
try {
Program.launch(
EnginePropertiesManager.PropertyName.APPLICATION_SERVER_CONVERTIGO_URL.getDefaultValue()+"/swagger/ui/index.html?url=" +
URLEncoder.encode(EnginePropertiesManager.PropertyName.APPLICATION_SERVER_CONVERTIGO_URL.getDefaultValue()+"/api?YAML","UTF-8"));
} catch (Exception e) {
ConvertigoPlugin.logException(e, "Error while opening the Swagger console");
}
}
示例10: run
import org.eclipse.swt.program.Program; //导入方法依赖的package包/类
public void run(IAction action) {
try {
Program.launch("http://www.convertigo.com/technical-documentation/");
} catch (Exception e) {
ConvertigoPlugin.logException(e, "Error while opening the Convertigo administration page");
}
}
示例11: run
import org.eclipse.swt.program.Program; //导入方法依赖的package包/类
public void run() {
Display display = Display.getDefault();
Cursor waitCursor = new Cursor(display, SWT.CURSOR_WAIT);
Shell shell = getParentShell();
shell.setCursor(waitCursor);
try {
ProjectExplorerView explorerView = getProjectExplorerView();
if (explorerView != null) {
TreeObject treeObject = explorerView.getFirstSelectedTreeObject();
Object databaseObject = treeObject.getObject();
if ((databaseObject != null) && (databaseObject instanceof Project)) {
Project project = (Project)treeObject.getObject();
Program.launch(
EnginePropertiesManager.PropertyName.APPLICATION_SERVER_CONVERTIGO_URL.getDefaultValue()+"/projects/" + project.getName());
}
}
}
catch (Throwable e) {
ConvertigoPlugin.logException(e, "Unable to open the selected project!");
}
finally {
shell.setCursor(null);
waitCursor.dispose();
}
}
示例12: run
import org.eclipse.swt.program.Program; //导入方法依赖的package包/类
public void run() {
Display display = Display.getDefault();
Cursor waitCursor = new Cursor(display, SWT.CURSOR_WAIT);
Shell shell = getParentShell();
shell.setCursor(waitCursor);
try {
ProjectExplorerView explorerView = getProjectExplorerView();
if (explorerView != null) {
TreeObject treeObject = explorerView.getFirstSelectedTreeObject();
Object databaseObject = treeObject.getObject();
if ((databaseObject != null) && (databaseObject instanceof Project)) {
Project project = (Project)treeObject.getObject();
Program.launch(
EnginePropertiesManager.PropertyName.APPLICATION_SERVER_CONVERTIGO_URL.getDefaultValue()+"/swagger/ui/index.html?url=" +
URLEncoder.encode(EnginePropertiesManager.PropertyName.APPLICATION_SERVER_CONVERTIGO_URL.getDefaultValue()+"/api?YAML&__project=" + project.getName(),"UTF-8"));
}
}
}
catch (Throwable e) {
ConvertigoPlugin.logException(e, "Unable to open the Swagger console for selected project!");
}
finally {
shell.setCursor(null);
waitCursor.dispose();
}
}
示例13: run
import org.eclipse.swt.program.Program; //导入方法依赖的package包/类
@Override
public void run() {
Display display = Display.getDefault();
Cursor waitCursor = new Cursor(display, SWT.CURSOR_WAIT);
Shell shell = getParentShell();
shell.setCursor(waitCursor);
try {
ProjectExplorerView explorerView = getProjectExplorerView();
if (explorerView != null) {
TreeObject treeObject = explorerView.getFirstSelectedTreeObject();
Object databaseObject = treeObject.getObject();
if ((databaseObject != null) && (databaseObject instanceof MobileApplication)) {
MobileApplication mobileApplication = (MobileApplication) databaseObject;
// Test plateform
Program.launch(
EnginePropertiesManager.PropertyName.APPLICATION_SERVER_CONVERTIGO_URL.getDefaultValue()+"/project.html#"
+ mobileApplication.getProject() + "?launch=webapp");
}
}
}
catch (Throwable e) {
ConvertigoPlugin.logException(e, "Unable to launch the mobile device selected project!");
}
finally {
shell.setCursor(null);
waitCursor.dispose();
}
}
示例14: run
import org.eclipse.swt.program.Program; //导入方法依赖的package包/类
@Override
public void run() {
Display display = Display.getDefault();
Cursor waitCursor = new Cursor(display, SWT.CURSOR_WAIT);
Shell shell = getParentShell();
shell.setCursor(waitCursor);
try {
ProjectExplorerView explorerView = getProjectExplorerView();
if (explorerView != null) {
TreeObject treeObject = explorerView.getFirstSelectedTreeObject();
Object databaseObject = treeObject.getObject();
if ((databaseObject != null) && (databaseObject instanceof MobileApplication)) {
MobileApplication mobileApplication = (MobileApplication) databaseObject;
String SERVER_C8O_URL = EnginePropertiesManager.getProperty(PropertyName.APPLICATION_SERVER_CONVERTIGO_URL);
Program.launch( SERVER_C8O_URL
+ "/projects/"
+ mobileApplication.getProject().getName() + "/DisplayObjects/mobile/index.html");
}
}
}
catch (Throwable e) {
ConvertigoPlugin.logException(e, "Unable to launch the mobile application selected!");
}
finally {
shell.setCursor(null);
waitCursor.dispose();
}
}
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:32,代码来源:LaunchMobileApplicationFullScreenProjectAction.java
示例15: launch
import org.eclipse.swt.program.Program; //导入方法依赖的package包/类
private static boolean launch(final String server, final String volume, final String path) {
String localMountPoint;
if ((localMountPoint = getMountPoint(server, volume)) == null) {
// try to mount the smb path, then try to get the
// local path (mountpoint)
if (!mountSMB(server, volume) || (localMountPoint = getMountPoint(server, volume)) == null) {
return false;
}
}
return Program.launch(localMountPoint + "/" + path.replace('\\', '/')); //$NON-NLS-1$
}