COOLBAR Problem

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

COOLBAR Problem

Postby danireb » Thu Jul 27, 2006 8:49 am

Hi,

I only want to make in a SWT WindowsApplication a coolbar.

Everything is ok while I am designing, and previewing the result.

The coolbar consist in 2 coolitems with ToolBars. Each ToolBar with 2 ToolItems. The ToolItems has an image but no text.

When I run the application, always the last image (toolItem) of the first CoolItem desappear. It is hidden. I had to move the second CoolItem in order to view that ToolItem. But i dont undestand why when i see the form in the designer, it is ok.

thanks in advance
danireb
 
Posts: 4
Joined: Thu Jul 27, 2006 8:16 am

Re: COOLBAR Problem

Postby Eric Clayberg » Thu Jul 27, 2006 11:12 am

danireb wrote:I only want to make in a SWT WindowsApplication a coolbar.
Everything is ok while I am designing, and previewing the result.
The coolbar consist in 2 coolitems with ToolBars. Each ToolBar with 2 ToolItems. The ToolItems has an image but no text.
When I run the application, always the last image (toolItem) of the first CoolItem desappear. It is hidden. I had to move the second CoolItem in order to view that ToolItem. But i dont undestand why when i see the form in the designer, it is ok.

I have no idea. I tried a simple example based on what you described above and it looked fine both in Designer and at runtime.

If you want to provide a test case, we can look into it further.

You might also consider submitting a bug report to Eclipse.org since the runtime behavior of the Coolbar would be an Eclipse SWT issue that we could do little about even if we could reproduce it.
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: COOLBAR Problem

Postby danireb » Thu Jul 27, 2006 3:16 pm

I "fix" the problem.

In windows/Preferences in Eclipse, in the Designer preferences. I checked "Create every component in its own block" and then all started to work fine.

I dont know if that was the solution, but it works for me.


danireb wrote:Hi,

I only want to make in a SWT WindowsApplication a coolbar.

Everything is ok while I am designing, and previewing the result.

The coolbar consist in 2 coolitems with ToolBars. Each ToolBar with 2 ToolItems. The ToolItems has an image but no text.

When I run the application, always the last image (toolItem) of the first CoolItem desappear. It is hidden. I had to move the second CoolItem in order to view that ToolItem. But i dont undestand why when i see the form in the designer, it is ok.

thanks in advance
danireb
 
Posts: 4
Joined: Thu Jul 27, 2006 8:16 am

Re: COOLBAR Problem

Postby Eric Clayberg » Thu Jul 27, 2006 3:40 pm

danireb wrote:In windows/Preferences in Eclipse, in the Designer preferences. I checked "Create every component in its own block" and then all started to work fine.

Hmmm. That should not have any effect at all. In my example, that option was turned off.

We would really need to see your original code in order to try and reproduce the problem (or tell you why it is occurring).
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: COOLBAR Problem

Postby danireb » Thu Jul 27, 2006 5:34 pm

Here is the code.

Now, there are 3 toolItem and 2 toolBar and 2 Coolbar.

In the designer and when i test de form, i dont see the second image. but when i run from eclipse the application, it appears. i cant see the image that i cant see in the design.

(THE OPTION IN THE PREFERENCES IN UNCHECKED)

package src;

import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.CoolBar;
import org.eclipse.swt.widgets.CoolItem;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.ToolBar;
import org.eclipse.swt.widgets.ToolItem;
import com.swtdesigner.SWTResourceManager;

Code: Select all
public class Interface {

   protected Shell shell;

   /**
    * Launch the application
    *
    * @param args
    */
   public static void main(String[] args) {
      try {
         Interface window = new Interface();
         window.open();
      } catch (Exception e) {
         e.printStackTrace();
      }
   }

   /**
    * Open the window
    */
   public void open() {
      final Display display = Display.getDefault();
      createContents();
      shell.open();
      shell.layout();
      while (!shell.isDisposed()) {
         if (!display.readAndDispatch())
            display.sleep();
      }
   }

   /**
    * Create contents of the window
    */
   protected void createContents() {
      shell = new Shell();
      shell.setSize(500, 375);
      shell.setText("SWT Application");

      final CoolBar coolBar = new CoolBar(shell, SWT.NONE);
      coolBar.setBounds(0, 0, 205, 22);

      final CoolItem newItemCoolItem = new CoolItem(coolBar, SWT.PUSH);
      newItemCoolItem.setText("New item");

      final ToolBar toolBar = new ToolBar(coolBar, SWT.FLAT);
      newItemCoolItem.setControl(toolBar);

      final ToolItem newItemToolItem = new ToolItem(toolBar, SWT.PUSH);
      newItemToolItem.setImage(SWTResourceManager.getImage(Interface.class,
            "icons/debug_exec.gif"));

      final ToolItem newItemToolItem_1 = new ToolItem(toolBar, SWT.PUSH);
      newItemToolItem_1.setImage(SWTResourceManager.getImage(Interface.class,
            "icons/new_wiz.gif"));
      //

      SWTResourceManager.fixCoolBarSize(coolBar);

      final CoolItem newItemCoolItem_1 = new CoolItem(coolBar, SWT.PUSH);
      newItemCoolItem_1.setText("New item");

      final ToolBar toolBar_1 = new ToolBar(coolBar, SWT.FLAT);
      newItemCoolItem_1.setControl(toolBar_1);

      final ToolItem newItemToolItem_2 = new ToolItem(toolBar_1, SWT.PUSH);
      newItemToolItem_2.setImage(SWTResourceManager.getImage(Interface.class,
            "icons/prop_ps.gif"));
   }

}



Sometimes, i dont see the image in the designer nor when i run the application. And sometimes i see all the images in the designer, but when i run the application, it desappears. (This things happened to me in different projects)

I hope for your response.

Thanks

Eric Clayberg wrote:
danireb wrote:In windows/Preferences in Eclipse, in the Designer preferences. I checked "Create every component in its own block" and then all started to work fine.

Hmmm. That should not have any effect at all. In my example, that option was turned off.

We would really need to see your original code in order to try and reproduce the problem (or tell you why it is occurring).
Code: Select all
danireb
 
Posts: 4
Joined: Thu Jul 27, 2006 8:16 am

Re: COOLBAR Problem

Postby Eric Clayberg » Sun Jul 30, 2006 5:22 pm

danireb wrote:Sometimes, i dont see the image in the designer nor when i run the application. And sometimes i see all the images in the designer, but when i run the application, it desappears. (This things happened to me in different projects)

I tried your example and it worked fine on my end. You did not include any images, so I had to use my own.

Does it matter which images you use? IOW, is the problem associated with specific images?

If the problem also occurs at runtime, this is a clear indication that this is an Eclipse problem rather than a Designer problem. Yoiu should package up a test case and submit a bug report to Eclipse.org.
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: COOLBAR Problem

Postby danireb » Sun Jul 30, 2006 6:36 pm

OK.

Thanks for your response. I will report this debug to Eclipse.

But, I insist that something wrong is with my plugin, elipse or SWT designer, because if I copy the source above and paste it in a new class. The problem persists. I cant see the images in the SWT Designer but when I run de SWT Application, the image appears.

I set a lot of different images in the button, so I discard the that the images are the problem.

There are 2 situations:

When everything is OK in the SWT Designer, when I run the application, some coolitems are hidden behind others.

When I run the application and everything is OK, in the SWT Designer I cant see the coolitem.

Thanks, I will still trying...

Eric Clayberg wrote:
danireb wrote:Sometimes, i dont see the image in the designer nor when i run the application. And sometimes i see all the images in the designer, but when i run the application, it desappears. (This things happened to me in different projects)

I tried your example and it worked fine on my end. You did not include any images, so I had to use my own.

Does it matter which images you use? IOW, is the problem associated with specific images?

If the problem also occurs at runtime, this is a clear indication that this is an Eclipse problem rather than a Designer problem. Yoiu should package up a test case and submit a bug report to Eclipse.org.
:( :(
danireb
 
Posts: 4
Joined: Thu Jul 27, 2006 8:16 am

Re: COOLBAR Problem

Postby Eric Clayberg » Mon Jul 31, 2006 5:59 am

Unfortunately, without a reproduceable test case, there is very little we can do to help.
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: No registered users and 1 guest