public Properties getProductTranslation() { initValues(); URL transURL = null; if (customizationValue != null) transURL = FileLocator.find(customizationBundle, NL_DIR.append(customizationValue).removeFileExtension().addFileExtension(PROPERTIES_FILE_EXTENSION), null); if (transURL == null && InternalPlatform.DEBUG_PLUGIN_PREFERENCES) InternalPlatform.message("No preference translations found for product/file: " + customizationBundle.getSymbolicName() + '/' + customizationValue); //$NON-NLS-1$ return loadProperties(transURL); }
public static String getLastSegment(IPath path, boolean removeFileExtension) { if (path == null) { return null; } if (removeFileExtension) { path.removeFileExtension(); } return path.lastSegment(); }
/** * Given a name that ends with .launch, return the simple name of the configuration. * * @param fileName the name to parse * @return simple name * @since 3.5 */ protected static String getSimpleName(String fileName) { IPath path = new Path(fileName); if(ILaunchConfiguration.LAUNCH_CONFIGURATION_FILE_EXTENSION.equals(path.getFileExtension())) { return path.removeFileExtension().toString(); } return fileName; }
private static String getFileName(XSDSchema schema) { URI schemaURI = schema.eResource().getURI(); IPath filePath = new Path(schemaURI.toString()); return filePath.removeFileExtension().lastSegment().toString(); } }
@Override public String getName() { String nam = getNameNoDefault(); if (Strings.isNullOrEmpty(nam)) { final IPath path = getJarFile(); if (path != null) { nam = path.removeFileExtension().lastSegment(); } else { nam = getId(); } } return nam; }
static File getProgram(IContainer project) { IPath projectFile = ProjectFileAccessor.getProjectFile(project); String projectConfiguration = "Debug"; //$NON-NLS-1$ String[] frameworks = ProjectFileAccessor.getTargetFrameworks(project.getWorkspace().getRoot().getFile(projectFile).getLocation()); if (frameworks.length > 0) { return new File(project.getLocation().toFile().getAbsolutePath() + "/bin/" + projectConfiguration + "/" + frameworks[0] + "/" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + projectFile.removeFileExtension().addFileExtension("dll").lastSegment()); //$NON-NLS-1$ } return null; }
public Object[] getResult() { Object[] objects = super.getResult(); if (objects == null || objects.length == 0) { return null; } IPath path = JavaUtil.getPathOnClasspath(_javaProject, objects[0]); String result = null; if (path.segmentCount() == 0) { return new Object[] { "" }; } path = path.removeFileExtension(); result = path.toOSString(); result = result.replace(File.separatorChar, '.'); return new Object[] { result }; }
@Override public Properties getProductTranslation() { initValues(); URL transURL = null; if (customizationValue != null) transURL = FileLocator.find(customizationBundle, NL_DIR.append(customizationValue).removeFileExtension().addFileExtension(PROPERTIES_FILE_EXTENSION), null); if (transURL == null && InternalPlatform.DEBUG_PLUGIN_PREFERENCES) InternalPlatform.message("No preference translations found for product/file: " + customizationBundle.getSymbolicName() + '/' + customizationValue); //$NON-NLS-1$ return loadProperties(transURL); }
public Properties getProductTranslation() { initValues(); URL transURL = null; if (customizationValue != null) transURL = FileLocator.find(customizationBundle, NL_DIR.append(customizationValue).removeFileExtension().addFileExtension(PROPERTIES_FILE_EXTENSION), null); if (transURL == null && InternalPlatform.DEBUG_PLUGIN_PREFERENCES) InternalPlatform.message("No preference translations found for product/file: " + customizationBundle.getSymbolicName() + '/' + customizationValue); //$NON-NLS-1$ return loadProperties(transURL); }
public Properties getProductTranslation() { initValues(); URL transURL = null; if (customizationValue != null) transURL = FileLocator.find(customizationBundle, NL_DIR.append(customizationValue).removeFileExtension().addFileExtension(PROPERTIES_FILE_EXTENSION), null); if (transURL == null && InternalPlatform.DEBUG_PLUGIN_PREFERENCES) InternalPlatform.message("No preference translations found for product/file: " + customizationBundle.getSymbolicName() + '/' + customizationValue); //$NON-NLS-1$ return loadProperties(transURL); }
public UnpackJarBuilder(JarPackageData jarPackage) { fSubfolder= jarPackage.getAbsoluteJarLocation().removeFileExtension().lastSegment() + SUBFOLDER_SUFFIX; fSubfolderPath= jarPackage.getAbsoluteJarLocation().removeLastSegments(1).append(fSubfolder); fJarPackage= jarPackage; }
public UnpackJarBuilder(JarPackageData jarPackage) { fSubfolder= jarPackage.getAbsoluteJarLocation().removeFileExtension().lastSegment() + SUBFOLDER_SUFFIX; fSubfolderPath= jarPackage.getAbsoluteJarLocation().removeLastSegments(1).append(fSubfolder); fJarPackage= jarPackage; }
/** * Open an appropriate destination browser so that the user can specify a source * to import from */ protected void handleDescriptionFileBrowseButtonPressed() { SaveAsDialog dialog= new SaveAsDialog(getContainer().getShell()); dialog.create(); dialog.getShell().setText(JarPackagerMessages.JarOptionsPage_saveAsDialog_title); dialog.setMessage(JarPackagerMessages.JarOptionsPage_saveAsDialog_message); dialog.setOriginalFile(createFileHandle(fJarPackage.getDescriptionLocation())); if (dialog.open() == Window.OK) { IPath path= dialog.getResult(); path= path.removeFileExtension().addFileExtension(JarPackagerUtil.DESCRIPTION_EXTENSION); fDescriptionFileText.setText(path.toString()); } }
/** * Open an appropriate destination browser so that the user can specify a source * to import from */ protected void handleDescriptionFileBrowseButtonPressed() { SaveAsDialog dialog= new SaveAsDialog(getContainer().getShell()); dialog.create(); dialog.getShell().setText(JarPackagerMessages.JarOptionsPage_saveAsDialog_title); dialog.setMessage(JarPackagerMessages.JarOptionsPage_saveAsDialog_message); dialog.setOriginalFile(createFileHandle(fJarPackage.getDescriptionLocation())); if (dialog.open() == Window.OK) { IPath path= dialog.getResult(); path= path.removeFileExtension().addFileExtension(AJJarPackagerUtil.DESCRIPTION_EXTENSION); fDescriptionFileText.setText(path.toString()); } }
@Override protected IPath createNewPath() { final IPath path= getResourcePath(); if (path.getFileExtension() != null) return path.removeFileExtension().removeLastSegments(1).append(getNewName()); else return path.removeLastSegments(1).append(getNewName()); }
@Override protected IPath createNewPath() { final IPath path= getResourcePath(); if (path.getFileExtension() != null) { return path.removeFileExtension().removeLastSegments(1).append(getNewName()); } else { return path.removeLastSegments(1).append(getNewName()); } }
protected IPath createNewPath() { final IPath path= getResourcePath(); if (path.getFileExtension() != null) return path.removeFileExtension().removeLastSegments(1).append(getNewName()); else return path.removeLastSegments(1).append(getNewName()); }
@Override protected IPath createNewPath() { final IPath path= getResourcePath(); if (path.getFileExtension() != null) return path.removeFileExtension().removeLastSegments(1).append(getNewName()); else return path.removeLastSegments(1).append(getNewName()); }
public String getLabel() { if(plural) { return MarkerMessages.FilterProblemResolution_create_filters_for_problems; } else { IJavaElement element = resolveElementFromMarker(); if(element != null) { return MessageFormat.format(MarkerMessages.FilterProblemResolution_0, new String[] {JavaElementLabels.getTextLabel(element, JavaElementLabels.M_PARAMETER_TYPES), resolveCategoryName()}); } else { IResource res = fBackingMarker.getResource(); return MessageFormat.format(MarkerMessages.FilterProblemResolution_0, new String[] {res.getFullPath().removeFileExtension().lastSegment(), resolveCategoryName()}); } } }
public String getLabel() { if(plural) { return MarkerMessages.FilterProblemWithCommentResolution_create_commented_filters; } else { IJavaElement element = resolveElementFromMarker(); if(element != null) { return MessageFormat.format(MarkerMessages.FilterProblemWithCommentResolution_create_commented_filter, new String[] {JavaElementLabels.getTextLabel(element, JavaElementLabels.M_PARAMETER_TYPES), resolveCategoryName()}); } else { IResource res = fBackingMarker.getResource(); return MessageFormat.format(MarkerMessages.FilterProblemWithCommentResolution_create_commented_filter, new String[] {res.getFullPath().removeFileExtension().lastSegment(), resolveCategoryName()}); } } }