Package org.eobjects.metamodel.schema

Examples of org.eobjects.metamodel.schema.Table


  public void onAdd(InputColumn<?> sourceColumn) {
    _hintLabel.setVisible(false);
    _maxRowsFilterShortcutPanel.setEnabled(true);

    Column column = sourceColumn.getPhysicalColumn();
    Table table = column.getTable();

    ColumnListTable sourceColumnTable = getColumnListTable(table);
    sourceColumnTable.addColumn(sourceColumn);
  }
View Full Code Here


  }

  @Override
  public void onRemove(InputColumn<?> sourceColumn) {
    Column column = sourceColumn.getPhysicalColumn();
    Table table = column.getTable();
    ColumnListTable sourceColumnTable = getColumnListTable(table);
    sourceColumnTable.removeColumn(sourceColumn);
    if (sourceColumnTable.getColumnCount() == 0) {
      this.remove(sourceColumnTable);
      _sourceColumnTables.remove(sourceColumnTable);
View Full Code Here

    Datastore ds = conf.getDatastoreCatalog().getDatastore("orderdb");
    ajb.setDatastore(ds);

    DataContextProvider dcp = ds.getDataContextProvider();
    Table table = dcp.getSchemaNavigator().convertToTable("PUBLIC.ORDERS");

    ajb.addSourceColumn(table.getColumnByName("ORDERDATE"));
    ajb.addSourceColumn(table.getColumnByName("SHIPPEDDATE"));
    ajb.addSourceColumn(table.getColumnByName("CUSTOMERNUMBER"));

    @SuppressWarnings("unchecked")
    InputColumn<Date> orderDateColumn = (InputColumn<Date>) ajb.getSourceColumnByName("ORDERDATE");
    @SuppressWarnings("unchecked")
    InputColumn<Date> shippedDateColumn = (InputColumn<Date>) ajb.getSourceColumnByName("SHIPPEDDATE");
View Full Code Here

    // run a small job
    AnalyzerBeansConfiguration conf = new JaxbConfigurationReader().create(new File(DataCleanerHome.get(), "conf.xml"));
    final AnalysisJobBuilder ajb = new AnalysisJobBuilder(conf);
    Datastore ds = conf.getDatastoreCatalog().getDatastore("orderdb");
    DataContextProvider dcp = ds.getDataContextProvider();
    Table table = dcp.getSchemaNavigator().convertToTable("PUBLIC.CUSTOMERS");
    ajb.setDatastore(ds);
    ajb.addSourceColumns(table.getNumberColumns());
    ajb.addRowProcessingAnalyzer(NumberAnalyzer.class).addInputColumns(ajb.getSourceColumns());

    Injector injector = Guice.createInjector(new DCModule(conf) {
      @Override
      public AnalysisJobBuilder getAnalysisJobBuilder() {
View Full Code Here

    if (url == null) {
      throw new IllegalStateException("Could not find dependencies file");
    }
    try {
      DataContext dc = DataContextFactory.createCsvDataContext(url.openStream(), ',', '"', false);
      Table table = dc.getDefaultSchema().getTables()[0];
      Column projectColumn = table.getColumnByName("Project");
      Column websiteColumn = table.getColumnByName("Website");
      Column licenseColumn = table.getColumnByName("License");
      Query q = dc.query().from(table).select(table.getColumns()).orderBy(projectColumn).asc().toQuery();
      DataSet ds = dc.executeQuery(q);
      while (ds.next()) {
        final LicensedProject licensedProject = new LicensedProject();
        final Row row = ds.getRow();
        final String licenseName = row.getValue(licenseColumn).toString();
View Full Code Here

      _tableNode = tableNode;
    }

    @Override
    protected Void doInBackground() throws Exception {
      Table table = (Table) _tableNode.getUserObject();
      Column[] columns = table.getColumns();
      for (Column column : columns) {
        String name = column.getName();
        logger.debug("Publishing column name: {}", name);
        publish(column);
      }
View Full Code Here

      return;
    }
    DefaultMutableTreeNode node = (DefaultMutableTreeNode) path.getLastPathComponent();
    Object userObject = node.getUserObject();
    if (userObject instanceof Table) {
      final Table table = (Table) userObject;

      int button = e.getButton();

      if (button == MouseEvent.BUTTON1 && e.getClickCount() == 2) {
        // double click = add table
        addTable(table);
      } else if (button == MouseEvent.BUTTON2 || button == MouseEvent.BUTTON3) {
        // right click = open popup menu

        boolean enableAddTable = false;
        boolean enableRemoveTable = false;

        final Column[] columns = table.getColumns();
        for (Column column : columns) {
          if (_analysisJobBuilder.containsSourceColumn(column)) {
            enableRemoveTable = true;
          } else {
            enableAddTable = true;
          }
          if (enableAddTable && enableRemoveTable) {
            break;
          }
        }

        final JPopupMenu popup = new JPopupMenu();
        popup.setLabel(table.getName());

        if (enableAddTable) {
          final JMenuItem addTableItem = WidgetFactory.createMenuItem("Add table to source",
              "images/actions/toggle-source-table.png");
          addTableItem.addActionListener(new ActionListener() {
View Full Code Here

  @Override
  public void analyzerSuccess(AnalysisJob job, final AnalyzerJob analyzerJob, final AnalyzerResult result) {
    SourceColumnFinder sourceColumnFinder = new SourceColumnFinder();
    sourceColumnFinder.addSources(job);
    final Table table = sourceColumnFinder.findOriginatingTable(analyzerJob.getInput()[0]);

    _progressInformationPanel.addUserLog("Analyzer '" + LabelUtils.getLabel(analyzerJob) + "' finished");
    _progressInformationPanel.addUserLog("Adding result to tab of " + table.getName());
    _resultWindow.addResult(table, analyzerJob, result);
  }
View Full Code Here

      previewButton.setMargin(buttonMargin);
      previewButton.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
          final DataContextProvider dcp = datastore.getDataContextProvider();
          final Table previewTable = result.getPreviewTable(datastore);
          if (previewTable == null) {
            throw new IllegalStateException("Result did not return any preview table: " + result);
          } else {
            final PreviewSourceDataActionListener actionListener = new PreviewSourceDataActionListener(
                windowContext, dcp, previewTable);
View Full Code Here

          _masterTermColumnComboBox.setModel(_datastore);
          _masterTermColumnComboBox.addItemListener(new ItemListener() {

            @Override
            public void itemStateChanged(ItemEvent itemEvent) {
              Table table = _masterTermColumnComboBox.getSelectedItem().getTable();
              _synonymColumnsPanel.updateSourceComboBoxes(_datastore, table);
              _synonymColumnsPanel.updateUI();

            }
          });
View Full Code Here

TOP

Related Classes of org.eobjects.metamodel.schema.Table

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.