click-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From take...@apache.org
Subject svn commit: r908827 - in /click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse: ./ core/builder/ ui/editor/attrs/ ui/editor/forms/
Date Thu, 11 Feb 2010 03:40:17 GMT
Author: takezoe
Date: Thu Feb 11 03:40:17 2010
New Revision: 908827

URL: http://svn.apache.org/viewvc?rev=908827&view=rev
Log:
Added missed element/attribute support to the click.xml editor:
- Added: control-set element
- Fixed: autobinding attribute values of the pages element

Added:
    click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/attrs/ControlSetAttributeEditor.java
  (with props)
Modified:
    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/ui/editor/attrs/PagesAttributeEditor.java
    click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/forms/ClickControlsEditor.java
    click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/forms/ClickTreeLabelProvider.java

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=908827&r1=908826&r2=908827&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
Thu Feb 11 03:40:17 2010
@@ -67,6 +67,7 @@
 	public static final String TAG_PAGE = "page";
 	public static final String TAG_CONTROLS = "controls";
 	public static final String TAG_CONTROL = "control";
+	public static final String TAG_CONTROL_SET = "control-set";
 	public static final String TAG_FORMAT = "format";
 	public static final String TAG_MODE = "mode";
 	public static final String TAG_EXCLUDES = "excludes";
@@ -87,6 +88,7 @@
 	public static final String ATTR_PATTERN = "pattern";
 
 	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"};

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=908827&r1=908826&r2=908827&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
Thu Feb 11 03:40:17 2010
@@ -32,10 +32,11 @@
 editor.clickXML.general.locale=Locale:
 editor.clickXML.general.format=Format Class:
 editor.clickXML.general.mode=Mode:
-editor.clickXML.general.logTo=Log To:
-editor.clickXML.controls.class=Class:
-editor.clickXML.headers.name=Name:
-editor.clickXML.headers.value=Value:
+#editor.clickXML.general.logTo=Log To:
+editor.clickXML.controls.class=Class(*):
+editor.clickXML.controls.name=Name(*):
+editor.clickXML.headers.name=Name(*):
+editor.clickXML.headers.value=Value(*):
 editor.clickXML.headers.type=Type:
 editor.clickXML.pages.autoMapping=Auto Mapping:
 editor.clickXML.pages.autoBinding=Auto Binding:
@@ -43,8 +44,8 @@
 editor.clickXML.pages.path=Path:
 editor.clickXML.pages.class=Class:
 editor.clickXML.pages.excludePattern=Exclude Pattern:
-editor.clickXML.property.name=Name:
-editor.clickXML.property.value=Value:
+editor.clickXML.property.name=Name(*):
+editor.clickXML.property.value=Value(*):
 
 # 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=908827&r1=908826&r2=908827&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
Thu Feb 11 03:40:17 2010
@@ -32,10 +32,11 @@
 editor.clickXML.general.locale=\u30ed\u30b1\u30fc\u30eb:
 editor.clickXML.general.format=\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u30af\u30e9\u30b9:
 editor.clickXML.general.mode=\u52d5\u4f5c\u30e2\u30fc\u30c9:
-editor.clickXML.general.logTo=\u30ed\u30b0\u306e\u51fa\u529b\u5148:
-editor.clickXML.controls.class=\u30af\u30e9\u30b9:
-editor.clickXML.headers.name=\u540d\u524d:
-editor.clickXML.headers.value=\u5024:
+#editor.clickXML.general.logTo=\u30ed\u30b0\u306e\u51fa\u529b\u5148:
+editor.clickXML.controls.class=\u30af\u30e9\u30b9(*):
+editor.clickXML.controls.name=\u540d\u524d(*)\uff1a
+editor.clickXML.headers.name=\u540d\u524d(*):
+editor.clickXML.headers.value=\u5024(*):
 editor.clickXML.headers.type=\u30bf\u30a4\u30d7:
 editor.clickXML.pages.autoMapping=\u81ea\u52d5\u30de\u30c3\u30d4\u30f3\u30b0:
 editor.clickXML.pages.autoBinding=\u81ea\u52d5\u30d0\u30a4\u30f3\u30c7\u30a3\u30f3\u30b0:
@@ -43,8 +44,8 @@
 editor.clickXML.pages.path=\u30d1\u30b9:
 editor.clickXML.pages.class=\u30af\u30e9\u30b9:
 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.property.name=\u540d\u524d(*):
+editor.clickXML.property.value=\u5024(*):
 
 # 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=908827&r1=908826&r2=908827&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
Thu Feb 11 03:40:17 2010
@@ -146,6 +146,7 @@
 				}
 			}
 		}
+		
 		// automapping and package of <pages>
 		if(tagName.equals(ClickPlugin.TAG_PAGES)){
 			if(attrName.equals(ClickPlugin.ATTR_AUTO_MAPPING)){
@@ -153,7 +154,7 @@
 					createWarningMarker(file, "autoMapping", new String[0], start, length);
 				}
 			} else if(attrName.equals(ClickPlugin.ATTR_AUTO_BINDING)){
-				if(!containsValue(ClickPlugin.BOOLEAN_VALUES, attrValue)){
+				if(!containsValue(ClickPlugin.AUTO_BINDING_VALUES, attrValue)){
 					createWarningMarker(file, "autoBinding", new String[0], start, length);
 				}
 			} else if(attrName.equals(ClickPlugin.ATTR_PACKAGE)){

Added: click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/attrs/ControlSetAttributeEditor.java
URL: http://svn.apache.org/viewvc/click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/attrs/ControlSetAttributeEditor.java?rev=908827&view=auto
==============================================================================
--- click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/attrs/ControlSetAttributeEditor.java
(added)
+++ click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/attrs/ControlSetAttributeEditor.java
Thu Feb 11 03:40:17 2010
@@ -0,0 +1,34 @@
+package org.apache.click.eclipse.ui.editor.attrs;
+
+import org.apache.click.eclipse.ClickPlugin;
+import org.apache.click.eclipse.ClickUtils;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.layout.GridData;
+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 ControlSetAttributeEditor implements IAttributeEditor {
+	
+	public Composite createForm(FormToolkit toolkit, Composite parent, final IDOMElement element)
{
+		final Composite composite = toolkit.createComposite(parent);
+		composite.setLayout(ClickUtils.createGridLayout(2));
+		composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+		
+		final Text text = AttributeEditorUtils.createText(toolkit, composite, element, 
+				ClickPlugin.getString("editor.clickXML.controls.name"), ClickPlugin.ATTR_NAME);
+		text.addModifyListener(new ModifyListener(){
+			public void modifyText(ModifyEvent e){
+				if(text.getText().equals("")){
+					element.removeAttribute(ClickPlugin.ATTR_NAME);
+				} else {
+					element.setAttribute(ClickPlugin.ATTR_NAME, text.getText());
+				}
+			}
+		});
+		
+		return composite;
+	}
+}
\ No newline at end of file

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

Modified: click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/attrs/PagesAttributeEditor.java
URL: http://svn.apache.org/viewvc/click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/attrs/PagesAttributeEditor.java?rev=908827&r1=908826&r2=908827&view=diff
==============================================================================
--- click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/attrs/PagesAttributeEditor.java
(original)
+++ click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/attrs/PagesAttributeEditor.java
Thu Feb 11 03:40:17 2010
@@ -77,7 +77,7 @@
 				toolkit, composite, element, 
 				ClickPlugin.getString("editor.clickXML.pages.autoBinding"), 
 				ClickPlugin.ATTR_AUTO_BINDING,
-				ClickUtils.createComboValues(ClickPlugin.BOOLEAN_VALUES));
+				ClickUtils.createComboValues(ClickPlugin.AUTO_BINDING_VALUES));
 		autoBinding.addSelectionListener(new SelectionAdapter(){
 			public void widgetSelected(SelectionEvent evt){
 				if(autoBinding.getText().equals("")){

Modified: click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/forms/ClickControlsEditor.java
URL: http://svn.apache.org/viewvc/click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/forms/ClickControlsEditor.java?rev=908827&r1=908826&r2=908827&view=diff
==============================================================================
--- click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/forms/ClickControlsEditor.java
(original)
+++ click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/forms/ClickControlsEditor.java
Thu Feb 11 03:40:17 2010
@@ -23,6 +23,7 @@
 import org.apache.click.eclipse.ClickUtils;
 import org.apache.click.eclipse.ui.editor.actions.ElementAppendAction;
 import org.apache.click.eclipse.ui.editor.attrs.ControlAttributeEditor;
+import org.apache.click.eclipse.ui.editor.attrs.ControlSetAttributeEditor;
 import org.apache.click.eclipse.ui.editor.attrs.IAttributeEditor;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
 
@@ -37,19 +38,24 @@
 				ClickUtils.getElement(element, ClickPlugin.TAG_CONTROLS)==null){
 			newMenu.add(new ElementAppendAction(ClickPlugin.TAG_CONTROLS, element, null, this));
 		}
-		
 		if(element.getNodeName().equals(ClickPlugin.TAG_CONTROLS)){
-			newMenu.add(new ElementAppendAction(ClickPlugin.TAG_CONTROL, element, null, this));
+			IDOMElement controlSet = ClickUtils.getElement(element, ClickPlugin.TAG_CONTROL_SET);
+			
+			newMenu.add(new ElementAppendAction(ClickPlugin.TAG_CONTROL, element, controlSet, this));
+			newMenu.add(new ElementAppendAction(ClickPlugin.TAG_CONTROL_SET, element, null, this));
 		}
 	}
 
 	protected String[] getAcceptElementNames() {
-		return new String[]{ClickPlugin.TAG_CONTROLS, ClickPlugin.TAG_CONTROL};
+		return new String[]{ClickPlugin.TAG_CONTROLS, ClickPlugin.TAG_CONTROL, ClickPlugin.TAG_CONTROL_SET};
 	}
 
 	protected IAttributeEditor getAttributeEditor(String elementName) {
 		if(elementName.equals(ClickPlugin.TAG_CONTROL)){
 			return new ControlAttributeEditor();
+			
+		} else if(elementName.equals(ClickPlugin.TAG_CONTROL_SET)){
+			return new ControlSetAttributeEditor();
 		}
 		return null;
 	}

Modified: click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/forms/ClickTreeLabelProvider.java
URL: http://svn.apache.org/viewvc/click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/forms/ClickTreeLabelProvider.java?rev=908827&r1=908826&r2=908827&view=diff
==============================================================================
--- click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/forms/ClickTreeLabelProvider.java
(original)
+++ click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/forms/ClickTreeLabelProvider.java
Thu Feb 11 03:40:17 2010
@@ -52,6 +52,8 @@
 				ClickPlugin.getImageDescriptor("icons/folder.gif").createImage());
 		images.put(ClickPlugin.TAG_CONTROL,
 				ClickPlugin.getImageDescriptor("icons/control.gif").createImage());
+		images.put(ClickPlugin.TAG_CONTROL_SET,
+				ClickPlugin.getImageDescriptor("icons/control.gif").createImage());
 		images.put(ClickPlugin.TAG_CONTROLS,
 				ClickPlugin.getImageDescriptor("icons/folder.gif").createImage());
 		images.put(ClickPlugin.TAG_EXCLUDES,



Mime
View raw message