Package org.jdesktop.swingx

Examples of org.jdesktop.swingx.JXTextField


  @Override
  public String[] getValue() {
    Component[] components = _textFieldPanel.getComponents();
    String[] result = new String[components.length];
    for (int i = 0; i < components.length; i++) {
      JXTextField textField = (JXTextField) components[i];
      result[i] = textField.getText();
    }
    return result;
  }
View Full Code Here


      WidgetUtils.addToGridBag(new JLabel(ImageManager.getInstance().getImageIcon("images/status/valid.png")), this,
          0, 0);
      WidgetUtils.addToGridBag(loggedInLabel, this, 0, 1);
    } else {
      final JXTextField usernameTextField = new JXTextField();
      usernameTextField.setColumns(15);
      final JPasswordField passwordTextField = new JPasswordField(15);

      final JButton registerButton = WidgetFactory.createButton("Register", "images/actions/website.png");
      registerButton.addActionListener(new OpenBrowserAction("http://datacleaner.eobjects.org/?register"));

      final JButton loginButton = WidgetFactory.createButton("Login", "images/actions/login.png");
      loginButton.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
          String username = usernameTextField.getText();
          char[] password = passwordTextField.getPassword();
          if (StringUtils.isNullOrEmpty(username) || password == null || password.length == 0) {
            JOptionPane.showMessageDialog(LoginPanel.this, "Please enter a username and a password.",
                "Invalid credentials", JOptionPane.ERROR_MESSAGE);
          } else {
View Full Code Here

  public static JXTextField createTextField() {
    return createTextField(null);
  }

  public static JXTextField createTextField(String promptText) {
    JXTextField tf = new JXTextField(promptText);
    tf.setColumns(17);
    if (promptText != null) {
      tf.setFocusBehavior(FocusBehavior.SHOW_PROMPT);
    }
    return tf;
  }
View Full Code Here

    }

    for (Entry<String, String> variableEntry : metadata.getVariables().entrySet()) {
      String id = variableEntry.getKey();
      String value = variableEntry.getValue();
      JXTextField textField = WidgetFactory.createTextField("Original: " + value);
      textField.setText(value);
      _variableTextFields.put(id, textField);
    }

    _openButton.setEnabled(false);
    _datastoreCatalog = configuration.getDatastoreCatalog();
View Full Code Here

      WidgetUtils.addToGridBag(tableLabel, panel, 0, row, 2, 1, GridBagConstraints.WEST);

      for (Entry<String, JXTextField> entry : _variableTextFields.entrySet()) {
        row++;
        String variableId = entry.getKey();
        JXTextField textField = entry.getValue();

        WidgetUtils.addToGridBag(
            new JLabel(imageManager.getImageIcon("images/model/variable.png", IconUtils.ICON_SIZE_SMALL)),
            panel, 0, row);
        WidgetUtils.addToGridBag(DCLabel.bright(variableId), panel, 1, row, GridBagConstraints.WEST);
View Full Code Here

      _textFieldPanel.updateUI();
    }
  }

  private void addTextField(String value, boolean updateUI) {
    JXTextField textField = WidgetFactory.createTextField();
    if (value != null) {
      textField.setText(value);
    }
    textField.getDocument().addDocumentListener(new DCDocumentListener() {
      @Override
      protected void onChange(DocumentEvent e) {
        fireValueChanged();
      }
    });
View Full Code Here

    TableModel model = new DefaultTableModel(headers, _columns.size());
    int i = 0;
    Icon icon = imageManager.getImageIcon("images/model/column.png", IconUtils.ICON_SIZE_SMALL);
    for (final InputColumn<?> column : _columns) {
      if (column instanceof MutableInputColumn<?>) {
        final JXTextField textField = WidgetFactory.createTextField("Column name");
        textField.setText(column.getName());
        final MutableInputColumn<?> mutableInputColumn = (MutableInputColumn<?>) column;
        textField.addFocusListener(new FocusAdapter() {
          @Override
          public void focusLost(FocusEvent e) {
            if (!mutableInputColumn.getName().equals(textField.getText())) {
              mutableInputColumn.setName(textField.getText());

              TransformerJobBuilder<?> tjb = _analysisJobBuilder.getOriginatingTransformer(mutableInputColumn);
              if (tjb != null) {
                tjb.onOutputChanged();
              }
View Full Code Here

    _tabbedPane.setSelectedIndex(1);
  }

  private DCPanel getGeneralTab() {
    final String username = _userPreferences.getUsername();
    final JXTextField usernameTextField = WidgetFactory.createTextField();
    usernameTextField.setText(username);
    usernameTextField.setEnabled(false);

    final JButton logoutButton = WidgetFactory.createSmallButton("images/actions/remove.png");
    logoutButton.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent e) {
        _userPreferences.setUsername(null);
        usernameTextField.setText("");
        logoutButton.setEnabled(false);
      }
    });
    logoutButton.setEnabled(_userPreferences.isLoggedIn());
View Full Code Here

    return panel;
  }

  private DCPanel getQuickAnalysisPanel() {
    final QuickAnalysisStrategy quickAnalysisStrategy = _userPreferences.getQuickAnalysisStrategy();
    final JXTextField columnsTextField = WidgetFactory.createTextField("Columns");
    columnsTextField.setColumns(2);
    columnsTextField.setDocument(new NumberDocument());
    columnsTextField.setText("" + quickAnalysisStrategy.getColumnsPerAnalyzer());

    final JCheckBox valueDistributionCheckBox = new JCheckBox("Include Value distribution in Quick analysis?");
    valueDistributionCheckBox.setOpaque(false);
    valueDistributionCheckBox.setSelected(quickAnalysisStrategy.isIncludeValueDistribution());

    final JCheckBox patternFinderCheckBox = new JCheckBox("Include Pattern finder in Quick analysis?");
    patternFinderCheckBox.setOpaque(false);
    patternFinderCheckBox.setSelected(quickAnalysisStrategy.isIncludePatternFinder());

    final ActionListener actionListener = new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent event) {
        try {
          int columns = Integer.parseInt(columnsTextField.getText());
          QuickAnalysisStrategy newStrategy = new QuickAnalysisStrategy(columns,
              valueDistributionCheckBox.isSelected(), patternFinderCheckBox.isSelected());
          _userPreferences.setQuickAnalysisStrategy(newStrategy);
        } catch (NumberFormatException e) {
          // skip this action, could not parse columns
        }
      }
    };
    valueDistributionCheckBox.addActionListener(actionListener);
    patternFinderCheckBox.addActionListener(actionListener);
    columnsTextField.getDocument().addDocumentListener(new DCDocumentListener() {
      @Override
      protected void onChange(DocumentEvent event) {
        actionListener.actionPerformed(null);
      }
    });
View Full Code Here

  private JXTextField addValueWidthTextField() {
    return addValueWidthTextField(8);
  }

  private JXTextField addValueWidthTextField(int valueWidth) {
    JXTextField textField = WidgetFactory.createTextField();
    textField.setColumns(2);
    NumberDocument document = new NumberDocument();
    document.addDocumentListener(_updatePreviewTableDocumentListener);
    textField.setDocument(document);
    textField.setText(valueWidth + "");
    _valueWidthTextFields.add(textField);
    _valueWidthsPanel.add(textField);
    if (_valueWidthTextFields.size() > 1) {
      _removeValueWidthButton.setEnabled(true);
    }
View Full Code Here

TOP

Related Classes of org.jdesktop.swingx.JXTextField

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.