private static String getOverflow(final ScrolledComposite composite) { String result; ScrollBar horizontalBar = composite.getHorizontalBar(); boolean scrollX = horizontalBar != null && horizontalBar.getVisible(); ScrollBar verticalBar = composite.getVerticalBar(); boolean scrollY = verticalBar != null && verticalBar.getVisible(); if (scrollX && scrollY) { result = "scroll"; } else if (scrollX) { result = "scrollX"; } else if (scrollY) { result = "scrollY"; } else { result = "hidden"; } return result; }
private static Integer getBarSelection(final ScrollBar scrollBar) { Integer result; if (scrollBar != null) { result = new Integer(scrollBar.getSelection()); } else { result = null; } return result; }