Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Visual Editor (VE) » VE code pattern question
VE code pattern question [message #610734] Mon, 12 September 2005 14:28
Greg Renegar is currently offline Greg RenegarFriend
Messages: 18
Registered: July 2009
Junior Member
Hi, I am trying to use VE for swing UI and have a problem as follows..

I have a JToolbar that adds a JButton. (see code below) This will render
perfectly in VE design view. However, if I uncomment the
'//addStaffCommand.setCaller(this);' line I get buggy rendering and the
following warning:

java.lang.IllegalArgumentException( ...AddStaffCommand.setCaller
( ...StaffInternalFrame): "argument type mismatch")

I know for a fact that this is NOT an argument type mismatch as
parameter is of type StaffInternalFrame in caller and receiver.

Also, I gather that one must always use empty constructors, then set
fields after object creation.

Sorry if this is dumb question, I an new to VE. Also, is there a
resource (other than this newsgroup) for information about coding for VE
compliance? So far it is trial and error method and very frustrating.


private JButton getAddButton() {
if (addButton == null) {
addButton = new JButton();
addButton.setAction(getAddAction());
if (addButton.getIcon() != null) {
addButton.setText(""); //an icon-only button
}
}
return addButton;
}

private AddAction getAddAction() {
if (addStaffAction == null) {
addStaffAction = new AddAction(); // a class that extends
AbstractAction
addStaffAction.setCommand(getAddStaffCommand());
}
return addStaffAction;
}

private AddStaffCommand getAddStaffCommand() {
if (addStaffCommand == null) {
if ( !java.beans.Beans.isDesignTime() ) {
addStaffCommand = new AddStaffCommand();
//addStaffCommand.setCaller(this);
}
}
return addStaffCommand;
}

Many thanks,
Greg
Previous Topic:Small error?
Next Topic:Details of "Parse Error"
Goto Forum:
  


Current Time: Fri Apr 19 22:44:31 GMT 2024

Powered by FUDForum. Page generated in 0.03333 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top