Package DisplayProject

Examples of DisplayProject.ArrayColumnModel


   * Returns the total number of columns in the array including hidden columns
   * @return
   */
  //PM:1/5/08
  public int getRealColumnCount() {
    ArrayColumnModel cm = (ArrayColumnModel)getColumnModel();
    return cm.getRealColumnCount();
  }
View Full Code Here


    public void performAction() {
        ArrayColumn tc;
        // TF:5/11/08:If we're search by name, do a column lookup
        if (this.name != null) {
          ArrayColumnModel columnModel = (ArrayColumnModel)((JTable)this._component).getColumnModel();
          tc = columnModel.findColumn(this.name);
          if (tc == null) {
            // Nothing to do, couldn't find the column
            return;
          }
        }
View Full Code Here

        JTable t = ArrayFieldCellHelper.getArrayField(comp);
       
        // CraigM:18/10/2008 - If we are modifying a component which is in a grid in the array field, then this will not affect the column
        if (t != null && ArrayFieldCellHelper.isInGridFieldInArrayField(comp) == false) {
            int col = ArrayFieldCellHelper.getArrayFieldColumn((JComponent)comp);
            ArrayColumnModel model = (ArrayColumnModel) t.getColumnModel();
            ArrayColumn column = (ArrayColumn)model.getRealColumn(col);
            if (column != null) {
              // CraigM:17/10/2008 - If the component is not focusable (like TextFields), then don't allow it to be editable
              if (value && Focusable.is(comp)) {
                column.setEditable(true);
              }
View Full Code Here

          }
        }
        else if (comp instanceof ArrayField) {
          // TF:13/10/2009:Get our columns and process them as well
          ArrayField af = (ArrayField)comp;
          ArrayColumnModel model = (ArrayColumnModel)af.getColumnModel();
          for (int i = 0; i < model.getRealColumnCount(); i++) {
            ArrayColumn column = model.getRealColumn(i);
            Component childComp = column.getComponent();
            if (childComp != null) {
              // TF:29/10/2009:DET-123:Changed this to use processComponent to take into account the state of the child component.
              // set(childComp, state);
              processComponent(childComp, state);
View Full Code Here

         * to the sorting column.
         */
        //  Some test code to see if code below could be simplified
        if (this.getSorter().isSorting())  {
            int column = this.getSorter().getSortColumn();
            ArrayColumnModel columnModel = this.getColumnModel();
            ArrayColumn arrayColumn = columnModel.getRealColumn(column);
            TextData name = new TextData();
            name.setValue(arrayColumn.getName());
            if (name.moveToString("Item")) {
                name = name.copyRange(name.getOffset());
            }
View Full Code Here

     * The GetColumnList method returns a copy of an outline field�s array of outline column descriptors
     * @return
     */
    public Array_Of_OutlineColumnDesc<OutlineColumnDesc> getColumnList(){
        Array_Of_OutlineColumnDesc<OutlineColumnDesc> columns = new Array_Of_OutlineColumnDesc<OutlineColumnDesc>();
        ArrayColumnModel acm = (ArrayColumnModel)this.table.getColumnModel();
       
        // CraigM:22/08/2008 - Get the real columns
        /*
        if (acm.getRealColumnCount() > 0) {
            columns = new Array_Of_OutlineColumnDesc<OutlineColumnDesc>();
        }
        */
        for (int i = 0; i < acm.getRealColumnCount(); i++){
            ArrayColumn col = (ArrayColumn)acm.getRealColumn(i);
            columns.add(this.getOutlineColumn(col, false));
        }
        return columns;
    }
View Full Code Here

     * You use setColumnList to produce the column descriptors for outline fields for code generation; you cannot use it to dynamically change the outline column descriptors for a ListView field displaying data.
     * @param columns
     */
    public void setColumnList(Array_Of_OutlineColumnDesc<OutlineColumnDesc> columns){
        //  === Column model setup ===
        ArrayColumnModel cm = new ArrayColumnModel();
        int colNum = 0;
        // TF:14 Jul 2009:Placing a check if columns are null
        if (columns == null) {
          return;
       
        String[] propNames = new String[columns.size()];
        boolean isDraggable = false;

        for (OutlineColumnDesc col : (List<OutlineColumnDesc>)columns){
            int alignment = JLabel.LEFT;
            switch (col.getAlignment()){
            case Constants.TA_LEFT:
                alignment = JLabel.LEFT;
                break;
            case Constants.TA_RIGHT:
                alignment = JLabel.RIGHT;
                break;
            case Constants.TA_CENTER:
                alignment = JLabel.CENTER;
                break;
            }
            int colWidth = 0;
            if (col.getArrayColumn() != null) {
                colWidth = col.getArrayColumn().getMinWidth();
            }
            else if (col.getActualWidth() >= 0) {
              colWidth = col.getActualWidth();
            }
            else {
              // TF:19/3/08: Added in a factor to make the columns approximately as wide as they are in Forte.
                colWidth = (int)(UIutils.colsToPixels(col.getMaxCharacters(), this) * UIutils.FORTE_COLUMNS_SCALING_FACTOR);
            }
            AlignedCellRenderer renderer = new AlignedCellRenderer(alignment, col.getName().toString());
            renderer.setInsets(0, 2, 0, 2);
            ArrayColumn ac = new ArrayColumn(col.getName().toString(),
                    colNum,
                    colWidth,
                    renderer,
                    false,
                    new Integer(col.getTitleMsgNum()));
           
            // CraigM:18/07/2008 - We need to set the size policy as it is used in ArrayFieldModel.resizeColumnIfNecessary()
            ac.setSizePolicy(col.getSizePolicy());
           
            // TF:19/06/2008:In Forte, the user could always adjust the widths of the columns in a list view. If we use
            // setMinWidth (as the ArrayColumn constructor does) then the user cannot reduce the columns smaller than
            // their initial size. Hence we use setMinWidth(0) and setPreferredWith. This is done here rather than in
            // the array column constructor as this rule applies only for list views, not array fields.
            ac.setMinWidth(0);
            ac.setPreferredWidth(colWidth);
           
            col.setArrayColumn(ac);
            cm.addColumn(ac, col.getTitle().toString(), col.getState() != Constants.FS_INVISIBLE);

            propNames[colNum] = col.getName().toString();
            colNum++;
           
            if (col.getState() == Constants.FS_DRAG) {
View Full Code Here

   * @param setNumber
   * @param mcat
   */
  //PM:23/4/08
  public void loadColumnHeadings(int setNumber, MsgCatalog mcat) {
    ArrayColumnModel acm = (ArrayColumnModel)this.table.getColumnModel();
   
    // CraigM:01/05/2008:Use the total array collection (including invisible columns)
    ArrayList<ArrayColumn> allColumns = acm.getColumnList();

    for (int i = 0; i < allColumns.size(); i++){
            ArrayColumn col = allColumns.get(i);
            if (col.getTitleMsgNumber() > 0){
              String titleString = mcat.getString(setNumber, col.getTitleMsgNumber());
View Full Code Here

    /**
     * Determine the index of the first visible column. If no visible column is found, this method returns -1
     * @return integer index of the first visible column.
     */
    public int getFirstVisibleColumnIndex() {
        ArrayColumnModel acm = (ArrayColumnModel)this.table.getColumnModel();
        for (int i = 0; i < acm.getRealColumnCount(); i++){
            ArrayColumn col = (ArrayColumn)acm.getRealColumn(i);
          if (col.isVisible()) {
            return i;
          }
        }
    return -1;
View Full Code Here

        // TF:22/11/07:If this component is a template for an array column, get the array column first
        ArrayColumn column = this.column;
        JTable t = ArrayFieldCellHelper.getArrayField(this._component);
        if (t != null) {
            int col = ArrayFieldCellHelper.getArrayFieldColumn((JComponent)this._component);
            ArrayColumnModel model = (ArrayColumnModel) t.getColumnModel();
            column = (ArrayColumn)model.getRealColumn(col);
        }

        switch (this.colourType) {
        case cBACKGROUND:
            if (column != null) {
View Full Code Here

TOP

Related Classes of DisplayProject.ArrayColumnModel

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.