I've been happily zooming along in my development of a module using Designer. At some point yesterday afternoon, I started hand coding some stuff. That just seemed faster. I probably stopped using Designer at some point and had integrated the module with my application. So I did not notice when that module stopped working with Designer.
Specifically, when I open an editor on that module in Eclipse, Designer's Source and Design tabs are absent.
I went back as far as my Eclipse local history could go, about 4pm yesterday afternoon. I sure think I was using the designer on that module at that time, but possibly not. Anyway, still not recognized as a Designer module.
I didn't think I hacked it up that badly. What are the major things to watch out for in hand editing a Designer module?
One particular thing I am curious about. Designer seemed to place a certain hunk of code in a block, i.e. surrounded by a pair of braces. Is there a rule about that? Why, when, where?
So below is the module, in its non-working-with-Designer state. It has no Java errors, and does work in my application.
Thanks,
Tom
- Code: Select all
package com.mps.radrecruit.client;
import org.gwtwidgets.client.ui.ImageButton;
import org.gwtwidgets.client.ui.ImageButtonFactory;
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
import com.google.gwt.user.client.ui.HasVerticalAlignment;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.MenuBar;
import com.google.gwt.user.client.ui.MenuItem;
import com.google.gwt.user.client.ui.SimplePanel;
import com.google.gwt.user.client.ui.VerticalPanel;
public class Header extends Composite
{
public Header()
{
final VerticalPanel header;
final HorizontalPanel menuRow;
final Image image;
final VerticalPanel menuRowContainer;
final HTML html;
final MenuBar menuBar;
final MenuBar viewMenu;
final MenuBar fileMenu;
final MenuBar recordsMenu;
final MenuBar helpMenu;
final HorizontalPanel buttonRow;
final SimplePanel spacerPanel;
final SimplePanel spacerPanel2;
final ImageButton buttonNew;
final ImageButton buttonDup;
final ImageButton buttonDel;
final HorizontalPanel buttonGroup;
header = new VerticalPanel();
initWidget(header);
header.setStyleName("gwt-nostyle-bkclr");
menuRowContainer = new VerticalPanel();
header.add(menuRowContainer);
menuRow = new HorizontalPanel();
menuRowContainer.add(menuRow);
menuRow.setSize("970", "26");
menuRow.setStyleName("gwt-nostyle-bkclr");
image = new Image();
menuRow.add(image);
menuRow.setCellHorizontalAlignment(image, HasHorizontalAlignment.ALIGN_CENTER);
image.setStyleName("gwt-nostyle");
menuRow.setCellWidth(image, "36");
image.setUrl("img/green_cube.png");
{
fileMenu = new MenuBar(true);
MenuItem changePassword = new MenuItem("Change Password", (Command) null);
fileMenu.addItem(changePassword);
fileMenu.addItem("<hr>", true, (Command) null);
MenuItem logout = new MenuItem("Log Out", (Command) null);
fileMenu.addItem(logout);
viewMenu = new MenuBar(true);
MenuItem browseMode = new MenuItem("Browse Mode", (Command) null);
// MenuItem browseMode = new MenuItem("Browse Mode",
// setBrowseModeCmd);
viewMenu.addItem(browseMode);
Command setFindModeCmd = new Command()
{
public void execute()
{
// setFindMode();
}
};
MenuItem findMode = new MenuItem("Find Mode", setFindModeCmd);
viewMenu.addItem(findMode);
recordsMenu = new MenuBar(true);
Command createNewRecordCmd = new Command()
{
public void execute()
{
// createNewRecord();
}
};
MenuItem newRecord = new MenuItem("New Record", createNewRecordCmd);
recordsMenu.addItem(newRecord);
MenuItem dupRecord = new MenuItem("Duplicate Record", (Command) null);
recordsMenu.addItem(dupRecord);
Command deleteRecordCmd = new Command()
{
public void execute()
{
// if (Window.confirm("Delete this record?"))
// deleteRecord();
}
};
MenuItem deleteRecord = new MenuItem("Delete Record", deleteRecordCmd);
recordsMenu.addItem(deleteRecord);
recordsMenu.addItem("<hr>", true, (Command) null);
MenuItem deleteFoundRecords = new MenuItem("Delete Found Records", (Command) null);
recordsMenu.addItem(deleteFoundRecords);
recordsMenu.addItem("<hr>", true, (Command) null);
helpMenu = new MenuBar(true);
MenuItem helpItem = new MenuItem("Help", (Command) null);
helpMenu.addItem(helpItem);
helpMenu.addItem("<hr>", true, (Command) null);
MenuItem about = new MenuItem("About", (Command) null);
helpMenu.addItem(about);
menuBar = new MenuBar();
menuRow.add(menuBar);
MenuItem file = new MenuItem("File", fileMenu);
file.setWidth("40px");
menuBar.addItem(file);
MenuItem view = new MenuItem("View", viewMenu);
view.setWidth("50px");
menuBar.addItem(view);
MenuItem records = new MenuItem("Records", recordsMenu);
records.setWidth("60px");
menuBar.addItem(records);
MenuItem help = new MenuItem("Help", helpMenu);
help.setWidth("40px");
menuBar.addItem(help);
}
html = new HTML("<hr>");
menuRowContainer.add(html);
buttonRow = new HorizontalPanel();
buttonRow.setBorderWidth(0);
buttonRow.setHeight("66px");
buttonRow.setVerticalAlignment(HasVerticalAlignment.ALIGN_TOP);
buttonRow.setSize("100%", "100%");
spacerPanel = new SimplePanel();
spacerPanel2 = new SimplePanel();
spacerPanel.setWidth("20px");
spacerPanel2.setWidth("10px");
buttonRow.add(spacerPanel);
buttonRow.setCellHorizontalAlignment(spacerPanel, HasHorizontalAlignment.ALIGN_LEFT);
// buttonRow.setSpacing(0);
header.setCellVerticalAlignment(buttonRow, HasVerticalAlignment.ALIGN_MIDDLE);
header.add(buttonRow);
header.setCellHeight(buttonRow, "38px");
buttonNew = new ImageButtonFactory().createImageButton("img/rolo-new.png", 44, 32);
buttonRow.add(buttonNew);
buttonRow.setCellHorizontalAlignment(buttonNew, HasHorizontalAlignment.ALIGN_LEFT);
buttonDup = new ImageButtonFactory().createImageButton("img/rolo-dup.png", 44, 32);
buttonRow.add(buttonDup);
buttonRow.setCellHorizontalAlignment(buttonDup, HasHorizontalAlignment.ALIGN_LEFT);
buttonDel = new ImageButtonFactory().createImageButton("img/rolo-delete.png", 44, 32);
buttonRow.add(buttonDel);
buttonRow.setCellHorizontalAlignment(buttonDel, HasHorizontalAlignment.ALIGN_LEFT);
buttonRow.add(spacerPanel2);
buttonGroup = new HorizontalPanel();
buttonRow.add(buttonGroup);
buttonGroup.setSize("200px", "100%");
buttonGroup.add(buttonNew);
buttonGroup.add(buttonDup);
buttonGroup.add(buttonDel);
// buttonRow.setCellWidth(buttonDel, "5");
// buttonRow.setCellWidth(buttonNew, "5");
// buttonRow.setCellWidth(buttonDup, "5");
}
}