1.2.3 loading 1.2.2 designs

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

1.2.3 loading 1.2.2 designs

Postby rgallen » Tue Dec 23, 2003 11:39 am

Yup; I cut and paste the subject line from the earlier posting "SWT 1.2.2 does not load 1.2.1 designs" :-)

And I read the thread, so I am just letting you know that this beta is "broken" as far as backward compatibility goes.
rgallen
 
Posts: 15
Joined: Sun Oct 12, 2003 7:45 pm

Re: 1.2.3 loading 1.2.2 designs

Postby Eric Clayberg » Tue Dec 23, 2003 12:33 pm

rgallen wrote:I am just letting you know that this beta is "broken" as far as backward compatibility goes.

SWT Designer 1.2.3 loads earlier designs just fine, so please be very specific, if you are going to make statements like that. We have a couple of hundred sample windows, dialogs and composites that we automatically test before every release, and all of them worked fine. That does not mean that there might not have been a regression on some specific feature, widget or edge condition that we aren't capturing in our tests.

Any time you run across a window that used to work and now fails, you should send it to us at support@swt-designer.com along with any exceptions that might have been recorded to the Eclipse .log file. You should also double check your installation to make sure that you have the correct version of Designer loaded for your environment.
Last edited by Eric Clayberg on Tue Dec 23, 2003 7:48 pm, edited 1 time in total.
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: 1.2.3 loading 1.2.2 designs

Postby rgallen » Tue Dec 23, 2003 2:03 pm

Eric,

I have verified my installation is correct.

I have Eclipse 2.1.2 and Designer 1.2.3 for Eclipse 2.1, Windows 2000 Professional with all service packs. Sun Java runtime 1.4.

As with the original poster if I simply delete Designer 1.2.3 (thereby reverting to Designer 1.2.2R then the design tab re-appears. I have flipped back and forth several times, it is 100% repeatable with the following source.

Code: Select all
package displayer;

import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.events.*;

import java.util.*;

import receiver.*;

/**
* @author rallen
*
* To change the template for this generated type comment go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
public class NLV {

   private Label filtered;
   private Button stopStartButton;
   private Combo sourceFilter;
   private Combo timestampFilter;
   private Combo severityFilter;
   private Label collected;
   private Table table;
   Vector log=new Vector();
   Logger logger;   
         
   public static void main(String[] args) {
      NLV window = new NLV();
      window.open();
   }
   
   public void open() {
      final Display display = new Display();
      final Shell shell = new Shell();
      shell.setLayout(new FormLayout());
      shell.setText("Net Log Viewer");
      {
         sourceFilter = new Combo(shell, SWT.NONE);
         final FormData formData = new FormData();
         formData.right = new FormAttachment(0, 175);
         formData.left = new FormAttachment(0, 5);
         formData.top = new FormAttachment(0, 10);
         sourceFilter.setLayoutData(formData);
         sourceFilter.add("None");
         sourceFilter.select(0);
      }
      {
         timestampFilter = new Combo(shell, SWT.NONE);
         final FormData formData = new FormData();
         formData.right = new FormAttachment(0, 345);
         formData.top = new FormAttachment(sourceFilter, 0, SWT.TOP);
         formData.left = new FormAttachment(sourceFilter, 0, SWT.RIGHT);
         timestampFilter.setLayoutData(formData);
         timestampFilter.add("None");
         timestampFilter.select(0);
      }
      {
         severityFilter = new Combo(shell, SWT.NONE);
         final FormData formData = new FormData();
         formData.right = new FormAttachment(0, 430);
         formData.top = new FormAttachment(sourceFilter, 0, SWT.TOP);
         formData.left = new FormAttachment(0, 345);
         severityFilter.setLayoutData(formData);
         severityFilter.add("None");
         severityFilter.select(0);
      }
      {
         stopStartButton = new Button(shell, SWT.NONE);
         final FormData formData = new FormData();
         formData.right = new FormAttachment(0, 538);
         formData.top = new FormAttachment(sourceFilter, 0, SWT.TOP);
         formData.left = new FormAttachment(severityFilter, 40, SWT.DEFAULT);
         stopStartButton.setLayoutData(formData);
         stopStartButton.setText("Stop");
         stopStartButton.addSelectionListener(new SelectionAdapter() {
            public void widgetSelected(SelectionEvent e) {
               if(logger.toggleCollect()) {
                  stopStartButton.setText("Stop");
               } else {
                  stopStartButton.setText("Start");
               }
            }
         });               
      }
      {
         collected = new Label(shell, SWT.BORDER | SWT.RIGHT);
         final FormData formData = new FormData();
         formData.bottom = new FormAttachment(sourceFilter, 21, SWT.TOP);
         formData.right = new FormAttachment(0, 637);
         formData.top = new FormAttachment(sourceFilter, 0, SWT.TOP);
         formData.left = new FormAttachment(stopStartButton, 7, SWT.DEFAULT);
         collected.setLayoutData(formData);
      }
      {
         filtered = new Label(shell, SWT.BORDER | SWT.RIGHT);
         final FormData formData = new FormData();
         formData.bottom = new FormAttachment(sourceFilter, 0, SWT.BOTTOM);
         formData.right = new FormAttachment(0, 720);
         formData.top = new FormAttachment(sourceFilter, 0, SWT.TOP);
         formData.left = new FormAttachment(collected, 5, SWT.RIGHT);
         filtered.setLayoutData(formData);
      }
      {
         table = new Table(shell, SWT.BORDER);
         final FormData formData = new FormData();
         formData.bottom = new FormAttachment(100, -5);
         formData.right = new FormAttachment(100, -5);
         formData.top = new FormAttachment(0, 35);
         formData.left = new FormAttachment(0, 5);
         table.setLayoutData(formData);
         table.setLinesVisible(true);
         table.setHeaderVisible(true);
         {
            final TableColumn tableColumn = new TableColumn(table, SWT.NONE);
            tableColumn.setWidth(170);
            tableColumn.setText("Source");
            final Sorter sorter=new Sorter(table, 0);
            tableColumn.addSelectionListener(sorter);               
         }
         {
            final TableColumn tableColumn = new TableColumn(table, SWT.NONE);
            tableColumn.setWidth(170);
            tableColumn.setText("Timestamp");
            final Sorter sorter=new Sorter(table, 1);
            tableColumn.addSelectionListener(sorter);               
         }
         {
            final TableColumn tableColumn = new TableColumn(table, SWT.NONE);
            tableColumn.setWidth(106);
            tableColumn.setText("Severity");
            final Sorter sorter=new Sorter(table, 2);
            tableColumn.addSelectionListener(sorter);               
         }
         {
            final TableColumn tableColumn = new TableColumn(table, SWT.NONE);
            tableColumn.setWidth(222);
            tableColumn.setText("Message");
            final Sorter sorter=new Sorter(table, 3);
            tableColumn.addSelectionListener(sorter);                  
         }
         Filter filter=new Filter(table, log, 0, filtered);
         sourceFilter.addSelectionListener(filter);
         filter=new Filter(table, log, 3, filtered);
         timestampFilter.addSelectionListener(filter);
         filter=new Filter(table, log, 2, filtered);
         severityFilter.addSelectionListener(filter);         
      }
      
      logger=new Logger(log, display, table, "226.200.100.101", 1000);   
      logger.start();
      
      TableUpdate  updater=new TableUpdate(log,table,sourceFilter,timestampFilter,severityFilter,collected);
      updater.setMaxLogSize(logger.getMaxSize());
                  
      shell.open();
      while (!shell.isDisposed()) {
         if (!display.readAndDispatch()) {
            display.timerExec(50,updater);
            display.sleep();
         }
      }
      logger.setShouldRun(false);
   }
}
rgallen
 
Posts: 15
Joined: Sun Oct 12, 2003 7:45 pm

Re: 1.2.3 loading 1.2.2 designs

Postby Eric Clayberg » Tue Dec 23, 2003 4:57 pm

rgallen wrote:As with the original poster if I simply delete Designer 1.2.3 (thereby reverting to Designer 1.2.2R then the design tab re-appears. I have flipped back and forth several times, it is 100% repeatable with the following source.

Are there any exceptions in your Eclipse .log file? When you say the "Design" tab does not appear, what do you mean? The tab is there, but it shows no contents (e.g., nothing in the widget tree or canvas), or the tab isn't there at all? If the tab isn't there at all, my guess is that you are simply using the standard Java Editor rather than the SWT Designer Editor.

I was able to open your example without any problems (see below), so I'm not sure what the problem might be on your end. I am hoping that there is some exception recorded that might provide a hint.

Image

If other folks out there could try this example and post their results, it would be appreciated.

BTW, if the "original poster" refers to the person who posted the thread about v1.2.2, that too was a very isolated problem that was resolved quite some time ago. I doubt it would have anything to do with the problem you are experiencing.
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: 1.2.3 loading 1.2.2 designs

Postby rgallen » Tue Dec 23, 2003 5:20 pm

Eric Clayberg wrote:Are there any exceptions in your Eclipse .log file?


No. I deleted the log file, tried to open NLV.java and no file was produced.
(I tried several times to make sure there was no buffering issue etc.).

Eric Clayberg wrote:When you say the "Design" tab does not appear, what do you mean?


The tab does not show up. I am a "double-clicker", so when I open a java source file I double click on its name, and, with 1.2.2 installed NLV.java opens, and I have 2 tabs (source and design) with 1.2.3 I get only the source tab.

Aha, I just tried doing (the very lengthy) right click->open with->SWT Designer Editor, and this works - I would never dream of doing so many mouse strokes :-).

I think this means that Designer stores some metadata about preferences (probably with some eclipse registry), that it does not read from the old Designers metadata registry. It should do this (for settings that existed in the old Designer only of course), however, this is obviously not a serious bug, since it does update that registry as soon as it is opened once via the laborious method.
rgallen
 
Posts: 15
Joined: Sun Oct 12, 2003 7:45 pm

Re: 1.2.3 loading 1.2.2 designs

Postby Eric Clayberg » Tue Dec 23, 2003 7:47 pm

rgallen wrote:I deleted the log file, tried to open NLV.java and no file was produced.

Good. That means that Designer isn't having a problem with the file.

rgallen wrote:The tab does not show up. I am a "double-clicker", so when I open a java source file I double click on its name, and, with 1.2.2 installed NLV.java opens, and I have 2 tabs (source and design) with 1.2.3 I get only the source tab.

If the tab did not show up, that means that you were not using the Designer. You were just using the standard Java Editor.

rgallen wrote:Aha, I just tried doing (the very lengthy) right click->open with->SWT Designer Editor, and this works - I would never dream of doing so many mouse strokes

Switching editor types requires using Open With. Once the editor has been associated with the file, Eclipse will usually keep using that editor (although some times it will inexplicably revert to using the default editor for a file...which in the case of a Java file is the standard Java Editor).

rgallen wrote:I think this means that Designer stores some metadata about preferences (probably with some eclipse registry), that it does not read from the old Designers metadata registry. It should do this (for settings that existed in the old Designer only of course), however, this is obviously not a serious bug, since it does update that registry as soon as it is opened once via the laborious method.

No. That is not how it works. Eclipse itself controls the information about what editor types to associate with each individual file. Eclipse also occassionally forgets, and you need to remind it by using Open With.
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: 1.2.3 loading 1.2.2 designs

Postby rgallen » Tue Dec 23, 2003 9:26 pm

No. That is not how it works. Eclipse itself controls the information about what editor types to associate with each individual file. Eclipse also occassionally forgets, and you need to remind it by using Open With.


I think I know what happened now. When I said I had uninstalled 1.2.2 I wasn't being completely accurate, what I had actually done was install 1.2.3 beside 1.2.2, knowing that Eclipse would enumerate only the newest version of the plugin (which it did as confirmed by Help -> About -> Plugin details); however, it appears that the association "stuck" to the older version of Designer, which is why I needed to inform Eclipse to use the newer version of Designer for the association. I have confirmed this by uninstalling 1.2.2 and then installing 1.2.3 and the association is properly reassigned to 1.2.3.

I apologize for the trouble.

btw: I have never seen Eclipse lose a file association, and I am a heavy user of the CDT (12 hours a day vs. 15 minutes a week with Designer).
rgallen
 
Posts: 15
Joined: Sun Oct 12, 2003 7:45 pm

Re: 1.2.3 loading 1.2.2 designs

Postby Eric Clayberg » Wed Dec 24, 2003 8:53 am

rgallen wrote:I have never seen Eclipse lose a file association, and I am a heavy user of the CDT (12 hours a day vs. 15 minutes a week with Designer).

How often do you assign a non-default editor to a file? For every file type, Eclipse assignes a default editor type. You can change the default editor type for any file type using the Workbench > File Associations preferences. You can override the default on a file-by-file basis by using the Open With command. Any wizard that creates a file can also override the default by opening the file with its own editor after the file is created. This is how the SWT Designer editor is normally associated with a specific Java file. As described in the Designer docs, you can assign the SWT Designer editor to any Java file by using the Open With command. You could also make the Designer the default editor for all Java file via the File Association preferences.

Presumably, the CDT assigns its own editors as the system default editors for C files, so you would have rarely (if ever?) used a non-default editor with a file. In that case, it isn't surprising that you would have never encountered this before. The problem is that Eclipse occassionally will forget what specific editor type is associated with a specific file, and that file will revert to using the system default. Most folks don't even notice this has happened as the system default editor is appropriate in most cases. It isn't even that big an issue when it happens to a Java file that was created with the Designer as it should be fairly obvious that the editor is the standard Java editor and not the Designer editor. Re-opening the file using Open With > SWT Designer Editor takes only a moment, and Eclipse will usually remember that association for quite awhile. I don't know what specific event might cause Eclipse to lose this association, but I suspect that it is more likely to happen any time your overall Eclipse configuration changes (e.g., any time you add, remove or update a plugin).
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