public static boolean isArchivePath(IPath path) { String ext= path.getFileExtension(); if (ext != null && ext.length() != 0) { for (int i= 0; i < fgArchiveExtensions.length; i++) { if (ext.equalsIgnoreCase(fgArchiveExtensions[i])) { return true; } } } return false; }
private int getImageType(final IPath path) { String extension = path.getFileExtension(); if ("gif".equalsIgnoreCase(extension)) //$NON-NLS-1$ return SWT.IMAGE_GIF; else if ("bmp".equalsIgnoreCase(extension)) //$NON-NLS-1$ return SWT.IMAGE_BMP; else if ("png".equalsIgnoreCase(extension)) //$NON-NLS-1$ return SWT.IMAGE_PNG; else if ("ico".equalsIgnoreCase(extension)) //$NON-NLS-1$ return SWT.IMAGE_ICO; return SWT.IMAGE_PNG; }
public static boolean isJmod(File file) { IPath path = Path.fromOSString(file.getPath()); if (path.getFileExtension().equalsIgnoreCase(SuffixConstants.EXTENSION_jmod)) { return true; } return false; }
public static boolean isArchivePath(IPath path) { String ext= path.getFileExtension(); if (ext != null && ext.length() != 0) { return isArchiveFileExtension(ext); } return false; }
public static boolean isArchivePath(IPath path, boolean allowAllAchives) { if (allowAllAchives) return true; String ext= path.getFileExtension(); if (ext != null && ext.length() != 0) { return isArchiveFileExtension(ext); } return false; }
public static boolean isArchivePath(IPath path, boolean allowAllAchives) { if (allowAllAchives) return true; String ext= path.getFileExtension(); if (ext != null && ext.length() != 0) { return isArchiveFileExtension(ext); } return false; }
public static boolean isJmod(File file) { IPath path = Path.fromOSString(file.getPath()); if (path.getFileExtension().equalsIgnoreCase(SuffixConstants.EXTENSION_jmod)) { return true; } return false; }
public boolean isFileValid(IPath path) { String ext = path.getFileExtension(); if (isPathValid(path) && ext != null && ext.length() != 0) return ext.equals(jarExt); return false; }
public boolean isLanguageResource(IResource resource) { String fileExtension = resource.getFullPath().getFileExtension(); for (String ext : getFileExtensions()) { if (ext.equals(fileExtension)) return true; } return false; } }
/** * @param jarRes * @return */ private boolean isIndexable(IJarEntryResource jarRes) { String ext = jarRes.getFullPath().getFileExtension(); return isIndexableExtension(ext); }
@Override public ImageDescriptor getImageDescriptor() { IEditorRegistry registry = PlatformUI.getWorkbench().getEditorRegistry(); return registry.getImageDescriptor(fJarEntryFile.getFullPath().getFileExtension()); }
protected void updateModel() { // destination String comboText= fDestinationNamesCombo.getText(); IPath path= Path.fromOSString(comboText); if (path.segmentCount() > 0 && ensureTargetFileIsValid(path.toFile()) && path.getFileExtension() == null) // append .jar path= path.addFileExtension(JarPackagerUtil.JAR_EXTENSION); fJarPackage.setJarLocation(path); }
/** * Stores the widget values in the JAR package. */ @Override protected void updateModel() { super.updateModel(); String comboText= fAntScriptNamesCombo.getText(); IPath path= Path.fromOSString(comboText); if (path.segmentCount() > 0 && ensureAntScriptFileIsValid(path.toFile()) && path.getFileExtension() == null) path= path.addFileExtension(ANTSCRIPT_EXTENSION); fAntScriptLocation= getAbsoluteLocation(path); }
/** * Stores the widget values in the JAR package. */ @Override protected void updateModel() { super.updateModel(); String comboText= fAntScriptNamesCombo.getText(); IPath path= Path.fromOSString(comboText); if (path.segmentCount() > 0 && ensureAntScriptFileIsValid(path.toFile()) && path.getFileExtension() == null) path= path.addFileExtension(ANTSCRIPT_EXTENSION); fAntScriptLocation= getAbsoluteLocation(path); }
/** * Stores the widget values in the JAR package. */ @Override protected void updateModel() { super.updateModel(); String comboText= fAntScriptNamesCombo.getText(); IPath path= Path.fromOSString(comboText); if (path.segmentCount() > 0 && ensureAntScriptFileIsValid(path.toFile()) && path.getFileExtension() == null) path= path.addFileExtension(ANTSCRIPT_EXTENSION); fAntScriptLocation= getAbsoluteLocation(path); }
@Override public String getType() { return fHunkResult.getDiffResult().getDiff().getTargetPath(fHunkResult.getDiffResult().getConfiguration()).getFileExtension(); }
@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()); } }
@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()); }