I think JIDE is a very good swing framework. I feel that the Eclipse platform is lacking on a jdk compatible desktop framework. Would JIDE be ported to the Eclipse platform?

Moderator: JIDE Support

- pop menu on [?] filter button
- Edit cell doesn't accept key!!!
package eval;
import java.awt.Frame;
import javax.swing.JFrame;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableModel;
import org.eclipse.swt.SWT;
import org.eclipse.swt.awt.SWT_AWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import com.jidesoft.pivot.PivotDataEditingProvider;
import com.jidesoft.pivot.PivotDataModel;
import com.jidesoft.pivot.PivotField;
import com.jidesoft.pivot.PivotTablePane;
public class PivotGrid 
{
   private static PivotTablePane createPivot()
   {
      PivotDataModel pivotModel = new PivotDataModel(createTableModel());
      pivotModel.getField("A").setAreaType(PivotField.AREA_ROW);
      pivotModel.getField("N").setAreaType(PivotField.AREA_COLUMN);
      pivotModel.getField("Double").setAreaType(PivotField.AREA_DATA);
      pivotModel.getField("String").setAreaType(PivotField.AREA_DATA);
      pivotModel.setDataEditingProvider(new PivotDataEditingProvider() 
      {
         public void setValueAt(PivotDataModel aArg0, Object aArg1, int aArg2, int aArg3) 
         {
         }
         
         public boolean isCellEditable(PivotDataModel aArg0, int aArg1, int aArg2) 
         {
            return true;
         }
      }); // just to see if cell are editable
   
      PivotTablePane pivot = new PivotTablePane(pivotModel);
      pivot.setFieldChooserEnabled(true);
      pivot.setColumnAutoResizable(true);
      return pivot;
   }
   
   private static TableModel createTableModel()
   {
      return new DefaultTableModel(new Object[][]{
                     {"A","1", 0.2, "Test"},
                     {"A","2", 0.1, "Test2"}
               }, 
               new Object[]{"A","N","Double","String"})
      {
         public Class<?> getColumnClass(int aColumnIndex) 
         {
            if(aColumnIndex==2) return double.class;
            else if(aColumnIndex==3) return String.class;
            else return Void.class;
         }
      };
   }
   
   public static void mainForSWT(String[] args) 
   {
      Shell shell = new Shell();
      shell.setSize(640,400);
      shell.setLayout(new org.eclipse.swt.layout.GridLayout());
      GridData gridData = new GridData();
      gridData.grabExcessHorizontalSpace = true;
      gridData.horizontalAlignment = org.eclipse.swt.layout.GridData.FILL;
      gridData.verticalAlignment = org.eclipse.swt.layout.GridData.FILL;
      gridData.grabExcessVerticalSpace = true;
      
      Composite composite = new Composite(shell, SWT.NO_BACKGROUND | SWT.EMBEDDED);
      composite.setLayout(new FillLayout());
      composite.setLayoutData(gridData);
      
      Frame frame = SWT_AWT.new_Frame(composite);
      frame.add(createPivot());
      
      Display display = shell.getDisplay();
      shell.pack();
      shell.open();
      while (!shell.isDisposed()) {
         if (!display.readAndDispatch())
            display.sleep();
      }
      display.dispose();
   }
   
   public static void mainForSwing(String[] args) 
   {
      JFrame frame = new JFrame("Pivot Evaluation");
      frame.setSize(640,400);
      frame.setContentPane(createPivot());
      frame.setVisible(true);
   }
   
   public static void main(String[] args) {
      mainForSWT(args);
   }
}


 . Basically my application is SWT/Jface based and i am planning to use JIDE with swing only for this table purpose. Also would like to know if this support Data binding (specifically Jface databinding) and all values are populated frm database. Does it support add row and delete row by clicking add and delete button
. Basically my application is SWT/Jface based and i am planning to use JIDE with swing only for this table purpose. Also would like to know if this support Data binding (specifically Jface databinding) and all values are populated frm database. Does it support add row and delete row by clicking add and delete buttonUsers browsing this forum: No registered users and 100 guests