Support for CellEditors as viewers

SWT Designer allows you to create the views, editors, perspectives, pref pages, composites, etc. that comprise Eclipse SWT & RCP applications and plug-ins.

Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg

Support for CellEditors as viewers

Postby ere » Fri Nov 27, 2009 12:35 am

Within the "what's new section" I found a statement "Support for CellEditors as viewers"

I guess/hope that with this feature I can bind the input and selection to a ComboBoxCell Editor within a table viewer. If this is the case, could you pls instruct me how to do this.

thanks
rene
ere
 
Posts: 6
Joined: Sat Sep 18, 2004 1:47 pm

Re: Support for CellEditors as viewers

Postby Eric Clayberg » Fri Nov 27, 2009 7:21 am

ere wrote:Within the "what's new section" I found a statement "Support for CellEditors as viewers"

That just means that you can use a CellEditor just like any other widget/viewer. For example...

Code: Select all
package test;

import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.layout.RowLayout;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Control;
import org.eclipse.jface.viewers.TextCellEditor;
import com.swtdesigner.SWTResourceManager;

public class Application_1 {
   protected Shell m_shell;
   /**
    * Launch the application.
    * @param args
    */
   public static void main(String[] args) {
      try {
         Application_1 window = new Application_1();
         window.open();
      } catch (Exception e) {
         e.printStackTrace();
      }
   }
   /**
    * Open the window.
    */
   public void open() {
      Display display = Display.getDefault();
      createContents();
      m_shell.open();
      m_shell.layout();
      while (!m_shell.isDisposed()) {
         if (!display.readAndDispatch()) {
            display.sleep();
         }
      }
   }
   /**
    * Create contents of the window.
    */
   protected void createContents() {
      m_shell = new Shell();
      m_shell.setSize(450, 300);
      m_shell.setText("SWT Application");
      m_shell.setLayout(new RowLayout(SWT.HORIZONTAL));
      {
         TextCellEditor textCellEditor = new TextCellEditor(m_shell, SWT.BORDER);
         Control control = textCellEditor.getControl();
         control.setBackground(SWTResourceManager.getColor(SWT.COLOR_LIST_BACKGROUND));
         control.setVisible(true);
      }
   }
}
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Re: Support for CellEditors as viewers

Postby ere » Mon Nov 30, 2009 3:58 am

Eric, is there any change for an WindowBuilder enhancement to support ComboBoxViewerCellEditor with the repsective dialogs to bind input, selection etc. as for ComboViewers ?

I've added now manually some code similar to this blog-entry:
http://splitshade.wordpress.com/2009/02 ... le-viewer/

Now, my screen works except that WindowBuilder generates parser exceptions.

br
rené
ere
 
Posts: 6
Joined: Sat Sep 18, 2004 1:47 pm

Re: Support for CellEditors as viewers

Postby Eric Clayberg » Fri Dec 04, 2009 6:15 am

ere wrote:is there any change for an WindowBuilder enhancement to support ComboBoxViewerCellEditor with the repsective dialogs to bind input, selection etc. as for ComboViewers ?

We don't have any enhancements like that currently planned.

ere wrote:Now, my screen works except that WindowBuilder generates parser exceptions.

What exceptions? In general, you should not modify the initDataBindings() method in any way as it is parsed and regenerated as a unit. If you need to add addditional DB code that is not supported by SWT Designer, do it outside of that method
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA


Return to SWT Designer

Who is online

Users browsing this forum: Google [Bot] and 2 guests