Tabnine Logo
Builder
Code IndexAdd Tabnine to your IDE (free)

How to use
Builder
in
it.tidalwave.hierarchy

Best Java code snippets using it.tidalwave.hierarchy.Builder (Showing top 20 results out of 315)

origin: it.tidalwave.netbeans/it-tidalwave-hierarchy-spi-simple

 @Before
 public void setUp() 
  {
   final HViewManager hvManager = new SimpleHViewManager();
   final HView view = hvManager.createView().withDisplayName("View 1").build();
   fixture = view.createChild().withDisplayName("Parent").build();
  }
}
origin: it.tidalwave.netbeans/it-tidalwave-hierarchy

@Test(expected=AsException.class)
public void aRenamableItemMustNotBeMovable()
 {
  final HItem item = fixture.createChild().
                withDisplayName("My Item 1").
                thatCanBeRenamed().
                build();
  item.as(Movable);
 }
origin: it.tidalwave.netbeans/it-tidalwave-hierarchy

/*******************************************************************************************************************
 *
 * Specifies the id of the object to build.
 *
 * @param   object           the id
 * @return               itself
 *
 ******************************************************************************************************************/
@Nonnull
public Builder<T> withId (final @Nonnull String id)
 {
  return withId(new Id(id));
 }
origin: it.tidalwave.netbeans/it-tidalwave-hierarchy

@Test(expected=IllegalArgumentException.class)
public void mustThrowExceptionWhenNoExplicitDisplayNameAndBoundObjectHasNoDisplayName()
 {
  final Lookup.Provider boundObject = mock(Lookup.Provider.class);
  when(boundObject.getLookup()).thenReturn(Lookup.EMPTY);
  fixture.createChild().boundTo(boundObject).build();
 }
origin: it.tidalwave.netbeans/it-tidalwave-hierarchy

@Test
public void testFindOrCreateViewWithNoView()
 {
  final HView view = hvManager.findOrCreateView().withId("id1").
                          withDisplayName("the name").
                          build();
  assertThat(view.getId(), is(new Id("id1")));
 }
origin: it.tidalwave.netbeans/it-tidalwave-hierarchy

@Test
public void mustMakeTheBoundObjectAvailableInTheLookup()
 {
  final BoundObject boundObject = new BoundObject();
  final HItem hItem = fixture.createChild().boundTo(boundObject).withDisplayName("name").build();
  assertThat(hItem.getLookup().lookup(BoundObject.class), is(sameInstance(boundObject)));
 }
origin: it.tidalwave.netbeans/it-tidalwave-hierarchy

HView galleries = hvManager.findOrCreateView().withId("urn:Galleries").
                        withDisplayName("Galleries").
                        build();
HItem gallery1 = galleries.createChild().withDisplayName("Gallery 1").build();
HItem folder1 = gallery1.createChild().withDisplayName("Folder 1").build();
gallery1.createChild().boundTo(photo1).build();
folder1.createChild().boundTo(photo2).build();
folder1.createChild().boundTo(photo3).build();
HView trips = hvManager.findOrCreateView().withId("urn:Trips").
                      withDisplayName("Trips").
                      build();
HItem trip1 = trips.createChild().withDisplayName("Trip 1").build();
trip1.createChild().boundTo(photo1).build();
trip1.createChild().boundTo(photo3).build();
origin: it.tidalwave.netbeans/it-tidalwave-hierarchy

@Test(expected=IllegalArgumentException.class)
public void mustThrowExceptionWhenNoExplicitDisplayNameAndNoBoundObject()
 {
  fixture.createChild().build();
 }
origin: it.tidalwave.netbeans/it-tidalwave-hierarchy

/*******************************************************************************************************************
 *
 * Specifies that the object to build can be renamed.
 *
 * @return               itself
 *
 ******************************************************************************************************************/
@Nonnull
public Builder<T> thatCanBeRenamed()
 {
  return thatCanBeRenamed(true);
 }
origin: it.tidalwave.netbeans/it-tidalwave-hierarchy

@Test
public void testFindOrCreateItemWithNoItem()
 {
  final HItem item = fixture.findOrCreateChild().withId("id1").
                          withDisplayName("the name").
                          build();
  assertThat(item.getId(), is(new Id("id1")));
 }
origin: it.tidalwave.netbeans/it-tidalwave-hierarchy

@Test
public void mustMakeTheBoundObjectAvailableAsAPersonality()
 {
  final BoundObject boundObject = new BoundObject();
  final HItem hItem = fixture.createChild().boundTo(boundObject).withDisplayName("name").build();
  assertThat(hItem.as(BoundObject.class), is(sameInstance(boundObject)));
 }
origin: it.tidalwave.netbeans/it-tidalwave-hierarchy

@Test
public void mustUseTheDisplayableOfBoundObjectWhenNoExpicitDisplayableIsProvided()
 {
  final Displayable displayable = mock(Displayable.class);
  final Lookup lookup = Lookups.fixed(displayable);
  final Lookup.Provider boundObject = mock(Lookup.Provider.class);
  when(boundObject.getLookup()).thenReturn(lookup);
  final HItem item = fixture.createChild().boundTo(boundObject).build();
  assertThat(item.as(Displayable), is(sameInstance(displayable)));
 }
origin: it.tidalwave.netbeans/it-tidalwave-hierarchy-node

@Before
public void setUp()
 {
  hViewManager = Locator.find(HViewManager);
  hViewManager.as(Resettable.class).reset();
  hView = hViewManager.createView().withDisplayName("view 1").build();
  hItems[0] = hView.createChild().withDisplayName("item 1").build();
  hItems[1] = hView.createChild().withDisplayName("item 2").build();
  hItems[2] = hView.createChild().withDisplayName("item 3").build();
 }
origin: it.tidalwave.netbeans/it-tidalwave-hierarchy

@Test(expected=AsException.class)
public void aRenamableItemMustNotBeCopiable()
 {
  final HItem item = fixture.createChild().
                withDisplayName("My Item 1").
                thatCanBeRenamed().
                build();
  item.as(Copiable);
 }
origin: it.tidalwave.netbeans/it-tidalwave-hierarchy

@Test
public void testFindOrCreateViewWithExistingView()
 {
  final HView view1 = hvManager.createView().withDisplayName("a name").build();
  final HView view2 = hvManager.findOrCreateView().withId(view1.getId()).
                           withDisplayName("the name").
                           build();
  assertThat(view2, is(sameInstance(view1)));
  assertThat(view1.as(Displayable).getDisplayName(), is("a name"));
 }
origin: it.tidalwave.netbeans/it-tidalwave-hierarchy

@Test
public void mustUseTheProvidedDisplayableEvenWhenTheBoundObjectHasGotExpicitDisplayable()
 {
  final Displayable displayable = mock(Displayable.class);
  final Lookup lookup = Lookups.fixed(displayable);
  final Lookup.Provider boundObject = mock(Lookup.Provider.class);
  when(boundObject.getLookup()).thenReturn(lookup);
  final HItem item = fixture.createChild().boundTo(boundObject).withDisplayName("new name").build();
  assertThat(item.as(Displayable), is(not(sameInstance(displayable))));
  assertThat(item.as(Displayable).getDisplayName(), is("new name"));
 }
origin: it.tidalwave.netbeans/it-tidalwave-hierarchy-node

@Before
public void setUp()
 {
  hViewManager = Locator.find(HViewManager);
  hViewManager.as(Resettable.class).reset();
  assertThat(hViewManager.findViews().count(), is(0));
  hViews[0] = hViewManager.createView().withDisplayName("view 1").build();
  hViews[1] = hViewManager.createView().withDisplayName("view 2").build();
  hViews[2] = hViewManager.createView().withDisplayName("view 3").build();
 }
origin: it.tidalwave.netbeans/it-tidalwave-hierarchy

@Test(expected=AsException.class)
public void aRenamableViewMustNotBeCopiable()
 {
  final HView view = hvManager.createView().
                 withDisplayName("My View 1").
                 thatCanBeRenamed().
                 build();
  view.as(Copiable);
 }
origin: it.tidalwave.netbeans/it-tidalwave-hierarchy

@Test
public void testFindOrCreateItemWithExistingItem()
 {
  final HItem item1 = fixture.createChild().withDisplayName("a name").build();
  final HItem item2 = fixture.findOrCreateChild().withId(item1.getId()).
                          withDisplayName("the name").
                          build();
  assertThat(item2, is(sameInstance(item1)));
  assertThat(item1.as(Displayable).getDisplayName(), is("a name"));
 }
origin: it.tidalwave.netbeans/it-tidalwave-hierarchy

@Test(expected=AsException.class)
public void aDefaultViewMustNotBeMovable()
 {
  final HView view = hvManager.createView().
                 withDisplayName("My View 1").
                 build();
  view.as(Movable);
 }
it.tidalwave.hierarchyBuilder

Most used methods

  • build
    Builds the object.
  • withDisplayName
    Specifies the display name of the object to build.
  • thatCanBeRenamed
    Specifies that the object to build can be renamed.
  • withId
    Specifies the id of the object to build.
  • boundTo
    Specifies the Object that will be logically bound with the object to create.

Popular in Java

  • Making http post requests using okhttp
  • onRequestPermissionsResult (Fragment)
  • notifyDataSetChanged (ArrayAdapter)
  • putExtra (Intent)
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • JPanel (javax.swing)
  • Table (org.hibernate.mapping)
    A relational table
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now