Hello,
I tried to implement DockSituationIgnore, but I’m getting NullPointerException during save.
I’m not sure whether it is a bug or maybe I didn’t implement it correctly. It can be reproduced if you add the following code to your PersistentLayoutExample.
...
frontend.setIgnoreForEntry(new DockablesFilter());
frontend.setIgnoreForFinal(new DockablesFilter());
...
private static class DockablesFilter implements DockSituationIgnore {
public boolean ignoreElement(DockElement element) {
if (element instanceof ColorDockable) {
ColorDockable colorDockable = (ColorDockable) element;
//Filter out red dockable
boolean result = (colorDockable.getColor().getRGB() == -26215);
return result;
}
return false;
}
public boolean ignoreElement(PerspectiveElement element) {
return false;
}
public boolean ignoreChildren(DockStation station) {
return false;
}
public boolean ignoreChildren(PerspectiveStation station) {
return false;
}
}
Also, I’m not completely understand the usage of setIgnoreForEntry and setIgnoreForFinal. What I should do if I don’t want some dockable to appear in the settings xml? Should I use both of them as in example above?