StyleItem newRun = new StyleItem(); newRun.start = run.start + start; newRun.length = run.length - start;
SCRIPT_PROPERTIES sp = new SCRIPT_PROPERTIES(); while (start < end) { StyleItem item = new StyleItem(); item.start = start; item.style = styles[styleIndex].style; StyleItem item = new StyleItem(); item.start = end; OS.MoveMemory(scriptItem, items + itemCount * SCRIPT_ITEM.sizeof, SCRIPT_ITEM.sizeof);
/** * Sets the receiver's text. *<p> * Note: Setting the text also clears all the styles. This method * returns without doing anything if the new text is the same as * the current text. * </p> * * @param text the new text * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the text is null</li> * </ul> * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> */ public void setText (String text) { checkLayout (); if (text == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); if (text.equals(this.text)) return; freeRuns(); this.text = text; styles = new StyleItem[2]; styles[0] = new StyleItem(); styles[1] = new StyleItem(); styles[1].start = text.length(); stylesCount = 2; }
/** * Sets the receiver's text. *<p> * Note: Setting the text also clears all the styles. This method * returns without doing anything if the new text is the same as * the current text. * </p> * * @param text the new text * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the text is null</li> * </ul> * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> */ public void setText (String text) { checkLayout (); if (text == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); if (text.equals(this.text)) return; freeRuns(); this.text = text; styles = new StyleItem[2]; styles[0] = new StyleItem(); styles[1] = new StyleItem(); styles[1].start = text.length(); stylesCount = 2; }
/** * Sets the receiver's text. *<p> * Note: Setting the text also clears all the styles. This method * returns without doing anything if the new text is the same as * the current text. * </p> * * @param text the new text * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the text is null</li> * </ul> * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> */ public void setText (String text) { checkLayout(); if (text == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); if (text.equals(this.text)) return; freeRuns(); this.text = text; styles = new StyleItem[2]; styles[0] = new StyleItem(); styles[1] = new StyleItem(); styles[1].start = text.length(); stylesCount = 2; }
/** * Constructs a new instance of this class on the given device. * <p> * You must dispose the text layout when it is no longer required. * </p> * * @param device the device on which to allocate the text layout * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if device is null and there is no current device</li> * </ul> * * @see #dispose() */ public TextLayout (Device device) { super(device); wrapWidth = ascent = descent = -1; alignment = SWT.LEFT; orientation = SWT.LEFT_TO_RIGHT; text = ""; styles = new StyleItem[2]; styles[0] = new StyleItem(); styles[1] = new StyleItem(); stylesCount = 2; init(); }
/** * Sets the receiver's text. *<p> * Note: Setting the text also clears all the styles. This method * returns without doing anything if the new text is the same as * the current text. * </p> * * @param text the new text * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the text is null</li> * </ul> * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> */ public void setText (String text) { checkLayout (); if (text == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); if (text.equals(this.text)) return; freeRuns(); this.text = text; styles = new StyleItem[2]; styles[0] = new StyleItem(); styles[1] = new StyleItem(); styles[1].start = text.length(); stylesCount = 2; }