Skip to content

Commit

Permalink
issue-5: Refactor, added InputText test and solution
Browse files Browse the repository at this point in the history
  • Loading branch information
yersan committed Jun 6, 2015
1 parent 2cc5d49 commit f501fb1
Show file tree
Hide file tree
Showing 14 changed files with 418 additions and 87 deletions.
18 changes: 18 additions & 0 deletions nb-configuration.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<project-shared-configuration>
<!--
This file contains additional configuration written by modules in the NetBeans IDE.
The configuration is intended to be shared among all the users of project and
therefore it is assumed to be part of version control checkout.
Without this configuration present, some functionality in the IDE may be limited or fail altogether.
-->
<properties xmlns="http://www.netbeans.org/ns/maven-properties-data/1">
<!--
Properties that influence various parts of the IDE, especially code formatting and the like.
You can copy and paste the single properties, into the pom.xml file and the IDE will pick them up.
That way multiple projects can share the same settings (useful for formatting rules for example).
Any value defined here will override the pom.xml file value but is only applicable to the current project.
-->
<org-netbeans-modules-javascript2-requirejs.enabled>true</org-netbeans-modules-javascript2-requirejs.enabled>
</properties>
</project-shared-configuration>
36 changes: 36 additions & 0 deletions nbactions-wildfly-managed.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<actions>
<action>
<actionName>CUSTOM-Failsafe test File</actionName>
<displayName>Failsafe test File</displayName>
<goals>
<goal>compiler:testCompile</goal>
<goal>verify</goal>
</goals>
<properties>
<it.test>${packageClassName}</it.test>

</properties>
<activatedProfiles>
<activatedProfile>wildfly-managed</activatedProfile>

</activatedProfiles>
</action>
<action>
<actionName>CUSTOM-Failsafe Debug test File</actionName>
<displayName>Failsafe Debug test File</displayName>
<goals>
<goal>test-compile</goal>
<goal>verify</goal>
</goals>
<properties>
<it.test>${packageClassName}</it.test>
<forkMode>once</forkMode>
<maven.failsafe.debug>-Xdebug -Xrunjdwp:transport=dt_socket,server=n,address=${jpda.address}</maven.failsafe.debug>
<jpda.listen>true</jpda.listen>
</properties>
<activatedProfiles>
<activatedProfile>wildfly-managed</activatedProfile>
</activatedProfiles>
</action>
</actions>
5 changes: 2 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
<maven.compiler.testTarget>1.6</maven.compiler.testTarget>
<maven.compiler.debug>true</maven.compiler.debug>
<maven.compiler.debuglevel>lines,vars,source</maven.compiler.debuglevel>
<maven.test.skip>true</maven.test.skip>
</properties>


Expand Down Expand Up @@ -330,7 +329,6 @@
safari
-->
<project.integration.tests.browser>htmlUnit</project.integration.tests.browser>
<maven.test.skip>false</maven.test.skip>
<bootsfaces.arquillian.jboss.version>8.2.0.Final</bootsfaces.arquillian.jboss.version>

</properties>
Expand Down Expand Up @@ -422,7 +420,8 @@
</executions>
<configuration>
<!-- Fork every test because it will launch a separate AS instance -->
<forkMode>always</forkMode>
<reuseForks>false</reuseForks>
<forkCount>1</forkCount>
<systemPropertyVariables>
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
<!-- the maven dependency plugin will have already downloaded the server on /target -->
Expand Down
122 changes: 61 additions & 61 deletions src/main/java/net/bootsfaces/component/InputText.java
Original file line number Diff line number Diff line change
@@ -1,22 +1,16 @@
/**
* Copyright 2014 Riccardo Massera (TheCoder4.Eu)
*
* This file is part of BootsFaces.
*
* BootsFaces is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* Copyright 2014 Riccardo Massera (TheCoder4.Eu)
*
* BootsFaces 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.
* This file is part of BootsFaces.
*
* You should have received a copy of the GNU Lesser General Public License
* along with BootsFaces. If not, see <http://www.gnu.org/licenses/>.
* BootsFaces is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your option) any later version.
*
* BootsFaces 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 BootsFaces. If not, see <http://www.gnu.org/licenses/>.
*/

package net.bootsfaces.component;

import javax.faces.application.ResourceDependencies;
Expand All @@ -31,72 +25,78 @@
*
* @author thecoder4.eu
*/

@ResourceDependencies({
@ResourceDependency(library="bsf", name="css/core.css", target="head"),
@ResourceDependency(library="bsf", name="css/bsf.css", target="head")
@ResourceDependency(library = "bsf", name = "css/core.css", target = "head"),
@ResourceDependency(library = "bsf", name = "css/bsf.css", target = "head")
})
@FacesComponent(C.INPUTTEXT_COMPONENT_TYPE)
public class InputText extends HtmlInputText {

/**
* <p>The standard component type for this component.</p>
* <p>
* The standard component type for this component.</p>
*/
public static final String COMPONENT_TYPE =C.INPUTTEXT_COMPONENT_TYPE;
public static final String COMPONENT_TYPE = C.INPUTTEXT_COMPONENT_TYPE;
/**
* <p>The component family for this component.</p>
* <p>
* The component family for this component.</p>
*/
public static final String COMPONENT_FAMILY = C.BSFCOMPONENT;
public static final String ADDON="input-group-addon";

public static final String ADDON = "input-group-addon";

protected enum PropertyKeys {

placeholder
,fieldSize
,type;
placeholder,
fieldSize,
type;

String toString;

String toString;
PropertyKeys(String toString) {
this.toString = toString;
}

PropertyKeys(String toString) {
this.toString = toString;
}
PropertyKeys() {
}

PropertyKeys() {}
public String toString() {
return ((this.toString != null) ? this.toString : super.toString());
}
}

public String toString() {
return ((this.toString != null) ? this.toString : super.toString());
}
}

public InputText() {
setRendererType("net.bootsfaces.component.InputTextRenderer");
Tooltip.addResourceFile();
setRendererType("net.bootsfaces.component.InputTextRenderer");
Tooltip.addResourceFile();
}

@Override
public String getFamily() {
return COMPONENT_FAMILY;
}

public java.lang.String getPlaceholder() {
return (java.lang.String) getStateHelper().eval(PropertyKeys.placeholder, null);
}
public void setPlaceholder(java.lang.String _placeholder) {
getStateHelper().put(PropertyKeys.placeholder, _placeholder);
}
public java.lang.String getFieldSize() {
return (java.lang.String) getStateHelper().eval(PropertyKeys.fieldSize, null);
}
public void setFieldSize(java.lang.String _fieldSize) {
getStateHelper().put(PropertyKeys.fieldSize, _fieldSize);
}
public java.lang.String getType() {
return (java.lang.String) getStateHelper().eval(PropertyKeys.type, "text");
}
public void setType(java.lang.String _type) {
getStateHelper().put(PropertyKeys.type, _type);
}


public java.lang.String getPlaceholder() {
return (java.lang.String) getStateHelper().eval(PropertyKeys.placeholder, null);
}

public void setPlaceholder(java.lang.String _placeholder) {
getStateHelper().put(PropertyKeys.placeholder, _placeholder);
}

public java.lang.String getFieldSize() {
return (java.lang.String) getStateHelper().eval(PropertyKeys.fieldSize, null);
}

public void setFieldSize(java.lang.String _fieldSize) {
getStateHelper().put(PropertyKeys.fieldSize, _fieldSize);
}

public java.lang.String getType() {
return (java.lang.String) getStateHelper().eval(PropertyKeys.type, "text");
}

public void setType(java.lang.String _type) {
getStateHelper().put(PropertyKeys.type, _type);
}

}
2 changes: 1 addition & 1 deletion src/main/java/net/bootsfaces/render/A.java
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ public static String asString(Map<String, Object> attrs, Object o) {

public static final String[] ALLBUTTON_ATTRS = A.concatAll( H.ALLBUTTON, E.DBLCLICK, E.FOCUS, E.MOUSE);
public static final String[] CHECKBOX_ATTRS = A.concatAll( H.CHECKBOX, E.CLICK, E.FOCUS, E.MOUSE, E.CHANGE_SELECT);
public static final String[] INPUT_TEXT_ATTRS = A.concatAll( H.INPUT_TEXT, E.CLICK, E.FOCUS, E.MOUSE);
public static final String[] INPUT_TEXT_ATTRS = A.concatAll( H.INPUT_TEXT, E.CLICK, E.FOCUS, E.MOUSE, E.CHANGE_SELECT);
public static final String[] TAB_ATTRS = A.concatAll( H.TAB, E.DBLCLICK, E.FOCUS, E.MOUSE);
public static final String[] TAB_VIEW_ATTRS = A.concatAll( H.TAB_VIEW, E.CLICK, E.FOCUS, E.MOUSE);
public static final String[] SELECT_ONE_MENU_ATTRS = A.concatAll( H.SELECT_ONE_MENU, E.CLICK, E.FOCUS, E.MOUSE);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
package net.bootsfaces.component;
package net.bootsfaces.render;

import java.io.IOException;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.el.ValueExpression;

import javax.faces.FacesException;
import javax.faces.component.UIComponent;
import javax.faces.component.ValueHolder;
import javax.faces.component.behavior.ClientBehavior;
Expand All @@ -18,11 +17,8 @@
import javax.faces.render.FacesRenderer;

import net.bootsfaces.C;
import net.bootsfaces.render.A;
import net.bootsfaces.render.CoreRenderer;
import net.bootsfaces.render.H;
import net.bootsfaces.render.R;
import net.bootsfaces.render.Tooltip;
import net.bootsfaces.component.InputSecret;
import net.bootsfaces.component.InputText;

@FacesRenderer(componentFamily = C.BSFCOMPONENT, rendererType = "net.bootsfaces.component.InputTextRenderer")
public class InputTextRenderer extends CoreRenderer {
Expand Down
Loading

0 comments on commit f501fb1

Please sign in to comment.