You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by sv...@apache.org on 2005/03/22 03:13:28 UTC

cvs commit: incubator-myfaces/src/components/org/apache/myfaces/custom/htmlEditor HtmlEditor.java HtmlEditorTag.java

svieujot    2005/03/21 18:13:28

  Modified:    tlds     myfaces_ext.tld
               src/components/org/apache/myfaces/custom/htmlEditor
                        HtmlEditor.java HtmlEditorTag.java
  Log:
  htmlEditor : Add a showAllToolBoxes short cut.
  
  Revision  Changes    Path
  1.182     +18 -9     incubator-myfaces/tlds/myfaces_ext.tld
  
  Index: myfaces_ext.tld
  ===================================================================
  RCS file: /home/cvs/incubator-myfaces/tlds/myfaces_ext.tld,v
  retrieving revision 1.181
  retrieving revision 1.182
  diff -u -r1.181 -r1.182
  --- myfaces_ext.tld	21 Mar 2005 12:33:45 -0000	1.181
  +++ myfaces_ext.tld	22 Mar 2005 02:13:28 -0000	1.182
  @@ -968,7 +968,7 @@
               <rtexprvalue>false</rtexprvalue>
               <description>
               	Allows the user to edit the HTML source code.
  -            	default is true.
  +            	Default is true.
               </description>
          	</attribute>
   		<attribute>
  @@ -977,7 +977,7 @@
               <rtexprvalue>false</rtexprvalue>
               <description>
               	Allows the user to insert external links.
  -            	default is true.
  +            	Default is true.
               </description>
          	</attribute>
          	<attribute>
  @@ -986,16 +986,25 @@
               <rtexprvalue>false</rtexprvalue>
               <description>
               	Show the Kupu Logo in the buttons bar.
  -            	default is true.
  +            	Default is true.
               </description>
          	</attribute>
          	<attribute>
  +	        <name>showAllToolBoxes</name>
  +            <required>false</required>
  +            <rtexprvalue>false</rtexprvalue>
  +			<description>
  +            	Shortcut to avoid setting all the showXXToolBox to true.
  +            	Default is false.
  +            </description>
  +        </attribute>
  +       	<attribute>
   	        <name>showPropertiesToolBox</name>
               <required>false</required>
               <rtexprvalue>false</rtexprvalue>
   			<description>
               	Show the Properties tool box next to the text.
  -            	default is false.
  +            	Default is false.
               </description>
           </attribute>
          	<attribute>
  @@ -1004,7 +1013,7 @@
               <rtexprvalue>false</rtexprvalue>
   			<description>
               	Show the Links tool box next to the text.
  -            	default is false.
  +            	Default is false.
               </description>
           </attribute>
          	<attribute>
  @@ -1013,7 +1022,7 @@
               <rtexprvalue>false</rtexprvalue>
   			<description>
               	Show the Images tool box next to the text.
  -            	default is false.
  +            	Default is false.
               </description>
           </attribute>
          	<attribute>
  @@ -1022,7 +1031,7 @@
               <rtexprvalue>false</rtexprvalue>
   			<description>
               	Show the Tables tool box next to the text.
  -            	default is false.
  +            	Default is false.
               </description>
           </attribute>
   		<attribute>
  @@ -1031,7 +1040,7 @@
               <rtexprvalue>false</rtexprvalue>
   			<description>
               	Show the Cleanup Expressions tool box next to the text.
  -            	default is false.
  +            	Default is false.
               </description>
           </attribute>
          	<attribute>
  @@ -1040,7 +1049,7 @@
               <rtexprvalue>false</rtexprvalue>
   			<description>
               	Show the Debug tool box next to the text.
  -            	default is false.
  +            	Default is false.
               </description>
           </attribute>
       </tag>
  
  
  
  1.20      +50 -15    incubator-myfaces/src/components/org/apache/myfaces/custom/htmlEditor/HtmlEditor.java
  
  Index: HtmlEditor.java
  ===================================================================
  RCS file: /home/cvs/incubator-myfaces/src/components/org/apache/myfaces/custom/htmlEditor/HtmlEditor.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- HtmlEditor.java	15 Mar 2005 05:24:03 -0000	1.19
  +++ HtmlEditor.java	22 Mar 2005 02:13:28 -0000	1.20
  @@ -30,6 +30,9 @@
    * @author Sylvain Vieujot (latest modification by $Author$)
    * @version $Revision$ $Date$
    * $Log$
  + * Revision 1.20  2005/03/22 02:13:28  svieujot
  + * htmlEditor : Add a showAllToolBoxes short cut.
  + *
    * Revision 1.19  2005/03/15 05:24:03  svieujot
    * Add a fallback textarea mode to the htmlEditor.
    *
  @@ -104,6 +107,7 @@
       private Boolean _allowExternalLinks;
       private Boolean _addKupuLogo;
       
  +	private Boolean _showAllToolBoxes;
       private Boolean _showPropertiesToolBox;
       private Boolean _showLinksToolBox;
       private Boolean _showImagesToolBox;
  @@ -142,13 +146,14 @@
           
           values[3] = toolBarButtons;
           
  -        Boolean toolBoxes[] = new Boolean[6];
  -        toolBoxes[0] = _showPropertiesToolBox;
  -        toolBoxes[1] = _showLinksToolBox;
  -        toolBoxes[2] = _showImagesToolBox;
  -        toolBoxes[3] = _showTablesToolBox;
  -		toolBoxes[4] = _showCleanupExpressionsToolBox;
  -        toolBoxes[5] = _showDebugToolBox;
  +        Boolean toolBoxes[] = new Boolean[7];
  +		toolBoxes[0] = _showAllToolBoxes;
  +        toolBoxes[1] = _showPropertiesToolBox;
  +        toolBoxes[2] = _showLinksToolBox;
  +        toolBoxes[3] = _showImagesToolBox;
  +        toolBoxes[4] = _showTablesToolBox;
  +		toolBoxes[5] = _showCleanupExpressionsToolBox;
  +        toolBoxes[6] = _showDebugToolBox;
           
           values[4] = toolBoxes;
           
  @@ -173,12 +178,13 @@
           _addKupuLogo = toolBarButtons[2];
           
           Boolean[] toolBoxes = (Boolean[]) values[4];
  -        _showPropertiesToolBox = toolBoxes[0];
  -        _showLinksToolBox = toolBoxes[1];
  -        _showImagesToolBox = toolBoxes[2];
  -        _showTablesToolBox = toolBoxes[3];
  -		_showCleanupExpressionsToolBox = toolBoxes[4];
  -        _showDebugToolBox = toolBoxes[5];
  +		_showAllToolBoxes = toolBoxes[0];
  +        _showPropertiesToolBox = toolBoxes[1];
  +        _showLinksToolBox = toolBoxes[2];
  +        _showImagesToolBox = toolBoxes[3];
  +        _showTablesToolBox = toolBoxes[4];
  +		_showCleanupExpressionsToolBox = toolBoxes[5];
  +        _showDebugToolBox = toolBoxes[6];
       }
       
       public String getStyle(){
  @@ -254,7 +260,20 @@
           this._addKupuLogo = Boolean.valueOf(addKupuLogo);
       }
       
  +	public boolean isShowAllToolBoxes(){
  +   		if (_showAllToolBoxes != null)
  +   		    return _showAllToolBoxes.booleanValue();
  +    	ValueBinding vb = getValueBinding("showAllToolBoxes");
  +    	return vb != null ? ((Boolean)vb.getValue(getFacesContext())).booleanValue() : false;
  +    }
  +    public void setShowAllToolBoxes(boolean showAllToolBoxes){
  +        this._showAllToolBoxes = Boolean.valueOf(showAllToolBoxes);
  +    }
  +	
       public boolean isShowPropertiesToolBox(){
  +		if( isShowAllToolBoxes() )
  +			return true;
  +
      		if (_showPropertiesToolBox != null)
      		    return _showPropertiesToolBox.booleanValue();
       	ValueBinding vb = getValueBinding("showPropertiesToolBox");
  @@ -265,6 +284,9 @@
       }
       
       public boolean isShowLinksToolBox(){
  +		if( isShowAllToolBoxes() )
  +			return true;
  +
      		if (_showLinksToolBox != null)
      		    return _showLinksToolBox.booleanValue();
       	ValueBinding vb = getValueBinding("showLinksToolBox");
  @@ -275,6 +297,9 @@
       }
       
       public boolean isShowImagesToolBox(){
  +		if( isShowAllToolBoxes() )
  +			return true;
  +
      		if (_showImagesToolBox != null)
      		    return _showImagesToolBox.booleanValue();
       	ValueBinding vb = getValueBinding("showImagesToolBox");
  @@ -285,6 +310,9 @@
       }
       
       public boolean isShowTablesToolBox(){
  +		if( isShowAllToolBoxes() )
  +			return true;
  +
      		if (_showTablesToolBox != null)
      		    return _showTablesToolBox.booleanValue();
       	ValueBinding vb = getValueBinding("showTablesToolBox");
  @@ -295,6 +323,9 @@
       }
   	
   	public boolean isShowCleanupExpressionsToolBox(){
  +		if( isShowAllToolBoxes() )
  +			return true;
  +
      		if (_showCleanupExpressionsToolBox != null)
      		    return _showCleanupExpressionsToolBox.booleanValue();
       	ValueBinding vb = getValueBinding("showCleanupExpressionsToolBox");
  @@ -305,6 +336,9 @@
       }
       
       public boolean isShowDebugToolBox(){
  +		if( isShowAllToolBoxes() )
  +			return true;
  +
      		if (_showDebugToolBox != null)
      		    return _showDebugToolBox.booleanValue();
       	ValueBinding vb = getValueBinding("showDebugToolBox");
  @@ -315,7 +349,8 @@
       }
       
       public boolean isShowAnyToolBox(){
  -   		return isShowPropertiesToolBox()
  +   		return isShowAllToolBoxes()
  +   			|| isShowPropertiesToolBox()
      			|| isShowLinksToolBox()
      			|| isShowImagesToolBox()
      			|| isShowTablesToolBox()
  
  
  
  1.16      +14 -3     incubator-myfaces/src/components/org/apache/myfaces/custom/htmlEditor/HtmlEditorTag.java
  
  Index: HtmlEditorTag.java
  ===================================================================
  RCS file: /home/cvs/incubator-myfaces/src/components/org/apache/myfaces/custom/htmlEditor/HtmlEditorTag.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- HtmlEditorTag.java	18 Mar 2005 15:38:15 -0000	1.15
  +++ HtmlEditorTag.java	22 Mar 2005 02:13:28 -0000	1.16
  @@ -25,6 +25,9 @@
    * @author Sylvain Vieujot (latest modification by $Author$)
    * @version $Revision$ $Date$
    * $Log$
  + * Revision 1.16  2005/03/22 02:13:28  svieujot
  + * htmlEditor : Add a showAllToolBoxes short cut.
  + *
    * Revision 1.15  2005/03/18 15:38:15  svieujot
    * Bugfix for weblogic.
    *
  @@ -81,7 +84,8 @@
       private String allowEditSource;
       private String allowExternalLinks;
       private String addKupuLogo;
  -    
  +
  +    private String showAllToolBoxes;
       private String showPropertiesToolBox;
       private String showLinksToolBox;
       private String showImagesToolBox;
  @@ -106,6 +110,8 @@
           allowEditSource=null;
           allowExternalLinks=null;
           addKupuLogo=null;
  +		
  +		showAllToolBoxes=null;
           showPropertiesToolBox=null;
           showLinksToolBox=null;
           showImagesToolBox=null;
  @@ -134,6 +140,7 @@
           setBooleanProperty(component, "allowExternalLinks", allowExternalLinks);
           setBooleanProperty(component, "addKupuLogo", addKupuLogo);
           
  +		setBooleanProperty(component, "showAllToolBoxes", showAllToolBoxes);
           setBooleanProperty(component, "showPropertiesToolBox", showPropertiesToolBox);
           setBooleanProperty(component, "showLinksToolBox", showLinksToolBox);
           setBooleanProperty(component, "showImagesToolBox", showImagesToolBox);
  @@ -185,7 +192,11 @@
       public void setAddKupuLogo(String addKupuLogo){
           this.addKupuLogo = addKupuLogo;
       }
  -    
  +
  +	public void setShowAllToolBoxes(String showAllToolBoxes){
  +        this.showAllToolBoxes = showAllToolBoxes;
  +    }
  +
       public void setShowPropertiesToolBox(String showPropertiesToolBox){
           this.showPropertiesToolBox = showPropertiesToolBox;
       }