Skip to: Site menu | Main content

A Grails-like Rich Internet Framework

MacWidgetsBuilder Print

MacWidgetsBuilder is a Groovy builder for the open source MacWidgets Swing component suite

Description

Mac Widgets for Java are a collection of widgets seen in OS X applications, offered in a Java API. These widgets help Java developers create more Mac-like applications. There usage is not restricted to Mac though, as they will render across platforms. This builder follows the same principles as SwingBuilder and can be combined with other SwingBuilder based builders or used in a standalone fashion.

Download

macwidgetsbuilder-0.2

Installing

Drop macwidgetsbuilder-0.2 into $GROOVY_HOME/lib along with its dependencies

All these dependencies can be downloaded from this directory too.

Warning

MacWidgets and MacWidgetsBuilder require Jdk5 to be installed.

Pre-requisites

Groovy 1.6.0 is the required minimum version to run MacWidgetsBuilder 0.2

It is recommended that you upgrade to the 1.6.x series in order to take advantage of

  • @Bindable and ASTTransformations
  • short binding syntax
  • numerous enhancements made to SwingBuilder and FactoryBuilderSupport

Documentation

These are the nodes currently supported by MacWidgetsBuilder 0.2, they are listed in alphabetic order according the group that contains them. Component groups are a good way to organize nodes, they also serve another purpose when used with Griffon's CompositeBuilder.

Properties

The following table summarizes the properties required by the node factories, there are other properties that can be set on the built nodes, for example all buttons inherit properties from javax.swing.AbstractButton.

MacWidgets            
Node Property Type Default Required Bindable Notes
bottomBar

[TriAreaComponent]
size BottomBarSize BottomBarSize.SMALL  
  locationOnBar int   one of SwingConstants.[LEFT,CENTER,RIGHT] or its literal equivalent. Must be specified on children elements.
  spacer int   Add a spacer to the right. Must be specified on children elements.
componentStatusBar

[ComponentBottomBar]
locationOnBar int   one of SwingConstants.[LEFT,CENTER,RIGHT] or its literal equivalent. Must be specified on children elements.
componentTopBar

[ComponentTopBar]
locationOnBar int   one of SwingConstants.[LEFT,CENTER,RIGHT] or its literal equivalent. Must be specified on children elements.
  spacer int   Add a spacer to the right. Must be specified on children elements.
emphasizedLabel

[JLabel]
text String   may also specify a JLabel or a String as value.
  focusedColor Color   must set two other color properties.
  unfocusedColor Color   must set two other color properties.
  emphasisColor Color   must set two other color properties.
hudWindow

[HudWindow]
          proxies all properties that can be set on a JFrame.
hudLabel

[JLabel]
          nest it inside hudWindow.

must specify a String as value
hudButton

[JButton]
          nest it inside hudWindow.

must specify a String as value
hudTextField

[JTextField]
          nest it inside hudWindow.

must specify a String as value
hudCheckBox

[JcheckBox]
          nest it inside hudWindow.

must specify a String as value
hudComboBox

[JComboBox]
          nest it inside hudWindow.

must specify a List or a ComboBoxModel as value
iappScrollPane

[JSplitPane]
          same as a SwingBuilder.splitPane but with a custom UI.
imageButton

[ImageButton]
url URL    
  file File   can also be a String
  inputStream InputStream    
  resource String    
  class Class   only required if resource is specified.
  mask Icon    
            specify one of url, file, inputStream, resource or use a String as node value.
itunesTable

[JTable]
          same as SwingBuilder.table but with a custom UI.
labeledComponentGroup

[LabeledComponentGroup]
text String   alternatively specify a String as value.
  label String   alias for text
macGradientButton

[JComponent]
url URL    
  file File   can also be a String
  inputStream InputStream    
  resource String    
  class Class   only required if resource is specified.
  icon Icon    
  actionListener ActionListener    
  actionPerformed Closure   alternative to actionListener
            specify one of url, file, inputStream, resource, icon or use a String as node value.
macGradientPopdownButton

[JComponent]
url URL    
  file File   can also be a String
  inputStream InputStream    
  resource String    
  class Class   only required if resource is specified.
  icon Icon    
  popupMenuCustomizer PopupMenuCustomizer    
  customizePopup Closure   alternative to popupMenuCustomizer
            specify one of url, file, inputStream, resource, icon or use a String as node value.
macButtonAddItem16

[JButton]
segmentedPosition String    
macButtonAddItem18

[JButton]
segmentedPosition String    
macButtonRemoveItem16

[JButton]
segmentedPosition String    
macButtonRemoveItem18

[JButton]
segmentedPosition String    
macButtonLock

[JButton]
segmentedPosition String    
macButtonSourceViewNormal

[JToggleButton]
segmentedPosition String    
preferencesTab

[]
url URL    
  file File   can also be a String
  inputStream InputStream    
  resource String    
  class Class   only required if resource is specified.
  icon Icon    
  text String    
  actionListener ActionListener    
  actionPerformed Closure   alternative to actionListener
            specify one of url, file, inputStream, resource, icon or use a String as node value.
preferencesTabBar

[PreferencesTabBar]
unified boolean false  
sourceList

[SourceList]
sourceListCategoryClicked Closure   will promote it to a SourceListClickListener.
  sourceListItemClicked Closure   will promote it to a SourceListClickListener.
  sourceListItemSelected Closure   will promote it to a SourceListClickSelected.
sourceListCategory

[SourceListCategory]
          value must be a String.
sourceListItem

[SourceListItem]
url URL    
  file File   can also be a String
  inputStream InputStream    
  resource String    
  class Class   only required if resource is specified.
  icon Icon    
  text String    
            specify one of url, file, inputStream, resource, icon or use a String as node value.
sourceListControlBar

[SourceListControlBar]
           
sourceListSplitPane

[splitPane]
          requires a sourceList and another component as children.
sourceListContextMenuProvider

[SourceListContextMenuProvider]
listContextMenu Closure   must specify as a child closure. Accepts a popup as arg.
  categoryContextMenu Closure   must specify as a child closure. Accepts popup, category as args.
  itemContextMenu Closure   must specify as a child closure. Accepts popup, item as args.
controlBarButton

[SourceListControlBarButton]
url URL    
  file File   can also be a String
  inputStream InputStream    
  resource String    
  class Class   only required if resource is specified.
  icon Icon    
  actionListener ActionListener    
  actionPerformed Closure   alternative to actionListener
            specify one of url, file, inputStream, resource, icon or use a String as node value.
controlBarPopdownButton

[SourceListControlBarPopdownButton]
url URL    
  file File   can also be a String
  inputStream InputStream    
  resource String    
  class Class   only required if resource is specified.
  icon Icon    
  popupMenuCustomizer PopupMenuCustomizer    
  customizePopup Closure   alternative to popupMenuCustomizer
            specify one of url, file, inputStream, resource, icon or use a String as node value.
spacer

[JLabel]
width int 0  
  height int 0  
unifiedToolBar

[TriAreaComponent]
locationOnBar int   one of SwingConstants.[LEFT,CENTER,RIGHT] or its literal equivalent. Must be specified on children elements.
  spacer int   Add a spacer to the right. Must be specified on children elements.
preferencesBarButton

[AbstractButton]
url URL    
  file File   can also be a String
  inputStream InputStream    
  resource String    
  class Class   only required if resource is specified.
  icon Icon    
  button AbstractButton    
  actionListener ActionListener    
  actionPerformed Closure   alternative to actionListener
            specify one of url, file, inputStream, resource, icon, button or use a String as node value.
unifiedToolBarButton

[AbstractButton]
url URL    
  file File   can also be a String
  inputStream InputStream    
  resource String    
  class Class   only required if resource is specified.
  icon Icon    
  button AbstractButton    
  actionListener ActionListener    
  actionPerformed Closure   alternative to actionListener
            specify one of url, file, inputStream, resource, icon, button or use a String as node value.
Additional properties on Window/JFrame

The following properties are now enabled to every Window/JFrame

installRepaintListener boolean useful for SourceLists and ITunesTable to properly update their visible state.
makeLeopardStyle boolean make your JFrame look native.

Developers

Andres Almiray

Building

MacWidgetsBuilder uses Ant as its build tool, which means that if you want to

build your own version of MacWidgetsBuilder from source you'll need to have it

installed. Follow the instructions at http://ant.apache.org

Contributing

Please contact the Griffon team members by e-mail.