You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2015/03/10 09:15:20 UTC
[1/2] isis git commit: ISIS-1079: improve/fix support for
FixtureScript#defaultParam
Repository: isis
Updated Branches:
refs/heads/master f68f2e999 -> e8c7a1146
ISIS-1079: improve/fix support for FixtureScript#defaultParam
should set the property on the fixture script. Also support isXxx() for booleans.
Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/a15357be
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/a15357be
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/a15357be
Branch: refs/heads/master
Commit: a15357be26bbe2b4adf5bdd760b7ba7b246bcd6e
Parents: f68f2e9
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Tue Mar 10 08:13:24 2015 +0000
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Tue Mar 10 08:13:24 2015 +0000
----------------------------------------------------------------------
.../applib/fixturescripts/FixtureScript.java | 37 ++++++++++++++++++--
1 file changed, 35 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/isis/blob/a15357be/core/applib/src/main/java/org/apache/isis/applib/fixturescripts/FixtureScript.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/fixturescripts/FixtureScript.java b/core/applib/src/main/java/org/apache/isis/applib/fixturescripts/FixtureScript.java
index 2ed39db..80bd020 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/fixturescripts/FixtureScript.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/fixturescripts/FixtureScript.java
@@ -621,7 +621,12 @@ public abstract class FixtureScript
//region > defaultParam, checkParam
protected <T> T defaultParam(final String parameterName, final ExecutionContext ec, final T defaultValue) {
+ final T value = valueFor(parameterName, ec, defaultValue);
+ setParam(parameterName, value);
+ return value;
+ }
+ private <T> T valueFor(final String parameterName, final ExecutionContext ec, final T defaultValue) {
final Class<T> cls = (Class<T>) defaultValue.getClass();
final T value = readParam(parameterName, ec, cls);
@@ -647,17 +652,45 @@ public abstract class FixtureScript
if(value != null) { return (T) value; }
// else from fixture script
- final Method method;
+ Method method;
try {
- method = this.getClass().getMethod("get" + parameterName.substring(0, 1).toUpperCase() + parameterName.substring(1));
+ method = this.getClass().getMethod("get" + uppercase(parameterName));
value = (T)method.invoke(this);
} catch (NoSuchMethodException | InvocationTargetException | IllegalAccessException ignored) {
}
if(value != null) { return (T) value; }
+ if (cls == Boolean.class || cls == boolean.class) {
+ try {
+ method = this.getClass().getMethod("is" + uppercase(parameterName));
+ value = (T)method.invoke(this);
+ } catch (NoSuchMethodException | InvocationTargetException | IllegalAccessException ignored) {
+
+ }
+ if(value != null) { return (T) value; }
+ }
+
return null;
}
+
+ private <T> void setParam(final String parameterName, final T value) {
+ final String mutator = "set" + uppercase(parameterName);
+ final Method[] methods = this.getClass().getMethods();
+ for (Method method : methods) {
+ if(method.getName().equals(mutator) && method.getParameterTypes().length == 1) {
+ try {
+ method.invoke(this, value);
+ } catch (InvocationTargetException | IllegalAccessException ignored) {
+ }
+ break;
+ }
+ }
+ }
+
+ private String uppercase(final String parameterName) {
+ return parameterName.substring(0, 1).toUpperCase() + parameterName.substring(1);
+ }
//endregion
//region > run (entry point for FixtureScripts service to call)
[2/2] isis git commit: ISIS-1080: for reference panel,
add some padding to write of label (too close to image). Also add
some padding top/below if null.
Posted by da...@apache.org.
ISIS-1080: for reference panel, add some padding to write of label (too close to image). Also add some padding top/below if null.
Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/e8c7a114
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/e8c7a114
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/e8c7a114
Branch: refs/heads/master
Commit: e8c7a1146b20ac08c98a2386549c8f32a3ef0eb6
Parents: a15357b
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Tue Mar 10 08:14:54 2015 +0000
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Tue Mar 10 08:14:54 2015 +0000
----------------------------------------------------------------------
.../isis/viewer/wicket/ui/pages/bootstrap-overrides.css | 9 +++++++++
1 file changed, 9 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/isis/blob/e8c7a114/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/bootstrap-overrides.css
----------------------------------------------------------------------
diff --git a/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/bootstrap-overrides.css b/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/bootstrap-overrides.css
index 1ea3f04..5aa5eb4 100644
--- a/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/bootstrap-overrides.css
+++ b/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/bootstrap-overrides.css
@@ -639,6 +639,15 @@ div.referencePanel.scalarNameAndValueComponentType {
height: 20px;
}
+.referencePanel .form-group.label-left .scalarName.control-label {
+ padding-right: 10px;
+}
+
+.referencePanel .form-group.label-left .scalarValueWrapper .entityLinkSelect2Panel{
+ padding-top: 4px;
+ padding-bottom: 3px;
+}
+
.prototype {
font-style: italic;
}