本文整理汇总了Java中org.eclipse.jface.util.Util.isLinux方法的典型用法代码示例。如果您正苦于以下问题:Java Util.isLinux方法的具体用法?Java Util.isLinux怎么用?Java Util.isLinux使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jface.util.Util
的用法示例。
在下文中一共展示了Util.isLinux方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ConcordanceSearchDialog
import org.eclipse.jface.util.Util; //导入方法依赖的package包/类
/**
* 构造方法
* @param parentShell
* @param file
* 当前文件
* @param strSrcLang
* 当前文件的源语言
* @param strTgtLang
* 当前文件的目标语言
* @param strSearchText
* 搜索文本
*/
public ConcordanceSearchDialog(Shell parentShell, IFile file, String strSrcLang, String strTgtLang,
String strSearchText) {
super(parentShell);
FontData fontData = JFaceResources.getDefaultFont().getFontData()[0];
fontData.setStyle(fontData.getStyle() | SWT.BOLD);
font = new Font(Display.getDefault(), fontData);
style = new TextStyle(font, null, null);
this.strSrcLang = strSrcLang;
this.strTgtLang = strTgtLang;
this.strSearchText = strSearchText;
ProjectConfiger projectConfig = ProjectConfigerFactory.getProjectConfiger(file.getProject());
lstDatabase = projectConfig.getAllTmDbs();
filterUnAvaliableDatabase();
setHelpAvailable(true);
setBlockOnOpen(false);
lstSearchHistory = new ArrayList<String>(HISTORY_SIZE - 1);
lstFilterHistory = new ArrayList<String>(HISTORY_SIZE - 1);
if (!Util.isLinux()) {
totalWidth = 910;
}
}
示例2: showInSystemExplorer
import org.eclipse.jface.util.Util; //导入方法依赖的package包/类
public void showInSystemExplorer(File canonicalPath, IProgressMonitor monitor) throws IOException {
SubMonitor subMonitor = SubMonitor.convert(monitor, 100);
String launchCmd = formShowInSystemExplorerCommand(canonicalPath);
if ("".equals(launchCmd)) {
throw new IOException(
"System Explorer command unavailable. Please set the System Explorer command in the workspace preferences.");
}
File dir = ResourcesPlugin.getWorkspace().getRoot().getLocation().toFile();
Process p;
if (Util.isLinux() || Util.isMac()) {
p = Runtime.getRuntime().exec(new String[] { "/bin/sh", "-c", launchCmd }, null, dir);
} else {
p = Runtime.getRuntime().exec(launchCmd, null, dir);
}
int retCode;
try {
retCode = p.waitFor();
} catch (InterruptedException e) {
throw new IOException(e);
}
subMonitor.worked(100);
if (retCode != 0 && !Util.isWindows()) {
throw new IOException("Execution of '" + launchCmd + "' failed with return code: " + retCode, null);
}
}
示例3: quotePath
import org.eclipse.jface.util.Util; //导入方法依赖的package包/类
private String quotePath(String path) {
if (Util.isLinux() || Util.isMac()) {
// Quote for usage inside "", man sh, topic QUOTING:
path = path.replaceAll("[\"$`]", "\\\\$0"); //$NON-NLS-1$ //$NON-NLS-2$
}
// Windows: Can't quote, since explorer.exe has a very special command
// line parsing strategy.
return path;
}