当前位置: 首页>>代码示例>>Java>>正文


Java ValidationState类代码示例

本文整理汇总了Java中org.gwtbootstrap3.client.ui.constants.ValidationState的典型用法代码示例。如果您正苦于以下问题:Java ValidationState类的具体用法?Java ValidationState怎么用?Java ValidationState使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ValidationState类属于org.gwtbootstrap3.client.ui.constants包,在下文中一共展示了ValidationState类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: updateStatus

import org.gwtbootstrap3.client.ui.constants.ValidationState; //导入依赖的package包/类
/**
 * Update the status
 */
private void updateStatus(String textValue) {
	isValid = true;
	String msg = null;
	
	for(TextValidator vdater : validators) {
		if(!vdater.validate(textValue)) {
			isValid = false;
			msg = vdater.getErrorMessage();
			break;
		}
	}
	
	if(isValid) {
		formgroup.setValidationState(ValidationState.NONE);
		fgHelpBlock.setText(null);
	} else {
		formgroup.setValidationState(ValidationState.ERROR);
		fgHelpBlock.setText(msg);
	}
	
}
 
开发者ID:Teiid-Designer,项目名称:teiid-webui,代码行数:25,代码来源:ValidatingTextBoxHoriz.java

示例2: addProperty

import org.gwtbootstrap3.client.ui.constants.ValidationState; //导入依赖的package包/类
private PropertyEditorCategory addProperty() {
    paramKeyInline.setText("");
    paramKeyControlGroup.setValidationState(ValidationState.NONE);

    //Check the Key is valid
    final NameValidator validator = NameValidator.parameterNameValidator();
    if (!validator.isValid(key.getText())) {
        paramKeyControlGroup.setValidationState(ValidationState.ERROR);
        paramKeyInline.setText(validator.getValidationError());
        return null;
    }

    //Check the Key is unique
    Map<String, String> properties = configContext.getComponentProperties();
    for (String parameterKey : properties.keySet()) {
        if (key.getText().equals(parameterKey)) {
            paramKeyControlGroup.setValidationState(ValidationState.ERROR);
            paramKeyInline.setText(CommonConstants.INSTANCE.DuplicateParameterName());
            return null;
        }
    }

    configContext.setComponentProperty(key.getText(),
                                       value.getText());
    return generateScreenSettingsCategory();
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:27,代码来源:EditScreen.java

示例3: onOKButtonClick

import org.gwtbootstrap3.client.ui.constants.ValidationState; //导入依赖的package包/类
private void onOKButtonClick() {
    if (defaultGroupIdTextBox.getText() == null || defaultGroupIdTextBox.getText().trim().isEmpty()) {
        defaultGroupIdGroup.setValidationState(ValidationState.ERROR);
        defaultGroupIdHelpInline.setText(OrganizationalUnitManagerConstants.INSTANCE.DefaultGroupIdIsMandatory());
    } else {
        presenter.checkValidGroupId(defaultGroupIdTextBox.getText(),
                                    new RemoteCallback<Boolean>() {
                                        @Override
                                        public void callback(Boolean valid) {
                                            if (!valid) {
                                                defaultGroupIdGroup.setValidationState(ValidationState.ERROR);
                                                defaultGroupIdHelpInline.setText(OrganizationalUnitManagerConstants.INSTANCE.InvalidGroupId());
                                            } else {
                                                presenter.saveOrganizationalUnit(nameTextBox.getText(),
                                                                                 ownerTextBox.getText(),
                                                                                 defaultGroupIdTextBox.getText());
                                                hide();
                                            }
                                        }
                                    });
    }
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:23,代码来源:EditOrganizationalUnitPopup.java

示例4: reset

import org.gwtbootstrap3.client.ui.constants.ValidationState; //导入依赖的package包/类
@Override
public void reset() {
    nameTextBox.setText("");
    nameGroup.setValidationState(ValidationState.NONE);
    nameHelpInline.setText("");

    organizationalUnitDropdown.setValue("");
    organizationalUnitDropdown.refresh();
    organizationalUnitGroup.setValidationState(ValidationState.NONE);
    organizationalUnitHelpInline.setText("");

    gitURLTextBox.setText("");
    urlGroup.setValidationState(ValidationState.NONE);
    urlHelpInline.setText("");

    usernameTextBox.setText("");
    passwordTextBox.setText("");

    managedRepository.setValue(Boolean.FALSE);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:21,代码来源:CloneRepositoryViewImpl.java

示例5: testCloneNoGroup

import org.gwtbootstrap3.client.ui.constants.ValidationState; //导入依赖的package包/类
@Test
public void testCloneNoGroup() {
    when(repositoryPreferences.isOUMandatory()).thenReturn(true);
    when(view.isGitUrlEmpty()).thenReturn(false);
    when(view.getGitUrl()).thenReturn(REPO_URL);
    when(view.getName()).thenReturn(REPO_NAME);
    when(view.getSelectedOrganizationalUnit()).thenReturn("");

    presenter = new CloneRepositoryPresenter(repositoryPreferences,
                                             view,
                                             repoServiceCaller,
                                             ouServiceCaller,
                                             placeManager,
                                             authorizationManager,
                                             sessionInfo);
    presenter.handleCloneClick();

    verify(view).setOrganizationalUnitGroupType(ValidationState.ERROR);
    verify(view).showOrganizationalUnitHelpMandatoryMessage();
    verifyRepoCloned(false);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:22,代码来源:CloneRepositoryPresenterTest.java

示例6: testCloneNoUrl

import org.gwtbootstrap3.client.ui.constants.ValidationState; //导入依赖的package包/类
@Test
public void testCloneNoUrl() {
    when(repositoryPreferences.isOUMandatory()).thenReturn(true);
    when(view.isGitUrlEmpty()).thenReturn(true);
    when(view.getGitUrl()).thenReturn("");
    when(view.getName()).thenReturn(REPO_NAME);
    when(view.getSelectedOrganizationalUnit()).thenReturn(ORG_UNIT_ONE);

    presenter = new CloneRepositoryPresenter(repositoryPreferences,
                                             view,
                                             repoServiceCaller,
                                             ouServiceCaller,
                                             placeManager,
                                             authorizationManager,
                                             sessionInfo);
    presenter.handleCloneClick();

    verify(view).setUrlGroupType(ValidationState.ERROR);
    verify(view).showUrlHelpMandatoryMessage();
    verifyRepoCloned(false);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:22,代码来源:CloneRepositoryPresenterTest.java

示例7: showErrors

import org.gwtbootstrap3.client.ui.constants.ValidationState; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public void showErrors(List<EditorError> errors) {
    init();
    // clearErrors();
    String errorMsg = "";
    if (validationStateParent != null) {
        validationStateParent.setValidationState(errors.size() <= 0 ? ValidationState.NONE : ValidationState.ERROR);
        for (int index = 0; index < errors.size(); index++) {
            errorMsg = errors.get(0).getMessage();
            if (index + 1 < errors.size()) { errorMsg += "; "; }
        }
    }
    if (validationStateHelpBlock != null) {
        validationStateHelpBlock.setError(errorMsg);
    }
}
 
开发者ID:gwtbootstrap3,项目名称:gwtbootstrap3,代码行数:18,代码来源:DefaultErrorHandler.java

示例8: hide

import org.gwtbootstrap3.client.ui.constants.ValidationState; //导入依赖的package包/类
@Override
public void hide() {
    super.hide();
    serverTemplateGroup.setVisible(false);
    containerIdText.setText(null);
    startContainerCheck.setValue(null);
    serverTemplateDropdown.setValue((String) null);
    final Iterator<Widget> options = serverTemplateDropdown.iterator();
    while (options.hasNext()) {
        options.next();
        options.remove();
    }
    serverTemplateDropdown.refresh();
    validateExistingContainerCallback = null;

    containerIdTextGroup.setValidationState(ValidationState.NONE);
    containerIdTextHelpInline.setText("");

    serverTemplateGroup.setValidationState(ValidationState.NONE);
    serverTemplateHelpInline.setText("");
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:22,代码来源:DeploymentScreenPopupViewImpl.java

示例9: validateUrl

import org.gwtbootstrap3.client.ui.constants.ValidationState; //导入依赖的package包/类
private boolean validateUrl(final ExampleRepository selectedRepository) {
    if (selectedRepository == null) {
        view.setUrlGroupType(ValidationState.ERROR);
        view.showUrlHelpMessage(translator.format(ExamplesScreenConstants.SourceRepositoryPage_WizardSelectRepositoryURLMandatory));
        return false;
    }
    final String url = selectedRepository.getUrl();
    if (url == null || url.trim().isEmpty()) {
        selectedRepository.setUrlValid(false);
        view.setUrlGroupType(ValidationState.ERROR);
        view.showUrlHelpMessage(translator.format(ExamplesScreenConstants.SourceRepositoryPage_WizardSelectRepositoryURLMandatory));
        return false;
    } else if (!isUrlValid(url)) {
        selectedRepository.setUrlValid(false);
        view.setUrlGroupType(ValidationState.ERROR);
        view.showUrlHelpMessage(translator.format(ExamplesScreenConstants.SourceRepositoryPage_WizardSelectRepositoryURLFormatInvalid));
        return false;
    } else {
        selectedRepository.setUrlValid(true);
        view.setUrlGroupType(ValidationState.NONE);
        view.hideUrlHelpMessage();
        return true;
    }
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:25,代码来源:SourceRepositoryPage.java

示例10: testIsComplete_EmptyRepositoryUrl

import org.gwtbootstrap3.client.ui.constants.ValidationState; //导入依赖的package包/类
@Test
@SuppressWarnings("unchecked")
public void testIsComplete_EmptyRepositoryUrl() {
    final ExampleRepository repository = new ExampleRepository("");
    model.setSelectedRepository(repository);
    final Callback<Boolean> callback = mock(Callback.class);
    page.isComplete(callback);

    verify(callback,
           times(1)).callback(eq(false));
    verify(view,
           times(1)).setUrlGroupType(eq(ValidationState.ERROR));
    verify(view,
           times(1)).showUrlHelpMessage(any(String.class));

    assertFalse(repository.isUrlValid());
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:18,代码来源:SourceRepositoryPageTest.java

示例11: testIsComplete_InvalidRepositoryUrl

import org.gwtbootstrap3.client.ui.constants.ValidationState; //导入依赖的package包/类
@Test
@SuppressWarnings("unchecked")
public void testIsComplete_InvalidRepositoryUrl() {
    final ExampleRepository repository = new ExampleRepository("cheese");
    model.setSelectedRepository(repository);
    final Callback<Boolean> callback = mock(Callback.class);
    page.isComplete(callback);

    verify(callback,
           times(1)).callback(eq(false));
    verify(view,
           times(1)).setUrlGroupType(eq(ValidationState.ERROR));
    verify(view,
           times(1)).showUrlHelpMessage(any(String.class));

    assertFalse(repository.isUrlValid());
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:18,代码来源:SourceRepositoryPageTest.java

示例12: startScanner

import org.gwtbootstrap3.client.ui.constants.ValidationState; //导入依赖的package包/类
@EventHandler("container-config-start-scanner")
public void startScanner(final ClickEvent event) {
    if (startScanner.isActive()) {
        return;
    }

    try {
        presenter.startScanner(getInterval(),
                               intervalTimeUnit.getSelectedItem().getValue());
    } catch (final IllegalArgumentException ex) {
        StyleHelper.addUniqueEnumStyleName(scannerForm,
                                           ValidationState.class,
                                           ValidationState.ERROR);
        stopScannerActive.execute();
    }
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:17,代码来源:ContainerRulesConfigView.java

示例13: onOKButtonClick

import org.gwtbootstrap3.client.ui.constants.ValidationState; //导入依赖的package包/类
private void onOKButtonClick() {
    boolean hasError = false;
    if (importTypeTextBox.getText() == null || importTypeTextBox.getText().trim().isEmpty()) {
        importTypeGroup.setValidationState(ValidationState.ERROR);
        importTypeHelpInline.setText(ImportConstants.INSTANCE.importTypeIsMandatory());
        hasError = true;
    } else {
        importTypeGroup.setValidationState(ValidationState.NONE);
    }

    if (hasError) {
        return;
    }

    if (callbackCommand != null) {
        callbackCommand.execute();
    }
    hide();
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:20,代码来源:AddImportPopup.java

示例14: testFileNameFailure

import org.gwtbootstrap3.client.ui.constants.ValidationState; //导入依赖的package包/类
protected void testFileNameFailure(String fileName) {
    when(view.fileNameTextBox.getText()).thenReturn(fileName);

    view.onOKButtonClick();

    validateClearErrors();

    verify(view.fileNameGroup).addClassName(ValidationState.ERROR.getCssName());
    verify(view.fileNameHelpInline).setText(anyString());
    verify(view.translationService).getTranslation(KieWorkbenchWidgetsConstants.NewResourceViewFileNameIsMandatory);

    verify(packageListBox,
           never()).getSelectedPackage();

    verify(view.packageGroup,
           never()).addClassName(ValidationState.ERROR.getCssName());
    verify(view.packageHelpInline,
           never()).setText(anyString());
    verify(view.translationService,
           never()).getTranslation(KieWorkbenchWidgetsConstants.NewResourceViewMissingPath);

    verify(presenter,
           never()).validate(anyString(),
                             any(ValidatorWithReasonCallback.class));
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:26,代码来源:NewResourceViewTest.java

示例15: validateForm

import org.gwtbootstrap3.client.ui.constants.ValidationState; //导入依赖的package包/类
private boolean validateForm() {
    boolean valid = true;
    clearErrorMessages();
    String filterName = (String) formValues.get(FILTER_NAME_PARAM);
    if (filterName == null || filterName.trim().length() == 0) {
        errorMessages.setText(CommonConstants.INSTANCE.Filter_Must_Have_A_Name());
        errorMessagesGroup.setValidationState(ValidationState.ERROR);
        valid = false;
    } else {
        errorMessages.setText("");
        errorMessagesGroup.setValidationState(ValidationState.NONE);
    }
    return valid;
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:15,代码来源:NewFilterPopup.java


注:本文中的org.gwtbootstrap3.client.ui.constants.ValidationState类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。