Use ownButtonGroup class

Swing Designer allows you to quickly create the frames, panels, dialogs, applets and other UI elements that comprise Java Swing applications.

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

Use ownButtonGroup class

Postby mkornatzki » Fri Nov 06, 2009 6:28 am

Hi,

is it possible to configure the use of the buttonGroupClass or better if i right click on buttons and use SetButtonGroup that i can select one of the "configured" ButtonGroupClasses?

I have made a new ButtonGroupClass for JToggleButtons so that i can deselect the buttons.
If i want use the ButtonGroupClass then i have to do it in sourcecode and can not assign it with the designer.

regrads,
michael
mkornatzki
 
Posts: 121
Joined: Wed Oct 15, 2008 3:57 am

Re: Use ownButtonGroup class

Postby Konstantin.Scheglov » Mon Nov 09, 2009 6:51 am

Can you describe YourButtonGroup?
Is it subclass of standard ButtonGroup?
Can you send source?

If it is, then you should see its existing instances in "Set ButtonGroup" menu.
If no, you can try to create wbp-component.xml for it and use
<model class="com.instantiations.designer.swing.model.bean.ButtonGroupInfo"/>
to force Designer use known model, so again show it.
Konstantin.Scheglov
Moderator
 
Posts: 186
Joined: Tue Oct 18, 2005 8:11 pm
Location: Russian Federation, Lipetsk

Re: Use ownButtonGroup class

Postby mkornatzki » Mon Nov 09, 2009 7:06 am

Hi,

yes, it is a subclass of standard ButtonGroup.
Code: Select all
public class ExtButtonGroup
   extends ButtonGroup {

   private PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(this);

   /**
    * {@inheritDoc}
    */
   @Override
   public void setSelected(ButtonModel newM, boolean newB) {
      ButtonModel oldSelection = getSelection();
      super.setSelected(newM, newB);

      if (!newB && (oldSelection == newM)) {
         clearSelection();
         propertyChangeSupport.firePropertyChange("clearSelection", oldSelection, null); //$NON-NLS-1$
      }
   }

   public void addPropertyChangeListener(PropertyChangeListener propertyChangeListener) {
      propertyChangeSupport.addPropertyChangeListener(propertyChangeListener);
   }

   public void removePropertyChangeListener(PropertyChangeListener propertyChangeListener) {
      propertyChangeSupport.removePropertyChangeListener(propertyChangeListener);
   }
}

I made now a wbp-component.xml but it didn't show me the buttonGroup. The SwingDesigner didn't show any Group although there is one.
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<component xmlns="http://www.instantiations.com/D2/WBPComponent">
   <model class="com.instantiations.designer.swing.model.bean.ButtonGroupInfo"/>
</component>
mkornatzki
 
Posts: 121
Joined: Wed Oct 15, 2008 3:57 am

Re: Use ownButtonGroup class

Postby Eric Clayberg » Mon Nov 09, 2009 1:38 pm

Subclasses of ButtonGroup should work in the latest Swing Designer v7.2 build.
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: Use ownButtonGroup class

Postby mkornatzki » Mon Nov 09, 2009 11:42 pm

thank you.

i can see my buttongroup now if i make an instance manually in sourcecode and then i can select this buttongroup in the "Set Button Group" menu.
Is it possible that i can choose between some more configured Buttongroups without doing the manually sourcecode way?
Somethng like "Set ButtonGroup" - "new..." and then choose a button group class?

regards,
michael
mkornatzki
 
Posts: 121
Joined: Wed Oct 15, 2008 3:57 am

Re: Use ownButtonGroup class

Postby Eric Clayberg » Tue Nov 10, 2009 5:47 pm

mkornatzki wrote:Is it possible that i can choose between some more configured Buttongroups without doing the manually sourcecode way?
Somethng like "Set ButtonGroup" - "new..." and then choose a button group class?

We have added this option to the latest build.
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 Swing Designer

Who is online

Users browsing this forum: No registered users and 1 guest