@Test public void testInit() { testedTreeExplorerView.init(presenter); verify(testedTreeExplorerView, times(1)).initWidget(any()); verify(testedTreeExplorerView.tree, times(1)).addSelectionHandler(any(SelectionHandler.class)); }
@Override public void init(final TreeExplorer presenter) { this.presenter = presenter; initWidget(uiBinder.createAndBindUi(this)); handlerRegistration = tree.addSelectionHandler(selectionEvent -> { final TreeItem item = selectionEvent.getSelectedItem(); final String uuid = item.getUuid(); final Shape shape = presenter.getCanvasHandler().getCanvas().getShape(uuid); if (shape != null) { presenter.onSelect(uuid); } }); }
TreeExplorerView extends Composite implements TreeExplorer.View { @Override public void init(final TreeExplorer presenter) { this.presenter = presenter; initWidget(uiBinder.createAndBindUi(this)); handlerRegistration = tree.addSelectionHandler(selectionEvent -> { final TreeItem item = selectionEvent.getSelectedItem(); final String uuid = item.getUuid(); final Shape shape = presenter.getCanvasHandler().getCanvas().getShape(uuid); if (shape != null) { presenter.onSelect(uuid); } }); } }
TreeExplorerView extends Composite implements TreeExplorer.View { @Override public void init(final TreeExplorer presenter) { this.presenter = presenter; initWidget(uiBinder.createAndBindUi(this)); handlerRegistration = tree.addSelectionHandler(selectionEvent -> { final TreeItem item = selectionEvent.getSelectedItem(); final String uuid = item.getUuid(); final Shape shape = presenter.getCanvasHandler().getCanvas().getShape(uuid); if (shape != null) { presenter.onSelect(uuid); } }); } @Inject  TreeExplorerView(final Tree<TreeItem> tree);   TreeExplorerView(final TreeExplorer presenter,
                     final Tree<TreeItem> tree,
                     final HandlerRegistration handlerRegistration
    ); }
TreeExplorerView extends Composite implements TreeExplorer.View { @Override public void init(final TreeExplorer presenter) { this.presenter = presenter; initWidget(uiBinder.createAndBindUi(this)); handlerRegistration = tree.addSelectionHandler(selectionEvent -> { final TreeItem item = selectionEvent.getSelectedItem(); final String uuid = item.getUuid(); final Shape shape = presenter.getCanvasHandler().getCanvas().getShape(uuid); if (shape != null) { presenter.onSelect(uuid); } }); } @Inject  TreeExplorerView(final Tree<TreeItem> tree);   TreeExplorerView(final TreeExplorer presenter,
                     final Tree<TreeItem> tree,
                     final HandlerRegistration handlerRegistration
    ); @Override void init(final TreeExplorer presenter); @SuppressWarnings("unchecked") TreeExplorer.View addItem(final String uuid,
                                     final String name,
                                     final IsWidget icon,
                                     final boolean isContainer,
                                     final boolean state); @SuppressWarnings("unchecked") TreeExplorer.View addItem(final String uuid,
                                     final String parentsUuid,
                                     final String name,
                                     final IsWidget icon,
                                     final boolean isContainer,
                                     final boolean state,
                                     final OptionalInt index); boolean isItemChanged(final String uuid,
                                 final String parentUuid,
                                 final String name,
                                 final int childCount,
                                 final OptionalInt indexIntoParent); @Override TreeExplorer.View clear(); TreeExplorer.View destroy(); @Override boolean isContainer(final String uuid); TreeExplorer.View setSelectedItem(final String uuid); TreeExplorer.View removeItem(String uuid); }
TreeExplorerView extends Composite implements TreeExplorer.View { @Override public void init(final TreeExplorer presenter) { this.presenter = presenter; initWidget(uiBinder.createAndBindUi(this)); handlerRegistration = tree.addSelectionHandler(selectionEvent -> { final TreeItem item = selectionEvent.getSelectedItem(); final String uuid = item.getUuid(); final Shape shape = presenter.getCanvasHandler().getCanvas().getShape(uuid); if (shape != null) { presenter.onSelect(uuid); } }); } @Inject  TreeExplorerView(final Tree<TreeItem> tree);   TreeExplorerView(final TreeExplorer presenter,
                     final Tree<TreeItem> tree,
                     final HandlerRegistration handlerRegistration
    ); @Override void init(final TreeExplorer presenter); @SuppressWarnings("unchecked") TreeExplorer.View addItem(final String uuid,
                                     final String name,
                                     final IsWidget icon,
                                     final boolean isContainer,
                                     final boolean state); @SuppressWarnings("unchecked") TreeExplorer.View addItem(final String uuid,
                                     final String parentsUuid,
                                     final String name,
                                     final IsWidget icon,
                                     final boolean isContainer,
                                     final boolean state,
                                     final OptionalInt index); boolean isItemChanged(final String uuid,
                                 final String parentUuid,
                                 final String name,
                                 final int childCount,
                                 final OptionalInt indexIntoParent); @Override TreeExplorer.View clear(); TreeExplorer.View destroy(); @Override boolean isContainer(final String uuid); TreeExplorer.View setSelectedItem(final String uuid); TreeExplorer.View removeItem(String uuid);  }