wlNrHeader.setLayoutData( fdlNrHeader ); wNrHeader = new Text( wContentComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER ); wNrHeader.setTextLimit( 3 ); props.setLook( wNrHeader ); wNrHeader.addModifyListener( lsMod ); wlNrFooter.setLayoutData( fdlNrFooter ); wNrFooter = new Text( wContentComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER ); wNrFooter.setTextLimit( 3 ); props.setLook( wNrFooter ); wNrFooter.addModifyListener( lsMod ); wlNrWraps.setLayoutData( fdlNrWraps ); wNrWraps = new Text( wContentComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER ); wNrWraps.setTextLimit( 3 ); props.setLook( wNrWraps ); wNrWraps.addModifyListener( lsMod ); wlNrLinesPerPage.setLayoutData( fdlNrLinesPerPage ); wNrLinesPerPage = new Text( wContentComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER ); wNrLinesPerPage.setTextLimit( 3 ); props.setLook( wNrLinesPerPage ); wNrLinesPerPage.addModifyListener( lsMod ); wlNrLinesDocHeader.setLayoutData( fdlNrLinesDocHeader ); wNrLinesDocHeader = new Text( wContentComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER ); wNrLinesDocHeader.setTextLimit( 3 ); props.setLook( wNrLinesDocHeader ); wNrLinesDocHeader.addModifyListener( lsMod );
wlNrHeader.setLayoutData( fdlNrHeader ); wNrHeader = new Text( wContentComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER ); wNrHeader.setTextLimit( 3 ); props.setLook( wNrHeader ); wNrHeader.addModifyListener( lsMod ); wlNrFooter.setLayoutData( fdlNrFooter ); wNrFooter = new Text( wContentComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER ); wNrFooter.setTextLimit( 3 ); props.setLook( wNrFooter ); wNrFooter.addModifyListener( lsMod ); wlNrWraps.setLayoutData( fdlNrWraps ); wNrWraps = new Text( wContentComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER ); wNrWraps.setTextLimit( 3 ); props.setLook( wNrWraps ); wNrWraps.addModifyListener( lsMod ); wlNrLinesPerPage.setLayoutData( fdlNrLinesPerPage ); wNrLinesPerPage = new Text( wContentComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER ); wNrLinesPerPage.setTextLimit( 3 ); props.setLook( wNrLinesPerPage ); wNrLinesPerPage.addModifyListener( lsMod ); wlNrLinesDocHeader.setLayoutData( fdlNrLinesDocHeader ); wNrLinesDocHeader = new Text( wContentComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER ); wNrLinesDocHeader.setTextLimit( 3 ); props.setLook( wNrLinesDocHeader ); wNrLinesDocHeader.addModifyListener( lsMod );
/** * Sets this text field's text limit. * * @param limit the limit on the number of character in the text * input field, or <code>UNLIMITED</code> for no limit */ public void setTextLimit(int limit) { textLimit = limit; if (textField != null) { textField.setTextLimit(limit); } }
/** * Sets this text field's text limit. * * @param limit the limit on the number of character in the text * input field, or <code>UNLIMITED</code> for no limit */ public void setTextLimit(int limit) { textLimit = limit; if (textField != null) { textField.setTextLimit(limit); } }
/** * Sets this text field's text limit. * * @param limit the limit on the number of character in the text * input field, or <code>UNLIMITED</code> for no limit */ public void setTextLimit(int limit) { textLimit = limit; if (textField != null) { textField.setTextLimit(limit); } }
public void setTextLimit(int limit) { m_text.setTextLimit(limit); }
private Text createText(final String text, final Composite group, boolean setSize) { final Text textObj = new Text(group, SWT.BORDER); textObj.setText(text); textObj.setTextLimit(99); GridData layout; if (setSize) { layout = new GridData(GridData.FILL, GridData.CENTER, true, true, 2, 1); } else { layout = new GridData(GridData.FILL, GridData.CENTER, true, true); } textObj.setLayoutData(layout); return textObj; }
/** * Sets the maximum number of characters that the receiver's * text field is capable of holding to be the argument. * * @param limit new text limit * * @exception IllegalArgumentException <ul> * <li>ERROR_CANNOT_BE_ZERO - if the limit is zero</li> * </ul> * @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 setTextLimit (int limit) { checkWidget(); text.setTextLimit (limit); }
/** * Sets the maximum number of characters that the receiver's * text field is capable of holding to be the argument. * * @param limit new text limit * * @exception IllegalArgumentException <ul> * <li>ERROR_CANNOT_BE_ZERO - if the limit is zero</li> * </ul> * @exception org.eclipse.swt.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 setTextLimit (int limit) { checkWidget(); text.setTextLimit (limit); }
/** * Sets the maximum number of characters that the receiver's * text field is capable of holding to be the argument. * * @param limit new text limit * * @exception IllegalArgumentException <ul> * <li>ERROR_CANNOT_BE_ZERO - if the limit is zero</li> * </ul> * @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 setTextLimit (int limit) { checkWidget(); text.setTextLimit (limit); }
/** * Sets the maximum number of characters that the receiver's * text field is capable of holding to be the argument. * * @param limit new text limit * * @exception IllegalArgumentException <ul> * <li>ERROR_CANNOT_BE_ZERO - if the limit is zero</li> * </ul> * @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 setTextLimit (int limit) { checkWidget(); text.setTextLimit (limit); }
/** * Sets the maximum number of characters that the receiver's * text field is capable of holding to be the argument. * * @param limit new text limit * * @exception IllegalArgumentException <ul> * <li>ERROR_CANNOT_BE_ZERO - if the limit is zero</li> * </ul> * @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 setTextLimit (int limit) { checkWidget(); text.setTextLimit (limit); }
/** * Sets the maximum number of characters that the receiver's * text field is capable of holding to be the argument. * * @param limit new text limit * * @exception IllegalArgumentException <ul> * <li>ERROR_CANNOT_BE_ZERO - if the limit is zero</li> * </ul> * @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 setTextLimit (int limit) { checkWidget(); text.setTextLimit (limit); }
private Control[] addTextField(Composite composite, String label, final String key, int textLimit, int indentation, PixelConverter pixelConverter) { Label labelControl= new Label(composite, SWT.NONE); labelControl.setText(label); GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING); gd.horizontalIndent= indentation; labelControl.setLayoutData(gd); final Text textControl= new Text(composite, SWT.BORDER | SWT.SINGLE); gd= new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING); gd.widthHint= pixelConverter.convertWidthInCharsToPixels(textLimit + 1); textControl.setLayoutData(gd); textControl.setTextLimit(textLimit); textControl.addModifyListener(new ModifyListener() { @Override public void modifyText(ModifyEvent e) { String value= textControl.getText(); if (key != null) fStore.setValue(key, value); } }); return new Control[] {labelControl, textControl}; }
private Control[] addTextField(Composite composite, String label, final String key, int textLimit, int indentation, PixelConverter pixelConverter) { Label labelControl= new Label(composite, SWT.NONE); labelControl.setText(label); GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING); gd.horizontalIndent= indentation; labelControl.setLayoutData(gd); final Text textControl= new Text(composite, SWT.BORDER | SWT.SINGLE); gd= new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING); gd.widthHint= pixelConverter.convertWidthInCharsToPixels(textLimit + 1); textControl.setLayoutData(gd); textControl.setTextLimit(textLimit); textControl.addModifyListener(new ModifyListener() { public void modifyText(ModifyEvent e) { String value= textControl.getText(); if (key != null) fStore.setValue(key, value); } }); return new Control[] {labelControl, textControl}; }
void createMarkerLimitArea(Composite parent) { Font font = parent.getFont(); Composite composite = new Composite(parent, SWT.NONE); composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); composite.setFont(font); GridLayout layout = new GridLayout(); layout.numColumns = 2; composite.setLayout(layout); filterOnMarkerLimit = createCheckbox(composite, TaskListMessages.TaskList_limitVisibleTasksTo, false); filterOnMarkerLimit.setLayoutData(new GridData()); markerLimit = new Text(composite, SWT.SINGLE | SWT.BORDER); markerLimit.setTextLimit(6); GridData gridData = new GridData(); gridData.widthHint = convertWidthInCharsToPixels(10); markerLimit.setLayoutData(gridData); markerLimit.setFont(font); }
public static Text newShortTextInput(Composite parent, String title, int textLimit, int width) { Text t = newInput(parent, title, SWT.BORDER); t.setTextLimit(textLimit); Rectangle r = t.getBounds(); r.width = width; t.setBounds(r); t.setSize(width, r.height); t.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING)); return t; }
public Text newShortTextInput(int textLimit, int width) { Text t = newInput(this, null, SWT.BORDER); t.setTextLimit(textLimit); Rectangle r = t.getBounds(); r.width = width; t.setBounds(r); t.setSize(width, r.height); t.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING)); return t; }
@Override public void runSupport() { if (text_entry_combo != null && !text_entry_combo.isDisposed()) { text_entry_combo.setTextLimit(textLimit); } if (text_entry_text != null && !text_entry_text.isDisposed()) { text_entry_text.setTextLimit(textLimit); } } });
public void activate() { Object element = fTreeItem.getData(); String value = cellModifier.getValue(element, fProperty).toString(); if (fControl instanceof Text) { Text text = (Text) fControl; int requiredSize = value.length() + 100; if (text.getTextLimit() < requiredSize) { text.setTextLimit(requiredSize); } } Rectangle r = fTreeItem.getBounds(); if (r != null) { fControl.setBounds(columnPosition + 5, r.y + 1, fTree1.getClientArea().width - (columnPosition + 5), r.height - 1); fControl.setVisible(true); fCellEditor.setValue(value); fCellEditor.addListener(this); fCellEditor.setFocus(); fControl.addFocusListener(this); } }