commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject cvs commit: jakarta-commons/jelly/jelly-tags/swt/src/java/org/apache/commons/jelly/tags/swt SwtTagLibrary.java
Date Sun, 05 Sep 2004 15:40:38 GMT
dion        2004/09/05 08:40:38

  Modified:    jelly/jelly-tags/swt/src/java/org/apache/commons/jelly/tags/swt
                        SwtTagLibrary.java
  Log:
  Jelly-48
  
  Revision  Changes    Path
  1.13      +33 -4     jakarta-commons/jelly/jelly-tags/swt/src/java/org/apache/commons/jelly/tags/swt/SwtTagLibrary.java
  
  Index: SwtTagLibrary.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/jelly/jelly-tags/swt/src/java/org/apache/commons/jelly/tags/swt/SwtTagLibrary.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- SwtTagLibrary.java	5 Sep 2004 15:32:54 -0000	1.12
  +++ SwtTagLibrary.java	5 Sep 2004 15:40:38 -0000	1.13
  @@ -38,11 +38,15 @@
   import org.eclipse.swt.widgets.Button;
   import org.eclipse.swt.widgets.Canvas;
   import org.eclipse.swt.widgets.Caret;
  +import org.eclipse.swt.widgets.ColorDialog;
   import org.eclipse.swt.widgets.Combo;
   import org.eclipse.swt.widgets.Composite;
   import org.eclipse.swt.widgets.CoolBar;
   import org.eclipse.swt.widgets.CoolItem;
   import org.eclipse.swt.widgets.Decorations;
  +import org.eclipse.swt.widgets.DirectoryDialog;
  +import org.eclipse.swt.widgets.FileDialog;
  +import org.eclipse.swt.widgets.FontDialog;
   import org.eclipse.swt.widgets.Group;
   import org.eclipse.swt.widgets.Label;
   import org.eclipse.swt.widgets.List;
  @@ -133,10 +137,10 @@
           registerLayoutDataTag( "rowData", RowData.class );
   
           // dialogs        
  -        //registerWidgetTag( "colorDialog", ColorDialog.class );
  -        //registerWidgetTag( "directoryDialog", DirectoryDialog.class );
  -        //registerWidgetTag( "fileDialog", FileDialog.class );
  -        //registerWidgetTag( "fontDialog", FontDialog.class );
  +		registerDialogTag( "colorDialog", ColorDialog.class );
  +		registerDialogTag( "directoryDialog", DirectoryDialog.class );
  +		registerDialogTag( "fileDialog", FileDialog.class );
  +		registerDialogTag( "fontDialog", FontDialog.class );
           
           // events
           registerTag("onEvent", OnEventTag.class);
  @@ -210,6 +214,31 @@
               }
           );
       }
  +   
  +	/**
  +	 * Register a registerDialogTag tag for the given name
  +	 */
  +	protected void registerDialogTag(String name, Class widgetClass) {
  +		registerDialogTag(name, widgetClass, SWT.NULL);
  +	}
  +	 
  +	/**
  +	   * Register a dialog tag for the given name
  +	   */
  +	protected void registerDialogTag(String name, final Class widgetClass, final int style)
{
  +		  registerTagFactory(
  +			  name,
  +			  new TagFactory() {
  +				  /**
  +				   * @see org.apache.commons.jelly.impl.TagFactory#createTag(java.lang.String, org.xml.sax.Attributes)
  +				   */
  +				  public Tag createTag(String name, Attributes attributes)
  +					  throws JellyException {
  +					  return new DialogTag(widgetClass, style);
  +				  }
  +			  }
  +		  );
  +	  }
   
       /**
        * Register a menu tag for the given name and style
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message