@Override public boolean isSelectAllEnabled() { if (text == null || text.isDisposed()) return false; return text.getCharCount() > 0; }
@Override public boolean isSelectAllEnabled() { if (text == null || text.isDisposed()) return false; return text.getCharCount() > 0; }
public boolean isSelectAllEnabled() { if (text == null || text.isDisposed()) return false; return text.getCharCount() > 0; }
@Override public void focusGained(FocusEvent e) { fControl.setSelection(0, fControl.getCharCount()); } });
protected void focusGained() { fOldSelected= fSelected; fNumberText.setSelection(0, fNumberText.getCharCount()); }
protected void focusGained() { fOldSelected= fSelected; fNumberText.setSelection(0, fNumberText.getCharCount()); }
protected void focusGained() { fOldSelected= fSelected; fText.setSelection(0, fText.getCharCount()); }
protected void focusGained() { fOldSelected= fSelected; fNumberText.setSelection(0, fNumberText.getCharCount()); }
protected void focusGained() { fOldSelected= fSelected; fText.setSelection(0, fText.getCharCount()); }
NSString getInsertString (String string, NSRange range) { NSString str; int charCount = getCharCount (); int length = string.length (); int selectionLength = range != null ? (int)/*64*/(range.length) : 0; if (charCount - selectionLength + length > textLimit) { length = textLimit - charCount + selectionLength; length = Math.max (0, length); } char [] buffer = new char [length]; string.getChars (0, buffer.length, buffer, 0); str = NSString.stringWithCharacters (buffer, buffer.length); return str; }
@Override public void verifyText(VerifyEvent e) { if (fCanModifyPackage && ! fEnclosingTypeSelection.isSelected() && e.start == 0 && e.end == ((Text) e.widget).getCharCount()) { String typeNameWithoutParameters= getTypeNameWithoutParameters(getTypeNameWithoutExtension(e.text)); int lastDot= typeNameWithoutParameters.lastIndexOf('.'); if (lastDot == -1 || lastDot == typeNameWithoutParameters.length() - 1) return; String pack= typeNameWithoutParameters.substring(0, lastDot); if (validatePackageName(pack, null).getSeverity() == IStatus.ERROR) return; fPackageDialogField.setText(pack); e.text= e.text.substring(lastDot + 1); } } });
@Override public void verifyText(VerifyEvent e) { if (fCanModifyPackage && ! fEnclosingTypeSelection.isSelected() && e.start == 0 && e.end == ((Text) e.widget).getCharCount()) { String typeNameWithoutParameters= getTypeNameWithoutParameters(e.text); int lastDot= typeNameWithoutParameters.lastIndexOf('.'); if (lastDot == -1 || lastDot == typeNameWithoutParameters.length() - 1) return; String pack= typeNameWithoutParameters.substring(0, lastDot); if (validatePackageName(pack, null).getSeverity() == IStatus.ERROR) return; fPackageDialogField.setText(pack); e.text= e.text.substring(lastDot + 1); } } });
public boolean isDeleteEnabled() { if (text == null || text.isDisposed()) return false; return text.getSelectionCount() > 0 || text.getCaretPosition() < text.getCharCount(); }
@Override public boolean isDeleteEnabled() { if (text == null || text.isDisposed()) return false; return text.getSelectionCount() > 0 || text.getCaretPosition() < text.getCharCount(); }
@Override public boolean isDeleteEnabled() { if (text == null || text.isDisposed()) return false; return text.getSelectionCount() > 0 || text.getCaretPosition() < text.getCharCount(); }
/** * The <code>TextCellEditor</code> implementation of this * <code>CellEditor</code> method returns <code>true</code> * if there is a selection or if the caret is not positioned * at the end of the text. */ @Override public boolean isDeleteEnabled() { if (text == null || text.isDisposed()) { return false; } return text.getSelectionCount() > 0 || text.getCaretPosition() < text.getCharCount(); }
/** * The <code>TextCellEditor</code> implementation of this * <code>CellEditor</code> method returns <code>true</code> * if there is a selection or if the caret is not positioned * at the end of the text. */ @Override public boolean isDeleteEnabled() { if (text == null || text.isDisposed()) { return false; } return text.getSelectionCount() > 0 || text.getCaretPosition() < text.getCharCount(); }
/** * Update the state. */ public void updateEnabledState() { if (activeTextControl != null && !activeTextControl.isDisposed()) { setEnabled(activeTextControl.getCharCount() > 0); return; } if (selectAllAction != null) { setEnabled(selectAllAction.isEnabled()); return; } setEnabled(false); } }
private void showGoToAddressComposite() { String selectedStr = getSelectedAsString(); Text text = fGoToAddressComposite.getExpressionWidget(); text.setText(selectedStr); text.setSelection(0, text.getCharCount()); double height = fGoToAddressComposite.getHeight(); double canvasHeight = fSashForm.getParent().getClientArea().height; double tableHeight = canvasHeight - height; double tableWeight = (tableHeight / canvasHeight) * 100; double textWeight = (height / canvasHeight) * 100; fSashForm.setWeights(new int[] { (int) tableWeight, (int) textWeight }); fSashForm.setMaximizedControl(null); fGoToAddressComposite.getExpressionWidget().setFocus(); }
public void performDelete() { if (text.getSelectionCount() > 0) // remove the contents of the current selection text.insert(""); //$NON-NLS-1$ else { // remove the next character int pos = text.getCaretPosition(); if (pos < text.getCharCount()) { text.setSelection(pos, pos + 1); text.insert(""); //$NON-NLS-1$ } } checkSelection(); checkDeleteable(); checkSelectable(); }