Author: Alex.Kolonitsky
Date: 2010-04-20 12:42:23 -0400 (Tue, 20 Apr 2010)
New Revision: 16783
Added:
root/ui/trunk/components/core/src/main/java/org/richfaces/view/facelets/html/AjaxPushHandler1.java
Removed:
root/ui/trunk/components/core/src/main/java/org/richfaces/view/facelets/html/AjaxPushHandler_.java
Modified:
root/examples/trunk/richfaces-demo/src/main/java/org/richfaces/demo/common/SkinBean.java
root/framework/trunk/impl/src/main/java/org/richfaces/resource/Xcss2EcssConverter.java
root/ui/trunk/components/core/src/main/java/org/richfaces/component/AbstractMediaOutput.java
Log:
fix checkstyle
Modified:
root/examples/trunk/richfaces-demo/src/main/java/org/richfaces/demo/common/SkinBean.java
===================================================================
---
root/examples/trunk/richfaces-demo/src/main/java/org/richfaces/demo/common/SkinBean.java 2010-04-20
16:29:38 UTC (rev 16782)
+++
root/examples/trunk/richfaces-demo/src/main/java/org/richfaces/demo/common/SkinBean.java 2010-04-20
16:42:23 UTC (rev 16783)
@@ -1,31 +1,24 @@
/**
- *
+ *
*/
package org.richfaces.demo.common;
import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-import javax.faces.context.FacesContext;
-import javax.faces.event.ValueChangeEvent;
-import javax.faces.model.SelectItem;
-
/**
* @author sim
- *
*/
public class SkinBean implements Serializable {
- /**
- *
- */
- private static final long serialVersionUID = -2399884208294434812L;
- private String skin;
- public String getSkin() {
- return skin;
- }
+ /**
+ *
+ */
+ private static final long serialVersionUID = -2399884208294434812L;
+ private String skin;
+ public String getSkin() {
+ return skin;
+ }
public void setSkin(String skin) {
Modified:
root/framework/trunk/impl/src/main/java/org/richfaces/resource/Xcss2EcssConverter.java
===================================================================
---
root/framework/trunk/impl/src/main/java/org/richfaces/resource/Xcss2EcssConverter.java 2010-04-20
16:29:38 UTC (rev 16782)
+++
root/framework/trunk/impl/src/main/java/org/richfaces/resource/Xcss2EcssConverter.java 2010-04-20
16:42:23 UTC (rev 16783)
@@ -3,6 +3,7 @@
import java.io.File;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
+import java.io.IOException;
import java.net.URLDecoder;
import javax.xml.parsers.SAXParserFactory;
@@ -12,6 +13,7 @@
import org.xml.sax.Attributes;
import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.ParserConfigurationException;
public final class Xcss2EcssConverter {
@@ -19,7 +21,7 @@
private Xcss2EcssConverter() {
}
- public static void main(String[] args) {
+ public static void main(String[] args) throws SAXException,
ParserConfigurationException, IOException {
// Create Handler
Handler handler = new Handler();
@@ -58,7 +60,7 @@
*/
public void startElement(String namespaceURI, String localName, String qName,
Attributes atts)
throws SAXException {
-
+
if (TEMPLATE.equals(localName)) {
ecssContent = new StringBuilder();
}
@@ -153,7 +155,7 @@
*/
public void characters(char[] ch, int start, int length)
throws SAXException {
-
+
if (verbatim) {
String strValue = new String(ch, start, length);
ecssContent.append(strValue);
@@ -172,7 +174,7 @@
*/
public void endElement(String namespaceURI, String localName, String qName)
throws SAXException {
-
+
if (TEMPLATE.equals(localName)) {
System.out.println(ecssContent.toString().trim());
}
@@ -193,6 +195,7 @@
hasAttribbute = false;
}
if (ATTRIBBUTE.equals(localName)) {
+ // Do nothing.
}
}
@@ -207,28 +210,31 @@
* Constructor
*
* @param handler - DefaultHandler for the SAX parser
+ * @throws javax.xml.parsers.ParserConfigurationException
+ *
+ * @throws org.xml.sax.SAXException
*/
- public CreateParser(DefaultHandler handler) {
+ public CreateParser(DefaultHandler handler) throws SAXException,
ParserConfigurationException {
this.handler = handler;
create();
}
/**
* Create the SAX parser
+ *
+ * @throws javax.xml.parsers.ParserConfigurationException
+ *
+ * @throws org.xml.sax.SAXException
*/
- private void create() {
- try {
- // Obtain a new instance of a SAXParserFactory.
- SAXParserFactory factory = SAXParserFactory.newInstance();
- // Specifies that the parser produced by this code will provide support for
XML namespaces.
- factory.setNamespaceAware(true);
- // Specifies that the parser produced by this code will validate documents as
they are parsed.
- //factory.setValidating(true);
- // Creates a new instance of a SAXParser using the currently configured
factory parameters.
- saxParser = factory.newSAXParser();
- } catch (Throwable t) {
- t.printStackTrace();
- }
+ private void create() throws SAXException, ParserConfigurationException {
+ // Obtain a new instance of a SAXParserFactory.
+ SAXParserFactory factory = SAXParserFactory.newInstance();
+ // Specifies that the parser produced by this code will provide support for XML
namespaces.
+ factory.setNamespaceAware(true);
+ // Specifies that the parser produced by this code will validate documents as
they are parsed.
+ //factory.setValidating(true);
+ // Creates a new instance of a SAXParser using the currently configured factory
parameters.
+ saxParser = factory.newSAXParser();
}
/**
@@ -236,12 +242,8 @@
*
* @param file - File
*/
- public void parse(File file) {
- try {
- saxParser.parse(file, handler);
- } catch (Throwable t) {
- t.printStackTrace();
- }
+ public void parse(File file) throws IOException, SAXException {
+ saxParser.parse(file, handler);
}
/**
@@ -249,12 +251,8 @@
*
* @param uri - String
*/
- public void parse(String uri) {
- try {
- saxParser.parse(uri, handler);
- } catch (Throwable t) {
- t.printStackTrace();
- }
+ public void parse(String uri) throws IOException, SAXException {
+ saxParser.parse(uri, handler);
}
/**
@@ -262,12 +260,8 @@
*
* @param stream - InputStream
*/
- public void parse(InputStream stream) {
- try {
- saxParser.parse(stream, handler);
- } catch (Throwable t) {
- t.printStackTrace();
- }
+ public void parse(InputStream stream) throws IOException, SAXException {
+ saxParser.parse(stream, handler);
}
}
Modified:
root/ui/trunk/components/core/src/main/java/org/richfaces/component/AbstractMediaOutput.java
===================================================================
---
root/ui/trunk/components/core/src/main/java/org/richfaces/component/AbstractMediaOutput.java 2010-04-20
16:29:38 UTC (rev 16782)
+++
root/ui/trunk/components/core/src/main/java/org/richfaces/component/AbstractMediaOutput.java 2010-04-20
16:42:23 UTC (rev 16783)
@@ -205,7 +205,7 @@
public abstract String getVspace();
- @Attribute(events = @EventName("blur"))
+ @Attribute(events = @EventName("blur"))
public abstract String getOnblur();
@Attribute(events = @EventName("click"))
Copied:
root/ui/trunk/components/core/src/main/java/org/richfaces/view/facelets/html/AjaxPushHandler1.java
(from rev 16778,
root/ui/trunk/components/core/src/main/java/org/richfaces/view/facelets/html/AjaxPushHandler_.java)
===================================================================
---
root/ui/trunk/components/core/src/main/java/org/richfaces/view/facelets/html/AjaxPushHandler1.java
(rev 0)
+++
root/ui/trunk/components/core/src/main/java/org/richfaces/view/facelets/html/AjaxPushHandler1.java 2010-04-20
16:42:23 UTC (rev 16783)
@@ -0,0 +1,83 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+
+package org.richfaces.view.facelets.html;
+
+import java.util.EventListener;
+
+import javax.faces.view.facelets.ComponentConfig;
+import javax.faces.view.facelets.ComponentHandler;
+import javax.faces.view.facelets.FaceletContext;
+import javax.faces.view.facelets.MetaRule;
+import javax.faces.view.facelets.MetaRuleset;
+import javax.faces.view.facelets.Metadata;
+import javax.faces.view.facelets.MetadataTarget;
+import javax.faces.view.facelets.TagAttribute;
+
+import org.richfaces.component.AbstractPush;
+
+public class AjaxPushHandler1 extends ComponentHandler {
+ private static final MetaRule AJAX_PUSH_META_RULE = new AjaxPushMetaRule();
+
+ public AjaxPushHandler1(ComponentConfig config) {
+ super(config);
+ }
+
+ @Override
+ protected MetaRuleset createMetaRuleset(Class type) {
+ MetaRuleset metaRules = super.createMetaRuleset(type);
+
+ metaRules.addRule(AJAX_PUSH_META_RULE);
+
+ return metaRules;
+ }
+
+ static class AjaxPushActionMapper extends Metadata {
+ private static final Class<?>[] AJAX_PUSH_ACTION_SIG = new Class[]
{EventListener.class};
+ private final TagAttribute send;
+
+ public AjaxPushActionMapper(TagAttribute attribute) {
+ send = attribute;
+ }
+
+ public void applyMetadata(FaceletContext ctx, Object instance) {
+ ((AbstractPush) instance).setEventProducer(this.send.getMethodExpression(ctx,
null, AJAX_PUSH_ACTION_SIG));
+ }
+ }
+
+ static class AjaxPushMetaRule extends MetaRule {
+
+ public AjaxPushMetaRule() {
+ super();
+ }
+
+ public Metadata applyRule(String name, TagAttribute attribute, MetadataTarget
meta) {
+ if (meta.isTargetInstanceOf(AbstractPush.class)) {
+ if ("eventProducer".equals(name)) {
+ return new AjaxPushActionMapper(attribute);
+ }
+ }
+
+ return null;
+ }
+ }
+}
Property changes on:
root/ui/trunk/components/core/src/main/java/org/richfaces/view/facelets/html/AjaxPushHandler1.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Deleted:
root/ui/trunk/components/core/src/main/java/org/richfaces/view/facelets/html/AjaxPushHandler_.java
===================================================================
---
root/ui/trunk/components/core/src/main/java/org/richfaces/view/facelets/html/AjaxPushHandler_.java 2010-04-20
16:29:38 UTC (rev 16782)
+++
root/ui/trunk/components/core/src/main/java/org/richfaces/view/facelets/html/AjaxPushHandler_.java 2010-04-20
16:42:23 UTC (rev 16783)
@@ -1,83 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-
-package org.richfaces.view.facelets.html;
-
-import java.util.EventListener;
-
-import javax.faces.view.facelets.ComponentConfig;
-import javax.faces.view.facelets.ComponentHandler;
-import javax.faces.view.facelets.FaceletContext;
-import javax.faces.view.facelets.MetaRule;
-import javax.faces.view.facelets.MetaRuleset;
-import javax.faces.view.facelets.Metadata;
-import javax.faces.view.facelets.MetadataTarget;
-import javax.faces.view.facelets.TagAttribute;
-
-import org.richfaces.component.AbstractPush;
-
-public class AjaxPushHandler_ extends ComponentHandler {
- private static final MetaRule AJAX_PUSH_META_RULE = new AjaxPushMetaRule();
-
- public AjaxPushHandler_(ComponentConfig config) {
- super(config);
- }
-
- @Override
- protected MetaRuleset createMetaRuleset(Class type) {
- MetaRuleset metaRules = super.createMetaRuleset(type);
-
- metaRules.addRule(AJAX_PUSH_META_RULE);
-
- return metaRules;
- }
-
- static class AjaxPushActionMapper extends Metadata {
- private static final Class<?>[] AJAX_PUSH_ACTION_SIG = new Class[]
{EventListener.class};
- private final TagAttribute send;
-
- public AjaxPushActionMapper(TagAttribute attribute) {
- send = attribute;
- }
-
- public void applyMetadata(FaceletContext ctx, Object instance) {
- ((AbstractPush) instance).setEventProducer(this.send.getMethodExpression(ctx,
null, AJAX_PUSH_ACTION_SIG));
- }
- }
-
- static class AjaxPushMetaRule extends MetaRule {
-
- public AjaxPushMetaRule() {
- super();
- }
-
- public Metadata applyRule(String name, TagAttribute attribute, MetadataTarget
meta) {
- if (meta.isTargetInstanceOf(AbstractPush.class)) {
- if ("eventProducer".equals(name)) {
- return new AjaxPushActionMapper(attribute);
- }
- }
-
- return null;
- }
- }
-}