private boolean dragOverUp(Div div, MouseEvent e) { final int top = div.getBoundingClientRect().getTop().intValue(); final int bottom = div.getBoundingClientRect().getBottom().intValue(); int dragOverY = e.getClientY(); return (dragOverY - top) < (bottom - dragOverY); }
private boolean dragOverUp(Div div, MouseEvent e) { final int top = div.getBoundingClientRect().getTop().intValue(); final int bottom = div.getBoundingClientRect().getBottom().intValue(); int dragOverY = e.getClientY(); return (dragOverY - top) < (bottom - dragOverY); }
@Override public int getHeaderHeight() { try { return workbenchLayout.getHeaderPanel().getBoundingClientRect().getHeight().intValue(); } catch (Exception e) { return 0; } } }
private void calculateContentWidth() { int smallSpace = 2; final int colWidth = col.getBoundingClientRect().getWidth().intValue(); final int contentWidth = colWidth - (originalLeftRightWidth * 2) - smallSpace; if (contentWidth >= 0) { content.getStyle().setProperty("width", contentWidth + "px"); } }
private void calculateContentWidth() { int smallSpace = 2; final int colWidth = col.getBoundingClientRect().getWidth().intValue(); final int contentWidth = colWidth - (originalLeftRightWidth * 2) - smallSpace; if (contentWidth >= 0) { content.getStyle().setProperty("width", contentWidth + "px"); } }
@Override public void setVisibleItems(List<CaseRoleAssignmentSummary> visibleItems) { caseRolesList.setModel(visibleItems); int maxWidth = scrollbox.getBoundingClientRect().getWidth().intValue() - 70; roleAssignmentListLoadEvent.fire(new CaseRoleAssignmentListLoadEvent(maxWidth)); roleAssignments.getComponent(visibleItems.size() - 1).setLastElementStyle(); }
@Override public void setVisibleItems(List<CaseRoleAssignmentSummary> visibleItems) { caseRolesList.setModel(visibleItems); int maxWidth = scrollbox.getBoundingClientRect().getWidth().intValue() - 70; roleAssignmentListLoadEvent.fire(new CaseRoleAssignmentListLoadEvent(maxWidth)); roleAssignments.getComponent(visibleItems.size() - 1).setLastElementStyle(); }
@Test public void digTheHeightTheNormalWay() throws Exception { final Div div = mock(Div.class); final DOMClientRect domClientRect = mock(DOMClientRect.class); doReturn(div).when(workbenchLayout).getHeaderPanel(); doReturn(domClientRect).when(div).getBoundingClientRect(); doReturn(new Double(12)).when(domClientRect).getHeight(); assertEquals(12, workbenchLayoutInfo.getHeaderHeight()); } }
@Test public void digTheHeightTheNormalWay() throws Exception { final Div div = mock(Div.class); final DOMClientRect domClientRect = mock(DOMClientRect.class); doReturn(div).when(workbenchLayout).getHeaderPanel(); doReturn(domClientRect).when(div).getBoundingClientRect(); doReturn(new Double(12)).when(domClientRect).getHeight(); assertEquals(12, workbenchLayoutInfo.getHeaderHeight()); } }
@Override public void calculateWidth() { Scheduler.get().scheduleDeferred(() -> { final int colWidth = row.getBoundingClientRect().getWidth().intValue(); int padding = 2; final int contentWidth = colWidth - (originalLeftRightWidth * 2) - padding; left.getStyle().setProperty("width", originalLeftRightWidth + "px"); right.getStyle().setProperty("width", originalLeftRightWidth + "px"); content.getStyle().setProperty("width", contentWidth + "px"); presenter.calculateSizeChilds(); }); } }
@Override public void calculateWidth() { Scheduler.get().scheduleDeferred(() -> { final int colWidth = row.getBoundingClientRect().getWidth().intValue(); int padding = 2; final int contentWidth = colWidth - (originalLeftRightWidth * 2) - padding; left.getStyle().setProperty("width", originalLeftRightWidth + "px"); right.getStyle().setProperty("width", originalLeftRightWidth + "px"); content.getStyle().setProperty("width", contentWidth + "px"); presenter.calculateSizeChilds(); }); } }