@Override public void handleEvent(Event e) { if (DEBUG_FOCUS) System.out.println("Traversal: " + e); //$NON-NLS-1$ switch (e.detail) { case SWT.TRAVERSE_PAGE_NEXT: case SWT.TRAVERSE_PAGE_PREVIOUS: case SWT.TRAVERSE_ARROW_NEXT: case SWT.TRAVERSE_ARROW_PREVIOUS: e.doit = false; return; } if (!model.hasFocusSegments()) { e.doit = true; return; } if (e.detail == SWT.TRAVERSE_TAB_NEXT) e.doit = advance(true); else if (e.detail == SWT.TRAVERSE_TAB_PREVIOUS) e.doit = advance(false); else if (e.detail != SWT.TRAVERSE_RETURN) e.doit = true; } });
@Override public void getFocus(AccessibleControlEvent e) { int childID = ACC.CHILDID_NONE; if (model.hasFocusSegments()) { int selectedIndex = model.getSelectedSegmentIndex(); if (selectedIndex != -1) { childID = selectedIndex; } } e.childID = childID; }
@Override public void getFocus(AccessibleControlEvent e) { int childID = ACC.CHILDID_NONE; if (model.hasFocusSegments()) { int selectedIndex = model.getSelectedSegmentIndex(); if (selectedIndex != -1) { childID = selectedIndex; } } e.childID = childID; }
model.selectLink(null); if (!model.hasFocusSegments()) redraw();
model.selectLink(null); if (!model.hasFocusSegments()) redraw();
private void repaint(GC gc, int x, int y, int width, int height) { Image textBuffer = new Image(getDisplay(), width, height); Color bg = getBackground(); Color fg = getForeground(); if (!getEnabled()) { bg = getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND); fg = getDisplay().getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW); } GC textGC = new GC(textBuffer, gc.getStyle()); textGC.setForeground(fg); textGC.setBackground(bg); textGC.setFont(getFont()); textGC.fillRectangle(0, 0, width, height); Rectangle repaintRegion = new Rectangle(x, y, width, height); Paragraph[] paragraphs = model.getParagraphs(); IHyperlinkSegment selectedLink = getSelectedLink(); if (getDisplay().getFocusControl() != this) selectedLink = null; for (Paragraph p : paragraphs) { p .paint(textGC, repaintRegion, resourceTable, selectedLink, selData); } if (hasFocus && !model.hasFocusSegments()) textGC.drawFocus(x, y, width, height); textGC.dispose(); gc.drawImage(textBuffer, x, y); textBuffer.dispose(); }
private void repaint(GC gc, int x, int y, int width, int height) { Image textBuffer = new Image(getDisplay(), width, height); Color bg = getBackground(); Color fg = getForeground(); if (!getEnabled()) { bg = getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND); fg = getDisplay().getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW); } GC textGC = new GC(textBuffer, gc.getStyle()); textGC.setForeground(fg); textGC.setBackground(bg); textGC.setFont(getFont()); textGC.fillRectangle(0, 0, width, height); Rectangle repaintRegion = new Rectangle(x, y, width, height); Paragraph[] paragraphs = model.getParagraphs(); IHyperlinkSegment selectedLink = getSelectedLink(); if (getDisplay().getFocusControl() != this) selectedLink = null; for (Paragraph p : paragraphs) { p .paint(textGC, repaintRegion, resourceTable, selectedLink, selData); } if (hasFocus && !model.hasFocusSegments()) textGC.drawFocus(x, y, width, height); textGC.dispose(); gc.drawImage(textBuffer, x, y); textBuffer.dispose(); }
return; if (!model.hasFocusSegments()) { e.doit = true; return;