本文整理汇总了Java中de.invation.code.toval.os.OSUtils类的典型用法代码示例。如果您正苦于以下问题:Java OSUtils类的具体用法?Java OSUtils怎么用?Java OSUtils使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OSUtils类属于de.invation.code.toval.os包,在下文中一共展示了OSUtils类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPrismSearcher
import de.invation.code.toval.os.OSUtils; //导入依赖的package包/类
public static PrismSearcher getPrismSearcher() throws IOException, ParameterException{
String OS = System.getProperty("os.name").toLowerCase();
OSType os= OSUtils.getCurrentOS();
if (OS.contains("win"))
return new WindowsSearcher();
if (OS.contains("mac"))
return new MacOSSearcher();
if (OS.contains("nux") || OS.contains("sunos"))
return new LinuxSearcher();
return null;
}
示例2: tryToOpenNet
import de.invation.code.toval.os.OSUtils; //导入依赖的package包/类
private void tryToOpenNet() throws Exception {
if (filePaths == null) {
setLookAndFeel();
JFileChooser fch;
fch = new JFileChooser(OSUtils.getUserHomeDirectory());
fch.removeChoosableFileFilter(fch.getFileFilter());
fch.addChoosableFileFilter(new FileFilter() {
@Override
public String getDescription() {
return "PNML Documents (*.pnml)";
}
@Override
public boolean accept(File f) {
if (f.isDirectory()) {
return true;
} else {
return f.getName().toLowerCase().endsWith(".pnml");
}
}
});
fch.setDialogTitle("Load PNML");
int returnVal = fch.showDialog(null, "load PNML");
if (returnVal == JFileChooser.APPROVE_OPTION) {
String filename = fch.getSelectedFile().getAbsolutePath();
openPNMLFile(filename);
} else {
startApplication();
}
} else {
for (String path : filePaths)
openPNMLFile(path);
}
// filePath = null;
}
示例3: EditorProperties
import de.invation.code.toval.os.OSUtils; //导入依赖的package包/类
private EditorProperties() throws IOException {
try {
load(OSUtils.getUserHomeDirectory() + "/" + propertyFileName);
} catch (IOException e) {
// Create new property file.
loadDefaultProperties();
store();
}
}
示例4: store
import de.invation.code.toval.os.OSUtils; //导入依赖的package包/类
public final void store() throws IOException {
try {
store(OSUtils.getUserHomeDirectory() + "/" + propertyFileName);
} catch (IOException e) {
throw new IOException("Cannot create/store wolfgang properties file on disk.", e);
}
}