@Override public Void run() { try { find(object, MutableDisplayable).setDisplayName(name); } catch (NotFoundException e) { // FIXME: do nothing or throw runtime exception? } return null; } });
displayable.addPropertyChangeListener(new PropertyChangeListener()
@Override public GeoLocation build() throws DuplicateException { final GeoLocation child = ElmoGeoLocationFactory.findOrCreate(null, null); child.as(MutableDisplayable).setDisplayNames(displayNames); if (coordinate != null) { child.setCoordinate(coordinate); } if (code != null) { child.setCode(code); } // TODO: type merge(child); ElmoGeoLocation.this.as(SkosConcept).addNarrower(child); return child; } };
@Nonnull public Builder withDisplayName (final @Nonnull String displayName, final @Nonnull Locale locale) { ((MutableDisplayable)displayable).setDisplayName(displayName, locale); return this; }
@Nonnull public Builder withDisplayName (final @Nonnull String displayName, final @Nonnull Locale locale) { ((MutableDisplayable)displayable).setDisplayName(displayName, locale); return this; }
as(MutableDisplayable).setDisplayName(gcEntity.as(Displayable).getDisplayName());
@Test public void aRenamableViewCanBeRenamed() { final HView view = hvManager.createView(). withDisplayName("My View 1"). thatCanBeRenamed(). build(); assertThat(view, is(notNullValue())); view.as(MutableDisplayable.class).setDisplayName("New View Name"); assertThat(view.as(Displayable).getDisplayName(), is("New View Name")); }
@Test public void aRenamableItemCanBeRenamed() { final HItem item = fixture.createChild(). withDisplayName("My Item 1"). thatCanBeRenamed(). build(); assertThat(item, is(notNullValue())); item.as(MutableDisplayable.class).setDisplayName("New Item Name"); assertThat(item.as(Displayable).getDisplayName(), is("New Item Name")); }