本文整理了Java中org.eclipse.core.runtime.Path.toOSString()
方法的一些代码示例,展示了Path.toOSString()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Path.toOSString()
方法的具体详情如下:
包路径:org.eclipse.core.runtime.Path
类名称:Path
方法名:toOSString
暂无
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.equinox.common
@Override
public File toFile() {
return new File(toOSString());
}
代码示例来源:origin: com.github.veithen.cosmos.bootstrap/org.eclipse.equinox.common
@Override
public File toFile() {
return new File(toOSString());
}
代码示例来源:origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.equinox.common
public File toFile() {
return new File(toOSString());
}
代码示例来源:origin: org.eclipse.equinox/common
public File toFile() {
return new File(toOSString());
}
代码示例来源:origin: stackoverflow.com
Path pth = new Path( MY_JARFILE_LOCATION );
Path pthd = new Path( MY_JAVADOC_LOCATION );
ClasspathAttribute att = new ClasspathAttribute("javadoc_location", "file:" + pthd.toOSString());
IClasspathAttribute[] atts = new IClasspathAttribute[] { att };
IClasspathEntry cpISDI = JavaCore.newLibraryEntry(pth, null, null, null, atts, false);
cpEntries.add(1, cpISDI);
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.ide
/**
* Set this data's initialDefault parameter to a properly formatted version
* of the argument directory string. The proper format is to the platform
* appropriate separator character without meaningless leading or trailing
* separator characters.
*/
private void setInitialDefault(String dir) {
if (dir == null || dir.length() <= 0) {
initialDefault = null;
return;
}
dir = new Path(dir).toOSString();
while (dir.charAt(dir.length() - 1) == File.separatorChar) {
dir = dir.substring(0, dir.length() - 1);
}
initialDefault = dir;
}
代码示例来源:origin: org.eclipse/org.eclipse.ajdt.ui
private String[] getLTWClasspath() throws IOException {
URL resolvedaspectjWeaverJar = FileLocator.resolve(new URL(Platform.getBundle(AspectJPlugin.WEAVER_PLUGIN_ID).getEntry("/"), "aspectjweaver.jar")); //$NON-NLS-1$ //$NON-NLS-2$
URL resolvedaspectjRTJar = FileLocator.resolve(new URL(Platform.getBundle(AspectJPlugin.RUNTIME_PLUGIN_ID).getEntry("/"), "aspectjrt.jar")); //$NON-NLS-1$ //$NON-NLS-2$
String weaverPath = new Path(resolvedaspectjWeaverJar.getFile()).toOSString();
String rtPath = new Path(resolvedaspectjRTJar.getFile()).toOSString();
return new String[] {weaverPath, rtPath};
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface
/**
* Returns the filename for the ImageData.
*
* @return {@link String} or <code>null</code> if the file cannot be found
*/
private String getFilePath() {
if (location == null)
return new Path(name).toOSString();
URL resource = location.getResource(name);
if (resource == null)
return null;
try {
if (!InternalPolicy.OSGI_AVAILABLE) {// Stand-alone case
return new Path(resource.getFile()).toOSString();
}
return new Path(FileLocator.toFileURL(resource).getPath()).toOSString();
} catch (IOException e) {
Policy.logException(e);
return null;
}
}
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.jface
return new Path(name).toOSString();
if (!InternalPolicy.OSGI_AVAILABLE) {// Stand-alone case
return new Path(resource.getFile()).toOSString();
return new Path(FileLocator.toFileURL(resource).getPath()).toOSString();
} catch (IOException e) {
if (logIOException) {
代码示例来源:origin: org.eclipse/org.eclipse.jst.pagedesigner
public static Path getInstallLocation() {
try {
URL url = getDefault().getBundle().getEntry("/");
String s1 = FileLocator.resolve(url).getFile();
if (s1.startsWith("/")) //$NON-NLS-1$
{
s1 = s1.substring(1);
}
s1 = (new Path(s1)).toOSString();
String s;
if (s1.endsWith(File.separator)) {
s = s1;
} else {
s = s1 + File.separator;
}
return new Path(s);
} catch (Exception exception) {
_log.error("Error.PDPlugin.Installation.15", exception); //$NON-NLS-1$
return null;
}
}
代码示例来源:origin: org.apache.uima/uimaj-ep-configurator
/**
* Handle browse.
*/
void handleBrowse() {
ContainerSelectionDialog dialog = new ContainerSelectionDialog(getShell(), ResourcesPlugin
.getWorkspace().getRoot(), false, "Select a containing folder");
if (dialog.open() == Window.OK) {
Object[] result = dialog.getResult();
if (result.length == 1) {
containerText.setText(((Path) result[0]).toOSString());
}
}
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.jface
if (!InternalPolicy.OSGI_AVAILABLE) {
if (FILE_PROTOCOL.equalsIgnoreCase(url.getProtocol()))
return new Path(url.getFile()).toOSString();
return null;
return new Path(locatedURL.getPath()).toOSString();
return null;
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface
if (!InternalPolicy.OSGI_AVAILABLE) {
if (FILE_PROTOCOL.equalsIgnoreCase(url.getProtocol()))
return new Path(url.getFile()).toOSString();
return null;
return new Path(locatedURL.getPath()).toOSString();
return null;
代码示例来源:origin: org.eclipse.egit/ui
public void handleEvent(Event event) {
final FileDialog dialog = new FileDialog(getShell(),
SWT.PRIMARY_MODAL | SWT.SAVE);
if (pageValid) {
final File file = new File(fsPathText.getText());
dialog.setFilterPath(file.getParent());
dialog.setFileName(file.getName());
} else
dialog.setFileName(""); //$NON-NLS-1$
dialog.setText(""); //$NON-NLS-1$
final String path = dialog.open();
if (path != null)
fsPathText.setText(new Path(path).toOSString());
validatePage();
}
});
代码示例来源:origin: org.eclipse.equinox.security/ui
locationLabel.setText(new Path(location).toOSString());
代码示例来源:origin: org.eclipse.platform/org.eclipse.equinox.security.ui
locationLabel.setText(new Path(location).toOSString());
代码示例来源:origin: org.eclipse/org.eclipse.datatools.connectivity.ui
private void handleLocationBrowseButtonPressed() {
FileDialog dialog = new FileDialog(getShell());
dialog.setText(DriverMgmtMessages
.getString("EditDriverDialog.title.filebrowse")); //$NON-NLS-1$
String dirName = previouslyBrowsedDirectory;
if (dirName.length() == 0) //$NON-NLS-1$
dialog.setFilterPath(ResourcesPlugin.getWorkspace().getRoot()
.getLocation().toOSString());
else {
File path = new File(dirName);
if (path.exists())
dialog.setFilterPath(new Path(dirName).toOSString());
}
String selectedDirectory = dialog.open();
if (selectedDirectory != null) {
previouslyBrowsedDirectory = selectedDirectory;
this.list.add(selectedDirectory);
}
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.ide
/**
* Open an appropriate directory browser
*/
private void handleLocationBrowseButtonPressed() {
DirectoryDialog dialog = new DirectoryDialog(locationPathField
.getShell(), SWT.SHEET);
dialog.setMessage(DataTransferMessages.WizardExternalProjectImportPage_directoryLabel);
String dirName = getProjectLocationFieldValue();
if (dirName.length() == 0) {
dirName = previouslyBrowsedDirectory;
}
if (dirName.length() == 0) {
dialog.setFilterPath(getWorkspace().getRoot().getLocation()
.toOSString());
} else {
File path = new File(dirName);
if (path.exists()) {
dialog.setFilterPath(new Path(dirName).toOSString());
}
}
String selectedDirectory = dialog.open();
if (selectedDirectory != null) {
previouslyBrowsedDirectory = selectedDirectory;
locationPathField.setText(previouslyBrowsedDirectory);
setProjectName(projectFile(previouslyBrowsedDirectory));
}
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.ide
/**
* The browse button has been selected. Select the location.
*/
protected void handleLocationDirectoryButtonPressed() {
DirectoryDialog dialog = new DirectoryDialog(directoryPathField
.getShell(), SWT.SHEET);
dialog
.setMessage(DataTransferMessages.WizardProjectsImportPage_SelectDialogTitle);
String dirName = directoryPathField.getText().trim();
if (dirName.length() == 0) {
dirName = previouslyBrowsedDirectory;
}
if (dirName.length() == 0) {
dialog.setFilterPath(IDEWorkbenchPlugin.getPluginWorkspace()
.getRoot().getLocation().toOSString());
} else {
File path = new File(dirName);
if (path.exists()) {
dialog.setFilterPath(new Path(dirName).toOSString());
}
}
String selectedDirectory = dialog.open();
if (selectedDirectory != null) {
previouslyBrowsedDirectory = selectedDirectory;
directoryPathField.setText(previouslyBrowsedDirectory);
updateProjectsList(selectedDirectory);
}
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.equinox.security.ui
if (location != null) {
new Label(page, SWT.NONE).setText(SecUIMessages.locationButton);
new Text(page, SWT.READ_ONLY).setText(new Path(location.getFile()).toOSString());
内容来源于网络,如有侵权,请联系作者删除!