tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hls...@apache.org
Subject cvs commit: jakarta-tapestry/contrib/src/net/sf/tapestry/contrib/inspector Inspector.html ViewTabs.html ViewTabs.java Inspector.page ViewTabs.jwc Inspector.java
Date Wed, 19 Feb 2003 23:23:35 GMT
hlship      2003/02/19 15:23:35

  Modified:    contrib/src/net/sf/tapestry/contrib/valid
                        ValidatingTextField.java NumericField.java
                        DateField.java
               contrib/src/net/sf/tapestry/contrib/inspector Inspector.html
                        ViewTabs.html ViewTabs.java Inspector.page
                        ViewTabs.jwc Inspector.java
  Log:
  Have the component class enhancer create a binding property for each formal parameter.
  Update many comonents to use abstract binding properties.
  
  Revision  Changes    Path
  1.7       +2 -2      jakarta-tapestry/contrib/src/net/sf/tapestry/contrib/valid/ValidatingTextField.java
  
  Index: ValidatingTextField.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/contrib/src/net/sf/tapestry/contrib/valid/ValidatingTextField.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ValidatingTextField.java	13 Jan 2003 03:33:50 -0000	1.6
  +++ ValidatingTextField.java	19 Feb 2003 23:23:33 -0000	1.7
  @@ -129,7 +129,7 @@
    * 
    **/
   
  -public class ValidatingTextField extends ValidField
  +public abstract class ValidatingTextField extends ValidField
   {
       private IBinding minimumLengthBinding;
       private IBinding requiredBinding;
  
  
  
  1.7       +2 -2      jakarta-tapestry/contrib/src/net/sf/tapestry/contrib/valid/NumericField.java
  
  Index: NumericField.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/contrib/src/net/sf/tapestry/contrib/valid/NumericField.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- NumericField.java	13 Jan 2003 03:33:50 -0000	1.6
  +++ NumericField.java	19 Feb 2003 23:23:33 -0000	1.7
  @@ -143,7 +143,7 @@
    *
    **/
   
  -public class NumericField extends ValidField
  +public abstract class NumericField extends ValidField
   {
       private IBinding minimumBinding;
       private IBinding maximumBinding;
  
  
  
  1.9       +2 -2      jakarta-tapestry/contrib/src/net/sf/tapestry/contrib/valid/DateField.java
  
  Index: DateField.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/contrib/src/net/sf/tapestry/contrib/valid/DateField.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- DateField.java	13 Jan 2003 03:33:51 -0000	1.8
  +++ DateField.java	19 Feb 2003 23:23:33 -0000	1.9
  @@ -155,7 +155,7 @@
    * 
    **/
   
  -public class DateField extends ValidField
  +public abstract class DateField extends ValidField
   {
       private IBinding minimumBinding;
       private IBinding maximumBinding;
  
  
  
  1.3       +14 -14    jakarta-tapestry/contrib/src/net/sf/tapestry/contrib/inspector/Inspector.html
  
  Index: Inspector.html
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/contrib/src/net/sf/tapestry/contrib/inspector/Inspector.html,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Inspector.html	17 Jan 2003 17:40:54 -0000	1.2
  +++ Inspector.html	19 Feb 2003 23:23:34 -0000	1.3
  @@ -1,30 +1,30 @@
   <!-- $Id$ -->
  -<span jwcid="shell">
  -<body jwcid="body">
  +<span jwcid="@Shell" title="[[ inspectorTitle ]]" stylesheet="[[ assets.stylesheet ]]">
  +<body jwcid="@Body">
   
  -<span jwcid="selector">
  +<span jwcid="@inspector:Selector">
   
  -<span jwcid="viewTabs">
  +<span jwcid="@inspector:ViewTabs">
   
  -<span jwcid="renderBlockForView"/>
  +<span jwcid="@RenderBlock" block="[[ blockForView ]]"/>
   
   </span>
   </span>
   
  -<span jwcid="specificationBlock">
  -<span jwcid="showSpecification"/>
  +<span jwcid="specificationBlock@Block">
  +<span jwcid="@inspector:ShowSpecification"/>
   </span>
   
  -<span jwcid="templateBlock">
  -<span jwcid="showTemplate"/>
  +<span jwcid="templateBlock@Block">
  +<span jwcid="@inspector:ShowTemplate"/>
   </span>
   
  -<span jwcid="propertiesBlock">
  -<span jwcid="showProperties"/>
  +<span jwcid="propertiesBlock@Block">
  +<span jwcid="@inspector:ShowProperties"/>
   </span>
   
  -<span jwcid="engineBlock">
  -<span jwcid="showEngine"/>
  +<span jwcid="engineBlock@Block">
  +<span jwcid="@inspector:ShowEngine"/>
   </span>
   
   </body>
  
  
  
  1.3       +7 -5      jakarta-tapestry/contrib/src/net/sf/tapestry/contrib/inspector/ViewTabs.html
  
  Index: ViewTabs.html
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/contrib/src/net/sf/tapestry/contrib/inspector/ViewTabs.html,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ViewTabs.html	17 Jan 2003 17:40:55 -0000	1.2
  +++ ViewTabs.html	19 Feb 2003 23:23:34 -0000	1.3
  @@ -3,16 +3,18 @@
   <table border=0 cellpadding=0 cellspacing=2>
   	<tr>
   		<td>
  -<span jwcid="e">
  -			<a jwcid="select"><img jwcid="tab" width="120" height="19"/></a>
  +<span jwcid="@Foreach" source="[[ views ]]" value="[[ view ]]">
  +			<a jwcid="select@ActionLink" listener="[[ listeners.selectTab ]]"><img 
  +				jwcid="@Rollover" image="[[ viewImage ]]" focus="[[ focusImage ]]"
  +				width="120" height="19"/></a>
   </span>
   		</td>
   	</tr>
   	<tr>
  -		<td><span jwcid="banner"/></td>
  +		<td><img jwcid="@Image" image="[[ bannerImage ]]"/></td>
   	</tr>
   	<tr>
  -		<td><span jwcid="renderBody"/></td>
  +		<td><span jwcid="@RenderBody"/></td>
   	</tr>
   </table>
   
  
  
  
  1.3       +18 -40    jakarta-tapestry/contrib/src/net/sf/tapestry/contrib/inspector/ViewTabs.java
  
  Index: ViewTabs.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/contrib/src/net/sf/tapestry/contrib/inspector/ViewTabs.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ViewTabs.java	17 Jan 2003 17:40:55 -0000	1.2
  +++ ViewTabs.java	19 Feb 2003 23:23:34 -0000	1.3
  @@ -67,48 +67,32 @@
    *
    **/
   
  -public class ViewTabs extends BaseComponent
  +public abstract class ViewTabs extends BaseComponent
   {
  -    private static View[] views =
  +    private static View[] _views =
           {
               View.SPECIFICATION,
               View.TEMPLATE,
               View.PROPERTIES,
               View.ENGINE };
   
  -    private View view;
  -
  -    public View[] getViews()
  +     public View[] getViews()
       {
  -        return views;
  +        return _views;
       }
   
  -    public void setView(View value)
  -    {
  -        view = value;
  -    }
  +    public abstract void setView(View value);
   
  -    // We don't worry about cleaning this up at the end of the request cycle
  -    // because the value is an Enum, a singleton that would stay in memory
  -    // anyway.
  -
  -    public View getView()
  -    {
  -        return view;
  -    }
  +    public abstract View getView();
   
       private IAsset getImageForView(boolean focus)
       {
  -        StringBuffer buffer;
  -        Inspector inspector;
  -        boolean selected;
  -        String key;
  -
  -        inspector = (Inspector) getPage();
  +        Inspector inspector = (Inspector) getPage();
  +		View view = getView();
  +		
  +        boolean selected = (view == inspector.getView());
   
  -        selected = (view == inspector.getView());
  -
  -        buffer = new StringBuffer(view.getName());
  +        StringBuffer buffer = new StringBuffer(view.getName());
   
           if (selected)
               buffer.append("_selected");
  @@ -116,7 +100,7 @@
           if (focus)
               buffer.append("_focus");
   
  -        key = buffer.toString();
  +        String key = buffer.toString();
   
           return (IAsset) getAssets().get(key);
       }
  @@ -133,22 +117,16 @@
   
       public IAsset getBannerImage()
       {
  -        Inspector inspector;
  -        View selectedView;
  -        String key;
  -
  -        inspector = (Inspector) getPage();
  -        selectedView = inspector.getView();
  -        key = selectedView.getName() + "_banner";
  +         Inspector inspector = (Inspector) getPage();
  +        View selectedView = inspector.getView();
  +        String key = selectedView.getName() + "_banner";
   
           return (IAsset) getAssets().get(key);
       }
   
       public void selectTab(IRequestCycle cycle)
       {
  -        Inspector inspector;
  -
  -        inspector = (Inspector) getPage();
  -        inspector.setView(view);
  +        Inspector inspector = (Inspector) getPage();
  +        inspector.setView(getView());
       }
   }
  
  
  
  1.4       +7 -32     jakarta-tapestry/contrib/src/net/sf/tapestry/contrib/inspector/Inspector.page
  
  Index: Inspector.page
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/contrib/src/net/sf/tapestry/contrib/inspector/Inspector.page,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Inspector.page	26 Jan 2003 02:59:21 -0000	1.3
  +++ Inspector.page	19 Feb 2003 23:23:34 -0000	1.4
  @@ -6,37 +6,12 @@
   	
   <page-specification class="net.sf.tapestry.contrib.inspector.Inspector">
   
  -  <component id="shell" type="Shell">
  -    <binding name="title" expression="inspectorTitle"/>
  -    <binding name="stylesheet" expression="assets.stylesheet"/>
  -  </component>
  -
  -  <component id="body" type="Body"/>
  -
  -  <component id="selector" type="inspector:Selector"/>
  -
  -  <component id="viewTabs" type="inspector:ViewTabs"/>
  -
  -  <component id="renderBlockForView" type="RenderBlock">
  -    <binding name="block" expression="blockForView"/>
  -  </component>
  -
  -  <component id="specificationBlock" type="Block"/>
  -
  -  <component id="showSpecification" type="inspector:ShowSpecification"/>
  -
  -  <component id="templateBlock" type="Block"/>
  -
  -  <component id="showTemplate" type="inspector:ShowTemplate"/>
  -
  -  <component id="propertiesBlock" type="Block"/>
  -
  -  <component id="showProperties" type="inspector:ShowProperties"/>
  -
  -  <component id="engineBlock" type="Block"/>
  -
  -  <component id="showEngine" type="inspector:ShowEngine"/>
  -
  +  <property-specification name="view" type="net.sf.tapestry.contrib.inspector.View"
  +  		persistent="yes"
  +  		initial-value="@net.sf.tapestry.contrib.inspector.View@SPECIFICATION"/>
  +  <property-specification name="inspectedPageName" type="java.lang.String" persistent="yes"/>
  +  <property-specification name="inspectedIdPath" type="java.lang.String" persistent="yes"/>
  +  
     <private-asset name="stylesheet" resource-path="Inspector.css"/>
   
   </page-specification>
  
  
  
  1.4       +2 -20     jakarta-tapestry/contrib/src/net/sf/tapestry/contrib/inspector/ViewTabs.jwc
  
  Index: ViewTabs.jwc
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/contrib/src/net/sf/tapestry/contrib/inspector/ViewTabs.jwc,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ViewTabs.jwc	26 Jan 2003 02:59:21 -0000	1.3
  +++ ViewTabs.jwc	19 Feb 2003 23:23:34 -0000	1.4
  @@ -5,26 +5,8 @@
     "http://jakarta.apache.org/tapestry/dtd/Tapestry_1_4.dtd">
   	
   <component-specification class="net.sf.tapestry.contrib.inspector.ViewTabs">
  -
  -  <component id="e" type="Foreach">
  -    <binding name="source" expression="views"/>
  -    <binding name="value" expression="view"/>
  -  </component>
     
  -  <component id="select" type="ActionLink">
  -    <binding name="listener" expression="listeners.selectTab"/>
  -  </component>
  -  
  -  <component id="tab" type="Rollover">
  -    <binding name="image" expression="viewImage"/>
  -    <binding name="focus" expression="focusImage"/>
  -  </component>
  -  
  -  <component id="banner" type="Image">
  -    <binding name="image" expression="bannerImage"/>
  -  </component>
  -  
  -  <component id="renderBody" type="RenderBody"/>
  +  <property-specification name="view" type="net.sf.tapestry.contrib.inspector.View"/>
     
     <private-asset name="SPECIFICATION" resource-path="Specification_Np1.gif"/>
     <private-asset name="SPECIFICATION_selected" resource-path="Specification_Hp3.gif"/>
  
  
  
  1.3       +14 -55    jakarta-tapestry/contrib/src/net/sf/tapestry/contrib/inspector/Inspector.java
  
  Index: Inspector.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/contrib/src/net/sf/tapestry/contrib/inspector/Inspector.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Inspector.java	17 Jan 2003 17:40:54 -0000	1.2
  +++ Inspector.java	19 Feb 2003 23:23:34 -0000	1.3
  @@ -70,70 +70,29 @@
    *  @version $Id$
    **/
   
  -public class Inspector extends BasePage
  +public abstract class Inspector extends BasePage
   {
  -    private View _view = View.SPECIFICATION;
  -    private String _inspectedPageName;
  -    private String _inspectedIdPath;
  +    private Map _blocks = new HashMap();
   
  -    private static final int MAP_SIZE = 7;
  -
  -    private Map _blocks;
  -
  -    public void detach()
  -    {
  -        _view = View.SPECIFICATION;
  -        _inspectedPageName = null;
  -        _inspectedIdPath = null;
  -
  -        super.detach();
  -    }
  -
  -    public void finishLoad()
  +    protected void finishLoad()
       {
  -        _blocks = new HashMap(MAP_SIZE);
  -
           _blocks.put(View.TEMPLATE, getComponent("templateBlock"));
           _blocks.put(View.SPECIFICATION, getComponent("specificationBlock"));
           _blocks.put(View.ENGINE, getComponent("engineBlock"));
           _blocks.put(View.PROPERTIES, getComponent("propertiesBlock"));
       }
   
  -    public View getView()
  -    {
  -        return _view;
  -    }
  +    public abstract View getView();
   
  -    public void setView(View value)
  -    {
  -        _view = value;
  +    public abstract void setView(View value);
   
  -        fireObservedChange("view", value);
  -    }
  +    public abstract String getInspectedPageName();
  +    
  +    public abstract void setInspectedPageName(String value);
   
  -    public String getInspectedPageName()
  -    {
  -        return _inspectedPageName;
  -    }
  -
  -    public void setInspectedPageName(String value)
  -    {
  -        _inspectedPageName = value;
  +    public abstract String getInspectedIdPath();
   
  -        fireObservedChange("inspectedPageName", value);
  -    }
  -
  -    public String getInspectedIdPath()
  -    {
  -        return _inspectedIdPath;
  -    }
  -
  -    public void setInspectedIdPath(String value)
  -    {
  -        _inspectedIdPath = value;
  -
  -        fireObservedChange("inspectedIdPath", value);
  -    }
  +    public abstract void setInspectedIdPath(String value);
   
       /** 
        *  Invoked to change the component being inspected within the current
  @@ -195,7 +154,7 @@
   
       public IPage getInspectedPage()
       {
  -        return getRequestCycle().getPage(_inspectedPageName);
  +        return getRequestCycle().getPage(getInspectedPageName());
       }
   
       /**
  @@ -206,7 +165,7 @@
   
       public IComponent getInspectedComponent()
       {
  -        return getInspectedPage().getNestedComponent(_inspectedIdPath);
  +        return getInspectedPage().getNestedComponent(getInspectedIdPath());
       }
   
       public String getInspectorTitle()
  @@ -221,6 +180,6 @@
   
       public Block getBlockForView()
       {
  -        return (Block) _blocks.get(_view);
  +        return (Block) _blocks.get(getView());
       }
   }
  
  
  

Mime
View raw message