/** * A helper method that ensures the provided control is visible when * ScrolledComposite is somewhere in the parent chain. If scroll bars are * visible and the control is clipped, the client of the scrolled composite * will be scrolled to reveal the control. * * @param c * the control to reveal */ public static void ensureVisible(Control c) { FormUtil.ensureVisible(c); }
@Override public void focusGained(FocusEvent e) { if (!handleNextFocusGained) { handleNextFocusGained = true; } else { Widget w = e.widget; if (w instanceof Control) { FormUtil.ensureVisible((Control) w); } } }
@Override public void focusGained(FocusEvent e) { if (!handleNextFocusGained) { handleNextFocusGained = true; } else { Widget w = e.widget; if (w instanceof Control) { FormUtil.ensureVisible((Control) w); } } }
/** * A helper method that ensures the provided control is visible when * ScrolledComposite is somewhere in the parent chain. If scroll bars are * visible and the control is clipped, the client of the scrolled composite * will be scrolled to reveal the control. * * @param c * the control to reveal */ public static void ensureVisible(Control c) { FormUtil.ensureVisible(c); }
public static void ensureVisible(Control c) { ScrolledComposite scomp = getScrolledComposite(c); if (scomp != null) { Object data = scomp.getData(FOCUS_SCROLLING); if (data == null || !data.equals(Boolean.FALSE)) FormUtil.ensureVisible(scomp, c); } }
public static void ensureVisible(Control c) { ScrolledComposite scomp = getScrolledComposite(c); if (scomp != null) { Object data = scomp.getData(FOCUS_SCROLLING); if (data == null || !data.equals(Boolean.FALSE)) FormUtil.ensureVisible(scomp, c); } }
public static void ensureVisible(ScrolledComposite scomp, Control control) { // if the control is a FormText we do not need to scroll since it will // ensure visibility of its segments as necessary if (control instanceof FormText) return; Point controlSize = control.getSize(); Point controlOrigin = getControlLocation(scomp, control); ensureVisible(scomp, controlOrigin, controlSize); }
public static void ensureVisible(ScrolledComposite scomp, Control control) { // if the control is a FormText we do not need to scroll since it will // ensure visibility of its segments as necessary if (control instanceof FormText) return; Point controlSize = control.getSize(); Point controlOrigin = getControlLocation(scomp, control); ensureVisible(scomp, controlOrigin, controlSize); }
public static void ensureVisible(Control control) { ScrolledComposite form = FormUtil.getScrolledComposite(control); if (form != null) { if (control instanceof StyledText) { // bug 299392: ensure that the caret is visible for styled text but avoid scrolling form if only a portion of the control is visible Point origin = FormUtil.getControlLocation(form, control); Point caretLocation = ((StyledText) control).getCaret().getLocation(); origin.x += caretLocation.x; origin.y += caretLocation.y; FormUtil.ensureVisible(form, origin, new Point(20, 20)); } else { FormUtil.ensureVisible(form, control); } } }
private void ensureVisible(IFocusSelectable segment) { if (mouseFocus) { mouseFocus = false; return; } if (segment == null) return; Rectangle bounds = segment.getBounds(); ScrolledComposite scomp = FormUtil.getScrolledComposite(this); if (scomp == null) return; Point origin = FormUtil.getControlLocation(scomp, this); origin.x += bounds.x; origin.y += bounds.y; FormUtil.ensureVisible(scomp, origin, new Point(bounds.width, bounds.height)); }
private void handleDrag(MouseEvent e) { if (selData != null) { ScrolledComposite scomp = FormUtil.getScrolledComposite(this); if (scomp != null) { FormUtil.ensureVisible(scomp, this, e); } selData.update(e); redraw(); } }
private void ensureVisible(IFocusSelectable segment) { if (mouseFocus) { mouseFocus = false; return; } if (segment == null) return; Rectangle bounds = segment.getBounds(); ScrolledComposite scomp = FormUtil.getScrolledComposite(this); if (scomp == null) return; Point origin = FormUtil.getControlLocation(scomp, this); origin.x += bounds.x; origin.y += bounds.y; FormUtil.ensureVisible(scomp, origin, new Point(bounds.width, bounds.height)); }
private void handleDrag(MouseEvent e) { if (selData != null) { ScrolledComposite scomp = FormUtil.getScrolledComposite(this); if (scomp != null) { FormUtil.ensureVisible(scomp, this, e); } selData.update(e); redraw(); } }
private void toggleState() { boolean newState = !isExpanded(); fireExpanding(newState, true); internalSetExpanded(newState); fireExpanding(newState, false); if (newState) FormUtil.ensureVisible(this); }
private void toggleState() { boolean newState = !isExpanded(); fireExpanding(newState, true); internalSetExpanded(newState); fireExpanding(newState, false); if (newState) FormUtil.ensureVisible(this); }