mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-24 23:18:17 +01:00
Fix git issue with renaming
This commit is contained in:
parent
60a027e00d
commit
cb236f65fb
3 changed files with 11 additions and 44 deletions
|
@ -1,33 +0,0 @@
|
|||
/*
|
||||
* This file is part of Bitsquare.
|
||||
*
|
||||
* Bitsquare is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Bitsquare is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
|
||||
* License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package io.bitsquare.gui.common;
|
||||
|
||||
import static java.lang.String.format;
|
||||
|
||||
public class ViewFxException1 extends RuntimeException {
|
||||
|
||||
private static final long serialVersionUID = -6266047448442595372L;
|
||||
|
||||
public ViewFxException1(Throwable cause, String format, Object... args) {
|
||||
super(format(format, args), cause);
|
||||
}
|
||||
|
||||
public ViewFxException1(String format, Object... args) {
|
||||
super(format(format, args));
|
||||
}
|
||||
}
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
package io.bitsquare.gui.common.fxml;
|
||||
|
||||
import io.bitsquare.gui.common.ViewFxException;
|
||||
import io.bitsquare.gui.common.ViewfxException;
|
||||
import io.bitsquare.gui.common.view.FxmlView;
|
||||
import io.bitsquare.gui.common.view.View;
|
||||
import io.bitsquare.gui.common.view.ViewFactory;
|
||||
|
@ -76,13 +76,13 @@ public class FxmlViewLoader implements ViewLoader {
|
|||
|
||||
URL fxmlUrl = viewClass.getClassLoader().getResource(resolvedLocation);
|
||||
if (fxmlUrl == null)
|
||||
throw new ViewFxException(
|
||||
throw new ViewfxException(
|
||||
"Failed to load view class [%s] because FXML file at [%s] could not be loaded " +
|
||||
"as a classpath resource. Does it exist?", viewClass, specifiedLocation);
|
||||
|
||||
return loadFromFxml(fxmlUrl);
|
||||
} catch (InstantiationException | IllegalAccessException ex) {
|
||||
throw new ViewFxException(ex, "Failed to load view from class %s", viewClass);
|
||||
throw new ViewfxException(ex, "Failed to load view from class %s", viewClass);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -94,14 +94,14 @@ public class FxmlViewLoader implements ViewLoader {
|
|||
loader.load();
|
||||
Object controller = loader.getController();
|
||||
if (controller == null)
|
||||
throw new ViewFxException("Failed to load view from FXML file at [%s]. " +
|
||||
throw new ViewfxException("Failed to load view from FXML file at [%s]. " +
|
||||
"Does it declare an fx:controller attribute?", fxmlUrl);
|
||||
if (!(controller instanceof View))
|
||||
throw new ViewFxException("Controller of type [%s] loaded from FXML file at [%s] " +
|
||||
throw new ViewfxException("Controller of type [%s] loaded from FXML file at [%s] " +
|
||||
"does not implement [%s] as expected.", controller.getClass(), fxmlUrl, View.class);
|
||||
return (View) controller;
|
||||
} catch (IOException ex) {
|
||||
throw new ViewFxException(ex, "Failed to load view from FXML file at [%s]", fxmlUrl);
|
||||
throw new ViewfxException(ex, "Failed to load view from FXML file at [%s]", fxmlUrl);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
package io.bitsquare.common.fxml;
|
||||
|
||||
import io.bitsquare.gui.common.ViewFxException;
|
||||
import io.bitsquare.gui.common.ViewfxException;
|
||||
import io.bitsquare.gui.common.fxml.FxmlViewLoader;
|
||||
import io.bitsquare.gui.common.view.*;
|
||||
import javafx.fxml.LoadException;
|
||||
|
@ -70,7 +70,7 @@ public class FxmlViewLoaderTests {
|
|||
|
||||
@Test
|
||||
public void fxmlFileMissingFxControllerAttributeShouldThrow() {
|
||||
thrown.expect(ViewFxException.class);
|
||||
thrown.expect(ViewfxException.class);
|
||||
thrown.expectMessage("Does it declare an fx:controller attribute?");
|
||||
viewLoader.load(MissingFxController.class);
|
||||
}
|
||||
|
@ -93,7 +93,7 @@ public class FxmlViewLoaderTests {
|
|||
|
||||
@Test
|
||||
public void malformedFxmlFileShouldThrow() {
|
||||
thrown.expect(ViewFxException.class);
|
||||
thrown.expect(ViewfxException.class);
|
||||
thrown.expectMessage("Failed to load view from FXML file");
|
||||
thrown.expectCause(instanceOf(LoadException.class));
|
||||
viewLoader.load(Malformed.class);
|
||||
|
@ -106,7 +106,7 @@ public class FxmlViewLoaderTests {
|
|||
|
||||
@Test
|
||||
public void missingFxmlFileShouldThrow() {
|
||||
thrown.expect(ViewFxException.class);
|
||||
thrown.expect(ViewfxException.class);
|
||||
thrown.expectMessage("Does it exist?");
|
||||
viewLoader.load(MissingFxmlFile.class);
|
||||
}
|
||||
|
@ -118,7 +118,7 @@ public class FxmlViewLoaderTests {
|
|||
|
||||
@Test
|
||||
public void customFxmlFileLocationShouldOverrideDefaultConvention() {
|
||||
thrown.expect(ViewFxException.class);
|
||||
thrown.expect(ViewfxException.class);
|
||||
thrown.expectMessage("Failed to load view class");
|
||||
thrown.expectMessage("CustomLocation");
|
||||
thrown.expectMessage("[unconventionally/located.fxml] could not be loaded");
|
||||
|
|
Loading…
Add table
Reference in a new issue