void createWidget () { isVisible = true; if (parent.getCaret () == null) { parent.setCaret (this); } }
@Override void releaseParent () { super.releaseParent (); if (this == parent.getCaret ()) parent.setCaret (null); }
@Override void releaseParent () { super.releaseParent (); if (this == parent.getCaret ()) parent.setCaret (null); }
@Override void releaseParent () { super.releaseParent (); if (this == parent.getCaret ()) parent.setCaret (null); }
@Override void releaseParent () { super.releaseParent (); if (this == parent.getCaret ()) parent.setCaret (null); }
void releaseParent () { super.releaseParent (); if (this == parent.getCaret ()) parent.setCaret (null); }
/** * Sets the receiver's caret. Set the caret's height and location. * * </p> * @param caret the new caret for the receiver * * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> */ public void setCaret(Caret caret) { checkWidget (); super.setCaret(caret); caretDirection = SWT.NULL; if (caret != null) { setCaretLocation(); } } /**
/** * Sets the receiver's caret. Set the caret's height and location. * * </p> * @param caret the new caret for the receiver * * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> */ @Override public void setCaret(Caret caret) { checkWidget (); super.setCaret(caret); caretDirection = SWT.NULL; if (caret != null) { setCaretLocation(); } } /**
/** * Sets the receiver's caret. Set the caret's height and location. * * </p> * @param caret the new caret for the receiver * * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> */ @Override public void setCaret(Caret caret) { checkWidget (); super.setCaret(caret); caretDirection = SWT.NULL; if (caret != null) { setCaretLocation(); } } /**
void createWidget () { super.createWidget (); blinkRate = display.getCaretBlinkTime (); isVisible = true; if (parent.getCaret () == null) { parent.setCaret (this); } }
@Override void createWidget (int index) { super.createWidget (index); blinkRate = display.getCaretBlinkTime (); isVisible = true; if (parent.getCaret () == null) { parent.setCaret (this); } }
/** * Sets the receiver's caret. Set the caret's height and location. * * </p> * @param caret the new caret for the receiver * * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> */ @Override public void setCaret(Caret caret) { checkWidget (); super.setCaret(caret); caretDirection = SWT.NULL; if (caret != null) { setCaretLocation(); } } /**
/** * Sets the receiver's caret. Set the caret's height and location. * * </p> * @param caret the new caret for the receiver * * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> */ @Override public void setCaret(Caret caret) { checkWidget (); super.setCaret(caret); caretDirection = SWT.NULL; if (caret != null) { setCaretLocation(); } } /**
@Override void createWidget (int index) { super.createWidget (index); blinkRate = display.getCaretBlinkTime (); isVisible = true; if (parent.getCaret () == null) { parent.setCaret (this); } }
@Override void createWidget (int index) { super.createWidget (index); blinkRate = display.getCaretBlinkTime (); isVisible = true; if (parent.getCaret () == null) { parent.setCaret (this); } }
/** * Sets or clears the caret in the "Example" widget. */ void setCaret () { Caret oldCaret = canvas.getCaret (); if (caretButton.getSelection ()) { Caret newCaret = new Caret(canvas, SWT.NONE); Font font = canvas.getFont(); newCaret.setFont(font); GC gc = new GC(canvas); gc.setFont(font); newCaret.setBounds(1, 1, 1, gc.getFontMetrics().getHeight()); gc.dispose(); canvas.setCaret (newCaret); canvas.setFocus(); } else { canvas.setCaret (null); } if (oldCaret != null) oldCaret.dispose (); }
canvas.setLayoutData(new GridData(64, 64)); canvas.addPaintListener(e -> e.gc.drawString("Canvas", 15, 25)); canvas.setCaret (new Caret(canvas, SWT.NONE));