/** * Sets the initial contents of the container name field. */ protected final void initialPopulateContainerField() { if (initialContainerFieldValue != null) { containerNameField.setText(initialContainerFieldValue); } else if (currentResourceSelection != null) { containerNameField.setText(currentResourceSelection.getFullPath() .makeRelative().toString()); } }
@Override public String getDescription(Object anElement) { if (anElement instanceof IResource) { return ((IResource) anElement).getFullPath().makeRelative().toString(); } return null; }
/** * Creates and returns the string that should be used as the name of the entry in the archive. * @param exportResource the resource to export * @param leadupDepth the number of resource levels to be included in the path including the resourse itself. */ private String createDestinationName(int leadupDepth, IResource exportResource) { IPath fullPath = exportResource.getFullPath(); if (createLeadupStructure) { return fullPath.makeRelative().toString(); } return fullPath.removeFirstSegments(fullPath.segmentCount() - leadupDepth).makeRelative().toString(); }
/** * @param path Path which needs to be changed relative to OS * @return returns the changed string. */ static String stripProtocol(String path) { return new Path(path).setDevice(null).makeRelative().toOSString(); }
/** * Set the resource whos name we will display. * @param resource */ protected void setResourceToDisplay(IResource resource) { setResourceFieldValue(resource.getFullPath().makeRelative().toString()); }
private void buildPathChangeControlPressed(DialogField field) { if (field == fBuildPathDialogField) { IContainer container= chooseContainer(); if (container != null) { fBuildPathDialogField.setText(container.getFullPath().makeRelative().toString()); } } }
private void buildPathChangeControlPressed(DialogField field) { if (field == fBuildPathDialogField) { IContainer container= chooseContainer(); if (container != null) { fBuildPathDialogField.setText(container.getFullPath().makeRelative().toString()); } } }
private void buildPathChangeControlPressed(DialogField field) { if (field == fBuildPathDialogField) { IContainer container= chooseContainer(); if (container != null) { fBuildPathDialogField.setText(container.getFullPath().makeRelative().toString()); } } }
protected IModuleResource[] getBinaryModuleMembers() { IPath archivePath = ((J2EEModuleVirtualArchiveComponent)component).getWorkspaceRelativePath(); ModuleFile mf = null; if (archivePath != null) { //In Workspace IFile utilFile = ResourcesPlugin.getWorkspace().getRoot().getFile(archivePath); mf = new ModuleFile(utilFile, utilFile.getName(), ((J2EEModuleVirtualArchiveComponent)component).getRuntimePath().makeRelative()); } else { File extFile = ((J2EEModuleVirtualArchiveComponent)component).getUnderlyingDiskFile(); mf = new ModuleFile(extFile, extFile.getName(), ((J2EEModuleVirtualArchiveComponent)component).getRuntimePath().makeRelative()); } return new IModuleResource[] {mf}; }
/** * Notification before a compile that a unit is about to be compiled. */ public void aboutToCompile(SourceFile unit) { String message = Messages.bind(Messages.build_compiling, unit.resource.getFullPath().removeLastSegments(1).makeRelative().toString()); subTask(message); }
protected void handleBrowseWorkspace() { ContainerSelectionDialog dialog = new ContainerSelectionDialog(fLocationText.getShell(), getContainer(), true, PDEUIMessages.BaseBlock_relative); if (dialog.open() == Window.OK) { Object[] result = dialog.getResult(); if (result.length == 0) return; IPath path = (IPath) result[0]; fLocationText.setText("${workspace_loc:" + path.makeRelative().toString() + "}"); //$NON-NLS-1$ //$NON-NLS-2$ } }
/** * Notification before a compile that a unit is about to be compiled. */ public void aboutToCompile(SourceFile unit) { String message = Messages.bind(Messages.build_compiling, unit.resource.getFullPath().removeLastSegments(1).makeRelative().toString()); subTask(message); }
/** * Notification before a compile that a unit is about to be compiled. */ public void aboutToCompile(SourceFile unit) { String message = Messages.bind(Messages.build_compiling, unit.resource.getFullPath().removeLastSegments(1).makeRelative().toString()); subTask(message); }
private String formatResourceMessage(IResource element) { IContainer parent = element.getParent(); if (parent != null && parent.getType() != IResource.ROOT) return element.getName() + JavaElementLabels.CONCAT_STRING + parent.getFullPath().makeRelative().toString(); else return element.getName(); }
private String getVariableString(IPath path) { String name= path.makeRelative().toString(); IPath entryPath= JavaCore.getClasspathVariable(path.segment(0)); if (entryPath != null) { String appended= entryPath.append(path.removeFirstSegments(1)).toOSString(); return Messages.format(NewWizardMessages.CPListLabelProvider_twopart, new String[] { name, appended }); } else { return name; } }
/** * Notification while within a compile that a unit has finished being compiled. */ public void compiled(SourceFile unit) { String message = Messages.bind(Messages.build_compiling, unit.resource.getFullPath().removeLastSegments(1).makeRelative().toString()); subTask(message); updateProgressDelta(this.progressPerCompilationUnit); checkCancelWithinCompiler(); }
/** * Notification while within a compile that a unit has finished being compiled. */ public void compiled(SourceFile unit) { String message = Messages.bind(Messages.build_compiling, unit.resource.getFullPath().removeLastSegments(1).makeRelative().toString()); subTask(message); updateProgressDelta(this.progressPerCompilationUnit); checkCancelWithinCompiler(); }
/** * Notification while within a compile that a unit has finished being compiled. */ public void compiled(SourceFile unit) { String message = Messages.bind(Messages.build_compiling, unit.resource.getFullPath().removeLastSegments(1).makeRelative().toString()); subTask(message); updateProgressDelta(this.progressPerCompilationUnit); checkCancelWithinCompiler(); }
void updateStatusLine() { boolean hasSingleSelection= getSelectedEntriesCount() == 1; String location= ""; //$NON-NLS-1$ if (hasSingleSelection) { ISearchResultViewEntry entry= (ISearchResultViewEntry)getTable().getItem(getTable().getSelectionIndex()).getData(); IPath path= entry.getResource().getFullPath(); if (path != null) location= path.makeRelative().toString(); } setStatusLineMessage(location); }
void updateStatusLine() { boolean hasSingleSelection= getSelectedEntriesCount() == 1; String location= ""; //$NON-NLS-1$ if (hasSingleSelection) { ISearchResultViewEntry entry= (ISearchResultViewEntry)getTable().getItem(getTable().getSelectionIndex()).getData(); IPath path= entry.getResource().getFullPath(); if (path != null) location= path.makeRelative().toString(); } setStatusLineMessage(location); }