private int compareTypeContainerName(String leftString, String rightString) { int leftLength= leftString.length(); int rightLength= rightString.length(); if (leftLength == 0 && rightLength > 0) return -1; if (leftLength == 0 && rightLength == 0) return 0; if (leftLength > 0 && rightLength == 0) return +1; return compareName(leftString, rightString); }
private void processVMInstallType(IVMInstallType installType, List locations, List labels) { if (installType != null) { IVMInstall[] installs= installType.getVMInstalls(); boolean isMac= Platform.OS_MACOSX.equals(Platform.getOS()); final String HOME_SUFFIX= "/Home"; //$NON-NLS-1$ for (int i= 0; i < installs.length; i++) { String label= getFormattedLabel(installs[i].getName()); LibraryLocation[] libLocations= installs[i].getLibraryLocations(); if (libLocations != null) { processLibraryLocation(libLocations, label); } else { String filePath= installs[i].getInstallLocation().getAbsolutePath(); // on MacOS X install locations end in an additional // "/Home" segment; remove it if (isMac && filePath.endsWith(HOME_SUFFIX)) filePath= filePath.substring(0, filePath.length() - HOME_SUFFIX.length() + 1); locations.add(filePath); labels.add(label); } } } }
/** * Creates new instance of TypeItemsComparator */ public TypeItemsComparator() { List locations= new ArrayList(); List labels= new ArrayList(); IVMInstallType[] installs= JavaRuntime.getVMInstallTypes(); for (int i= 0; i < installs.length; i++) { processVMInstallType(installs[i], locations, labels); } fInstallLocations= (String[]) locations.toArray(new String[locations.size()]); fVMNames= (String[]) labels.toArray(new String[labels.size()]); }
fTypeItemsComparator= new TypeItemsComparator();
fTypeItemsComparator= new TypeItemsComparator();
setDetailsLabelProvider(new TypeItemDetailsLabelProvider(fTypeInfoUtil)); fTypeItemsComparator= new TypeItemsComparator();
private void processVMInstallType(IVMInstallType installType, List<String> locations, List<String> labels) { if (installType != null) { IVMInstall[] installs= installType.getVMInstalls(); boolean isMac= Platform.OS_MACOSX.equals(Platform.getOS()); final String HOME_SUFFIX= "/Home"; //$NON-NLS-1$ for (int i= 0; i < installs.length; i++) { String label= getFormattedLabel(installs[i].getName()); LibraryLocation[] libLocations= installs[i].getLibraryLocations(); if (libLocations != null) { processLibraryLocation(libLocations, label); } else { String filePath= installs[i].getInstallLocation().getAbsolutePath(); // on MacOS X install locations end in an additional // "/Home" segment; remove it if (isMac && filePath.endsWith(HOME_SUFFIX)) filePath= filePath.substring(0, filePath.length() - HOME_SUFFIX.length() + 1); locations.add(filePath); labels.add(label); } } } }
private void processVMInstallType(IVMInstallType installType, List<String> locations, List<String> labels) { if (installType != null) { IVMInstall[] installs= installType.getVMInstalls(); boolean isMac= Platform.OS_MACOSX.equals(Platform.getOS()); final String HOME_SUFFIX= "/Home"; //$NON-NLS-1$ for (int i= 0; i < installs.length; i++) { String label= getFormattedLabel(installs[i].getName()); LibraryLocation[] libLocations= installs[i].getLibraryLocations(); if (libLocations != null) { processLibraryLocation(libLocations, label); } else { String filePath= installs[i].getInstallLocation().getAbsolutePath(); // on MacOS X install locations end in an additional // "/Home" segment; remove it if (isMac && filePath.endsWith(HOME_SUFFIX)) filePath= filePath.substring(0, filePath.length() - HOME_SUFFIX.length() + 1); locations.add(filePath); labels.add(label); } } } }
@Override public int compare(TypeNameMatch leftInfo, TypeNameMatch rightInfo) { int result= compareName(leftInfo.getSimpleTypeName(), rightInfo.getSimpleTypeName()); if (result != 0) return result; result= compareDeprecation(leftInfo.getModifiers(), rightInfo.getModifiers()); if (result != 0) return result; result= compareTypeContainerName(leftInfo.getTypeContainerName(), rightInfo.getTypeContainerName()); if (result != 0) return result; int leftCategory= getElementTypeCategory(leftInfo); int rightCategory= getElementTypeCategory(rightInfo); if (leftCategory < rightCategory) return -1; if (leftCategory > rightCategory) return +1; return compareContainerName(leftInfo, rightInfo); }
@Override public int compare(TypeNameMatch leftInfo, TypeNameMatch rightInfo) { int result= compareName(leftInfo.getSimpleTypeName(), rightInfo.getSimpleTypeName()); if (result != 0) return result; result= compareDeprecation(leftInfo.getModifiers(), rightInfo.getModifiers()); if (result != 0) return result; result= compareTypeContainerName(leftInfo.getTypeContainerName(), rightInfo.getTypeContainerName()); if (result != 0) return result; int leftCategory= getElementTypeCategory(leftInfo); int rightCategory= getElementTypeCategory(rightInfo); if (leftCategory < rightCategory) return -1; if (leftCategory > rightCategory) return +1; return compareContainerName(leftInfo, rightInfo); }
public int compare(Object left, Object right) { TypeNameMatch leftInfo= (TypeNameMatch) left; TypeNameMatch rightInfo= (TypeNameMatch) right; int result= compareName(leftInfo.getSimpleTypeName(), rightInfo.getSimpleTypeName()); if (result != 0) return result; result= compareTypeContainerName(leftInfo.getTypeContainerName(), rightInfo.getTypeContainerName()); if (result != 0) return result; int leftCategory= getElementTypeCategory(leftInfo); int rightCategory= getElementTypeCategory(rightInfo); if (leftCategory < rightCategory) return -1; if (leftCategory > rightCategory) return +1; return compareContainerName(leftInfo, rightInfo); }
private int compareContainerName(TypeNameMatch leftType, TypeNameMatch rightType) { return getContainerName(leftType).compareTo(getContainerName(rightType)); }
private int compareContainerName(TypeNameMatch leftType, TypeNameMatch rightType) { return getContainerName(leftType).compareTo(getContainerName(rightType)); }
private int compareContainerName(TypeNameMatch leftType, TypeNameMatch rightType) { return getContainerName(leftType).compareTo(getContainerName(rightType)); }
/** * Creates new instance of TypeItemsComparator */ public TypeItemsComparator() { List<String> locations= new ArrayList<>(); List<String> labels= new ArrayList<>(); IVMInstallType[] installs= JavaRuntime.getVMInstallTypes(); for (int i= 0; i < installs.length; i++) { processVMInstallType(installs[i], locations, labels); } fInstallLocations= locations.toArray(new String[locations.size()]); fVMNames= labels.toArray(new String[labels.size()]); }
private int compareTypeContainerName(String leftString, String rightString) { int leftLength= leftString.length(); int rightLength= rightString.length(); if (leftLength == 0 && rightLength > 0) return -1; if (leftLength == 0 && rightLength == 0) return 0; if (leftLength > 0 && rightLength == 0) return +1; return compareName(leftString, rightString); }
/** * Creates new instance of TypeItemsComparator */ public TypeItemsComparator() { List<String> locations= new ArrayList<>(); List<String> labels= new ArrayList<>(); IVMInstallType[] installs= JavaRuntime.getVMInstallTypes(); for (int i= 0; i < installs.length; i++) { processVMInstallType(installs[i], locations, labels); } fInstallLocations= locations.toArray(new String[locations.size()]); fVMNames= labels.toArray(new String[labels.size()]); }
private int compareTypeContainerName(String leftString, String rightString) { int leftLength= leftString.length(); int rightLength= rightString.length(); if (leftLength == 0 && rightLength > 0) return -1; if (leftLength == 0 && rightLength == 0) return 0; if (leftLength > 0 && rightLength == 0) return +1; return compareName(leftString, rightString); }