Added public remove() method, which is now required by Updatable interface.
This commit is contained in:
parent
52739414bd
commit
7799423ae5
2 changed files with 19 additions and 6 deletions
|
@ -69,10 +69,7 @@ public final class SkinFile implements Updatable {
|
||||||
|
|
||||||
if (!file.exists ()) {
|
if (!file.exists ()) {
|
||||||
// remove skin from prototype
|
// remove skin from prototype
|
||||||
if (prototype != null) {
|
remove ();
|
||||||
prototype.skins.remove (name);
|
|
||||||
prototype.updatables.remove (file.getName());
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
// we only need to update if the skin has already been initialized
|
// we only need to update if the skin has already been initialized
|
||||||
if (skin != null)
|
if (skin != null)
|
||||||
|
@ -90,10 +87,19 @@ public final class SkinFile implements Updatable {
|
||||||
} catch (IOException x) {
|
} catch (IOException x) {
|
||||||
app.logEvent ("Error reading Skin "+file+": "+x);
|
app.logEvent ("Error reading Skin "+file+": "+x);
|
||||||
}
|
}
|
||||||
|
|
||||||
lastmod = file.lastModified ();
|
lastmod = file.lastModified ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void remove () {
|
||||||
|
if (prototype != null) {
|
||||||
|
prototype.skins.remove (name);
|
||||||
|
if (file != null)
|
||||||
|
prototype.updatables.remove (file.getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public Skin getSkin () {
|
public Skin getSkin () {
|
||||||
if (skin == null)
|
if (skin == null)
|
||||||
read ();
|
read ();
|
||||||
|
@ -103,7 +109,7 @@ public final class SkinFile implements Updatable {
|
||||||
public String getName () {
|
public String getName () {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String toString () {
|
public String toString () {
|
||||||
return prototype.getName()+"/"+file.getName();
|
return prototype.getName()+"/"+file.getName();
|
||||||
}
|
}
|
||||||
|
|
|
@ -237,6 +237,13 @@ public final class DbMapping implements Updatable {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method in interface Updatable.
|
||||||
|
*/
|
||||||
|
public void remove () {
|
||||||
|
// do nothing, removing of type properties is not implemented.
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a JDBC connection for this DbMapping.
|
* Get a JDBC connection for this DbMapping.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Add table
Reference in a new issue