incubator-isis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danhayw...@apache.org
Subject svn commit: r1393977 - in /incubator/isis/trunk/framework: applib/src/main/java/org/apache/isis/applib/annotation/ runtimes/dflt/webserver/src/main/java/org/apache/isis/runtimes/dflt/webserver/ viewer/wicket/wicket-ui/src/main/java/org/apache/isis/view...
Date Thu, 04 Oct 2012 10:19:58 GMT
Author: danhaywood
Date: Thu Oct  4 10:19:58 2012
New Revision: 1393977

URL: http://svn.apache.org/viewvc?rev=1393977&view=rev
Log:
ISIS-232: fixing boolean panel, change way custom CSS specified; support custom JS

Modified:
    incubator/isis/trunk/framework/applib/src/main/java/org/apache/isis/applib/annotation/MemberOrder.java
    incubator/isis/trunk/framework/runtimes/dflt/webserver/src/main/java/org/apache/isis/runtimes/dflt/webserver/WebServerBootstrapper.java
    incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/ScalarPanelAbstract.java
    incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/primitive/BooleanPanel.java
    incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/primitive/ShortPanel.java
    incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/PageAbstract.html
    incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/PageAbstract.java
    incubator/isis/trunk/framework/viewer/wicket/wicket-viewer/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication.java
    incubator/isis/trunk/framework/viewer/wicket/wicket-viewer/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketModule.java

Modified: incubator/isis/trunk/framework/applib/src/main/java/org/apache/isis/applib/annotation/MemberOrder.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/applib/src/main/java/org/apache/isis/applib/annotation/MemberOrder.java?rev=1393977&r1=1393976&r2=1393977&view=diff
==============================================================================
--- incubator/isis/trunk/framework/applib/src/main/java/org/apache/isis/applib/annotation/MemberOrder.java
(original)
+++ incubator/isis/trunk/framework/applib/src/main/java/org/apache/isis/applib/annotation/MemberOrder.java
Thu Oct  4 10:19:58 2012
@@ -39,7 +39,7 @@ public @interface MemberOrder {
     String sequence();
 
     /**
-     * Name of the action group this set should be known as.
+     * Name of the group this set should be known as.
      */
     String name() default "";
 }

Modified: incubator/isis/trunk/framework/runtimes/dflt/webserver/src/main/java/org/apache/isis/runtimes/dflt/webserver/WebServerBootstrapper.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/webserver/src/main/java/org/apache/isis/runtimes/dflt/webserver/WebServerBootstrapper.java?rev=1393977&r1=1393976&r2=1393977&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/webserver/src/main/java/org/apache/isis/runtimes/dflt/webserver/WebServerBootstrapper.java
(original)
+++ incubator/isis/trunk/framework/runtimes/dflt/webserver/src/main/java/org/apache/isis/runtimes/dflt/webserver/WebServerBootstrapper.java
Thu Oct  4 10:19:58 2012
@@ -86,7 +86,7 @@ final class WebServerBootstrapper implem
                 jettyServer.join();
             }
         } catch (final Exception ex) {
-            throw new IsisException("Unable to start Jetty server", ex);
+             throw new IsisException("Unable to start Jetty server", ex);
         }
     }
 

Modified: incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/ScalarPanelAbstract.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/ScalarPanelAbstract.java?rev=1393977&r1=1393976&r2=1393977&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/ScalarPanelAbstract.java
(original)
+++ incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/ScalarPanelAbstract.java
Thu Oct  4 10:19:58 2012
@@ -44,6 +44,7 @@ public abstract class ScalarPanelAbstrac
 
     private static final long serialVersionUID = 1L;
 
+
     public enum Rendering {
         /**
          * Does not show labels, eg for use in tables
@@ -168,6 +169,7 @@ public abstract class ScalarPanelAbstrac
 
     protected abstract Component addComponentForCompact();
 
+    
     /**
      * Optional hook.
      */

Modified: incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/primitive/BooleanPanel.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/primitive/BooleanPanel.java?rev=1393977&r1=1393976&r2=1393977&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/primitive/BooleanPanel.java
(original)
+++ incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/primitive/BooleanPanel.java
Thu Oct  4 10:19:58 2012
@@ -64,17 +64,19 @@ public class BooleanPanel extends Scalar
         
         final String describedAs = getModel().getDescribedAs();
         if(describedAs != null) {
-            labelIfRegular.add(new AttributeModifier("title", true, Model.of(describedAs)));
+            labelIfRegular.add(new AttributeModifier("title", Model.of(describedAs)));
         }
         
         final Label scalarName = new Label(ID_SCALAR_NAME, getRendering().getLabelCaption(checkBox));
         labelIfRegular.add(scalarName);
 
         addOrReplace(labelIfRegular);
-        addOrReplace(new ComponentFeedbackPanel(ID_FEEDBACK, checkBox));
+        
+        labelIfRegular.addOrReplace(new ComponentFeedbackPanel(ID_FEEDBACK, checkBox));
 
         return labelIfRegular;
     }
+    
 
     /**
      * Mandatory hook method to build the component to render the model when in

Modified: incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/primitive/ShortPanel.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/primitive/ShortPanel.java?rev=1393977&r1=1393976&r2=1393977&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/primitive/ShortPanel.java
(original)
+++ incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/primitive/ShortPanel.java
Thu Oct  4 10:19:58 2012
@@ -19,17 +19,13 @@
 
 package org.apache.isis.viewer.wicket.ui.components.scalars.primitive;
 
-import org.apache.wicket.markup.html.form.AbstractTextComponent;
-import org.apache.wicket.markup.html.form.TextField;
-
 import org.apache.isis.viewer.wicket.model.models.ScalarModel;
-import org.apache.isis.viewer.wicket.ui.components.scalars.ScalarPanelTextFieldAbstract;
-import org.apache.isis.viewer.wicket.ui.components.scalars.TextFieldValueModel;
+import org.apache.isis.viewer.wicket.ui.components.scalars.ScalarPanelTextFieldNumeric;
 
 /**
  * Panel for rendering scalars of type {@link Short} or <tt>short</tt>.
  */
-public class ShortPanel extends ScalarPanelTextFieldAbstract<Short> {
+public class ShortPanel extends ScalarPanelTextFieldNumeric<Short> {
 
     private static final long serialVersionUID = 1L;
     private static final String ID_SCALAR_VALUE = "scalarValue";
@@ -38,14 +34,4 @@ public class ShortPanel extends ScalarPa
         super(id, scalarModel, Short.class);
     }
 
-    @Override
-    protected void addSemantics() {
-        super.addSemantics();
-    }
-
-    @Override
-    protected AbstractTextComponent<Short> createTextField() {
-        return new TextField<Short>(ID_SCALAR_VALUE, new TextFieldValueModel<Short>(this),
Short.class);
-    }
-
 }

Modified: incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/PageAbstract.html
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/PageAbstract.html?rev=1393977&r1=1393976&r2=1393977&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/PageAbstract.html
(original)
+++ incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/PageAbstract.html
Thu Oct  4 10:19:58 2012
@@ -28,7 +28,6 @@
 			<link href="cssreset.css" rel="stylesheet" type="text/css"/>
 			<link href="PageAbstract.css" rel="stylesheet" type="text/css"/>
 		</wicket:link>
-		<link href="application.css" rel="stylesheet" type="text/css"/>
 	</head>
 	<body>
 		

Modified: incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/PageAbstract.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/PageAbstract.java?rev=1393977&r1=1393976&r2=1393977&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/PageAbstract.java
(original)
+++ incubator/isis/trunk/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/PageAbstract.java
Thu Oct  4 10:19:58 2012
@@ -23,7 +23,14 @@ import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
 
+import com.google.inject.Inject;
+import com.google.inject.name.Named;
+
 import org.apache.wicket.RestartResponseAtInterceptPageException;
+import org.apache.wicket.markup.head.CssReferenceHeaderItem;
+import org.apache.wicket.markup.head.HeaderItem;
+import org.apache.wicket.markup.head.IHeaderResponse;
+import org.apache.wicket.markup.head.JavaScriptReferenceHeaderItem;
 import org.apache.wicket.markup.html.WebPage;
 import org.apache.wicket.markup.html.basic.Label;
 import org.apache.wicket.markup.html.link.Link;
@@ -67,6 +74,20 @@ public abstract class PageAbstract exten
     private final List<ComponentType> childComponentIds;
     private final PageParameters pageParameters;
     
+    /**
+     * {@link Inject}ed when {@link #init() initialized}.
+     */
+    @Inject
+    @Named("applicationCss")
+    private String applicationCss;
+    
+    /**
+     * {@link Inject}ed when {@link #init() initialized}.
+     */
+    @Inject
+    @Named("applicationJs")
+    private String applicationJs;
+
     public PageAbstract(final PageParameters pageParameters, final ComponentType... childComponentIds)
{
         addApplicationActionsComponent();
         this.childComponentIds = Collections.unmodifiableList(Arrays.asList(childComponentIds));
@@ -77,6 +98,18 @@ public abstract class PageAbstract exten
         add(new Label(ID_PAGE_TITLE, PageParameterNames.PAGE_TITLE.getStringFrom(pageParameters,
DEFAULT_TITLE)));
     }
 
+    @Override
+    public void renderHead(IHeaderResponse response) {
+        super.renderHead(response);
+        if(applicationCss != null) {
+            response.render(CssReferenceHeaderItem.forUrl(applicationCss));
+        }
+        if(applicationJs != null) {
+            response.render(JavaScriptReferenceHeaderItem.forUrl(applicationJs));
+        }
+
+    }
+    
     private void addUserName() {
         add(new Label(ID_USER_NAME, getAuthenticationSession().getUserName()));
     }

Modified: incubator/isis/trunk/framework/viewer/wicket/wicket-viewer/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/wicket/wicket-viewer/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication.java?rev=1393977&r1=1393976&r2=1393977&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/wicket/wicket-viewer/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication.java
(original)
+++ incubator/isis/trunk/framework/viewer/wicket/wicket-viewer/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication.java
Thu Oct  4 10:19:58 2012
@@ -28,6 +28,7 @@ import com.google.inject.Guice;
 import com.google.inject.Inject;
 import com.google.inject.Injector;
 import com.google.inject.Module;
+import com.google.inject.name.Named;
 
 import org.apache.log4j.Logger;
 import org.apache.wicket.Application;
@@ -156,6 +157,7 @@ public class IsisWicketApplication exten
 
     private BookmarkedPagesModel bookmarkedPagesModel;
 
+
     // /////////////////////////////////////////////////
     // constructor, init
     // /////////////////////////////////////////////////

Modified: incubator/isis/trunk/framework/viewer/wicket/wicket-viewer/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketModule.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/wicket/wicket-viewer/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketModule.java?rev=1393977&r1=1393976&r2=1393977&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/wicket/wicket-viewer/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketModule.java
(original)
+++ incubator/isis/trunk/framework/viewer/wicket/wicket-viewer/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketModule.java
Thu Oct  4 10:19:58 2012
@@ -34,6 +34,26 @@ import org.apache.isis.viewer.wicket.vie
 import org.apache.isis.viewer.wicket.viewer.registries.pages.PageClassListDefault;
 import org.apache.isis.viewer.wicket.viewer.registries.pages.PageClassRegistryDefault;
 
+/**
+ * To override
+ * 
+ * <pre>
+ * final Module isisDefaults = new IsisWicketModule();
+ *
+ * final Module myAppOverrides = new AbstractModule() {
+ *     @Override
+ *     protected void configure() {
+ *         bind(ComponentFactoryRegistrar.class).to(ComponentFactoryRegistrarForMyApp.class);
+ *              
+ *         bind(String.class).annotatedWith(Names.named("applicationCss")).toInstance("application.css");
+ *         bind(String.class).annotatedWith(Names.named("applicationJs")).toInstance("application.js");
+ *         bind(String.class).annotatedWith(Names.named("welcomeMessage")).toInstance("Hello,
welcome to my app");
+ *         bind(String.class).annotatedWith(Names.named("aboutMessage")).toInstance("MyApp
v1.0.0");
+ *      }
+ *  };
+ * final Module overridden = Modules.override(isisDefaults).with(myAppOverrides);
+ * </pre>
+ */
 public class IsisWicketModule extends AbstractModule {
 
     @Override
@@ -44,14 +64,9 @@ public class IsisWicketModule extends Ab
         bind(ComponentFactoryRegistrar.class).to(ComponentFactoryRegistrarDefault.class);
         bind(ImageResourceCache.class).to(ImageCacheClassPath.class);
         
-        // override with:
-        // bind(String.class).annotatedWith(Names.named("welcomeMessage")).toInstance("...");
+        bind(String.class).annotatedWith(Names.named("applicationCss")).toProvider(Providers.of((String)null));
+        bind(String.class).annotatedWith(Names.named("applicationJs")).toProvider(Providers.of((String)null));
         bind(String.class).annotatedWith(Names.named("welcomeMessage")).toProvider(Providers.of((String)null));
-
-        // override with:
-        // bind(String.class).annotatedWith(Names.named("aboutMessage")).toInstance("...");
         bind(String.class).annotatedWith(Names.named("aboutMessage")).toProvider(Providers.of((String)null));
-
     }
-
 }
\ No newline at end of file



Mime
View raw message