@Override public File toFile() { return new File(toOSString()); }
@Override public File toFile() { return new File(toOSString()); }
public File toFile() { return new File(toOSString()); }
public File toFile() { return new File(toOSString()); }
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);
/** * 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; }
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}; }
/** * 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; } } }
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) {
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; } }
/** * 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()); } } }
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;
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;
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(); } });
locationLabel.setText(new Path(location).toOSString());
locationLabel.setText(new Path(location).toOSString());
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); } }
/** * 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)); } }
/** * 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); } }
if (location != null) { new Label(page, SWT.NONE).setText(SecUIMessages.locationButton); new Text(page, SWT.READ_ONLY).setText(new Path(location.getFile()).toOSString());