@Override public boolean setFocus(Hashtable<String, Object> resourceTable, boolean next) { Control c = getControl(resourceTable); if (c!=null) { return setFocus(c, next); } return false; }
private ControlSegment processControlSegment(Node control) { ControlSegment segment = new ControlSegment(); processObjectSegment(segment, control, "o."); //$NON-NLS-1$ Node fill = control.getAttributes().getNamedItem("fill"); //$NON-NLS-1$ if (fill!=null) { String value = fill.getNodeValue(); boolean doFill = value.equalsIgnoreCase("true"); //$NON-NLS-1$ segment.setFill(doFill); } try { Node width = control.getAttributes().getNamedItem("width"); //$NON-NLS-1$ if (width!=null) { String value = width.getNodeValue(); int doWidth = Integer.parseInt(value); segment.setWidth(doWidth); } Node height = control.getAttributes().getNamedItem("height"); //$NON-NLS-1$ if (height!=null) { String value = height.getNodeValue(); int doHeight = Integer.parseInt(value); segment.setHeight(doHeight); } } catch (NumberFormatException e) { // ignore invalid width or height } return segment; }
@Override public void layout(GC gc, int width, Locator loc, Hashtable<String, Object> resourceTable, boolean selected) { super.layout(gc, width, loc, resourceTable, selected); Control control = getControl(resourceTable); if (control!=null) control.setBounds(getBounds()); }
@Override public boolean isFocusSelectable(Hashtable<String, Object> resourceTable) { Control c = getControl(resourceTable); if (c!=null) return true; return false; } }
public Control getControl(Hashtable<String, Object> resourceTable) { Object obj = resourceTable.get(getObjectId()); if (obj instanceof Control) { Control c = (Control)obj; if (!c.isDisposed()) return c; } return null; }
private boolean setFocus(Control c, boolean direction) { if (c instanceof Composite) { Composite comp = (Composite)c; Control [] tabList = comp.getTabList(); if (direction) { for (Control element : tabList) { if (setFocus(element, direction)) return true; } } else { for (int i=tabList.length-1; i>=0; i--) { if (setFocus(tabList[i], direction)) return true; } } if (!(c instanceof Canvas)) return false; } return c.setFocus(); }
private ControlSegment processControlSegment(Node control) { ControlSegment segment = new ControlSegment(); processObjectSegment(segment, control, "o."); //$NON-NLS-1$ Node fill = control.getAttributes().getNamedItem("fill"); //$NON-NLS-1$ if (fill!=null) { String value = fill.getNodeValue(); boolean doFill = value.equalsIgnoreCase("true"); //$NON-NLS-1$ segment.setFill(doFill); } try { Node width = control.getAttributes().getNamedItem("width"); //$NON-NLS-1$ if (width!=null) { String value = width.getNodeValue(); int doWidth = Integer.parseInt(value); segment.setWidth(doWidth); } Node height = control.getAttributes().getNamedItem("height"); //$NON-NLS-1$ if (height!=null) { String value = height.getNodeValue(); int doHeight = Integer.parseInt(value); segment.setHeight(doHeight); } } catch (NumberFormatException e) { // ignore invalid width or height } return segment; }
@Override public void layout(GC gc, int width, Locator loc, Hashtable<String, Object> resourceTable, boolean selected) { super.layout(gc, width, loc, resourceTable, selected); Control control = getControl(resourceTable); if (control!=null) control.setBounds(getBounds()); }
@Override public boolean isFocusSelectable(Hashtable<String, Object> resourceTable) { Control c = getControl(resourceTable); if (c!=null) return true; return false; } }
public Control getControl(Hashtable<String, Object> resourceTable) { Object obj = resourceTable.get(getObjectId()); if (obj instanceof Control) { Control c = (Control)obj; if (!c.isDisposed()) return c; } return null; }
private boolean setFocus(Control c, boolean direction) { if (c instanceof Composite) { Composite comp = (Composite)c; Control [] tabList = comp.getTabList(); if (direction) { for (Control element : tabList) { if (setFocus(element, direction)) return true; } } else { for (int i=tabList.length-1; i>=0; i--) { if (setFocus(tabList[i], direction)) return true; } } if (!(c instanceof Canvas)) return false; } return c.setFocus(); }
@Override public boolean setFocus(Hashtable<String, Object> resourceTable, boolean next) { Control c = getControl(resourceTable); if (c!=null) { return setFocus(c, next); } return false; }
@Override protected Point getObjectSize(Hashtable<String, Object> resourceTable, int widthHint) { Control control = getControl(resourceTable); if (control==null) return new Point(0,0); Point size = control.computeSize(widthHint, SWT.DEFAULT); if (widthHint!=SWT.DEFAULT && fill) size.x = Math.max(size.x, widthHint); if (width != SWT.DEFAULT) size.x = width; if (height != SWT.DEFAULT) size.y = height; return size; }
@Override protected Point getObjectSize(Hashtable<String, Object> resourceTable, int wHint) { Control control = getControl(resourceTable); if (control==null) return new Point(0,0); int realWhint = FormUtil.getWidthHint(wHint, control); Point size = control.computeSize(realWhint, SWT.DEFAULT); if (realWhint!=SWT.DEFAULT && fill) size.x = Math.max(size.x, realWhint); if (width !=SWT.DEFAULT) size.x = width; if (height != SWT.DEFAULT) size.y = height; return size; }
if (segment instanceof ControlSegment) { ControlSegment cs = (ControlSegment) segment; Control c = cs.getControl(resourceTable); if (c != null) { if (c.getData(CONTROL_KEY) == null) {
if (segment instanceof ControlSegment) { ControlSegment cs = (ControlSegment) segment; Control c = cs.getControl(resourceTable); if (c != null) { if (c.getData(CONTROL_KEY) == null) {