當前位置: 首頁>>代碼示例>>Java>>正文


Java StringValidators類代碼示例

本文整理匯總了Java中org.netbeans.validation.api.builtin.stringvalidation.StringValidators的典型用法代碼示例。如果您正苦於以下問題:Java StringValidators類的具體用法?Java StringValidators怎麽用?Java StringValidators使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


StringValidators類屬於org.netbeans.validation.api.builtin.stringvalidation包,在下文中一共展示了StringValidators類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: initValidators

import org.netbeans.validation.api.builtin.stringvalidation.StringValidators; //導入依賴的package包/類
private void initValidators() {
    if (isApp) {
        vg.add(txtAddModule, ValidatorUtils.merge(
            MavenValidators.createArtifactIdValidators(),
            StringValidators.REQUIRE_VALID_FILENAME
        ));
        SwingValidationGroup.setComponentName(txtAddModule, ADD_Module_Name());
    }
    vgEnabled.add(versionCombo, new Validator<String>() {
        
        @Override
        public void validate(Problems prblms, String name, String value) {
            if (SEARCHING.equals(value) || !isLoaded) {
                prblms.add("Still searching", Severity.FATAL);
            }
        }
        
        @Override
        public Class modelType() {
            return String.class;
        }
    });
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:24,代碼來源:NbmWizardPanelVisual.java

示例2: createValidations

import org.netbeans.validation.api.builtin.stringvalidation.StringValidators; //導入依賴的package包/類
void createValidations(DialogDescriptor dd) {
    nls = dd.createNotificationLineSupport();
    vg = ValidationGroup.create(new NotificationLineSupportAdapter(nls), new DialogDescriptorAdapter(dd));
    vg.add(txtFolder,
            new OptionalValidator(cbFolder,
                ValidatorUtils.merge(
                    StringValidators.REQUIRE_NON_EMPTY_STRING,
                    ValidatorUtils.merge(StringValidators.REQUIRE_VALID_FILENAME,
                    new FileNameExists(FileUtil.toFile(project.getProjectDirectory().getParent()))
                )
            )));
    vg.add(txtArtifactId,
            new OptionalValidator(cbArtifactId,
                    MavenValidators.createArtifactIdValidators()
            ));
    checkEnablement();
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:18,代碼來源:RenameProjectPanel.java

示例3: initPaginationControlPanel

import org.netbeans.validation.api.builtin.stringvalidation.StringValidators; //導入依賴的package包/類
private void initPaginationControlPanel()   {
    pageCtrlPanel = new PaginationCtrlPanel();
    pageCtrlPanel.setPageSize(pageSize+"");
    
    panelValdPagCtrl = new ValidationPanel();
    panelValdPagCtrl.setBorder(new TitledBorder(new LineBorder(Color.BLACK), "Pagination Control", 
                                                    TitledBorder.CENTER,TitledBorder.TOP));
    panelValdPagCtrl.setInnerComponent(pageCtrlPanel);
    vgPagControl = panelValdPagCtrl.getValidationGroup();
    vgPagControl.add(pageCtrlPanel.getPageSizeTextField(), 
                    StringValidators.REQUIRE_VALID_INTEGER,
                    StringValidators.REQUIRE_NON_NEGATIVE_NUMBER,
                    StringValidators.REQUIRE_NON_EMPTY_STRING);
    vgPagControl.add(pageCtrlPanel.getVisibleRowTextField(), 
                    StringValidators.REQUIRE_VALID_INTEGER,
                    StringValidators.REQUIRE_NON_NEGATIVE_NUMBER,
                    StringValidators.REQUIRE_NON_EMPTY_STRING);
    vgPagControl.add(pageCtrlPanel.getSelectedPageTextField(), 
                    StringValidators.REQUIRE_VALID_INTEGER,
                    StringValidators.REQUIRE_NON_NEGATIVE_NUMBER,
                    StringValidators.REQUIRE_NON_EMPTY_STRING);
}
 
開發者ID:dbunibas,項目名稱:BART,代碼行數:23,代碼來源:TableDataView.java

示例4: initValidator

import org.netbeans.validation.api.builtin.stringvalidation.StringValidators; //導入依賴的package包/類
private void initValidator()   {
    panelValAcc = new ValidationPanel();
    panelValAcc.setBorder(new TitledBorder(new LineBorder(Color.BLUE), "Main Memory Configuration", TitledBorder.CENTER,TitledBorder.TOP));
    panelMainMem = new MainMemoryPanel();
    panelValAcc.setInnerComponent(panelMainMem);
    vg = panelValAcc.getValidationGroup();
    vg.add(panelMainMem.getXmlSchemaTextField(), StringValidators.REQUIRE_NON_EMPTY_STRING,
                                                   StringValidators.NO_WHITESPACE
                                                   //StringValidators.FILE_MUST_EXIST
                                                           );
    vg.add(panelMainMem.getXmlInstanceTextField(), StringValidators.REQUIRE_NON_EMPTY_STRING,
                                                   StringValidators.NO_WHITESPACE
                                                   //StringValidators.FILE_MUST_EXIST 
                                                           );
    panelMainMem.getXmlInstanceTextField()
            .getDocument()
            .addDocumentListener(new ValidDocumentListener());
    panelMainMem.getXmlSchemaTextField()
            .getDocument()
            .addDocumentListener(new ValidDocumentListener());
}
 
開發者ID:dbunibas,項目名稱:BART,代碼行數:22,代碼來源:MainMemoryEditPanel.java

示例5: createArtifactIdValidators

import org.netbeans.validation.api.builtin.stringvalidation.StringValidators; //導入依賴的package包/類
public static Validator<String> createArtifactIdValidators() {
        return ValidatorUtils.merge(
                    StringValidators.REQUIRE_NON_EMPTY_STRING,
//                  ValidatorUtils.merge(StringValidators.MAY_NOT_START_WITH_DIGIT,
                    ValidatorUtils.merge(StringValidators.NO_WHITESPACE,
                    StringValidators.regexp("[a-zA-Z0-9_\\-.]*[a-zA-Z0-9]{1}", NbBundle.getMessage(MavenValidators.class, "ERR_Coordinate_Invalid"), false)
               ));
    }
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:9,代碼來源:MavenValidators.java

示例6: createGroupIdValidators

import org.netbeans.validation.api.builtin.stringvalidation.StringValidators; //導入依賴的package包/類
public static Validator<String> createGroupIdValidators() {
        return ValidatorUtils.merge(
                    StringValidators.REQUIRE_NON_EMPTY_STRING,
//                  ValidatorUtils.merge(StringValidators.MAY_NOT_START_WITH_DIGIT,
                    ValidatorUtils.merge(StringValidators.NO_WHITESPACE,
                    StringValidators.regexp("[a-zA-Z0-9_\\-.]*[a-zA-Z0-9]{1}", NbBundle.getMessage(MavenValidators.class, "ERR_Coordinate_Invalid"), false)
               ));
    }
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:9,代碼來源:MavenValidators.java

示例7: createVersionValidators

import org.netbeans.validation.api.builtin.stringvalidation.StringValidators; //導入依賴的package包/類
public static Validator<String> createVersionValidators() {
        return ValidatorUtils.merge(
                    StringValidators.REQUIRE_NON_EMPTY_STRING,
//                  ValidatorUtils.merge(StringValidators.MAY_NOT_START_WITH_DIGIT,
                    ValidatorUtils.merge(StringValidators.NO_WHITESPACE,
                    StringValidators.regexp("[a-zA-Z0-9_\\-.]*[a-zA-Z0-9]{1}", NbBundle.getMessage(MavenValidators.class, "ERR_Coordinate_Invalid"),  false)
               ));
    }
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:9,代碼來源:MavenValidators.java

示例8: createValidations

import org.netbeans.validation.api.builtin.stringvalidation.StringValidators; //導入依賴的package包/類
@SuppressWarnings("unchecked")
    void createValidations(DialogDescriptor dd) {
        line = dd.createNotificationLineSupport();
        this.dd = dd;
        vg = ValidationGroup.create(new NotificationLineSupportAdapter(line), new DialogDescriptorAdapter(dd));
        vg.add(txtName,
                    ValidatorUtils.merge(
                        StringValidators.REQUIRE_NON_EMPTY_STRING,
//                        StringValidators.REQUIRE_VALID_FILENAME,
                        new LibraryNameExists()
                    ));
    }
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:13,代碼來源:CreateLibraryPanel.java

示例9: initPanel

import org.netbeans.validation.api.builtin.stringvalidation.StringValidators; //導入依賴的package包/類
private void initPanel()   {
    panelValAcc = new ValidationPanel();
    getPanelValAcc().setBorder(new TitledBorder(new LineBorder(Color.BLACK), "EGTask Configuration", 
                                                    TitledBorder.CENTER,TitledBorder.TOP));
    panel = new ConfEGTaskPanel();
    getPanelValAcc().setInnerComponent(panel);
    vg = getPanelValAcc().getValidationGroup();
    vg.add(panel.getExportCellChangesPathTextField(), StringValidators.REQUIRE_NON_EMPTY_STRING);
    vg.add(panel.getExportDirtyDbTypeTextField(),StringValidators.REQUIRE_NON_EMPTY_STRING);
    
    vg.add(panel.getExportDirtyDBPathTextField(), StringValidators.REQUIRE_NON_EMPTY_STRING);
    
    vg.add(panel.getCloneSuffixTextField(), StringValidators.REQUIRE_NON_EMPTY_STRING);
    
    //vg.add(panel.getQueryWxecutionTimeOutTextField(), StringValidators.REQUIRE_VALID_NUMBER);
    vg.add(panel.getSizeFactorReductionTextField(), StringValidators.REQUIRE_VALID_NUMBER);
    
    
    panel.getExportCellChangesPathTextField()
            .getDocument()
            .addDocumentListener(new ValidatorDocListener());
    panel.getExportDirtyDbTypeTextField()
            .getDocument()
            .addDocumentListener(new ValidatorDocListener());
    panel.getExportDirtyDBPathTextField()
            .getDocument()
            .addDocumentListener(new ValidatorDocListener());
    panel.getCloneSuffixTextField()
            .getDocument()
            .addDocumentListener(new ValidatorDocListener());
    panel.getSizeFactorReductionTextField()
            .getDocument()
            .addDocumentListener(new ValidatorDocListener());
}
 
開發者ID:dbunibas,項目名稱:BART,代碼行數:35,代碼來源:ConfEGTaskEditPanel.java

示例10: initValidation

import org.netbeans.validation.api.builtin.stringvalidation.StringValidators; //導入依賴的package包/類
private void initValidation()   {
    panelValidation = new ValidationPanel();
    panelValidation.setInnerComponent(this);
    panelValidation.setBorder(new TitledBorder(new LineBorder(Color.BLUE), "Strategies", 
                                                    TitledBorder.CENTER,TitledBorder.TOP));
    
    vg = panelValidation.getValidationGroup();
    vg.add(charsTextField, StringValidators.REQUIRE_NON_EMPTY_STRING,
                           StringValidators.NO_WHITESPACE);
    vg.add(charTOAddTextField, StringValidators.REQUIRE_NON_EMPTY_STRING,
                               StringValidators.NO_WHITESPACE,
                               StringValidators.REQUIRE_VALID_INTEGER);
    vg.add(charsToRemoveTextField, StringValidators.REQUIRE_NON_EMPTY_STRING,
                               StringValidators.NO_WHITESPACE,
                               StringValidators.REQUIRE_VALID_INTEGER);
    vg.add(charToSwitchTextField, StringValidators.REQUIRE_NON_EMPTY_STRING,
                               StringValidators.NO_WHITESPACE,
                               StringValidators.REQUIRE_VALID_INTEGER);
    
    charsTextField.getDocument()
            .addDocumentListener(new ValidatorDocListener());
    charTOAddTextField.getDocument()
            .addDocumentListener(new ValidatorDocListener());
    charsToRemoveTextField.getDocument()
            .addDocumentListener(new ValidatorDocListener());
    charToSwitchTextField.getDocument()
            .addDocumentListener(new ValidatorDocListener());
}
 
開發者ID:dbunibas,項目名稱:BART,代碼行數:29,代碼來源:DirtyStrategyPanel.java

示例11: initValidation

import org.netbeans.validation.api.builtin.stringvalidation.StringValidators; //導入依賴的package包/類
@SuppressWarnings("unchecked")
private void initValidation()   {
    panelValidation = new ValidationPanel();
    panelValidation.setInnerComponent(this);
    panelValidation.setBorder(new TitledBorder(new LineBorder(Color.BLUE), "Strategies", 
                                                    TitledBorder.CENTER,TitledBorder.TOP));
    
    vg = panelValidation.getValidationGroup();
    vg.add(charsTextField, StringValidators.REQUIRE_NON_EMPTY_STRING,
                           StringValidators.NO_WHITESPACE);
    vg.add(charTOAddTextField, StringValidators.REQUIRE_NON_EMPTY_STRING,
                               StringValidators.NO_WHITESPACE,
                               StringValidators.REQUIRE_VALID_INTEGER);
    vg.add(charsToRemoveTextField, StringValidators.REQUIRE_NON_EMPTY_STRING,
                               StringValidators.NO_WHITESPACE,
                               StringValidators.REQUIRE_VALID_INTEGER);
    vg.add(charToSwitchTextField, StringValidators.REQUIRE_NON_EMPTY_STRING,
                               StringValidators.NO_WHITESPACE,
                               StringValidators.REQUIRE_VALID_INTEGER);
    
    charsTextField.getDocument()
            .addDocumentListener(new ValidatorDocListener());
    charTOAddTextField.getDocument()
            .addDocumentListener(new ValidatorDocListener());
    charsToRemoveTextField.getDocument()
            .addDocumentListener(new ValidatorDocListener());
    charToSwitchTextField.getDocument()
            .addDocumentListener(new ValidatorDocListener());
}
 
開發者ID:dbunibas,項目名稱:BART,代碼行數:30,代碼來源:DefaultDirtyStrategyPanel.java

示例12: initPanel

import org.netbeans.validation.api.builtin.stringvalidation.StringValidators; //導入依賴的package包/類
private void initPanel()   {
    panelValAcc = new ValidationPanel();
    getPanelValAcc().setBorder(new TitledBorder(new LineBorder(Color.BLACK), "VioGenQuery Configuration", 
                                                    TitledBorder.CENTER,TitledBorder.TOP));
    panel = new ConfVioGenQPanel();
    getPanelValAcc().setInnerComponent(panel);
    vg = getPanelValAcc().getValidationGroup();
    vg.add(panel.getPercentagjTextField1(), StringValidators.REQUIRE_VALID_NUMBER);
    vg.add(panel.getQueryExecutorjTextField1(), StringValidators.NO_WHITESPACE);
    vg.add(panel.getMaxNumberOfRowsForSingleTupleQueriesjTextField1(),StringValidators.REQUIRE_VALID_INTEGER);
    
    vg.add(panel.getSizeFactorForStandardQueriesTextField(), StringValidators.REQUIRE_VALID_NUMBER);
    vg.add(panel.getSizeFactorForSymmetricQueriesTextField(), StringValidators.REQUIRE_VALID_NUMBER);
    vg.add(panel.getSizeFactorForInequalityQueriesTextField(), StringValidators.REQUIRE_VALID_NUMBER);
    vg.add(panel.getSizeFactorForSingleTupleQueriesTextField(), StringValidators.REQUIRE_VALID_NUMBER);
    
    vg.add(panel.getProbabilityFactorForStandardQueriesTextField(), StringValidators.REQUIRE_VALID_NUMBER);
    vg.add(panel.getProbabilityFactorForSymmetricQueriesTextField(), StringValidators.REQUIRE_VALID_NUMBER);
    vg.add(panel.getProbabilityFactorForInequalityQueriesTextField(), StringValidators.REQUIRE_VALID_NUMBER);
    vg.add(panel.getProbabilityFactorForSingleTupleQueriesTextField(), StringValidators.REQUIRE_VALID_NUMBER);
    
    vg.add(panel.getWindowSizeFactorForStandardQueriesTextField(), StringValidators.REQUIRE_VALID_NUMBER);
    vg.add(panel.getWindowSizeFactorForSymmetricQueriesjTextField1(), StringValidators.REQUIRE_VALID_NUMBER);
    vg.add(panel.getWindowSizeFactorForInequalityQueriesjTextField1(), StringValidators.REQUIRE_VALID_NUMBER);
    vg.add(panel.getWindowSizeFactorForSingleTupleQueriesjTextField1(), StringValidators.REQUIRE_VALID_NUMBER);
    
    vg.add(panel.getOffsetFactorForStandardQueriesjTextField1(), StringValidators.REQUIRE_VALID_NUMBER);
    vg.add(panel.getOffsetFactorForSymmetricQueriesjTextField1(), StringValidators.REQUIRE_VALID_NUMBER);
    vg.add(panel.getOffsetFactorForInequalityQueriesjTextField1(), StringValidators.REQUIRE_VALID_NUMBER);
    vg.add(panel.getOffsetFactorForSingleTupleQueriesjTextField1(), StringValidators.REQUIRE_VALID_NUMBER);
    
    for(Document d : panel.getAllDocument())   {
        d.addDocumentListener(WeakListeners.create(DocumentListener.class, new ValidDocListener(), panel));
    }
}
 
開發者ID:dbunibas,項目名稱:BART,代碼行數:36,代碼來源:ConfVioGenQEditPanel.java

示例13: initValidator

import org.netbeans.validation.api.builtin.stringvalidation.StringValidators; //導入依賴的package包/類
private void initValidator()   {
    panelValAcc = new ValidationPanel();
    panelValAcc.setBorder(new TitledBorder(new LineBorder(Color.BLUE), "Plain Instance", TitledBorder.CENTER,TitledBorder.TOP));
    memoryGeneratePanel = new MainMemoryGeneratePanel();
    panelValAcc.setInnerComponent(getMemoryGeneratePanel());
    vg = panelValAcc.getValidationGroup();
    vg.add(getMemoryGeneratePanel().getPlainInstanceArea(), StringValidators.REQUIRE_NON_EMPTY_STRING);
    getMemoryGeneratePanel().getPlainInstanceArea()
            .getDocument()
            .addDocumentListener(new ValidatorDocList());
}
 
開發者ID:dbunibas,項目名稱:BART,代碼行數:12,代碼來源:MainMeemoryGENEditPanel.java

示例14: initAccPanel

import org.netbeans.validation.api.builtin.stringvalidation.StringValidators; //導入依賴的package包/類
private void initAccPanel()   {
    panelValAcc = new ValidationPanel();
    panelValAcc.setBorder(new TitledBorder(new LineBorder(Color.BLACK), "Access Configuration", TitledBorder.CENTER,TitledBorder.TOP));
    panelAcc = new AccesConfPanel();
    panelValAcc.setInnerComponent(getPanelAcc());
    vg = panelValAcc.getValidationGroup();
    vg.add(getPanelAcc().getDriverTextField(), StringValidators.REQUIRE_NON_EMPTY_STRING,
                                          StringValidators.NO_WHITESPACE);
    vg.add(getPanelAcc().getUriTextField(), StringValidators.REQUIRE_NON_EMPTY_STRING,
                                          StringValidators.NO_WHITESPACE);
    vg.add(getPanelAcc().getSchemaTextField(), StringValidators.REQUIRE_NON_EMPTY_STRING,
                                          StringValidators.NO_WHITESPACE);
    vg.add(getPanelAcc().getLoginTextField(), StringValidators.REQUIRE_NON_EMPTY_STRING);
    vg.add(getPanelAcc().getPasswordTextField(), StringValidators.REQUIRE_NON_EMPTY_STRING);
    vg.add(panelInitDb.getScriptArea(), StringValidators.REQUIRE_NON_EMPTY_STRING);
    getPanelAcc().getDriverTextField()
            .getDocument()
            .addDocumentListener(new ValidatorDocumentListener());
    getPanelAcc().getUriTextField()
            .getDocument()
            .addDocumentListener(new ValidatorDocumentListener());
    getPanelAcc().getSchemaTextField()
            .getDocument()
            .addDocumentListener(new ValidatorDocumentListener());
    getPanelAcc().getLoginTextField()
            .getDocument()
            .addDocumentListener(new ValidatorDocumentListener());
    getPanelAcc().getPasswordTextField()
            .getDocument()
            .addDocumentListener(new ValidatorDocumentListener());
    //panelInitDb.getScriptArea()
     //       .getDocument()
     //       .addDocumentListener(new ValidatorDocumentListener());
}
 
開發者ID:dbunibas,項目名稱:BART,代碼行數:35,代碼來源:DbmsEditPanel.java

示例15: doAttach

import org.netbeans.validation.api.builtin.stringvalidation.StringValidators; //導入依賴的package包/類
protected void doAttach(ValidationGroup validationGroup) {
    validationGroup.add(nameField, StringValidators.REQUIRE_NON_EMPTY_STRING);
    validationGroup.add(descriptionField, StringValidators.REQUIRE_NON_EMPTY_STRING);
    validationGroup.add(fileField, StringValidators.FILE_MUST_BE_FILE);
    validationGroup.add(charsetField, StringValidators.REQUIRE_NON_EMPTY_STRING);
    validationGroup.add(kindField, StringValidators.REQUIRE_NON_EMPTY_STRING);
}
 
開發者ID:edouardhue,項目名稱:comeon,代碼行數:8,代碼來源:TemplateSubPanel.java


注:本文中的org.netbeans.validation.api.builtin.stringvalidation.StringValidators類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。