Package org.enhydra.jawe.base.panel.panels.tablesorting

Examples of org.enhydra.jawe.base.panel.panels.tablesorting.BasicSortingTable


      }
      return cnames;
   }

   protected JTable createTable(final boolean colors) {
      JTable t=new BasicSortingTable(this, new Vector(), columnNames) {

         public boolean isCellEditable(int row, int col) {
            return false;
         }

         // This table colors elements depending on their owner
         public Component prepareRenderer(TableCellRenderer renderer, int rowIndex, int vColIndex) {
            Component c = super.prepareRenderer(renderer, rowIndex, vColIndex);
            if (!isCellSelected(rowIndex, vColIndex) && colors) {
               XMLElement el = (XMLElement) getValueAt(rowIndex, 0);
               if (el instanceof XMLCollectionElement) {
                  XMLCollectionElement cel = (XMLCollectionElement) el;
                  XMLCollection celOwner = (XMLCollection) cel.getParent();
                  if (celOwner == null) {
                     c.setBackground(SPEC_EL_COLOR_BKG);
                  } else if (celOwner!=getOwner()) {
                     c.setBackground(FOREIGN_EL_COLOR_BKG);
                  } else {
                     c.setBackground(getBackground());
                  }
               } else {
                  c.setBackground(getBackground());
               }
            }

            return c;
         }
      };

      Color bkgCol=new Color(245,245,245);
      if (ipc.getSettings() instanceof PanelSettings) {
         bkgCol=((PanelSettings)ipc.getSettings()).getBackgroundColor();
      }
      t.setBackground(bkgCol);

      return t;
   }
View Full Code Here

TOP

Related Classes of org.enhydra.jawe.base.panel.panels.tablesorting.BasicSortingTable

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.