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


Java Program.launch方法代碼示例

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

}
 
開發者ID:heartsome,項目名稱:translationstudio8,代碼行數:26,代碼來源:TBXMakerDialog.java

示例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);
	}
}
 
開發者ID:elexis,項目名稱:elexis-3-core,代碼行數:21,代碼來源:StartEditLocalDocumentHandler.java

示例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;
}
 
開發者ID:elexis,項目名稱:elexis-3-core,代碼行數:25,代碼來源:ExternalLink.java

示例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);
}
 
開發者ID:elexis,項目名稱:elexis-3-base,代碼行數:19,代碼來源:EMediplanServiceImplTest.java

示例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());
	}
}
 
開發者ID:elexis,項目名稱:elexis-3-base,代碼行數:28,代碼來源:NotesDetail.java

示例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);
}
 
開發者ID:elexis,項目名稱:elexis-3-base,代碼行數:20,代碼來源:SwissmedicSearchAction.java

示例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());
	}
}
 
開發者ID:elexis,項目名稱:elexis-3-base,代碼行數:21,代碼來源:DocHandle.java

示例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");
	}
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:11,代碼來源:AdministrationAction.java

示例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");
	}
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:10,代碼來源:OpenSwaggerConsoleAction.java

示例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");
	}
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:8,代碼來源:OpenConvertigoDocumentationAction.java

示例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();
       }
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:30,代碼來源:OpenProjectTestPlatformAction.java

示例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();
       }
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:31,代碼來源:OpenProjectSwaggerConsoleAction.java

示例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();
       }
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:33,代碼來源:LaunchMobileApplicationProjectAction.java

示例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$
}
 
開發者ID:Microsoft,項目名稱:team-explorer-everywhere,代碼行數:14,代碼來源:MacUNCLauncher.java


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