obj instanceof AvailableField
src/org/pentaho/agilebi/modeler/CategoryTreeHelper.java
AvailableField availableField = (AvailableField)obj;
        addAvailableField(availableField);

  private void addAvailableField(AvailableField availableField) {
    AbstractMetaDataModelNode theNode = null;
    Object selectedTreeItem = getSelectedTreeItem();
    // depending on the parent
    if (selectedTreeItem == null) {
      // null - cannot add fields at this level
else if (obj instanceof AvailableField)
selectedTreeItem instanceof CategoryMetaData
src/org/pentaho/agilebi/modeler/CategoryTreeHelper.java
// category - add as a field
      theNode = workspace.createFieldForParentWithNode((CategoryMetaData) selectedTreeItem, availableField);
      CategoryMetaData theCategory = (CategoryMetaData) selectedTreeItem;
      theCategory.add((FieldMetaData) theNode);
else if (selectedTreeItem instanceof CategoryMetaData)
Object selected
src/org/pentaho/agilebi/modeler/ModelerController.java
if (selected != null && selected instanceof IAvailableItem) {
      selectedFields = new IAvailableItem[]{(IAvailableItem)selected
void setSelectedFieldsChanged(Object selected)
aFields[i] instanceof AvailableTable
src/org/pentaho/agilebi/modeler/ModelerController.java
f[i] = (AvailableTable)aFields[i];
else if (aFields[i] instanceof AvailableTable)
src/org/pentaho/agilebi/modeler/ModelerWorkspace.java
return availableTables;
  private void fireTablesChanged() {
    firePropertyChange("availableTables", null, this.availableTables); //$NON-NLS-1$
    // Add in new physical tables/columns
      // see if the table is in the availableTables list
      AvailableTable aTable = availableTables.findAvailableTable(table.getName(LocalizedString.DEFAULT_LOCALE));
      if (aTable == null) {
        // new table, make sure we add it
        availableTables.add(new AvailableTable(table));
AvailableItemCollection getAvailableTables()
test-src/org/pentaho/agilebi/modeler/util/TableModelerSourceTest.java
// come back to this
void test()
LogicalColumn lc
src/org/pentaho/agilebi/modeler/BaseModelerWorkspaceHelper.java
String tableId = lc.getLogicalTable().getId().replaceAll("BT", "LC");
    String olapColId = tableId + OLAP_SUFFIX + "_" + lc.getPhysicalColumn().getId();
    return olapColId;
String getCorrespondingOlapColumnId(LogicalColumn lc)
selectedTreeItem == null
src/org/pentaho/agilebi/modeler/CategoryTreeHelper.java
// null - cannot add fields at this level
parent
        if (selectedTreeItem == null)
selectedTreeItem instanceof CategoryMetaData
src/org/pentaho/agilebi/modeler/CategoryTreeHelper.java
// category - add as a field
          theNode = workspace.createFieldForParentWithNode((CategoryMetaData) selectedTreeItem, availableField);
          CategoryMetaData theCategory = (CategoryMetaData) selectedTreeItem;
          theCategory.add((FieldMetaData) theNode);
else if (selectedTreeItem instanceof CategoryMetaData)
src/org/pentaho/agilebi/modeler/ModelerWorkspace.java
return availableFields;

  private void fireFieldsChanged() {
    firePropertyChange("availableFields", null, this.availableFields); //$NON-NLS-1$
    // Add in new physical columns
      for(IPhysicalColumn column : table.getPhysicalColumns()) {
        boolean exists = false;
        inner:
        for(AvailableField field : this.availableFields) {
          if (field.isSameUnderlyingPhysicalColumn(column)) {
            exists = true;
            break inner;
AvailableFieldCollection getAvailableFields()
AvailableFieldCollection fields
src/org/pentaho/agilebi/modeler/ModelerWorkspace.java
this.availableFields = fields;
    firePropertyChange("availableFields", null, getAvailableFields()); //$NON-NLS-1$

    this.availableFields.clear();
      for (IPhysicalColumn column : table.getPhysicalColumns()) {
        AvailableField field = new AvailableField(column);
        availableFields.add(field);
void setAvailableFields(AvailableFieldCollection fields)
src/org/pentaho/agilebi/modeler/nodes/AvailableField.java
return name;
String getName()
String name
src/org/pentaho/agilebi/modeler/nodes/AvailableField.java
this.name = name;
  @Bindable
  public String getDisplayName() {
    return displayName;
void setName(String name)
String displayName
src/org/pentaho/agilebi/modeler/nodes/AvailableField.java
this.displayName = displayName;
void setDisplayName(String displayName)
test-src/org/pentaho/agilebi/modeler/BaseModelerWorkspaceHelperTest.java
String origTableId = "BT_CUSTOMERS_CUSTOMERS";
    String origColumnId = "LC_CUSTOMERS_CUSTOMERNUMBER";
    String olapColumnId = "LC_CUSTOMERS_CUSTOMERS_OLAP_CUSTOMERNUMBER";

    LogicalTable ltOrig = new LogicalTable();
    ltOrig.setId(origTableId);

    LogicalColumn lcOrig = new LogicalColumn();
    lcOrig.setId(origColumnId);
    lcOrig.setLogicalTable(ltOrig);
    IPhysicalColumn pc = new SqlPhysicalColumn();
    pc.setId("CUSTOMERNUMBER");
    lcOrig.setPhysicalColumn(pc);

    assertEquals(olapColumnId, BaseModelerWorkspaceHelper.getCorrespondingOlapColumnId(lcOrig));
void testGetCorrespondingOlapColumnId()