Package org.eobjects.datacleaner.database

Examples of org.eobjects.datacleaner.database.DatabaseDriverDescriptor


      if ("jdbc:hsqldb:res:orderdb;readonly=true".equals(jdbcDatastore.getJdbcUrl())) {
        imagePath = "images/datastore-types/orderdb.png";
      } else {
        String driverClass = jdbcDatastore.getDriverClass();
        if (!StringUtils.isNullOrEmpty(driverClass)) {
          DatabaseDriverDescriptor driver = DatabaseDriverCatalog.getDatabaseDriverByDriverClassName(driverClass);
          if (driver != null) {
            imagePath = driver.getIconImagePath();
          }
        }
      }
    } else if (datastore instanceof CsvDatastore) {
      imagePath = CSV_IMAGEPATH;
View Full Code Here


      public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected,
          boolean cellHasFocus) {
        JLabel result = (JLabel) super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);

        if (value instanceof DatabaseDriverDescriptor) {
          DatabaseDriverDescriptor databaseDriver = (DatabaseDriverDescriptor) value;

          String iconImagePath = DatabaseDriverCatalog.getIconImagePath(databaseDriver);
          Icon driverIcon = imageManager.getImageIcon(iconImagePath, IconUtils.ICON_SIZE_SMALL);

          result.setText(databaseDriver.getDisplayName());
          result.setIcon(driverIcon);
        } else if (MANAGE_DATABASE_DRIVERS.equals(value)) {
          result.setIcon(imageManager.getImageIcon("images/menu/options.png", IconUtils.ICON_SIZE_SMALL));
        } else if (value instanceof Component) {
          return (Component) value;
        }

        return result;
      }
    });
    _databaseDriverComboBox.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent e) {
        Object value = _databaseDriverComboBox.getSelectedItem();
        if (value instanceof DatabaseDriverDescriptor) {
          DatabaseDriverDescriptor driver = (DatabaseDriverDescriptor) value;

          _driverClassNameTextField.setText(driver.getDriverClassName());

          String[] connectionUrls = driver.getConnectionUrlTemplates();
          setConnectionUrlTemplates(connectionUrls);
        } else if (MANAGE_DATABASE_DRIVERS.equals(value)) {
          OptionsDialog optionsDialog = _optionsDialogProvider.get();
          optionsDialog.selectDatabaseDriversTab();
          JdbcDatastoreDialog.this.dispose();

          optionsDialog.setVisible(true);
          optionsDialog.toFront();
        }
      }
    });

    _usernameTextField = WidgetFactory.createTextField("Username");
    _passwordField = new JPasswordField(17);

    if (_originalDatastore != null) {
      // the database driver has to be set as the first thing, because the
      // combobox's action listener will set other field's values as well.
      DatabaseDriverDescriptor databaseDriver = DatabaseDriverCatalog
          .getDatabaseDriverByDriverClassName(_originalDatastore.getDriverClass());
      _databaseDriverComboBox.setSelectedItem(databaseDriver);

      _datastoreNameTextField.setText(_originalDatastore.getName());
      _datastoreNameTextField.setEnabled(false);
View Full Code Here

      _passwordField.setText(_originalDatastore.getPassword());
    }
  }

  public void setSelectedDatabase(String databaseName) {
    DatabaseDriverDescriptor databaseDriverDescriptor = DatabaseDriverCatalog
        .getDatabaseDriverByDriverDatabaseName(databaseName);
    setSelectedDatabase(databaseDriverDescriptor);
  }
View Full Code Here

TOP

Related Classes of org.eobjects.datacleaner.database.DatabaseDriverDescriptor

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.