@Title @PropertyLayout(hidden = Where.EVERYWHERE) public String getFriendlyName() { return friendlyName; } public void setFriendlyName(final String friendlyName) {
@Test public void when_annotated_with_inline() throws Exception { context.checking(new Expectations() {{ allowing(mockPropertyLayout).promptStyle(); will(returnValue(PromptStyle.INLINE)); never(mockConfiguration); }}); PromptStyleFacet facet = PromptStyleFacetForPropertyLayoutAnnotation .create(mockPropertyLayout, mockConfiguration, mockFacetHolder); Assert.assertThat(facet, is((Matcher) IsisMatchers.anInstanceOf(PromptStyleFacetForPropertyLayoutAnnotation.class))); Assert.assertThat(facet.value(), is(PromptStyle.INLINE)); }
@Test public void when_annotated_with_dialog() throws Exception { context.checking(new Expectations() {{ allowing(mockPropertyLayout).promptStyle(); will(returnValue(PromptStyle.DIALOG)); never(mockConfiguration); }}); PromptStyleFacet facet = PromptStyleFacetForPropertyLayoutAnnotation .create(mockPropertyLayout, mockConfiguration, mockFacetHolder); Assert.assertThat(facet, is((Matcher) IsisMatchers.anInstanceOf(PromptStyleFacetForPropertyLayoutAnnotation.class))); Assert.assertThat(facet.value(), is(PromptStyle.DIALOG)); }
@PropertyLayout(named="Result class") @MemberOrder(sequence="3") public String getClassName() { return object != null? object.getClass().getName(): null; }
@Test public void when_annotated_with_as_configured_but_already_has_doop_facet() throws Exception { context.checking(new Expectations() {{ allowing(mockPropertyLayout).promptStyle(); will(returnValue(PromptStyle.AS_CONFIGURED)); oneOf(mockFacetHolder).containsDoOpFacet(PromptStyleFacet.class); will(returnValue(true)); never(mockConfiguration); }}); PromptStyleFacet facet = PromptStyleFacetForPropertyLayoutAnnotation .create(mockPropertyLayout, mockConfiguration, mockFacetHolder); Assert.assertThat(facet, is(nullValue())); }
@PropertyLayout( multiLine=5 ) public String getNotYetComplete() { final List<ToDoItem> notYetComplete = getItemsNotYetComplete(); return Joiner.on(", ").join( Iterables.transform(subcategories(), summarizeBySubcategory(notYetComplete))); }
@Test public void when_not_annotated_but_already_has_doop_facet() throws Exception { context.checking(new Expectations() {{ allowing(mockPropertyLayout).promptStyle(); will(returnValue(null)); allowing(mockFacetHolder).containsDoOpFacet(PromptStyleFacet.class); will(returnValue(true)); never(mockConfiguration); }}); PromptStyleFacet facet = PromptStyleFacetForPropertyLayoutAnnotation .create(mockPropertyLayout, mockConfiguration, mockFacetHolder); Assert.assertThat(facet, is(nullValue())); }
@PropertyLayout( multiLine=5 ) public String getComplete() { final List<ToDoItem> completeInCategory = getItemsComplete(); return Joiner.on(", ").join( Iterables.transform(subcategories(), summarizeBySubcategory(completeInCategory))); }
@Test public void when_not_annotated() throws Exception { context.checking(new Expectations() {{ allowing(mockPropertyLayout).promptStyle(); will(returnValue(null)); allowing(mockFacetHolder).containsDoOpFacet(PromptStyleFacet.class); will(returnValue(false)); never(mockConfiguration); }}); PromptStyleFacet facet = PromptStyleFacetForPropertyLayoutAnnotation .create(mockPropertyLayout, mockConfiguration, mockFacetHolder); Assert.assertThat(facet.value(), is(PromptStyle.INLINE)); Assert.assertThat(facet, is((Matcher) IsisMatchers.anInstanceOf(PromptStyleFacetFallBackToInline.class))); }
/** * Distinguishes commands from audit entries from published events/interactions (when these are shown mixed together in a (standalone) table). */ @Property @PropertyLayout( hidden = Where.ALL_EXCEPT_STANDALONE_TABLES ) @MemberOrder(name="Identifiers", sequence = "1") public ChangeType getType() { return type; }
@Test public void when_annotated_with_as_configured() throws Exception { context.checking(new Expectations() {{ allowing(mockPropertyLayout).promptStyle(); will(returnValue(PromptStyle.AS_CONFIGURED)); oneOf(mockConfiguration).getString("isis.viewer.wicket.promptStyle"); will(returnValue(PromptStyle.INLINE.name())); allowing(mockFacetHolder).containsDoOpFacet(PromptStyleFacet.class); will(returnValue(false)); }}); PromptStyleFacet facet = PromptStyleFacetForPropertyLayoutAnnotation .create(mockPropertyLayout, mockConfiguration, mockFacetHolder); Assert.assertThat(facet, is((Matcher) IsisMatchers.anInstanceOf(PromptStyleFacetAsConfigured.class))); Assert.assertThat(facet.value(), is(PromptStyle.INLINE)); }
@PropertyLayout(named="Fixture script") @Property(optionality = Optionality.OPTIONAL) @MemberOrder(sequence="1") public String getFixtureScriptClassName() { return fixtureScriptClassName; } public void setFixtureScriptClassName(String fixtureScriptClassName) {
@PropertyLayout(named="Result key") @Title(sequence="1", append=": ") @MemberOrder(sequence="1") public String getKey() { return key; } public void setKey(String key) {
@PropertyLayout(named="Result") @Title(sequence="2") @MemberOrder(sequence="1") public Object getObject() { return object; } public void setObject(Object object) {
/** * The class of the domain object being changed. * * <p> * This dummy implementation is a trick so that Isis will render the property in a standalone table. Each of the * subclasses override with the "real" implementation. */ @Property @PropertyLayout(named="Class") @MemberOrder(name="Target", sequence = "10") public String getTargetClass() { return null; }
/** * The (string representation of the) {@link Bookmark} identifying the domain object that has changed. * * <p> * This dummy implementation is a trick so that Isis will render the property in a standalone table. Each of the * subclasses override with the "real" implementation. */ @Property @PropertyLayout(named="Object") @MemberOrder(name="Target", sequence="30") public String getTargetStr() { return null; }
/** * The value of the property after it has changed. * * <p> * Populated only for <tt>AuditEntryJdo</tt>. * * <p> * This dummy implementation is a trick so that Isis will render the property in a standalone table. Each of the * subclasses override with the "real" implementation. */ @Property( optionality = MANDATORY ) @PropertyLayout( hidden = Where.ALL_EXCEPT_STANDALONE_TABLES ) @MemberOrder(name="Detail",sequence = "7") public String getPostValue() { return null; }
/** * The value of the property prior to it being changed. * * <p> * Populated only for <tt>AuditEntryJdo</tt>. * * <p> * This dummy implementation is a trick so that Isis will render the property in a standalone table. Each of the * subclasses override with the "real" implementation. */ @Property( optionality = OPTIONAL ) @PropertyLayout( hidden = Where.ALL_EXCEPT_STANDALONE_TABLES ) @MemberOrder(name="Detail",sequence = "6") public String getPreValue() { return null; }
/** * The property of the object that was changed. * * <p> * Populated only for <tt>AuditEntryJdo</tt>. * * <p> * This dummy implementation is a trick so that Isis will render the property in a standalone table. Each of the * subclasses override with the "real" implementation. */ @Property( optionality = OPTIONAL ) @PropertyLayout( hidden = Where.ALL_EXCEPT_STANDALONE_TABLES ) @MemberOrder(name="Target",sequence = "21") public String getPropertyId() { return null; }
@Property(hidden = Where.ALL_TABLES) @PropertyLayout(named = "Value") public Boolean getValueAsBoolean() { return hideValueAsBoolean() ? null : parseValueAsBoolean(); } public boolean hideValueAsBoolean() {