Minor updates
This commit is contained in:
@ -33,16 +33,14 @@ public class ClasspathClassLoader extends URLClassLoader {
|
||||
static {
|
||||
registerAsParallelCapable();
|
||||
}
|
||||
|
||||
public ClasspathClassLoader(String classpath, ClassLoader parent) throws IOException {
|
||||
super(initURLs(classpath), parent);
|
||||
}
|
||||
|
||||
|
||||
public ClasspathClassLoader(List<File> files, ClassLoader parent) throws IOException {
|
||||
super(fileToURL(files), parent);
|
||||
}
|
||||
|
||||
public ClasspathClassLoader(String classpath, ClassLoader parent) throws IOException {
|
||||
super(initURLs(classpath), parent);
|
||||
}
|
||||
|
||||
private static URL[] fileToURL(List<File> files) throws IOException {
|
||||
|
||||
@ -51,7 +49,7 @@ public class ClasspathClassLoader extends URLClassLoader {
|
||||
for (File f : files) {
|
||||
urlList.add(f.toURI().toURL());
|
||||
}
|
||||
return urlList.toArray(new URL[urlList.size()]);
|
||||
return urlList.toArray(new URL[0]);
|
||||
}
|
||||
|
||||
private static URL[] initURLs(String classpath) throws IOException {
|
||||
|
@ -57,7 +57,7 @@ public class AuxClassPathController implements Initializable, SettingsOwner {
|
||||
removeFileButton.disableProperty().bind(fileListView.getSelectionModel().selectedItemProperty().isNull());
|
||||
moveItemUpButton.disableProperty().bind(fileListView.getSelectionModel().selectedItemProperty().isNull());
|
||||
moveItemDownButton.disableProperty().bind(fileListView.getSelectionModel().selectedItemProperty().isNull());
|
||||
setClassPathButton.disableProperty().bind(fileListView.getSelectionModel().selectedItemProperty().isNull());
|
||||
|
||||
|
||||
|
||||
selectFilesButton.setOnAction(e -> onSelectFileClicked());
|
||||
|
@ -76,9 +76,9 @@ public class SourceEditorController implements Initializable, SettingsOwner {
|
||||
private static final Duration AST_REFRESH_DELAY = Duration.ofMillis(100);
|
||||
|
||||
private Var<List<File>> auxclasspathFiles = Var.newSimpleVar(Collections.emptyList());
|
||||
private final Val<ClassLoader> auxclasspathClassLoader = auxclasspathFiles.map(files -> {
|
||||
private final Val<ClassLoader> auxclasspathClassLoader = auxclasspathFiles.map(fileList -> {
|
||||
try {
|
||||
return new ClasspathClassLoader(files, SourceEditorController.class.getClassLoader());
|
||||
return new ClasspathClassLoader(fileList, SourceEditorController.class.getClassLoader());
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@ -117,6 +117,8 @@ public class SourceEditorController implements Initializable, SettingsOwner {
|
||||
parent.refreshAST();
|
||||
});
|
||||
|
||||
auxclasspathClassLoader.changes().subscribe(t -> parent.refreshAST());
|
||||
|
||||
codeEditorArea.setParagraphGraphicFactory(LineNumberFactory.get(codeEditorArea));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user