Package org.compiere.model

Examples of org.compiere.model.X_AD_ColumnLayout


  public void saveColumns(MiniTable table)
  {
    TableColumn tcol;
    String tcolName;
    TableColumnModel model = table.getColumnModel();
    X_AD_ColumnLayout colLayout = null;
    boolean modified = false;
   
    // Iterate over the columns of the table
    for (int modelIndex = 0; modelIndex < table.getColumnCount(); modelIndex++)
    {
      tcol = model.getColumn(modelIndex);
      tcolName = tcol.getHeaderValue().toString();
      colLayout = columns.get(modelIndex);
     
      // If the position of column layout does not match the position of the
      // column in the table then move the column in the layout to match its
      // position in the table.
      if (!colLayout.getColumnName().equals(tcolName))
      {
        colLayout = null;
       
        for (X_AD_ColumnLayout currentLayout : columns)
        {
          if (currentLayout.getColumnName().equals(tcolName))
          {
            colLayout = currentLayout;
            break;
          }
        }
        if (colLayout != null)
        {
          columns.remove(colLayout);
          columns.add(modelIndex, colLayout);
          modified = true;
        }
      }
     
      // If the visibility of the column layout does not match the visibility
      // of the table column than change the column layout to match.
      if (colLayout != null &&
          table.isColumnVisible(tcol) != colLayout.isActive())
      {
        colLayout.setIsActive(table.isColumnVisible(tcol));
        modified = true;
      }
     
    } // end for
   
View Full Code Here


      pstmt.setInt(3, userID);
      pstmt.setInt(4, formID);
      rs = pstmt.executeQuery();
     
      while (rs.next())
        columns.add(new X_AD_ColumnLayout(Env.getCtx(), rs, null));
     
    }
    catch (SQLException e)
    {
      log.log(Level.SEVERE, sql.toString(), e);
View Full Code Here

   */
  private void verifyWith(Vector<String> columnNames)
  {
    if (columns.size() == 0)
    {
      X_AD_ColumnLayout colLayout;
      int index = 0;
     
      for (String colName : columnNames)
      {
        colLayout = new X_AD_ColumnLayout(Env.getCtx(), 0, null);
        colLayout.setColumnName(colName);
        colLayout.setAD_User_ID(userID);
        colLayout.setAD_Form_ID(formID);
        colLayout.setSeqNo(indexToSeqNo(index++));
        colLayout.setIsActive(true);
        columns.add(colLayout);
       
      } // end for
     
    } // end if
View Full Code Here

TOP

Related Classes of org.compiere.model.X_AD_ColumnLayout

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.