JIDE on Eclipse Platform

This forum is used by users to request and discuss new product features. Please do not use this forum for technical support including bug reports.

Moderator: JIDE Support

Forum rules
Product suggestions only. Please do not use this forum for technical support including bug reports.

JIDE on Eclipse Platform

Postby finger77 » Mon Dec 22, 2003 7:49 pm

Hi all,

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? :wink:
finger77
 
Posts: 1
Joined: Mon Dec 22, 2003 7:44 pm

Postby JIDE Support » Fri Dec 26, 2003 10:18 am

Our components are fully Swing compatible. We have no plan to rewrite our components in SWT. However if you can any other Swing components such as JTable, JTextField in Eclipse, you can use ours as well. I recently read news at http://download.eclipse.org/downloads/drops/R-3.0-200406251208/eclipse-news-part1-R3.html which says "SWT now supports embedding Swing/AWT widgets inside SWT widgets." If so, you will have no problem using all components from JIDE.

Thanks.
Last edited by JIDE Support on Mon Oct 25, 2004 1:10 pm, edited 1 time in total.
JIDE Support
Site Admin
 
Posts: 37245
Joined: Sun Sep 14, 2003 10:49 am

Postby NikIvancic » Mon Oct 25, 2004 12:13 pm

The link to eclipse's website (reference to the Eclipse support for Swing is not valid) Can you please advise where to look for that ?
Nik Ivancic
CTO
Congral
NikIvancic
 
Posts: 1
Joined: Mon Oct 25, 2004 10:00 am
Location: San Jose, CA

Postby JIDE Support » Mon Oct 25, 2004 1:11 pm

Hi Nik,

I just updated the link to reflect the corret location. When getting on that page, search for "embed" and you will find it.

Thanks.
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37245
Joined: Sun Sep 14, 2003 10:49 am

Demo QuickFilter doesn't work!...

Postby blumbroso » Thu Sep 07, 2006 8:46 am

Hello,

I will try the demo QuickFilter within Eclipse SWT Shell and some features
doesn't work:
- pop menu on [?] filter button
- Edit cell doesn't accept key!!!

Do you know if i have to do something more to provide the compatibility?
I have to choose a powerfull library and JIDE is very attrative but we want to use RCP...

run my code please :

package eval;
import com.jidesoft.grid.*;
import com.jidesoft.plaf.LookAndFeelFactory;
import com.jidesoft.swing.JideSplitPane;
import com.jidesoft.swing.JideTitledBorder;
import com.jidesoft.swing.PartialEtchedBorder;
import com.jidesoft.swing.PartialSide;

import javax.swing.*;
import javax.swing.event.TableModelEvent;
import javax.swing.event.TableModelListener;
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.Display;
import org.eclipse.swt.widgets.Shell;

import java.awt.*;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Vector;
import java.util.zip.GZIPInputStream;


/**
* Demoed Component: {@link com.jidesoft.grid.SortableTable}
* <br>
* Required jar files: jide-common.jar, jide-grids.jar
* <br>
* Required L&F: any L&F
*/
public class ExampleTable {

public ExampleTable() {
}



public Component getDemoPanel() {
final TableModel tableModel = createTableModel();
if (tableModel == null) {
return new JLabel("Failed to read Library.txt.gz");
}

final QuickFilterPane quickFilterPane = new QuickFilterPane(new SortableTableModel(tableModel), new int[]{3, 1, 2});

JPanel quickSearchPanel = new JPanel(new FlowLayout(FlowLayout.LEADING)) {
public void update(java.awt.Graphics g) {
/* Do not erase the background */
paint(g);
} };
QuickTableFilterField filterField = new QuickTableFilterField(quickFilterPane.getDisplayTableModel(), new int[]{1, 2, 0, 5});
quickSearchPanel.add(filterField);
quickSearchPanel.setBorder(new JideTitledBorder(new PartialEtchedBorder(PartialEtchedBorder.LOWERED, PartialSide.NORTH), "QuickTableFilterField", JideTitledBorder.LEADING, JideTitledBorder.ABOVE_TOP));

JideSplitPane pane = new JideSplitPane(JideSplitPane.VERTICAL_SPLIT);
quickFilterPane.setBorder(BorderFactory.createCompoundBorder(new JideTitledBorder(new PartialEtchedBorder(PartialEtchedBorder.LOWERED, PartialSide.NORTH), "QuickFilterPane", JideTitledBorder.LEADING, JideTitledBorder.ABOVE_TOP),
BorderFactory.createEmptyBorder(6, 0, 0, 0)));
pane.addPane(quickFilterPane);

JPanel tablePanel = new JPanel(new BorderLayout(2, 2));
tablePanel.setBorder(BorderFactory.createCompoundBorder(new JideTitledBorder(new PartialEtchedBorder(PartialEtchedBorder.LOWERED, PartialSide.NORTH), "Filtered Song List", JideTitledBorder.LEADING, JideTitledBorder.ABOVE_TOP),
BorderFactory.createEmptyBorder(0, 0, 0, 0)));
final JLabel label = new JLabel(filterField.getDisplayTableModel().getRowCount() + " out of " + tableModel.getRowCount() + " songs");
label.setHorizontalAlignment(SwingConstants.CENTER);
label.setBorder(BorderFactory.createEmptyBorder(2, 0, 2, 0));
SortableTable sortableTable = new SortableTable(filterField.getDisplayTableModel());
sortableTable.getColumnModel().getColumn(0).setPreferredWidth(200);
sortableTable.getColumnModel().getColumn(4).setPreferredWidth(60);
sortableTable.getColumnModel().getColumn(5).setPreferredWidth(60);
filterField.setTable(sortableTable);
JScrollPane scrollPane = new JScrollPane(sortableTable, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
scrollPane.setCorner(JScrollPane.UPPER_RIGHT_CORNER, TableColumnChooser.getTableColumnChooserButton(sortableTable,
new boolean[]{true, false, false, false, false, false}, new String[]{"Song Name", "Artist of the Song", "Album of the Song", "Genre of the Song", "Duration of the Song", "Year when the Song is published",}));
filterField.getDisplayTableModel().addTableModelListener(new TableModelListener() {
public void tableChanged(TableModelEvent e) {
if (e.getSource() instanceof FilterableTableModel) {
int count = ((TableModel) e.getSource()).getRowCount();
label.setText(count + " out of " + tableModel.getRowCount() + " songs");
}
}
});

tablePanel.add(label, BorderLayout.BEFORE_FIRST_LINE);
tablePanel.add(scrollPane);
pane.addPane(tablePanel);

JPanel panel = new JPanel(new BorderLayout(3, 3));
panel.add(quickSearchPanel, BorderLayout.BEFORE_FIRST_LINE);
panel.add(pane);
// JButton resetButton = new JButton("Reset");
// resetButton.addActionListener(new AbstractAction(){
// public void actionPerformed(ActionEvent e) {
// ((AbstractTableModel) tableModel).fireTableDataChanged();
// }
// });
// panel.add(resetButton, BorderLayout.AFTER_LAST_LINE);

return panel;
}

private TableModel createTableModel() {
try {
InputStream resource = this.getClass().getClassLoader().getResourceAsStream("Library.txt.gz");
if (resource == null) {
return null;
}
InputStream in = new GZIPInputStream(resource);
BufferedReader reader = new BufferedReader(new InputStreamReader(in, "UTF-8"));
Vector data = new Vector();
Vector columnNames = new Vector();

String columnsLine = reader.readLine(); // skip first line
String[] columnValues = columnsLine.split("\t");
for (int i = 0; i < columnValues.length; i++) {
String name = columnValues[i];
columnNames.add(name);
}
do {
String line = reader.readLine();
if (line == null || line.length() == 0) {
break;
}
String[] values = line.split("\t");
Vector lineData = new Vector();
if (values.length < 1)
lineData.add(null); // song name
else
lineData.add(values[0]); // song name
if (values.length < 2)
lineData.add(null); // artist
else
lineData.add(values[1]); // artist
if (values.length < 3)
lineData.add(null); // album
else
lineData.add(values[2]); // album
if (values.length < 4)
lineData.add(null); // genre
else
lineData.add(values[3]); // genre
if (values.length < 5)
lineData.add(null); // time
else
lineData.add(values[4]); // time
if (values.length < 6)
lineData.add(null); // year
else
lineData.add(values[5]); // year
data.add(lineData);
}
while (true);
DefaultTableModel tableModel = new DefaultTableModel(data, columnNames) {
public boolean isCellEditable(int row, int column) {
return true;
}
};
return tableModel;
}
catch (IOException e) {
e.printStackTrace();
}
return null;
}

public String getDemoFolder() {
return "G15. QuickFilter";
}

static public void main(String[] s) {
LookAndFeelFactory.installDefaultLookAndFeelAndExtension();
ExampleTable et = new ExampleTable();

Shell shell = new Shell();
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;
org.eclipse.swt.widgets.Composite composite = new org.eclipse.swt.widgets.Composite(shell, SWT.NO_BACKGROUND |SWT.EMBEDDED);

composite.setLayout(new FillLayout());
composite.setLayoutData(gridData);
java.awt.Frame locationFrame = SWT_AWT.new_Frame(composite);


locationFrame.setLayout(new FlowLayout());
locationFrame.add(et.getDemoPanel());


Display display = shell.getDisplay();
shell.pack();
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
display.dispose();

}
static public void mainInAllSwing(String[] s) {
LookAndFeelFactory.installDefaultLookAndFeelAndExtension();
ExampleTable et = new ExampleTable();

JFrame jf = new JFrame();
jf.getContentPane().setLayout(new FlowLayout());

jf.add(et.getDemoPanel());
jf.setSize(800,800);
jf.setVisible(true);


}
}
blumbroso
 
Posts: 4
Joined: Thu Sep 07, 2006 1:12 am

Postby blumbroso » Thu Sep 07, 2006 8:55 am

... to run the example use in eclipse the option
Run As...
--> SWT Application

thanks
blumbroso
 
Posts: 4
Joined: Thu Sep 07, 2006 1:12 am

Postby blumbroso » Thu Sep 07, 2006 9:04 am

I have tried with JDK 1.4.2 and it works fine!!

but with JDK1.6 no!...
blumbroso
 
Posts: 4
Joined: Thu Sep 07, 2006 1:12 am

Postby JIDE Support » Thu Sep 07, 2006 9:10 am

Can you elaborate the two issues? I didn't understand what you mean by "filter button" and "edit cell".

- pop menu on [?] filter button
- Edit cell doesn't accept key!!!


Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37245
Joined: Sun Sep 14, 2003 10:49 am

Postby blumbroso » Fri Sep 08, 2006 1:09 am

ok...

- pop menu on [?] filter button
--> When you click on the "?" near the the textfield for search

- Edit cell doesn't accept key!!!
--> when you enter in a cell of the table

if you try my code in JDK1.6, you will see in one second what i try to tell you.

PS: on eclipse project add the SWT library in build bath
blumbroso
 
Posts: 4
Joined: Thu Sep 07, 2006 1:12 am

Postby JIDE Support » Fri Sep 08, 2006 8:41 am

I didn't realize it was a JDK1.6 only thing. I just tried in JDK1.6 and it is not working. For popup menu, I debug and find JPopupMenu#show method is called but nothing is display. For the edit cell, it doesn't accept any keys at all. I think this is beyond the reach of JIDE. I tried to do

return new JScrollPane(new JTable(tableModel));

in getDemoPanel which means not JIDE code is used, I still cannot edit the cell. So you probably report this bug to Swing team against JDK1.6 before it is formal released.

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37245
Joined: Sun Sep 14, 2003 10:49 am

Re: JIDE on Eclipse Platform

Postby bogdoll » Thu Apr 08, 2010 5:56 am

Hi,

it is now 3 years later as the previous post. and it seems I have exactly the same problem.
Most mouse stuff doesn't work in the jide pivot grid which is embedded into an eclipse RCP.
I'm using JDK 1.6.

I can't click into an cell to get there an editor, I can't resize the cell, also the mouse wheel
doesn't work. If I use my test program outside of eclipse all works fine.

Any news on that problem?

Thanks,
Dieter

PS: here my example code to show it for the pivot grid:

Code: Select all
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);
   }
}
bogdoll
 
Posts: 22
Joined: Tue Mar 16, 2010 1:45 am

Re: JIDE on Eclipse Platform

Postby JIDE Support » Thu Apr 08, 2010 9:52 pm

Even though people are using Swing (including using JIDE) inside SWT through Swing-SWT bridge, but IMHO, it is far from perfect. Most importantly, it is not going to be a long term solution. We will not provide any technical support on using JIDE inside SWT. It is not we don't want to but not possible for us to support.

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37245
Joined: Sun Sep 14, 2003 10:49 am

Re: JIDE on Eclipse Platform

Postby manser » Tue May 11, 2010 6:20 am

@bogdoll

Ignore this post if you've already bought a full licence for JIDE and you still have this issue.

We found in our evaluation of JIDE that the evaluation popup was causing our application within the Eclipse RCP to have issues (similar to what you're describing). We're pretty sure that it's the evaluation popup (which causes threading issues between Swing and SWT) because we had encountered the exact same issue when we were evaluating JGo. The issue was solved once we purchased the full version of JGo. (the JGo developers tested some sample code for us though which confirmed that it was the popup)

I can't guarantee 100% that these issues will be resolved when you purchase the full version of JIDE since we're still currently evaluating it ourselves. Perhaps someone is able to test some sample code for you with a licenced version?
manser
 
Posts: 1
Joined: Tue May 11, 2010 5:56 am

Re: JIDE on Eclipse Platform

Postby JIDE Support » Tue May 11, 2010 7:17 am

Hi manser, I think bogdoll purchased a license already. Thanks for trying to help though. We always appreciate it.
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37245
Joined: Sun Sep 14, 2003 10:49 am

Re: JIDE on Eclipse Platform

Postby makebill » Tue Jan 22, 2013 6:32 pm

I am trying to run example table.... When i run it it display Failed to read "Library.txt.gz"

import com.jidesoft.grid.*;
import com.jidesoft.plaf.LookAndFeelFactory;
import com.jidesoft.swing.JideSplitPane;
import com.jidesoft.swing.JideTitledBorder;
import com.jidesoft.swing.PartialEtchedBorder;
import com.jidesoft.swing.PartialSide;

import javax.swing.*;
import javax.swing.event.TableModelEvent;
import javax.swing.event.TableModelListener;
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.Display;
import org.eclipse.swt.widgets.Shell;

import java.awt.*;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Vector;
import java.util.zip.GZIPInputStream;

public class ExampleTable {

public ExampleTable() {
}



public Component getDemoPanel() {
final TableModel tableModel = createTableModel();
if (tableModel == null) {
return new JLabel("Failed to read Library.txt.gz");
}

final QuickFilterPane quickFilterPane = new QuickFilterPane(new SortableTableModel(tableModel), new int[]{3, 1, 2});

JPanel quickSearchPanel = new JPanel(new FlowLayout(FlowLayout.LEADING)) {
public void update(java.awt.Graphics g) {
/* Do not erase the background */
paint(g);
} };
QuickTableFilterField filterField = new QuickTableFilterField(quickFilterPane.getDisplayTableModel(), new int[]{1, 2, 0, 5});
quickSearchPanel.add(filterField);
quickSearchPanel.setBorder(new JideTitledBorder(new PartialEtchedBorder(PartialEtchedBorder.LOWERED, PartialSide.NORTH), "QuickTableFilterField", JideTitledBorder.LEADING, JideTitledBorder.ABOVE_TOP));

JideSplitPane pane = new JideSplitPane(JideSplitPane.VERTICAL_SPLIT);
quickFilterPane.setBorder(BorderFactory.createCompoundBorder(new JideTitledBorder(new PartialEtchedBorder(PartialEtchedBorder.LOWERED, PartialSide.NORTH), "QuickFilterPane", JideTitledBorder.LEADING, JideTitledBorder.ABOVE_TOP),
BorderFactory.createEmptyBorder(6, 0, 0, 0)));
pane.addPane(quickFilterPane);

JPanel tablePanel = new JPanel(new BorderLayout(2, 2));
tablePanel.setBorder(BorderFactory.createCompoundBorder(new JideTitledBorder(new PartialEtchedBorder(PartialEtchedBorder.LOWERED, PartialSide.NORTH), "Filtered Song List", JideTitledBorder.LEADING, JideTitledBorder.ABOVE_TOP),
BorderFactory.createEmptyBorder(0, 0, 0, 0)));
final JLabel label = new JLabel(filterField.getDisplayTableModel().getRowCount() + " out of " + tableModel.getRowCount() + " songs");
label.setHorizontalAlignment(SwingConstants.CENTER);
label.setBorder(BorderFactory.createEmptyBorder(2, 0, 2, 0));
SortableTable sortableTable = new SortableTable(filterField.getDisplayTableModel());
sortableTable.getColumnModel().getColumn(0).setPreferredWidth(200);
sortableTable.getColumnModel().getColumn(4).setPreferredWidth(60);
sortableTable.getColumnModel().getColumn(5).setPreferredWidth(60);
filterField.setTable(sortableTable);
JScrollPane scrollPane = new JScrollPane(sortableTable, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
scrollPane.setCorner(JScrollPane.UPPER_RIGHT_CORNER, TableColumnChooser.getTableColumnChooserButton(sortableTable,
new boolean[]{true, false, false, false, false, false}, new String[]{"Song Name", "Artist of the Song", "Album of the Song", "Genre of the Song", "Duration of the Song", "Year when the Song is published",}));
filterField.getDisplayTableModel().addTableModelListener(new TableModelListener() {
public void tableChanged(TableModelEvent e) {
if (e.getSource() instanceof FilterableTableModel) {
int count = ((TableModel) e.getSource()).getRowCount();
label.setText(count + " out of " + tableModel.getRowCount() + " songs");
}
}
});

tablePanel.add(label, BorderLayout.BEFORE_FIRST_LINE);
tablePanel.add(scrollPane);
pane.addPane(tablePanel);

JPanel panel = new JPanel(new BorderLayout(3, 3));
panel.add(quickSearchPanel, BorderLayout.BEFORE_FIRST_LINE);
panel.add(pane);
// JButton resetButton = new JButton("Reset");
// resetButton.addActionListener(new AbstractAction(){
// public void actionPerformed(ActionEvent e) {
// ((AbstractTableModel) tableModel).fireTableDataChanged();
// }
// });
// panel.add(resetButton, BorderLayout.AFTER_LAST_LINE);

return panel;
}

private TableModel createTableModel() {
try {
InputStream resource = this.getClass().getClassLoader().getResourceAsStream("C:\\Users\\Administrator\\Documents\\jide.3.5.1.eval\\examples\\Demo\\Library.txt.gz");
if (resource == null) {
return null;
}
InputStream in = new GZIPInputStream(resource);
BufferedReader reader = new BufferedReader(new InputStreamReader(in, "UTF-8"));
Vector data = new Vector();
Vector columnNames = new Vector();

String columnsLine = reader.readLine(); // skip first line
String[] columnValues = columnsLine.split("\t");
for (int i = 0; i < columnValues.length; i++) {
String name = columnValues[i];
columnNames.add(name);
}
do {
String line = reader.readLine();
if (line == null || line.length() == 0) {
break;
}
String[] values = line.split("\t");
Vector lineData = new Vector();
if (values.length < 1)
lineData.add(null); // song name
else
lineData.add(values[0]); // song name
if (values.length < 2)
lineData.add(null); // artist
else
lineData.add(values[1]); // artist
if (values.length < 3)
lineData.add(null); // album
else
lineData.add(values[2]); // album
if (values.length < 4)
lineData.add(null); // genre
else
lineData.add(values[3]); // genre
if (values.length < 5)
lineData.add(null); // time
else
lineData.add(values[4]); // time
if (values.length < 6)
lineData.add(null); // year
else
lineData.add(values[5]); // year
data.add(lineData);
}
while (true);
DefaultTableModel tableModel = new DefaultTableModel(data, columnNames) {
public boolean isCellEditable(int row, int column) {
return true;
}
};
return tableModel;
}
catch (IOException e) {
e.printStackTrace();
}
return null;
}

public String getDemoFolder() {
return "G15. QuickFilter";
}

static public void main(String[] s) {
LookAndFeelFactory.installDefaultLookAndFeelAndExtension();
ExampleTable et = new ExampleTable();

Shell shell = new Shell();
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;
org.eclipse.swt.widgets.Composite composite = new org.eclipse.swt.widgets.Composite(shell, SWT.NO_BACKGROUND |SWT.EMBEDDED);

composite.setLayout(new FillLayout());
composite.setLayoutData(gridData);
java.awt.Frame locationFrame = SWT_AWT.new_Frame(composite);


locationFrame.setLayout(new FlowLayout());
locationFrame.add(et.getDemoPanel());


Display display = shell.getDisplay();
shell.pack();
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
display.dispose();

}
static public void mainInAllSwing(String[] s) {
LookAndFeelFactory.installDefaultLookAndFeelAndExtension();
ExampleTable et = new ExampleTable();

JFrame jf = new JFrame();
jf.getContentPane().setLayout(new FlowLayout());

jf.add(et.getDemoPanel());
jf.setSize(800,800);
jf.setVisible(true);


}
}

Is there any extra thing that i need to include while i run this example. I am using SWT Application to run
makebill
 
Posts: 5
Joined: Tue Jan 22, 2013 1:41 am

Re: JIDE on Eclipse Platform

Postby JIDE Support » Tue Jan 22, 2013 6:41 pm

There is a setting in the eclipse project to copy resource files to class output folder. One of the resource pattern we put in our example eclipse project is to include "*.txt.gz" as we used several such files for the demo data. Since you probably create an eclipse project yourself, so this setting is omitted.
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37245
Joined: Sun Sep 14, 2003 10:49 am

Re: JIDE on Eclipse Platform

Postby makebill » Tue Jan 22, 2013 6:53 pm

Please ignore previous post. My issue is resolved. :)
makebill
 
Posts: 5
Joined: Tue Jan 22, 2013 1:41 am

Re: JIDE on Eclipse Platform

Postby makebill » Tue Jan 22, 2013 8:45 pm

Hi, Is it possible to achieve attached tabular format using Jide & swing.... If so is there any example available.... :)
Attachments
Table1.png
Table1.png (34.31 KiB) Viewed 120117 times
makebill
 
Posts: 5
Joined: Tue Jan 22, 2013 1:41 am

Re: JIDE on Eclipse Platform

Postby JIDE Support » Tue Jan 22, 2013 9:27 pm

Yes, very easy using the CellSpan, CellStyle feature to do it. You can find several examples in our examples folder.
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37245
Joined: Sun Sep 14, 2003 10:49 am

Re: JIDE on Eclipse Platform

Postby makebill » Tue Jan 22, 2013 10:05 pm

thanks :). 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
makebill
 
Posts: 5
Joined: Tue Jan 22, 2013 1:41 am

Re: JIDE on Eclipse Platform

Postby JIDE Support » Tue Jan 22, 2013 10:31 pm

The JIDE Data Grids product provides feature related to the database. It can use JDBC ResultSet directly or to use Hibernate. It can even use the database or hibernate to do the sorting and filtering instead of sorting/filtering locally. However it doesn't support any modifications to the database (basically, CRUD) out of box, for which you will have to add your code to do it. I don't know much about the JFace DataBinding but I would expect it works similar to other bindings that depend on the property change listener etc. It is probably similar to our BeanTableModel which can take a list of objects (aka POJO) and use reflection to call its properties and populate the whole table.
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37245
Joined: Sun Sep 14, 2003 10:49 am

Re: JIDE on Eclipse Platform

Postby makebill » Tue Jan 22, 2013 10:46 pm

yaa exactly... and we are using ibatis.
makebill
 
Posts: 5
Joined: Tue Jan 22, 2013 1:41 am


Return to Product Suggestions

Who is online

Users browsing this forum: No registered users and 16 guests

cron