mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
a bit of cleaning
This commit is contained in:
@@ -40,7 +40,7 @@ abstract public class Contribution {
|
||||
|
||||
static final String SPECIAL_CATEGORY = "Starred";
|
||||
static final String UNKNOWN_CATEGORY = "Unknown";
|
||||
static final List validCategories =
|
||||
static final List<String> validCategories =
|
||||
Arrays.asList("3D", "Animation", "Data", "Geometry", "GUI", "Hardware",
|
||||
"I/O", "Math", "Simulation", "Sound", SPECIAL_CATEGORY,
|
||||
"Typography", "Utilities", "Video & Vision", "Other");
|
||||
@@ -95,20 +95,6 @@ abstract public class Contribution {
|
||||
return imports;
|
||||
}
|
||||
|
||||
/*
|
||||
protected String getImportStr() {
|
||||
if (imports == null || imports.isEmpty()) {
|
||||
return "";
|
||||
}
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (String importName : imports) {
|
||||
sb.append(importName);
|
||||
sb.append(',');
|
||||
}
|
||||
sb.deleteCharAt(sb.length() - 1); // delete last comma
|
||||
return sb.toString();
|
||||
}
|
||||
*/
|
||||
|
||||
protected boolean hasImport(String importName) {
|
||||
if (imports != null && importName != null) {
|
||||
@@ -263,9 +249,11 @@ abstract public class Contribution {
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
public StringDict loadProperties(File contribFolder) {
|
||||
return loadProperties(contribFolder, getType());
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
static public StringDict loadProperties(File contribFolder,
|
||||
|
||||
@@ -353,7 +353,11 @@ public class ContributionListing {
|
||||
try {
|
||||
URL url = new URL(LISTING_URL);
|
||||
File tempContribFile = Base.getSettingsFile("contribs.tmp");
|
||||
tempContribFile.setWritable(true, false);
|
||||
if (tempContribFile.exists() && !tempContribFile.canWrite()) {
|
||||
if (!tempContribFile.setWritable(true, false)) {
|
||||
System.err.println("Could not set " + tempContribFile + " writable");
|
||||
}
|
||||
}
|
||||
ContributionManager.download(url, base.getInstalledContribsInfo(),
|
||||
tempContribFile, progress);
|
||||
if (!progress.isCanceled() && !progress.isError()) {
|
||||
@@ -421,13 +425,6 @@ public class ContributionListing {
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
protected boolean listDownloadSuccessful() {
|
||||
return !listDownloadFailed;
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
private List<AvailableContribution> parseContribList(File file) {
|
||||
List<AvailableContribution> outgoing = new ArrayList<>();
|
||||
|
||||
@@ -515,7 +512,8 @@ public class ContributionListing {
|
||||
}
|
||||
|
||||
|
||||
static public Comparator<Contribution> COMPARATOR = Comparator.comparing(o -> o.getName().toLowerCase());
|
||||
static public Comparator<Contribution> COMPARATOR =
|
||||
Comparator.comparing(o -> o.getName().toLowerCase());
|
||||
|
||||
|
||||
public interface ChangeListener {
|
||||
|
||||
Reference in New Issue
Block a user