public FakeWardItem(FakeWardData fakeWardData, UIItemRenderingHints hints) { super(fakeWardData.getX(), fakeWardData.getY(), hints); this.fakeWardData = fakeWardData; getElement() .setClassName("ward ward-" + fakeWardData.getType().replace("_", "-")); // $NON-NLS-1$ getElement().setAttribute("unselectable", "on"); // $NON-NLS-1$ //$NON-NLS-2$ getElement().setInnerHTML("<div class=\"setupMask\"></div>"); updateData(fakeWardData); }
@Override public void onDataUpdate(Object newData) { FakeWardData newFakeWardData = (FakeWardData) newData; if (fakeWardData.getX() != newFakeWardData.getX() || fakeWardData.getY() != newFakeWardData.getY()) setLocation(newFakeWardData.getX(), newFakeWardData.getY()); if (fakeWardData.isValid() != newFakeWardData.isValid()) updateData(newFakeWardData); fakeWardData = newFakeWardData; }
private void updateData(FakeWardData fakeWardData) { if (fakeWardData.isValid()) getElement().getFirstChildElement().setClassName("setupMask"); else getElement().getFirstChildElement().setClassName("setupMask invalid"); }