Ejemplo n.º 1
0
        public ViewColumn(View view, TObjectName columnObject, int index)
        {
            if (view == null || columnObject == null)
            {
                throw new System.ArgumentException("TableColumn arguments can't be null.");
            }

            id = ++TableColumn.TABLE_COLUMN_ID;

            this.columnObject = columnObject;

            TSourceToken startToken = columnObject.startToken;
            TSourceToken endToken   = columnObject.endToken;

            this.startPosition = new Tuple <long, long>(startToken.lineNo, startToken.columnNo);
            this.endPosition   = new Tuple <long, long>(endToken.lineNo, endToken.columnNo + endToken.astext.Length);

            if (!"".Equals(columnObject.ColumnNameOnly))
            {
                this.name = columnObject.ColumnNameOnly;
            }
            else
            {
                this.name = columnObject.ToString();
            }

            this.view        = view;
            this.columnIndex = index;
            view.addColumn(this);
        }
Ejemplo n.º 2
0
 public virtual void bindStarLinkColumn(TObjectName objectName)
 {
     if (objectName != null && !starLinkColumns.Contains(objectName))
     {
         starLinkColumns.Add(objectName);
     }
 }
Ejemplo n.º 3
0
        public TableColumn(Table table, TObjectName columnObject)
        {
            if (table == null || columnObject == null)
            {
                throw new System.ArgumentException("TableColumn arguments can't be null.");
            }

            id = ++TABLE_COLUMN_ID;

            this.columnObject = columnObject;

            TSourceToken startToken = columnObject.startToken;
            TSourceToken endToken   = columnObject.endToken;

            this.startPosition = new Tuple <long, long>(startToken.lineNo, startToken.columnNo);
            this.endPosition   = new Tuple <long, long>(endToken.lineNo, endToken.columnNo + endToken.astext.Length);

            if (columnObject.ColumnNameOnly != null && !"".Equals(columnObject.ColumnNameOnly))
            {
                this.name = columnObject.ColumnNameOnly;
            }
            else
            {
                this.name = columnObject.ToString();
            }

            this.table = table;
            table.addColumn(this);
        }
Ejemplo n.º 4
0
        public static ResultColumn createUpdateResultColumn(ResultSet resultSet, TObjectName resultColumn)
        {
            if (ModelBindingManager.getUpdateModel(resultColumn) is ResultColumn)
            {
                return((ResultColumn)ModelBindingManager.getUpdateModel(resultColumn));
            }
            ResultColumn column = new ResultColumn(resultSet, resultColumn);

            ModelBindingManager.bindUpdateModel(resultColumn, column);
            return(column);
        }
Ejemplo n.º 5
0
        public static TableColumn createInsertTableColumn(Table tableModel, TObjectName column)
        {
            if (ModelBindingManager.getInsertModel(column) is TableColumn)
            {
                return((TableColumn)ModelBindingManager.getInsertModel(column));
            }
            TableColumn columnModel = new TableColumn(tableModel, column);

            ModelBindingManager.bindInsertModel(column, columnModel);
            return(columnModel);
        }
Ejemplo n.º 6
0
        public static ViewColumn createViewColumn(View viewModel, TObjectName column, int index)
        {
            if (ModelBindingManager.getViewModel(column) is ViewColumn)
            {
                return((ViewColumn)ModelBindingManager.getViewModel(column));
            }
            ViewColumn columnModel = new ViewColumn(viewModel, column, index);

            ModelBindingManager.bindViewModel(column, columnModel);
            return(columnModel);
        }
Ejemplo n.º 7
0
        public static TableColumn createTableColumn(Table table, TObjectName column)
        {
            if (ModelBindingManager.getModel(new Tuple <Table, TObjectName>(table, column)) is TableColumn)
            {
                return((TableColumn)ModelBindingManager.getModel(new Tuple <Table, TObjectName>(table, column)));
            }
            TableColumn columnModel = new TableColumn(table, column);

            ModelBindingManager.bindModel(new Tuple <Table, TObjectName>(table, column), columnModel);
            return(columnModel);
        }