Package javax.swing.event

Examples of javax.swing.event.DocumentListener


    WidgetUtils.addToGridBag(_expressionNameField, formPanel, 1, row);

    row++;
    WidgetUtils.addToGridBag(DCLabel.bright("Expression:"), formPanel, 0, row);

    _expressionField.getDocument().addDocumentListener(new DocumentListener() {
      public void changedUpdate(DocumentEvent e) {
        checkInputFields();
      }

      public void insertUpdate(DocumentEvent e) {
        checkInputFields();
      }

      public void removeUpdate(DocumentEvent e) {
        checkInputFields();
      }
    });
    WidgetUtils.addToGridBag(_expressionField, formPanel, 1, row);

    _resetButton.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent event) {
        _expressionField.setText(_expressionString);
      }
    });
    WidgetUtils.addToGridBag(_resetButton, formPanel, 2, row);

    row++;

    _saveButton.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent e) {
        String expressionName = _expressionNameField.getText();
        if (StringUtils.isNullOrEmpty(expressionName)) {
          JOptionPane.showMessageDialog(RegexStringPatternDialog.this,
              "Please fill out the name of the regular expression");
          return;
        }

        String expression = _expressionField.getText();
        if (StringUtils.isNullOrEmpty(expression)) {
          JOptionPane.showMessageDialog(RegexStringPatternDialog.this, "Please fill out the regular expression");
          return;
        }
        if (_regexStringPattern != null && _catalog.containsStringPattern(_regexStringPattern.getName())) {
          _catalog.removeStringPattern(_catalog.getStringPattern(_regexStringPattern.getName()));
        }
        RegexStringPattern regexStringPattern = new RegexStringPattern(expressionName, expression, true);
        _regexStringPattern = regexStringPattern;
        _catalog.addStringPattern(regexStringPattern);
        RegexStringPatternDialog.this.dispose();
      }
    });

    final DCPanel buttonPanel = new DCPanel();
    buttonPanel.setLayout(new FlowLayout(FlowLayout.RIGHT, 0, 0));
    buttonPanel.add(_saveButton);
    WidgetUtils.addToGridBag(buttonPanel, formPanel, 0, row, 2, 1);

    final DCPanel testitPanel = new DCPanel();
    testitPanel.setLayout(new FlowLayout(FlowLayout.RIGHT, 0, 0));

    _errorLabel = DCLabel.bright("");
    WidgetUtils.addToGridBag(_errorLabel, testitPanel, 0, row);

    row++;
    JLabel testInputLabel = DCLabel.bright("Test input");
    testInputLabel.setIcon(imageManager.getImageIcon("images/actions/test-pattern.png"));
    testInputLabel.setFont(WidgetUtils.FONT_HEADER1);
    WidgetUtils.addToGridBag(testInputLabel, testitPanel, 0, row);

    _inputFields = new ArrayList<JTextField>(NUM_TEST_FIELDS);
    _statusLabels = new ArrayList<JLabel>(NUM_TEST_FIELDS);
    for (int i = 0; i < NUM_TEST_FIELDS; i++) {
      final int index = i;
      JTextField inputField = WidgetFactory.createTextField("Test Input");
      inputField.getDocument().addDocumentListener(new DocumentListener() {
        public void changedUpdate(DocumentEvent e) {
          checkInputField(index);
        }

        public void insertUpdate(DocumentEvent e) {
View Full Code Here


      textField.setFont(toolTipFont);
      textField.setOpaque(false);
      textField.setBorder(null);
      if (controller != null) {
        // Add a listener to notify changes to controller
        textField.getDocument().addDocumentListener(new DocumentListener() {
            public void changedUpdate(DocumentEvent ev) {
              try {
                textField.commitEdit();
                controller.updateEditableProperty(editableProperty, textField.getValue());
              } catch (ParseException ex) {
View Full Code Here

        }
      });   
    this.view3DPrintedCheckBox.addItemListener(itemListener);
    controller.addPropertyChangeListener(PageSetupController.Property.PRINT, printChangeListener);
   
    DocumentListener documentListener = new DocumentListener() {
        public void changedUpdate(DocumentEvent ev) {
          controller.removePropertyChangeListener(PageSetupController.Property.PRINT, printChangeListener);
          updateController(controller);
          controller.addPropertyChangeListener(PageSetupController.Property.PRINT, printChangeListener);
        }
View Full Code Here

    private Pattern pattern;

    /** Creates new form CreateBooleanMatchesColumnUI */
    public GeneralCreateColumnFromRegexUI() {
        initComponents();
        regexTextField.getDocument().addDocumentListener(new DocumentListener() {

            public void insertUpdate(DocumentEvent e) {
                refreshPattern();
            }

            public void removeUpdate(DocumentEvent e) {
                refreshPattern();
            }

            public void changedUpdate(DocumentEvent e) {
                refreshPattern();
            }
        });
        titleTextField.getDocument().addDocumentListener(new DocumentListener() {

            public void insertUpdate(DocumentEvent e) {
                refreshOkButton();
            }

View Full Code Here

    private DialogControls dialogControls;

    /** Creates new form DuplicateColumnUI */
    public DuplicateColumnUI() {
        initComponents();
        titleTextField.getDocument().addDocumentListener(new DocumentListener() {

            public void insertUpdate(DocumentEvent e) {
                refreshOkButton();
            }

View Full Code Here

        searchReplaceController = Lookup.getDefault().lookup(SearchReplaceController.class);
        dataTablesController = Lookup.getDefault().lookup(DataTablesController.class);
        createSearchOptions();
        refreshSearchOptions();

        searchText.getDocument().addDocumentListener(new DocumentListener() {

            public void insertUpdate(DocumentEvent e) {
                refreshSearchOptions();
            }
View Full Code Here

    }

    /** Creates new form AddColumnUI */
    public AddColumnUI() {
        initComponents();
        titleTextField.getDocument().addDocumentListener(new DocumentListener() {

            public void insertUpdate(DocumentEvent e) {
                refreshOkButton();
            }

View Full Code Here

            attributeModel.addAttributeListener(DataTableTopComponent.this);
        }

        //Filter
        if (dynamicFiltering) {
            filterTextField.getDocument().addDocumentListener(new DocumentListener() {

                public void insertUpdate(DocumentEvent e) {
                    refreshFilter();
                }
View Full Code Here

    private ColumnWrapper column1, column2;

    /** Creates new form CreateTimeIntervalUI */
    public CreateTimeIntervalUI() {
        initComponents();
        defaultStartNumberText.getDocument().addDocumentListener(new DocumentListener() {

            public void insertUpdate(DocumentEvent e) {
                refreshOkButton();
            }

            public void removeUpdate(DocumentEvent e) {
                refreshOkButton();
            }

            public void changedUpdate(DocumentEvent e) {
                refreshOkButton();
            }
        });
        defaultEndNumberText.getDocument().addDocumentListener(new DocumentListener() {

            public void insertUpdate(DocumentEvent e) {
                refreshOkButton();
            }

View Full Code Here

    private String displayName;

    /** Creates new form GeneralColumnTitleChooserUI */
    public GeneralColumnTitleChooserUI() {
        initComponents();
        titleTextField.getDocument().addDocumentListener(new DocumentListener() {

            public void insertUpdate(DocumentEvent e) {
                refreshOkButton();
            }

View Full Code Here

TOP

Related Classes of javax.swing.event.DocumentListener

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.