Fix NPE, controller not found
This commit is contained in:
@ -115,8 +115,8 @@ public class MainDesignerController implements Initializable, SettingsOwner {
|
||||
private SourceEditorController sourceEditorController;
|
||||
@FXML
|
||||
private EventLogController eventLogPanelController;
|
||||
@FXML
|
||||
private AuxClassPathController auxClassPathController;
|
||||
|
||||
private final AuxClassPathController auxClassPathController;
|
||||
|
||||
// Other fields
|
||||
private Stack<File> recentFiles = new LimitedSizeStack<>(5);
|
||||
@ -127,6 +127,7 @@ public class MainDesignerController implements Initializable, SettingsOwner {
|
||||
|
||||
public MainDesignerController(DesignerRoot owner) {
|
||||
this.designerRoot = owner;
|
||||
this.auxClassPathController = new AuxClassPathController(designerRoot, this);
|
||||
}
|
||||
|
||||
|
||||
|
@ -226,7 +226,6 @@ public class XPathPanelController implements Initializable, SettingsOwner {
|
||||
|
||||
|
||||
public void showExportXPathToRuleWizard() throws IOException {
|
||||
// doesn't work for some reason
|
||||
ExportXPathWizardController wizard
|
||||
= new ExportXPathWizardController(xpathExpressionProperty());
|
||||
|
||||
|
@ -30,19 +30,14 @@ public class AuxClassPathController implements Initializable, SettingsOwner {
|
||||
|
||||
@FXML
|
||||
private Button removeFiles;
|
||||
|
||||
@FXML
|
||||
private TableView fileTable;
|
||||
|
||||
@FXML
|
||||
private Button selectFile;
|
||||
|
||||
@FXML
|
||||
private TableColumn fileList;
|
||||
|
||||
@FXML
|
||||
private TableColumn fileAdd;
|
||||
|
||||
@FXML
|
||||
private final MainDesignerController parent;
|
||||
|
||||
@ -71,12 +66,20 @@ public class AuxClassPathController implements Initializable, SettingsOwner {
|
||||
|
||||
public void showAuxPathWizard() throws Exception {
|
||||
|
||||
FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("fxml/aux-controller.fxml"));
|
||||
Parent root1 = (Parent) fxmlLoader.load();
|
||||
FXMLLoader fxmlLoader = new FXMLLoader(DesignerUtil.getFxml("aux-controller.fxml"));
|
||||
|
||||
fxmlLoader.setControllerFactory(type -> {
|
||||
if (type == AuxClassPathController.class) {
|
||||
return this;
|
||||
} else {
|
||||
throw new IllegalStateException("Wrong controller!");
|
||||
}
|
||||
});
|
||||
|
||||
Parent root1 = fxmlLoader.load();
|
||||
Stage stage = new Stage();
|
||||
stage.setScene(new Scene(root1));
|
||||
stage.show();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user