@Override public void writeData(IPath path, Object data, DataOutput output) throws IOException { // never write the root node of an ElementTree //because it contains the parent backpointer. if (!Path.ROOT.equals(path)) { flattener.writeElement(path, data, output); } }
@Override public void writeData(IPath path, Object data, DataOutput output) throws IOException { // never write the root node of an ElementTree //because it contains the parent backpointer. if (!Path.ROOT.equals(path)) { flattener.writeElement(path, data, output); } }
@Override public Object readData(IPath path, DataInput input) throws IOException { //never read the root node of an ElementTree //this node is reserved for the parent backpointer if (!Path.ROOT.equals(path)) return factory.readElement(path, input); return null; } };
@Override public Object readData(IPath path, DataInput input) throws IOException { //never read the root node of an ElementTree //this node is reserved for the parent backpointer if (!Path.ROOT.equals(path)) return factory.readElement(path, input); return null; } };
@Override public void writeData(IPath path, Object data, DataOutput output) throws IOException { // never write the root node of an ElementTree //because it contains the parent backpointer. if (!Path.ROOT.equals(path)) { flattener.writeElement(path, data, output); } }
@Override public Object readData(IPath path, DataInput input) throws IOException { //never read the root node of an ElementTree //this node is reserved for the parent backpointer if (!Path.ROOT.equals(path)) return factory.readElement(path, input); return null; } };
private ILaunchConfiguration[] getLaunchConfigurations() throws CoreException { ArrayList<ILaunchConfiguration> result = new ArrayList<>(); ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager(); ILaunchConfigurationType type = manager.getLaunchConfigurationType(EclipseLaunchShortcut.CONFIGURATION_TYPE); ILaunchConfiguration[] configs = manager.getLaunchConfigurations(type); for (int i = 0; i < configs.length; i++) { if (!DebugUITools.isPrivate(configs[i])) { String path = configs[i].getAttribute(IPDELauncherConstants.PRODUCT_FILE, ""); //$NON-NLS-1$ if (new Path(fPath).equals(new Path(path))) { result.add(configs[i]); } } } return result.toArray(new ILaunchConfiguration[result.size()]); }
/** * Returns the local file system location in which the meta data for the * resource with the given path is stored. */ public IPath locationFor(IPath resourcePath) { if (Path.ROOT.equals(resourcePath)) return metaAreaLocation.append(F_ROOT); return projectMetaLocation.append(resourcePath.segment(0)); }
/** * Returns the local file system location in which the meta data for the * resource with the given path is stored. */ public IPath locationFor(IPath resourcePath) { if (Path.ROOT.equals(resourcePath)) return metaAreaLocation.append(F_ROOT); return projectMetaLocation.append(resourcePath.segment(0)); }
/** * Returns the local file system location in which the meta data for the * resource with the given path is stored. */ public IPath locationFor(IPath resourcePath) { if (Path.ROOT.equals(resourcePath)) return metaAreaLocation.append(F_ROOT); return projectMetaLocation.append(resourcePath.segment(0)); }
public static URL[] getPluginPaths(String platformHome) { if (new Path(platformHome).equals(new Path(TargetPlatform.getDefaultLocation())) && !isDevLaunchMode()) return ConfiguratorUtils.getCurrentPlatformConfiguration().getPluginPath(); File file = new File(platformHome, "configuration/org.eclipse.update/platform.xml"); //$NON-NLS-1$ if (file.exists()) { try { String value = new Path(platformHome).toFile().toURL().toExternalForm(); System.setProperty(URL_PROPERTY, value); try { IPlatformConfiguration config = ConfiguratorUtils.getPlatformConfiguration(file.toURL()); return getConfiguredSitesPaths(platformHome, config, false); } finally { System.setProperty(URL_PROPERTY, EMPTY_STRING); } } catch (MalformedURLException e) { } catch (IOException e) { } } return scanLocations(getSites(platformHome, false)); }
/** * @return the current {@link IPluginModelBase} based on the current project * for this builder */ IPluginModelBase getCurrentModel() { IPluginModelBase[] workspaceModels = PluginRegistry.getWorkspaceModels(); IPath location = this.currentproject.getLocation(); IPluginModelBase currentModel = null; BundleDescription desc = null; loop: for (int i = 0, max = workspaceModels.length; i < max; i++) { desc = workspaceModels[i].getBundleDescription(); if (desc != null) { Path path = new Path(desc.getLocation()); if (path.equals(location)) { currentModel = workspaceModels[i]; break loop; } } else if (ApiPlugin.DEBUG_BUILDER) { System.out.println("ApiAnalysisBuilder: Tried to look up bundle description for: " + workspaceModels[i].toString()); //$NON-NLS-1$ } } return currentModel; }
public void loadBucketFor(IPath path) throws CoreException { current.load(Path.ROOT.equals(path) ? null : path.segment(0), locationFor(path)); }
public void loadBucketFor(IPath path) throws CoreException { current.load(Path.ROOT.equals(path) ? null : path.segment(0), locationFor(path)); }
public void loadBucketFor(IPath path) throws CoreException { current.load(Path.ROOT.equals(path) ? null : path.segment(0), locationFor(path)); }
public void widgetSelected(SelectionEvent e) { DirectoryDialog dialog = new DirectoryDialog(getShell()); dialog.setMessage(WizardMessages.ApiProfileWizardPage_11); String loctext = locationcombo.getText().trim(); if (loctext.length() > 0) { dialog.setFilterPath(loctext); } String newPath = dialog.open(); if (newPath != null && (!new Path(loctext).equals(new Path(newPath)) || getCurrentComponents().length == 0)) { /* * If the path is identical, but there is no component loaded, we still * want to reload. This might be the case if the combo is initialized by * copy/paste with a path that points to a plugin directory */ locationcombo.setText(newPath); setErrorMessage(null); doReload(); } } });
/** * From a starting point in the tree, visit all nodes under it. * @param visitor * @param base * @param depth */ public void accept(Bucket.Visitor visitor, IPath base, int depth) throws CoreException { if (Path.ROOT.equals(base)) { current.load(null, locationFor(Path.ROOT)); if (current.accept(visitor, base, DEPTH_ZERO) != Visitor.CONTINUE) return; if (depth == DEPTH_ZERO) return; boolean keepVisiting = true; depth--; IProject[] projects = workspace.getRoot().getProjects(IContainer.INCLUDE_HIDDEN); for (int i = 0; keepVisiting && i < projects.length; i++) { IPath projectPath = projects[i].getFullPath(); keepVisiting = internalAccept(visitor, projectPath, locationFor(projectPath), depth, 1); } } else internalAccept(visitor, base, locationFor(base), depth, 0); }
/** * From a starting point in the tree, visit all nodes under it. * @param visitor * @param base * @param depth */ public void accept(Bucket.Visitor visitor, IPath base, int depth) throws CoreException { if (Path.ROOT.equals(base)) { current.load(null, locationFor(Path.ROOT)); if (current.accept(visitor, base, DEPTH_ZERO) != Visitor.CONTINUE) return; if (depth == DEPTH_ZERO) return; boolean keepVisiting = true; depth--; IProject[] projects = workspace.getRoot().getProjects(IContainer.INCLUDE_HIDDEN); for (int i = 0; keepVisiting && i < projects.length; i++) { IPath projectPath = projects[i].getFullPath(); keepVisiting = internalAccept(visitor, projectPath, locationFor(projectPath), depth, 1); } } else internalAccept(visitor, base, locationFor(base), depth, 0); }
/** * From a starting point in the tree, visit all nodes under it. * @param visitor * @param base * @param depth */ public void accept(Bucket.Visitor visitor, IPath base, int depth) throws CoreException { if (Path.ROOT.equals(base)) { current.load(null, locationFor(Path.ROOT)); if (current.accept(visitor, base, DEPTH_ZERO) != Visitor.CONTINUE) return; if (depth == DEPTH_ZERO) return; boolean keepVisiting = true; depth--; IProject[] projects = workspace.getRoot().getProjects(IContainer.INCLUDE_HIDDEN); for (int i = 0; keepVisiting && i < projects.length; i++) { IPath projectPath = projects[i].getFullPath(); keepVisiting = internalAccept(visitor, projectPath, locationFor(projectPath), depth, 1); } } else internalAccept(visitor, base, locationFor(base), depth, 0); }
public Image getImage(Object element) { if (element instanceof LibraryStandin) { LibraryStandin library= (LibraryStandin) element; IPath sourcePath= library.getSystemLibrarySourcePath(); String key = null; if (sourcePath != null && !Path.EMPTY.equals(sourcePath)) { key = ISharedImages.IMG_OBJS_EXTERNAL_ARCHIVE_WITH_SOURCE; } else { key = ISharedImages.IMG_OBJS_EXTERNAL_ARCHIVE; } IStatus status = library.validate(); if (!status.isOK()) { ImageDescriptor base = JavaUI.getSharedImages().getImageDescriptor(key); JDIImageDescriptor descriptor= new JDIImageDescriptor(base, JDIImageDescriptor.IS_OUT_OF_SYNCH); return JDIDebugUIPlugin.getImageDescriptorRegistry().get(descriptor); } return JavaUI.getSharedImages().getImage(key); } else if (element instanceof SubElement) { if (((SubElement)element).getType() == SubElement.SOURCE_PATH) { return fRegistry.get(JavaPluginImages.DESC_OBJS_SOURCE_ATTACH_ATTRIB); // todo: change image } return fRegistry.get(JavaPluginImages.DESC_OBJS_JAVADOC_LOCATION_ATTRIB); // todo: change image } return null; }