click-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From take...@apache.org
Subject svn commit: r950140 - in /click/trunk/tools/eclipse/org.apache.click.eclipse: ./ click-2.2.0/ src/org/apache/click/eclipse/ src/org/apache/click/eclipse/core/builder/ src/org/apache/click/eclipse/core/validator/ src/org/apache/click/eclipse/ui/editor/ ...
Date Tue, 01 Jun 2010 16:08:19 GMT
Author: takezoe
Date: Tue Jun  1 16:08:18 2010
New Revision: 950140

URL: http://svn.apache.org/viewvc?rev=950140&view=rev
Log:
Upgrade Click to 2.2.0.

Added:
    click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/attrs/PageInterceptorAttributeEditor.java
  (with props)
    click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/forms/ClickInterceptorEditor.java
  (with props)
Modified:
    click/trunk/tools/eclipse/org.apache.click.eclipse/click-2.2.0/click.xml
    click/trunk/tools/eclipse/org.apache.click.eclipse/plugin.xml
    click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ClickPlugin.java
    click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ClickPlugin.properties
    click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ClickPlugin_ja.properties
    click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/core/builder/ClickXMLValidator.java
    click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/core/validator/validation.properties
    click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/core/validator/validation_ja.properties
    click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/ClickEditor.java
    click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/attrs/AttributeEditorUtils.java

Modified: click/trunk/tools/eclipse/org.apache.click.eclipse/click-2.2.0/click.xml
URL: http://svn.apache.org/viewvc/click/trunk/tools/eclipse/org.apache.click.eclipse/click-2.2.0/click.xml?rev=950140&r1=950139&r2=950140&view=diff
==============================================================================
--- click/trunk/tools/eclipse/org.apache.click.eclipse/click-2.2.0/click.xml (original)
+++ click/trunk/tools/eclipse/org.apache.click.eclipse/click-2.2.0/click.xml Tue Jun  1 16:08:18
2010
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<?xml version="1.0" encoding="UTF-8"?>
 <!--
    Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
@@ -18,7 +18,7 @@
    under the License.
 -->
 <!DOCTYPE click-app PUBLIC
-  "-//Apache Software Foundation//DTD Click Configuration 2.1//EN"
+  "-//Apache Software Foundation//DTD Click Configuration 2.2//EN"
   "http://click.apache.org/dtds/click-2.2.dtd">
 
 <click-app charset="UTF-8">
@@ -27,6 +27,4 @@
 
   <mode value="profile"/>
 
-  <page-interceptor classname="org.apache.click.examples.interceptor.ProfilingInterceptor"/>
-
 </click-app>

Modified: click/trunk/tools/eclipse/org.apache.click.eclipse/plugin.xml
URL: http://svn.apache.org/viewvc/click/trunk/tools/eclipse/org.apache.click.eclipse/plugin.xml?rev=950140&r1=950139&r2=950140&view=diff
==============================================================================
--- click/trunk/tools/eclipse/org.apache.click.eclipse/plugin.xml (original)
+++ click/trunk/tools/eclipse/org.apache.click.eclipse/plugin.xml Tue Jun  1 16:08:18 2010
@@ -33,7 +33,7 @@
       <description>Click Description</description>
     </project-facet>
 
-    <project-facet-version facet="click" version="2.1.0">
+    <project-facet-version facet="click" version="2.2.0">
        <constraint>
         <and>
           <requires facet="jst.web" version="[2.3"/>
@@ -45,7 +45,7 @@
           facet="click"
           id="click.install"
           type="install"
-          version="2.1.0">
+          version="2.2.0">
       <delegate class="org.apache.click.eclipse.core.facet.ClickFacetInstallDelegate"/>
       <config-factory class="org.apache.click.eclipse.core.facet.ClickFacetInstallDataModelProvider"/>
       <!--
@@ -57,7 +57,7 @@
        facet="click"
        id="click.uninstall"
        type="uninstall"
-       version="2.1.0">
+       version="2.2.0">
       <delegate class="org.apache.click.eclipse.core.facet.ClickFacetUninstallDelegate"/>
  	</action>
   </extension>
@@ -65,7 +65,7 @@
   <extension point="org.eclipse.wst.common.project.facet.core.runtimes">
     <supported>
       <runtime-component any="true"/>
-      <facet id="click" version="2.1.0"/>
+      <facet id="click" version="2.2.0"/>
     </supported>
   </extension>
 
@@ -75,18 +75,18 @@
         <page class="org.apache.click.eclipse.ui.wizard.ClickFacetWizardPage"/>
      </wizard-pages>
   </extension>
-  
+
   <extension
         point="org.eclipse.wst.common.project.facet.core.presets">
      <static-preset id="preset.click.2_1_0">
 	    <label>%preset.name</label>
 	    <facet id="jst.java" version="5.0" />
 	    <facet id="jst.web" version="2.4"/>
-	    <facet id="click" version="2.1.0" />
+	    <facet id="click" version="2.2.0" />
      <description>%preset.description</description>
      </static-preset>
   </extension>
-  
+
   <!--===============================================-->
   <!-- Wizards -->
   <!--===============================================-->
@@ -297,7 +297,7 @@
            id="org.apache.click.eclipse.ui.actions.SwitchToClassAction"
            name="%action.switchToClass"/>
      <category
-           id="net.sf.clickide.category"
+           id="org.apache.click.eclipse.category"
            name="Click"/>
   </extension>
   <extension
@@ -367,9 +367,9 @@
         point="org.eclipse.wst.xml.core.catalogContributions">
      <catalogContribution>
         <public
-              publicId="-//Apache Software Foundation//DTD Click Configuration 2.1//EN"
-              uri="click-2.1.0/click.dtd"
-              webURL="http://click.apache.org/dtds/click-2.1.dtd">
+              publicId="-//Apache Software Foundation//DTD Click Configuration 2.2//EN"
+              uri="click-2.2.0/click.dtd"
+              webURL="http://click.apache.org/dtds/click-2.2.dtd">
         </public>
      </catalogContribution>
   </extension>

Modified: click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ClickPlugin.java
URL: http://svn.apache.org/viewvc/click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ClickPlugin.java?rev=950140&r1=950139&r2=950140&view=diff
==============================================================================
--- click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ClickPlugin.java
(original)
+++ click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ClickPlugin.java
Tue Jun  1 16:08:18 2010
@@ -54,11 +54,12 @@ public class ClickPlugin extends Abstrac
 	private ResourceBundle resource;
 	private ColorManager colorManager;
 
-	private List<IClickConfigurationProvider> 
+	private List<IClickConfigurationProvider>
 		configProviders = new ArrayList<IClickConfigurationProvider>();
 
 	public static final String CLICK_PAGE_CLASS = "org.apache.click.Page";
 	public static final String CLICK_CONTROL_IF = "org.apache.click.Control";
+	public static final String CLICK_PAGE_INTERCEPTOR_IF = "org.apache.click.PageInterceptor";
 
 	public static final String TAG_CLICK_APP = "click-app";
 	public static final String TAG_HEADERS = "headers";
@@ -76,6 +77,7 @@ public class ClickPlugin extends Abstrac
 	public static final String TAG_LOG_SERVICE = "log-service";
 	public static final String TAG_TEMPLATE_SERVICE = "template-service";
 	public static final String TAG_RESOURCE_SERVICE = "resource-service";
+	public static final String TAG_PAGE_INTERCEPTOR = "page-interceptor";
 	public static final String ATTR_CHARSET = "charset";
 	public static final String ATTR_LOCALE = "locale";
 	public static final String ATTR_CLASSNAME = "classname";
@@ -87,12 +89,14 @@ public class ClickPlugin extends Abstrac
 	public static final String ATTR_AUTO_BINDING = "autobinding";
 	public static final String ATTR_PACKAGE = "package";
 	public static final String ATTR_PATTERN = "pattern";
+	public static final String ATTR_SCOPE = "scope";
 
 	public static final String[] BOOLEAN_VALUES = {"true", "false"};
 	public static final String[] AUTO_BINDING_VALUES = {"annotation", "public", "none"};
 	public static final String[] LOGTO_VALUES = {"console", "servlet"};
 	public static final String[] MODE_VALUES = {"production", "profile", "development", "debug",
"trace"};
 	public static final String[] HEADER_TYPE_VALUES = {"String", "Integer", "Date"};
+	public static final String[] SCOPE_VALUES = {"application", "request"};
 
 	public static final String PREF_TEMPLATES = "click.templates";
 	public static final String PREF_COLOR_VAR = "click.color.variable";

Modified: click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ClickPlugin.properties
URL: http://svn.apache.org/viewvc/click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ClickPlugin.properties?rev=950140&r1=950139&r2=950140&view=diff
==============================================================================
--- click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ClickPlugin.properties
(original)
+++ click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ClickPlugin.properties
Tue Jun  1 16:08:18 2010
@@ -24,6 +24,7 @@ editor.clickXML.headers=Headers
 editor.clickXML.pages=Pages
 editor.clickXML.controls=Controls
 editor.clickXML.service=Service
+editor.clickXML.pageInterceptor=Interceptor
 editor.clickXML.source=Source
 editor.clickXML.title=Click Configuration
 editor.clickXML.outline=Outline
@@ -46,6 +47,7 @@ editor.clickXML.pages.class=Class:
 editor.clickXML.pages.excludePattern=Exclude Pattern:
 editor.clickXML.property.name=Name(*):
 editor.clickXML.property.value=Value(*):
+editor.clickXML.pageInterceptor.scope=Scope:
 
 # for messages
 message.error.noPage=Unable to find the page class.

Modified: click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ClickPlugin_ja.properties
URL: http://svn.apache.org/viewvc/click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ClickPlugin_ja.properties?rev=950140&r1=950139&r2=950140&view=diff
==============================================================================
--- click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ClickPlugin_ja.properties
(original)
+++ click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ClickPlugin_ja.properties
Tue Jun  1 16:08:18 2010
@@ -24,6 +24,7 @@ editor.clickXML.headers=\u30d8\u30c3\u30
 editor.clickXML.pages=\u30da\u30fc\u30b8
 editor.clickXML.controls=\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb
 editor.clickXML.service=\u30b5\u30fc\u30d3\u30b9
+editor.clickXML.pageInterceptor=\u30a4\u30f3\u30bf\u30fc\u30bb\u30d7\u30bf\u30fc
 editor.clickXML.source=\u30bd\u30fc\u30b9
 editor.clickXML.title=Click\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u8a2d\u5b9a
 editor.clickXML.outline=\u30a2\u30a6\u30c8\u30e9\u30a4\u30f3
@@ -46,6 +47,7 @@ editor.clickXML.pages.class=\u30af\u30e9
 editor.clickXML.pages.excludePattern=\u9664\u5916\u3059\u308b\u30d1\u30bf\u30fc\u30f3:
 editor.clickXML.property.name=\u540d\u524d(*):
 editor.clickXML.property.value=\u5024(*):
+editor.clickXML.pageInterceptor.scope=\u30b9\u30b3\u30fc\u30d7:
 
 # for messages
 message.error.noPage=\u5bfe\u5fdc\u3059\u308b\u30da\u30fc\u30b8\u30af\u30e9\u30b9\u304c\u898b\u3064\u304b\u308a\u307e\u305b\u3093\u3002

Modified: click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/core/builder/ClickXMLValidator.java
URL: http://svn.apache.org/viewvc/click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/core/builder/ClickXMLValidator.java?rev=950140&r1=950139&r2=950140&view=diff
==============================================================================
--- click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/core/builder/ClickXMLValidator.java
(original)
+++ click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/core/builder/ClickXMLValidator.java
Tue Jun  1 16:08:18 2010
@@ -46,43 +46,45 @@ import org.eclipse.wst.xml.core.internal
  * This validator validates:
  * </p>
  * <ul>
- *   <li>charset of &lt;click-app&gt;.</li>
- *   <li>package of &lt;pages&gt;.</li>
- *   <li>automapping of &lt;pages&gt;.</li>
- *   <li>type of &lt;header&gt;.</li>
- *   <li>classname of &lt;page&gt;, &lt;control&gt; and &lt;format&gt;.</li>
- *   <li>value and logto of &lt;mode&gt;.</li>
+ *   <li>classname of many elements</li>
+ *   <li>charset of &lt;click-app&gt;</li>
+ *   <li>package of &lt;pages&gt;</li>
+ *   <li>automapping and autoBinding of &lt;pages&gt;</li>
+ *   <li>type of &lt;header&gt;</li>
+ *   <li>value and logto of &lt;mode&gt;</li>
+ *   <li>scope of &lt;page-interceptor&gt;</li>
  * </ul>
  * <p>
  * All detected errors are marked as WARNING.
  * </p>
- * 
+ * TODO We might have to remove attribute value validations from this validator because they
are validated by DTD.
+ *
  * @author Naoki Takezoe
  */
 public class ClickXMLValidator {
-	
-	private static ResourceBundle resource 
+
+	private static ResourceBundle resource
 		= ResourceBundle.getBundle("org.apache.click.eclipse.core.validator.validation");
-	
+
 	private String packageName = null;
-	
+
 	/**
 	 * Validates click.xml.
-	 * 
+	 *
 	 * @param file the <code>IFile</code> of click.xml.
 	 */
 	public void validate(IFile file, IProgressMonitor monitor){
-		
+
 		packageName = null;
-		
+
 		try {
 			file.deleteMarkers(IMarker.PROBLEM, false, 0);
 		} catch(Exception ex){
 			ClickPlugin.log(ex);
 		}
-		
+
 		IStructuredModel model = null;
-		
+
 		try {
 			model = StructuredModelManager.getModelManager().getModelForRead(file);
 			IStructuredDocument doc = model.getStructuredDocument();
@@ -97,16 +99,16 @@ public class ClickXMLValidator {
 						ITextRegion region = list.get(j);
 						if(region.getType()==DOMRegionContext.XML_TAG_NAME){
 							tagName = text.substring(region.getStart(), region.getEnd()).trim();
-							
+
 						} else if(region.getType()==DOMRegionContext.XML_TAG_ATTRIBUTE_NAME){
 							attrName = text.substring(region.getStart(), region.getEnd()).trim();
-							
+
 						} else if(region.getType()==DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE){
 							String attrValue = text.substring(region.getStart(), region.getEnd()).trim();
 							int length = attrValue.length();
 							attrValue = attrValue.replaceAll("^\"|\"$","");
 							if(tagName!=null && attrName!=null){
-								validateAttributeValue(file, tagName, attrName, attrValue, 
+								validateAttributeValue(file, tagName, attrName, attrValue,
 										curNode.getStart() + region.getStart(), length);
 							}
 							attrName = null;
@@ -122,35 +124,45 @@ public class ClickXMLValidator {
 			}
 		}
 	}
-	
+
 	/**
 	 * Validates the attribute value.
 	 */
-	private void validateAttributeValue(IFile file, 
+	private void validateAttributeValue(IFile file,
 			String tagName, String attrName, String attrValue, int start, int length){
-		
+
 		// package of <pages>
 		if(tagName.equals(ClickPlugin.TAG_PAGES) && attrName.equals(ClickPlugin.ATTR_PACKAGE)){
 			packageName = attrValue;
 			return;
 		}
-		
+
 		// classname of <control>, <page>, <format> and <xxx-service>
 		if(tagName.equals(ClickPlugin.TAG_CONTROL) || tagName.equals(ClickPlugin.TAG_PAGE) || tagName.equals(ClickPlugin.TAG_FORMAT)
||
-				tagName.equals(ClickPlugin.TAG_LOG_SERVICE) || tagName.equals(ClickPlugin.TAG_TEMPLATE_SERVICE)
|| 
-				tagName.equals(ClickPlugin.TAG_FILE_UPLOAD_SERVICE) || tagName.equals(ClickPlugin.TAG_RESOURCE_SERVICE)){
-			
+				tagName.equals(ClickPlugin.TAG_LOG_SERVICE) || tagName.equals(ClickPlugin.TAG_TEMPLATE_SERVICE)
||
+				tagName.equals(ClickPlugin.TAG_FILE_UPLOAD_SERVICE) || tagName.equals(ClickPlugin.TAG_RESOURCE_SERVICE)
||
+				tagName.equals(ClickPlugin.TAG_PAGE_INTERCEPTOR)){
+
 			if(tagName.equals(ClickPlugin.TAG_PAGE) && packageName!=null && !packageName.equals("")){
 				attrValue = packageName + "." + attrValue;
 			}
-			
+
 			if(attrName.equals(ClickPlugin.ATTR_CLASSNAME)){
 				if(!existsJavaClass(file, attrValue)){
 					createWarningMarker(file, "notExist", new String[]{attrValue}, start, length);
 				}
 			}
 		}
-		
+
+		// scope of <page-interceptor>
+		if(tagName.equals(ClickPlugin.TAG_PAGE_INTERCEPTOR)){
+			if(attrName.equals(ClickPlugin.ATTR_SCOPE)){
+				if(!containsValue(ClickPlugin.SCOPE_VALUES, attrValue)){
+					createWarningMarker(file, "scope", new String[0], start, length);
+				}
+			}
+		}
+
 		// automapping and package of <pages>
 		if(tagName.equals(ClickPlugin.TAG_PAGES)){
 			if(attrName.equals(ClickPlugin.ATTR_AUTO_MAPPING)){
@@ -162,13 +174,13 @@ public class ClickXMLValidator {
 					createWarningMarker(file, "autoBinding", new String[0], start, length);
 				}
 			} else if(attrName.equals(ClickPlugin.ATTR_PACKAGE)){
-				
+
 			}
 		}
 		// path of <page>
 		if(tagName.equals(ClickPlugin.TAG_PAGE)){
 			if(attrName.equals(ClickPlugin.ATTR_PATH)){
-				
+
 			}
 		}
 		// type of <header>
@@ -196,7 +208,7 @@ public class ClickXMLValidator {
 			}
 		}
 	}
-	
+
 	private boolean existsJavaClass(IFile file, String typename){
 		IJavaProject project = JavaCore.create(file.getProject());
 		boolean exist = false;
@@ -208,7 +220,7 @@ public class ClickXMLValidator {
 		}
 		return exist;
 	}
-	
+
 	private boolean containsValue(String[] proposals, String value){
 		for(int i=0;i<proposals.length;i++){
 			if(proposals[i].equals(value)){
@@ -217,7 +229,7 @@ public class ClickXMLValidator {
 		}
 		return false;
 	}
-	
+
 	private boolean isSupportedEncoding(String encoding){
 		try {
 			new String(new byte[0], encoding);
@@ -226,16 +238,16 @@ public class ClickXMLValidator {
 		}
 		return true;
 	}
-	
+
 	/**
 	 * Create the warning marker.
 	 */
-	private void createWarningMarker(IFile file, String key, Object[] values, 
+	private void createWarningMarker(IFile file, String key, Object[] values,
 			int start, int length){
 		try {
 			String message = resource.getString(key);
 			message = MessageFormat.format(message, values);
-			
+
 			IMarker marker = file.createMarker(IMarker.PROBLEM);
 			Map<String, Object> map = new HashMap<String, Object>();
 			map.put(IMarker.SEVERITY, new Integer(IMarker.SEVERITY_WARNING));
@@ -244,10 +256,10 @@ public class ClickXMLValidator {
 			map.put(IMarker.CHAR_START,new Integer(start));
 			map.put(IMarker.CHAR_END,new Integer(start + length));
 			marker.setAttributes(map);
-			
+
 		} catch(Exception e){
 			ClickPlugin.log(e);
 		}
-	}	
-	
+	}
+
 }

Modified: click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/core/validator/validation.properties
URL: http://svn.apache.org/viewvc/click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/core/validator/validation.properties?rev=950140&r1=950139&r2=950140&view=diff
==============================================================================
--- click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/core/validator/validation.properties
(original)
+++ click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/core/validator/validation.properties
Tue Jun  1 16:08:18 2010
@@ -21,5 +21,6 @@ autoBinding=autobinding must be true|fal
 headerType=type must be String|Integer|Date.
 modeValue=mode value must be production|profile|development|debug|trace.
 modeLogTo=logto must be console|servlet.
+scope=scope must be application|request.
 unsupportedEncoding={0} is unsupported encoding.
 velocityParseError={0}

Modified: click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/core/validator/validation_ja.properties
URL: http://svn.apache.org/viewvc/click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/core/validator/validation_ja.properties?rev=950140&r1=950139&r2=950140&view=diff
==============================================================================
--- click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/core/validator/validation_ja.properties
(original)
+++ click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/core/validator/validation_ja.properties
Tue Jun  1 16:08:18 2010
@@ -21,5 +21,6 @@ autoBinding=autobinding\u5c5e\u6027 \u30
 headerType=type\u5c5e\u6027 \u306f String|Integer|Date \u3067\u306a\u3051\u308c\u3070\u3044\u3051\u307e\u305b\u3093\u3002
 modeValue=value\u5c5e\u6027\u306f production|profile|development|debug|trace \u3067\u306a\u3051\u308c\u3070\u3044\u3051\u307e\u305b\u3093\u3002
 modeLogTo=logto\u5c5e\u6027\u306f console|servlet \u3067\u306a\u3051\u308c\u3070\u3044\u3051\u307e\u305b\u3093\u3002
+scope=scope\u5c5e\u6027\u306f application|request \u3067\u306a\u3051\u308c\u3070\u3044\u3051\u307e\u305b\u3093\u3002
 unsupportedEncoding={0} \u306f\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u306a\u3044\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3067\u3059\u3002
 velocityParseError={0}

Modified: click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/ClickEditor.java
URL: http://svn.apache.org/viewvc/click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/ClickEditor.java?rev=950140&r1=950139&r2=950140&view=diff
==============================================================================
--- click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/ClickEditor.java
(original)
+++ click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/ClickEditor.java
Tue Jun  1 16:08:18 2010
@@ -23,6 +23,7 @@ import org.apache.click.eclipse.ClickPlu
 import org.apache.click.eclipse.ui.editor.forms.ClickControlsEditor;
 import org.apache.click.eclipse.ui.editor.forms.ClickGeneralEditor;
 import org.apache.click.eclipse.ui.editor.forms.ClickHeadersEditor;
+import org.apache.click.eclipse.ui.editor.forms.ClickInterceptorEditor;
 import org.apache.click.eclipse.ui.editor.forms.ClickPagesEditor;
 import org.apache.click.eclipse.ui.editor.forms.ClickServiceEditor;
 import org.eclipse.core.resources.IResourceChangeEvent;
@@ -61,6 +62,7 @@ public class ClickEditor extends MultiPa
 	private ClickPagesEditor pageEditor;
 	private ClickControlsEditor controlEditor;
 	private ClickServiceEditor serviceEditor;
+	private ClickInterceptorEditor interceptorEditor;
 
 //	private int generalEditorIndex;
 //	private int headerEditorIndex;
@@ -109,6 +111,15 @@ public class ClickEditor extends MultiPa
 		IStructuredModel model = (IStructuredModel)sourceEditor.getAdapter(IStructuredModel.class);
 
 		try {
+			interceptorEditor = new ClickInterceptorEditor();
+			addPage(0, interceptorEditor, getEditorInput());
+			interceptorEditor.initModel(model);
+			setPageText(0, ClickPlugin.getString("editor.clickXML.pageInterceptor"));
+			sourceEditorIndex++;
+		} catch(Exception ex){
+			removePage(0);
+		}
+		try {
 			serviceEditor = new ClickServiceEditor();
 			addPage(0, serviceEditor, getEditorInput());
 			serviceEditor.initModel(model);

Modified: click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/attrs/AttributeEditorUtils.java
URL: http://svn.apache.org/viewvc/click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/attrs/AttributeEditorUtils.java?rev=950140&r1=950139&r2=950140&view=diff
==============================================================================
--- click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/attrs/AttributeEditorUtils.java
(original)
+++ click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/attrs/AttributeEditorUtils.java
Tue Jun  1 16:08:18 2010
@@ -148,8 +148,8 @@ public class AttributeEditorUtils {
 		return combo;
 	}
 
-	
-	
+
+
 	/**
 	 * Creates the classname field editor.
 	 *
@@ -168,7 +168,7 @@ public class AttributeEditorUtils {
 
 		// packagename of page class
 		final String packageName = getPagePackageName(element, superClass);
-		
+
 		final Hyperlink link = toolkit.createHyperlink(parent, label, SWT.NULL);
 		link.addHyperlinkListener(new HyperlinkAdapter(){
 			public void linkActivated(HyperlinkEvent e){
@@ -209,7 +209,9 @@ public class AttributeEditorUtils {
 								NewClassWizard wizard = new NewClassWizard();
 								wizard.init(PlatformUI.getWorkbench(), new StructuredSelection(project));
 								if(superClass != null){
-									if(superClass == ClickPlugin.CLICK_CONTROL_IF || superClass.endsWith("Service")){
+									if(superClass == ClickPlugin.CLICK_CONTROL_IF
+											|| superClass == ClickPlugin.CLICK_PAGE_INTERCEPTOR_IF
+											|| superClass.endsWith("Service")){
 										wizard.addInterface(superClass);
 									} else {
 										wizard.setSuperClass(superClass);
@@ -231,7 +233,7 @@ public class AttributeEditorUtils {
 		Composite composite = toolkit.createComposite(parent);
 		composite.setLayout(FieldAssistUtils.createGridLayout());
 		composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-		
+
 		ContentAssistField field = new ContentAssistField(composite, SWT.BORDER,
 				new TextControlCreator(), new TextContentAdapter(),
 				new TypeNameContentProposalProvider(project, packageName),

Added: click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/attrs/PageInterceptorAttributeEditor.java
URL: http://svn.apache.org/viewvc/click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/attrs/PageInterceptorAttributeEditor.java?rev=950140&view=auto
==============================================================================
--- click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/attrs/PageInterceptorAttributeEditor.java
(added)
+++ click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/attrs/PageInterceptorAttributeEditor.java
Tue Jun  1 16:08:18 2010
@@ -0,0 +1,63 @@
+package org.apache.click.eclipse.ui.editor.attrs;
+
+import org.apache.click.eclipse.ClickPlugin;
+import org.apache.click.eclipse.ClickUtils;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
+
+public class PageInterceptorAttributeEditor implements IAttributeEditor {
+
+	public Composite createForm(FormToolkit toolkit, Composite parent, final IDOMElement element)
{
+		Composite composite = toolkit.createComposite(parent);
+		composite.setLayout(ClickUtils.createGridLayout(2));
+		composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+		IFile file = (IFile)ClickUtils.getResource(element.getStructuredDocument());
+		IJavaProject project = JavaCore.create(file.getProject());
+
+		final Text textClass = AttributeEditorUtils.createClassText(
+				project, toolkit, composite, element,
+				ClickPlugin.getString("editor.clickXML.pages.class"),
+				ClickPlugin.ATTR_CLASSNAME,
+				ClickPlugin.CLICK_PAGE_INTERCEPTOR_IF, null);
+		textClass.addModifyListener(new ModifyListener(){
+			public void modifyText(ModifyEvent e){
+				if(textClass.getText().equals("")){
+					element.removeAttribute(ClickPlugin.ATTR_CLASSNAME);
+				} else {
+					element.setAttribute(ClickPlugin.ATTR_CLASSNAME, textClass.getText());
+				}
+			}
+		});
+
+		final Combo scope = AttributeEditorUtils.createCombo(
+				toolkit, composite, element,
+				ClickPlugin.getString("editor.clickXML.pageInterceptor.scope"),
+				ClickPlugin.ATTR_SCOPE,
+				ClickUtils.createComboValues(ClickPlugin.SCOPE_VALUES));
+		scope.addSelectionListener(new SelectionAdapter(){
+			public void widgetSelected(SelectionEvent evt){
+				if(scope.getText().equals("")){
+					element.removeAttribute(ClickPlugin.ATTR_SCOPE);
+				} else {
+					element.setAttribute(ClickPlugin.ATTR_SCOPE, scope.getText());
+				}
+			}
+		});
+
+
+		return composite;
+	}
+
+}

Propchange: click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/attrs/PageInterceptorAttributeEditor.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/forms/ClickInterceptorEditor.java
URL: http://svn.apache.org/viewvc/click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/forms/ClickInterceptorEditor.java?rev=950140&view=auto
==============================================================================
--- click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/forms/ClickInterceptorEditor.java
(added)
+++ click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/forms/ClickInterceptorEditor.java
Tue Jun  1 16:08:18 2010
@@ -0,0 +1,31 @@
+package org.apache.click.eclipse.ui.editor.forms;
+
+import org.apache.click.eclipse.ClickPlugin;
+import org.apache.click.eclipse.ui.editor.actions.ElementAppendAction;
+import org.apache.click.eclipse.ui.editor.attrs.IAttributeEditor;
+import org.apache.click.eclipse.ui.editor.attrs.PageInterceptorAttributeEditor;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
+
+public class ClickInterceptorEditor extends AbstractMasterDetailEditor {
+
+	@Override
+	protected void createMenu(IDOMElement element) {
+		if(element.getNodeName().equals(ClickPlugin.TAG_CLICK_APP)){
+			newMenu.add(new ElementAppendAction(ClickPlugin.TAG_PAGE_INTERCEPTOR, element, null, this));
+		}
+	}
+
+	@Override
+	protected String[] getAcceptElementNames() {
+		return new String[]{ ClickPlugin.TAG_PAGE_INTERCEPTOR };
+	}
+
+	@Override
+	protected IAttributeEditor getAttributeEditor(String elementName) {
+		if(elementName.equals(ClickPlugin.TAG_PAGE_INTERCEPTOR)){
+			return new PageInterceptorAttributeEditor();
+		}
+		return null;
+	}
+
+}

Propchange: click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/forms/ClickInterceptorEditor.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message