Examples of DCPanel


Examples of org.eobjects.datacleaner.panels.DCPanel

    return 465;
  }

  @Override
  protected JComponent getDialogContent() {
    final DCPanel formPanel = new DCPanel();

    int row = 0;
    WidgetUtils.addToGridBag(DCLabel.bright("Synonym catalog name:"), formPanel, 0, row);
    WidgetUtils.addToGridBag(_nameTextField, formPanel, 1, row);

    row++;
    WidgetUtils.addToGridBag(DCLabel.bright("Filename:"), formPanel, 0, row);
    WidgetUtils.addToGridBag(_filenameTextField, formPanel, 1, row);

    row++;
    WidgetUtils.addToGridBag(DCLabel.bright("Case sensitive matches:"), formPanel, 0, row);
    WidgetUtils.addToGridBag(_caseSensitiveCheckBox, formPanel, 1, row);

    row++;
    WidgetUtils.addToGridBag(DCLabel.bright("Character encoding:"), formPanel, 0, row);
    WidgetUtils.addToGridBag(_encodingComboBox, formPanel, 1, row);

    row++;
    final JButton saveButton = WidgetFactory.createButton("Save synonym catalog", "images/model/synonym.png");
    saveButton.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent e) {
        String name = _nameTextField.getText();
        if (StringUtils.isNullOrEmpty(name)) {
          JOptionPane.showMessageDialog(TextFileSynonymCatalogDialog.this,
              "Please fill out the name of the synonym catalog");
          return;
        }

        String filename = _filenameTextField.getFilename();
        if (StringUtils.isNullOrEmpty(filename)) {
          JOptionPane.showMessageDialog(TextFileSynonymCatalogDialog.this,
              "Please fill out the filename or select a file using the 'Browse' button");
          return;
        }

        String encoding = (String) _encodingComboBox.getSelectedItem();
        if (StringUtils.isNullOrEmpty(filename)) {
          JOptionPane.showMessageDialog(TextFileSynonymCatalogDialog.this, "Please select a character encoding");
          return;
        }

        TextFileSynonymCatalog sc = new TextFileSynonymCatalog(name, filename, _caseSensitiveCheckBox.isSelected(),
            encoding);

        if (_originalsynonymCatalog != null) {
          _catalog.removeSynonymCatalog(_originalsynonymCatalog);
        }
        _catalog.addSynonymCatalog(sc);
        TextFileSynonymCatalogDialog.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 DCLabel descriptionLabel = DCLabel
        .brightMultiLine("A text file synonym catalog is a synonym catalog based on a text file containing comma separated values where the first column represents the master term.");
    descriptionLabel.setBorder(new EmptyBorder(10, 10, 10, 20));
    descriptionLabel.setPreferredSize(new Dimension(300, 100));

    final DCPanel mainPanel = new DCPanel();
    mainPanel.setLayout(new VerticalLayout(4));
    mainPanel.add(descriptionLabel);
    mainPanel.add(formPanel);

    return mainPanel;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.