@Override public String isValid(String newText) { return resourceNameValidator.isValid(newText); } };
@Override public String isValid(String newText) { return resourceNameValidator.isValid(newText); } };
/** * Validates the current input * @since 3.3 */ private void validateInput() { String errorMessage = null; if (fValidator != null) { errorMessage = fValidator.isValid(fTextWidget.getText()); } setErrorMessage(errorMessage); }
public void modifyText(ModifyEvent e) { String error = inputValidator.isValid(name.getText()); setErrorMessage(error); getButton(OK).setEnabled(error == null); } });
/** * {@inheritDoc} */ @Override protected boolean validate(Text control) { if (null == inputValidator) { return true; } String errorMessage = inputValidator.isValid(control.getText()); if (null != errorMessage) { setDescriptionText(errorMessage); return false; } else { return true; } }
/** * Validates the input. * <p> * The default implementation of this framework method delegates the request * to the supplied input validator object; if it finds the input invalid, * the error message is displayed in the dialog's message line. This hook * method is called whenever the text changes in the input field. * </p> */ protected void validateInput() { String errorMessage = null; if (validator != null) { errorMessage = validator.isValid(text.getText()); } // Bug 16256: important not to treat "" (blank error) the same as null // (no error) setErrorMessage(errorMessage); }
/** * Validates the input. * <p> * The default implementation of this framework method delegates the request * to the supplied input validator object; if it finds the input invalid, * the error message is displayed in the dialog's message line. This hook * method is called whenever the text changes in the input field. * </p> */ protected void validateInput() { String errorMessage = null; if (validator != null) { errorMessage = validator.isValid(text.getText()); } // Bug 16256: important not to treat "" (blank error) the same as null // (no error) setErrorMessage(errorMessage); }
/** * Validates the input. * <p> * The default implementation of this framework method delegates the request * to the supplied input validator object; if it finds the input invalid, * the error message is displayed in the dialog's message line. This hook * method is called whenever the text changes in the input field. * </p> */ protected void validateInput() { String errorMessage = null; if (validator != null) { errorMessage = validator.isValid(text.getText()); } // Bug 16256: important not to treat "" (blank error) the same as null // (no error) setErrorMessage(errorMessage); }
/** * Validates the input. * <p> * The default implementation of this framework method delegates the request * to the supplied input validator object; if it finds the input invalid, * the error message is displayed in the dialog's message line. This hook * method is called whenever the text changes in the input field. * </p> */ protected void validateInput() { String errorMessage = null; if (validator != null) { errorMessage = validator.isValid(text.getText()); } // Bug 16256: important not to treat "" (blank error) the same as null // (no error) setErrorMessage(errorMessage); }
protected void focusLost() { updateStatus(null); final String input= fText.getText(); if (fInputValidator != null && fInputValidator.isValid(input) != null) fSelected= fOldSelected; else fSelected= input; if (fSelected != fOldSelected) { saveSelected(); fText.setText(fSelected); } }
protected void focusLost() { updateStatus(null); final String input= fText.getText(); if (fInputValidator != null && fInputValidator.isValid(input) != null) fSelected= fOldSelected; else fSelected= input; if (fSelected != fOldSelected) { saveSelected(); fText.setText(fSelected); } }
/** * Validates the input. * <p> * The default implementation of this framework method delegates the request * to the supplied input validator object; if it finds the input invalid, * the error message is displayed in the dialog's message line. This hook * method is called whenever the text changes in the input field. * </p> */ protected void validateInput() { String errorMessage = null; if (validator != null) { errorMessage = validator.isValid(text.getText()); } // Bug 16256: important not to treat "" (blank error) the same as null // (no error) setErrorMessage(errorMessage); }
/** * Is input in textual boxes valid. * * @return Is input in textual boxes valid. */ private boolean isInputValid() { if (null != keyValidator) { String errorMessage = keyValidator.isValid(keyBox.getText()); if (null != errorMessage) { setErrorMessage(errorMessage); return false; } } if (null != valueValidator) { String errorMessage = valueValidator.isValid(valueBox.getText()); if (null != errorMessage) { setErrorMessage(errorMessage); return false; } } setErrorMessage(null); return true; }
/** * Validates the input. * <p> * The default implementation of this framework method * delegates the request to the supplied input validator object; * if it finds the input invalid, the error message is displayed * in the dialog's message line. * This hook method is called whenever the text changes in the * input field. * </p> */ protected void validateInput() { String errorMessage = null; if (validator != null) { errorMessage = validator.isValid(text.getText()); } // Bug 16256: important not to treat empty string (blank error) the same as null (no error) errorMessageLabel.setText(errorMessage == null ? IInternalDebugCoreConstants.EMPTY_STRING : errorMessage); okButton.setEnabled(errorMessage == null); errorMessageLabel.getParent().update(); } @Override
private void textChanged(String text) { Button okButton = getButton(IDialogConstants.OK_ID); if (fValidator != null) { String message = fValidator.isValid(text); if (message != null) { status = new Status(IStatus.ERROR, PDEPlugin.getPluginId(), IStatus.ERROR, message, null); updateStatus(status); okButton.setEnabled(false); return; } } for (int i = 0; i < oldNames.size(); i++) { if ((isCaseSensitive && text.equals(oldNames.get(i))) || (!isCaseSensitive && text.equalsIgnoreCase(oldNames.get(i).toString()))) { status = new Status(IStatus.ERROR, PDEPlugin.getPluginId(), IStatus.ERROR, PDEUIMessages.RenameDialog_validationError, null); updateStatus(status); okButton.setEnabled(false); break; } okButton.setEnabled(true); status = new Status(IStatus.OK, PDEPlugin.getPluginId(), IStatus.OK, "", //$NON-NLS-1$ null); updateStatus(status); } }
protected void fieldModified() { final String text= fText.getText(); final String errorText= fInputValidator != null ? fInputValidator.isValid(text) : null; if (errorText == null) { updateStatus(null); if (fSelected != text) { fSelected= text; saveSelected(); } } else updateStatus(createErrorStatus(errorText)); }
protected void fieldModified() { final String text= fText.getText(); final String errorText= fInputValidator != null ? fInputValidator.isValid(text) : null; if (errorText == null) { updateStatus(null); if (fSelected != text) { fSelected= text; saveSelected(); } } else updateStatus(createErrorStatus(errorText)); }
@Override protected void validateInput() { String errorMessage = null; if (getValidator() != null) { errorMessage = getValidator().isValid(getText().getText()); } setErrorMessage(errorMessage); if (errorMessage == null) { updateForWorkingSetSettings(); } } }
private void validateInput() { // don't do anything if dialog is disposed if (getShell() == null) { return; } // validate tag name String tagNameMessage = tagNameValidator.isValid(tagNameText.getText()); setErrorMessage(tagNameMessage); String tagMessageVal = tagMessageText.getText().trim(); Control button = getButton(IDialogConstants.OK_ID); if (button != null) { boolean containsTagNameAndMessage = (tagNameMessage == null || tagMessageVal .length() == 0) && tagMessageVal.length() != 0; boolean shouldOverwriteTag = (overwriteButton.getSelection() && Repository .isValidRefName(Constants.R_TAGS + tagNameText.getText())); button.setEnabled(containsTagNameAndMessage || shouldOverwriteTag); } boolean existingTagSelected = existingTag != null; if (existingTagSelected && !overwriteButton.getSelection()) tagMessageText.getTextWidget().setEditable(false); else tagMessageText.getTextWidget().setEditable(true); overwriteButton.setEnabled(existingTagSelected); if (!existingTagSelected) overwriteButton.setSelection(false); }
return; String message = this.myValidator.isValid(nameText.getText()); if (message != null) { setErrorMessage(message);