You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2016/11/24 21:38:05 UTC
svn commit: r1771234 - in /myfaces/tobago/trunk:
tobago-core/src/main/java/org/apache/myfaces/tobago/context/
tobago-core/src/main/java/org/apache/myfaces/tobago/internal/context/
tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/r...
Author: lofwyr
Date: Thu Nov 24 21:38:05 2016
New Revision: 1771234
URL: http://svn.apache.org/viewvc?rev=1771234&view=rev
Log:
TOBAGO-1636: End of theme-dependent resource selection (ResourceManager)
* refactoring...
Modified:
myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ResourceManagerUtils.java
myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/context/ResourceManagerFactory.java
myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/FileRenderer.java
myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/ImageRenderer.java
myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/ObjectRenderer.java
myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/PageRenderer.java
myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SelectOneRadioRenderer.java
myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SheetRenderer.java
myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/TabGroupRenderer.java
myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/TreeIndentRenderer.java
myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/TreeNodeRenderer.java
myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/HtmlRendererUtils.java
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/CkeditorController.java
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/DemoController.java
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/NavigationNode.java
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/main.xhtml
myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/java/org/apache/myfaces/tobago/example/test/ResourceEntry.java
myfaces/tobago/trunk/tobago-extension/tobago-sandbox/src/main/java/org/apache/myfaces/tobago/renderkit/html/sandbox/standard/tag/NumberSliderRenderer.java
myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/tobago-config.xml
Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ResourceManagerUtils.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ResourceManagerUtils.java?rev=1771234&r1=1771233&r2=1771234&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ResourceManagerUtils.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ResourceManagerUtils.java Thu Nov 24 21:38:05 2016
@@ -19,11 +19,6 @@
package org.apache.myfaces.tobago.context;
-import org.apache.myfaces.tobago.internal.context.ResourceManagerFactory;
-
-import javax.faces.context.FacesContext;
-import java.util.ArrayList;
-import java.util.List;
import java.util.Locale;
public final class ResourceManagerUtils {
@@ -32,6 +27,8 @@ public final class ResourceManagerUtils
// no instance
}
+ //XXX RM
+/*
public static String getProperty(final FacesContext facesContext, final String bundle, final String key) {
return ResourceManagerFactory.getResourceManager(facesContext).getProperty(facesContext, bundle, key);
}
@@ -45,6 +42,7 @@ public final class ResourceManagerUtils
return result;
}
}
+*/
/**
* Searches for an image and return it with the context path
@@ -52,9 +50,12 @@ public final class ResourceManagerUtils
* @param facesContext the current FacesContext
* @param name the name of the image with extension
*/
+ //XXX RM
+/*
public static String getImageWithPath(final FacesContext facesContext, final String name) {
return getImageWithPath(facesContext, name, false);
}
+*/
/**
* Searches for an image and return it with the context path
@@ -63,6 +64,8 @@ public final class ResourceManagerUtils
* @param name the name of the image with extension
* @param ignoreMissing if set to false, an error message will be logged, when image is missing
*/
+ //XXX RM
+/*
public static String getImageWithPath(
final FacesContext facesContext, final String name, final boolean ignoreMissing) {
final String image
@@ -73,6 +76,7 @@ public final class ResourceManagerUtils
return facesContext.getExternalContext().getRequestContextPath() + image;
}
}
+*/
/**
* Searches for an image and return it with the context path.
@@ -82,10 +86,13 @@ public final class ResourceManagerUtils
* @param facesContext the current FacesContext
* @param name the name of the image without extension
*/
+ //XXX RM
+/*
public static String getImage(
final FacesContext facesContext, final String name) {
return getImage(facesContext, name, false);
}
+*/
/**
* Searches for an image and return it with the context path.
@@ -95,6 +102,8 @@ public final class ResourceManagerUtils
* @param name the name of the image without extension
* @param ignoreMissing if set to false, an error message will be logged, when image is missing
*/
+ //XXX RM
+/*
public static String getImage(
final FacesContext facesContext, final String name, final boolean ignoreMissing) {
final String image
@@ -105,7 +114,10 @@ public final class ResourceManagerUtils
return facesContext.getExternalContext().getRequestContextPath() + image;
}
}
+*/
+ //XXX RM
+/*
public static List<String> getStyles(final FacesContext facesContext, final String name) {
final String contextPath = facesContext.getExternalContext().getRequestContextPath();
final String[] styles = ResourceManagerFactory.getResourceManager(facesContext).getStyles(facesContext, name);
@@ -119,7 +131,10 @@ public final class ResourceManagerUtils
}
return withContext;
}
+*/
+//XXX RM
+ /*
public static List<String> getScripts(final FacesContext facesContext, final String name) {
final String contextPath = facesContext.getExternalContext().getRequestContextPath();
final String[] scripts = ResourceManagerFactory.getResourceManager(facesContext).getScripts(facesContext, name);
@@ -136,18 +151,7 @@ public final class ResourceManagerUtils
final boolean ignoreMissing) {
return getImage(facesContext, image + "Disabled", ignoreMissing);
}
-
- /**
- * Blank page e. g. useful to set src of iframes (to prevent https problems in ie, see TOBAGO-538)
- */
- public static String getBlankPage(final FacesContext facesContext) {
- return facesContext.getExternalContext().getRequestContextPath()
- + "/org/apache/myfaces/tobago/renderkit/html/standard/blank.html";
- }
-
- public static String getPageWithoutContextPath(final FacesContext facesContext, final String name) {
- return ResourceManagerUtils.getImageWithPath(facesContext, name);
- }
+*/
/**
* Detects if the value is an absolute resource or if the value has to be processed by the theme mechanism. A resource
@@ -180,6 +184,8 @@ public final class ResourceManagerUtils
return dot > slash ? dot : -1;
}
+// XXX RM
+/*
public static String getImageOrDisabledImageWithPath(
final FacesContext facesContext, final String image, final boolean disabled) {
return getImageOrDisabledImageWithPath(facesContext, image, disabled, false);
@@ -196,7 +202,10 @@ public final class ResourceManagerUtils
}
return imageWithPath;
}
+*/
+// XXX RM
+/*
public static String getImageOrDisabledImage(
final FacesContext facesContext, final String image, final boolean disabled) {
return getImageOrDisabledImage(facesContext, image, disabled, false);
@@ -213,4 +222,5 @@ public final class ResourceManagerUtils
}
return imageWithPath;
}
+*/
}
Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/context/ResourceManagerFactory.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/context/ResourceManagerFactory.java?rev=1771234&r1=1771233&r2=1771234&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/context/ResourceManagerFactory.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/context/ResourceManagerFactory.java Thu Nov 24 21:38:05 2016
@@ -54,7 +54,7 @@ public final class ResourceManagerFactor
final ResourceManagerImpl resourceManager = new ResourceManagerImpl(tobagoConfig);
final ResourceLocator resourceLocator = new ResourceLocator(servletContext, resourceManager);
- resourceLocator.locate();
+// resourceLocator.locate();
servletContext.setAttribute(RESOURCE_MANAGER, resourceManager);
Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/FileRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/FileRenderer.java?rev=1771234&r1=1771233&r2=1771234&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/FileRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/FileRenderer.java Thu Nov 24 21:38:05 2016
@@ -19,10 +19,14 @@
package org.apache.myfaces.tobago.internal.renderkit.renderer;
-import org.apache.myfaces.tobago.context.ResourceManagerUtils;
+import org.apache.myfaces.tobago.context.TobagoResourceBundle;
import org.apache.myfaces.tobago.internal.component.AbstractUIFile;
import org.apache.myfaces.tobago.internal.util.FacesContextUtils;
+import org.apache.myfaces.tobago.internal.util.HtmlRendererUtils;
+import org.apache.myfaces.tobago.internal.util.HttpPartWrapper;
+import org.apache.myfaces.tobago.internal.util.JsonUtils;
import org.apache.myfaces.tobago.internal.util.PartUtils;
+import org.apache.myfaces.tobago.internal.util.RenderUtils;
import org.apache.myfaces.tobago.renderkit.css.BootstrapClass;
import org.apache.myfaces.tobago.renderkit.css.Classes;
import org.apache.myfaces.tobago.renderkit.css.Icons;
@@ -31,10 +35,6 @@ import org.apache.myfaces.tobago.renderk
import org.apache.myfaces.tobago.renderkit.html.HtmlButtonTypes;
import org.apache.myfaces.tobago.renderkit.html.HtmlElements;
import org.apache.myfaces.tobago.renderkit.html.HtmlInputTypes;
-import org.apache.myfaces.tobago.internal.util.JsonUtils;
-import org.apache.myfaces.tobago.internal.util.HtmlRendererUtils;
-import org.apache.myfaces.tobago.internal.util.HttpPartWrapper;
-import org.apache.myfaces.tobago.internal.util.RenderUtils;
import org.apache.myfaces.tobago.util.ComponentUtils;
import org.apache.myfaces.tobago.validator.FileItemValidator;
import org.apache.myfaces.tobago.webapp.TobagoResponseWriter;
@@ -148,7 +148,7 @@ public class FileRenderer extends LabelL
writer.writeIdAttribute(fieldId);
writer.writeClassAttribute(Classes.create(file, "real"));
writer.writeNameAttribute(clientId);
- String multiFormat = ResourceManagerUtils.getPropertyNotNull(facesContext, "tobago", "tobago.file.multiFormat");
+ String multiFormat = TobagoResourceBundle.getString(facesContext, "tobago.file.multiFormat");
writer.writeAttribute(DataAttributes.dynamic("tobago-file-multi-format"), multiFormat, true);
// readonly seems not making sense in browsers.
writer.writeAttribute(HtmlAttributes.DISABLED, file.isDisabled() || file.isReadonly());
Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/ImageRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/ImageRenderer.java?rev=1771234&r1=1771233&r2=1771234&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/ImageRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/ImageRenderer.java Thu Nov 24 21:38:05 2016
@@ -52,14 +52,16 @@ public class ImageRenderer extends Rende
// absolute Path to image : nothing to do
src = value;
} else {
- final boolean disabled = isDisabled(image);
+// final boolean disabled = isDisabled(image);
if (ResourceManagerUtils.indexOfExtension(value) > -1) { // has extension
- src = ResourceManagerUtils.getImageOrDisabledImageWithPath(facesContext, value, disabled);
+ src = value;
+// XXX RM src = ResourceManagerUtils.getImageOrDisabledImageWithPath(facesContext, value, disabled);
} else if (value.startsWith("fa-")) {
fontAwesome = true;
src = null;
} else {
- src = ResourceManagerUtils.getImageOrDisabledImage(facesContext, value, disabled);
+ src = value;
+// XXX RM src = ResourceManagerUtils.getImageOrDisabledImage(facesContext, value, disabled);
}
}
} else {
Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/ObjectRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/ObjectRenderer.java?rev=1771234&r1=1771233&r2=1771234&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/ObjectRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/ObjectRenderer.java Thu Nov 24 21:38:05 2016
@@ -20,12 +20,12 @@
package org.apache.myfaces.tobago.internal.renderkit.renderer;
import org.apache.myfaces.tobago.component.UIObject;
-import org.apache.myfaces.tobago.context.ResourceManagerUtils;
+import org.apache.myfaces.tobago.context.TobagoResourceBundle;
+import org.apache.myfaces.tobago.internal.util.HtmlRendererUtils;
import org.apache.myfaces.tobago.renderkit.RendererBase;
import org.apache.myfaces.tobago.renderkit.css.Classes;
import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
import org.apache.myfaces.tobago.renderkit.html.HtmlElements;
-import org.apache.myfaces.tobago.internal.util.HtmlRendererUtils;
import org.apache.myfaces.tobago.webapp.TobagoResponseWriter;
import javax.faces.component.UIComponent;
@@ -48,23 +48,17 @@ public class ObjectRenderer extends Rend
}
writer.writeNameAttribute(name);
HtmlRendererUtils.writeDataAttributes(facesContext, writer, object);
- final String src = object.getSrc();
- if (src != null) {
- writer.writeAttribute(HtmlAttributes.SRC, src, true);
- } else {
- writer.writeAttribute(HtmlAttributes.SRC, ResourceManagerUtils.getBlankPage(facesContext), false);
- }
+ writer.writeAttribute(HtmlAttributes.SRC, object.getSrc(), true);
writer.writeClassAttribute(Classes.create(object), object.getCustomClass());
writer.writeStyleAttribute(object.getStyle());
- String noframes = ResourceManagerUtils.getPropertyNotNull(
- facesContext, "tobago", "browser.noframe.message.prefix");
+ String noframes = TobagoResourceBundle.getString(facesContext, "browser.noframe.message.prefix");
writer.writeText(noframes);
writer.writeText(" ");
- if (src != null) {
- writer.writeText(src);
+ if (object.getSrc() != null) {
+ writer.writeText(object.getSrc());
}
- noframes = ResourceManagerUtils.getPropertyNotNull(facesContext, "tobago", "browser.noframe.message.postfix");
+ noframes = TobagoResourceBundle.getString(facesContext, "browser.noframe.message.postfix");
writer.writeText(" " + noframes);
writer.endElement(HtmlElements.IFRAME);
Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/PageRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/PageRenderer.java?rev=1771234&r1=1771233&r2=1771234&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/PageRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/PageRenderer.java Thu Nov 24 21:38:05 2016
@@ -25,12 +25,15 @@ import org.apache.myfaces.tobago.compone
import org.apache.myfaces.tobago.config.TobagoConfig;
import org.apache.myfaces.tobago.context.ClientProperties;
import org.apache.myfaces.tobago.context.Markup;
-import org.apache.myfaces.tobago.context.ResourceManagerUtils;
import org.apache.myfaces.tobago.context.Theme;
+import org.apache.myfaces.tobago.context.TobagoResourceBundle;
import org.apache.myfaces.tobago.internal.component.AbstractUIPage;
import org.apache.myfaces.tobago.internal.util.AccessKeyLogger;
import org.apache.myfaces.tobago.internal.util.FacesContextUtils;
+import org.apache.myfaces.tobago.internal.util.HtmlRendererUtils;
+import org.apache.myfaces.tobago.internal.util.JsonUtils;
import org.apache.myfaces.tobago.internal.util.MimeTypeUtils;
+import org.apache.myfaces.tobago.internal.util.RenderUtils;
import org.apache.myfaces.tobago.internal.util.ResponseUtils;
import org.apache.myfaces.tobago.internal.util.StringUtils;
import org.apache.myfaces.tobago.portlet.PortletUtils;
@@ -41,9 +44,6 @@ import org.apache.myfaces.tobago.renderk
import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
import org.apache.myfaces.tobago.renderkit.html.HtmlElements;
import org.apache.myfaces.tobago.renderkit.html.HtmlInputTypes;
-import org.apache.myfaces.tobago.internal.util.JsonUtils;
-import org.apache.myfaces.tobago.internal.util.HtmlRendererUtils;
-import org.apache.myfaces.tobago.internal.util.RenderUtils;
import org.apache.myfaces.tobago.util.ComponentUtils;
import org.apache.myfaces.tobago.webapp.Secret;
import org.apache.myfaces.tobago.webapp.TobagoResponseWriter;
@@ -61,6 +61,7 @@ import javax.portlet.ResourceURL;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.Collections;
import java.util.List;
import java.util.Map;
@@ -178,28 +179,17 @@ public class PageRenderer extends Render
final String icon = page.getApplicationIcon();
if (icon != null) {
- final String href;
- if (ResourceManagerUtils.isAbsoluteResource(icon)) {
- href = icon;
- } else {
- href = ResourceManagerUtils.getImageWithPath(facesContext, icon);
- }
-
- if (href != null) {
- writer.startElement(HtmlElements.LINK);
- if (href.endsWith(".ico")) {
- writer.writeAttribute(HtmlAttributes.REL, "shortcut icon", false);
- writer.writeAttribute(HtmlAttributes.HREF, href, true);
- } else {
- // XXX IE only supports ICO files for favicons
- writer.writeAttribute(HtmlAttributes.REL, "icon", false);
- writer.writeAttribute(HtmlAttributes.TYPE, MimeTypeUtils.getMimeTypeForFile(href), true);
- writer.writeAttribute(HtmlAttributes.HREF, href, true);
- }
- writer.endElement(HtmlElements.LINK);
+ writer.startElement(HtmlElements.LINK);
+ if (icon.endsWith(".ico")) {
+ writer.writeAttribute(HtmlAttributes.REL, "shortcut icon", false);
+ writer.writeAttribute(HtmlAttributes.HREF, icon, true);
} else {
- LOG.warn("Application icon '" + icon + "' not found!");
+ // XXX IE only supports ICO files for favicons
+ writer.writeAttribute(HtmlAttributes.REL, "icon", false);
+ writer.writeAttribute(HtmlAttributes.TYPE, MimeTypeUtils.getMimeTypeForFile(icon), true);
+ writer.writeAttribute(HtmlAttributes.HREF, icon, true);
}
+ writer.endElement(HtmlElements.LINK);
}
UIViewRoot root = facesContext.getViewRoot();
List<UIComponent> componentResources = root.getComponentResources(facesContext, HEAD_TARGET);
@@ -319,7 +309,9 @@ public class PageRenderer extends Render
private void writeStyle(final FacesContext facesContext, final TobagoResponseWriter writer, final String styleFile)
throws IOException {
- final List<String> styles = ResourceManagerUtils.getStyles(facesContext, styleFile);
+// XXX RM
+ final List<String> styles = Collections.singletonList(styleFile);
+// final List<String> styles = ResourceManagerUtils.getStyles(facesContext, styleFile);
for (final String styleString : styles) {
if (styleString.length() > 0) {
writer.startElement(HtmlElements.LINK);
@@ -378,7 +370,7 @@ public class PageRenderer extends Render
writer.startElement(HtmlElements.NOSCRIPT);
writer.startElement(HtmlElements.DIV);
writer.writeClassAttribute(Classes.create(page, "noscript"));
- writer.writeText(ResourceManagerUtils.getPropertyNotNull(facesContext, "tobago", "pageNoscript"));
+ writer.writeText(TobagoResourceBundle.getString(facesContext, "pageNoscript"));
writer.endElement(HtmlElements.DIV);
writer.endElement(HtmlElements.NOSCRIPT);
@@ -432,12 +424,13 @@ public class PageRenderer extends Render
private void encodeScript(final FacesContext facesContext, final TobagoResponseWriter writer, final String script)
throws IOException {
final List<String> list;
- if (ResourceManagerUtils.isAbsoluteResource(script)) {
+// XXX RM
+// if (ResourceManagerUtils.isAbsoluteResource(script)) {
list = new ArrayList<String>();
list.add(script);
- } else {
- list = ResourceManagerUtils.getScripts(facesContext, script);
- }
+// } else {
+// list = ResourceManagerUtils.getScripts(facesContext, script);
+// }
for (final String src : list) {
if (StringUtils.isNotBlank(src)) {
writer.startElement(HtmlElements.SCRIPT);
Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SelectOneRadioRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SelectOneRadioRenderer.java?rev=1771234&r1=1771233&r2=1771234&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SelectOneRadioRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SelectOneRadioRenderer.java Thu Nov 24 21:38:05 2016
@@ -20,17 +20,16 @@
package org.apache.myfaces.tobago.internal.renderkit.renderer;
import org.apache.myfaces.tobago.component.UISelectOneRadio;
-import org.apache.myfaces.tobago.context.ResourceManagerUtils;
+import org.apache.myfaces.tobago.internal.util.HtmlRendererUtils;
+import org.apache.myfaces.tobago.internal.util.JsonUtils;
import org.apache.myfaces.tobago.internal.util.ObjectUtils;
+import org.apache.myfaces.tobago.internal.util.RenderUtils;
+import org.apache.myfaces.tobago.internal.util.SelectItemUtils;
import org.apache.myfaces.tobago.renderkit.css.BootstrapClass;
import org.apache.myfaces.tobago.renderkit.css.Classes;
import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
import org.apache.myfaces.tobago.renderkit.html.HtmlElements;
import org.apache.myfaces.tobago.renderkit.html.HtmlInputTypes;
-import org.apache.myfaces.tobago.internal.util.JsonUtils;
-import org.apache.myfaces.tobago.internal.util.HtmlRendererUtils;
-import org.apache.myfaces.tobago.internal.util.RenderUtils;
-import org.apache.myfaces.tobago.internal.util.SelectItemUtils;
import org.apache.myfaces.tobago.util.ComponentUtils;
import org.apache.myfaces.tobago.webapp.TobagoResponseWriter;
@@ -102,7 +101,8 @@ public class SelectOneRadioRenderer exte
final String image = tobagoItem.getImage();
if (image != null) {
final String imageToRender
- = ResourceManagerUtils.getImageOrDisabledImageWithPath(facesContext, image, item.isDisabled());
+ = image;
+// XXX RM = ResourceManagerUtils.getImageOrDisabledImageWithPath(facesContext, image, item.isDisabled());
writer.startElement(HtmlElements.IMG);
writer.writeAttribute(HtmlAttributes.SRC, imageToRender, true);
writer.writeAttribute(HtmlAttributes.ALT, "", false);
Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SheetRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SheetRenderer.java?rev=1771234&r1=1771233&r2=1771234&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SheetRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SheetRenderer.java Thu Nov 24 21:38:05 2016
@@ -30,7 +30,7 @@ import org.apache.myfaces.tobago.compone
import org.apache.myfaces.tobago.component.UIReload;
import org.apache.myfaces.tobago.component.UISheet;
import org.apache.myfaces.tobago.context.Markup;
-import org.apache.myfaces.tobago.context.ResourceManagerUtils;
+import org.apache.myfaces.tobago.context.TobagoResourceBundle;
import org.apache.myfaces.tobago.event.PageAction;
import org.apache.myfaces.tobago.internal.component.AbstractUIColumn;
import org.apache.myfaces.tobago.internal.component.AbstractUIColumnBase;
@@ -523,7 +523,7 @@ public class SheetRenderer extends Rende
writer.startElement(HtmlElements.LI);
writer.writeClassAttribute(BootstrapClass.PAGE_ITEM);
writer.writeAttribute(HtmlAttributes.TITLE,
- ResourceManagerUtils.getPropertyNotNull(facesContext, "tobago", "sheetPagingInfoRowPagingTip"), true);
+ TobagoResourceBundle.getString(facesContext, "sheetPagingInfoRowPagingTip"), true);
writer.startElement(HtmlElements.SPAN);
writer.writeClassAttribute(Classes.create(sheet, "pagingText"), BootstrapClass.PAGE_LINK);
if (sheet.getRowCount() != 0) {
@@ -550,7 +550,7 @@ public class SheetRenderer extends Rende
final String inputMarker = "{#}";
final Object[] args = {inputMarker, last1 == -1 ? "?" : last1, unknown ? "" : sheet.getRowCount()};
final MessageFormat detail = new MessageFormat(
- ResourceManagerUtils.getPropertyNotNull(facesContext, "tobago", key), locale);
+ TobagoResourceBundle.getString(facesContext, key), locale);
final String formatted = detail.format(args);
final int pos = formatted.indexOf(inputMarker);
if (pos >= 0) {
@@ -574,7 +574,7 @@ public class SheetRenderer extends Rende
writer.writeText(formatted);
}
} else {
- writer.write(ResourceManagerUtils.getPropertyNotNull(facesContext, "tobago", "sheetPagingInfoEmptyRow"));
+ writer.write(TobagoResourceBundle.getString(facesContext, "sheetPagingInfoEmptyRow"));
}
writer.endElement(HtmlElements.SPAN);
writer.endElement(HtmlElements.LI);
@@ -622,7 +622,7 @@ public class SheetRenderer extends Rende
writer.startElement(HtmlElements.SPAN);
writer.writeClassAttribute(Classes.create(sheet, "pagingText"), BootstrapClass.PAGE_LINK);
writer.writeAttribute(HtmlAttributes.TITLE,
- ResourceManagerUtils.getPropertyNotNull(facesContext, "tobago", "sheetPagingInfoPagePagingTip"), true);
+ TobagoResourceBundle.getString(facesContext, "sheetPagingInfoPagePagingTip"), true);
if (sheet.getRowCount() != 0) {
final Locale locale = facesContext.getViewRoot().getLocale();
final int first = sheet.getCurrentPage() + 1;
@@ -645,7 +645,7 @@ public class SheetRenderer extends Rende
final String inputMarker = "{#}";
final Object[] args = {inputMarker, pages == -1 ? "?" : pages};
final MessageFormat detail = new MessageFormat(
- ResourceManagerUtils.getPropertyNotNull(facesContext, "tobago", key), locale);
+ TobagoResourceBundle.getString(facesContext, key), locale);
final String formatted = detail.format(args);
final int pos = formatted.indexOf(inputMarker);
if (pos >= 0) {
@@ -669,7 +669,7 @@ public class SheetRenderer extends Rende
writer.writeText(formatted);
}
} else {
- writer.writeText(ResourceManagerUtils.getPropertyNotNull(facesContext, "tobago", "sheetPagingInfoEmptyPage"));
+ writer.writeText(TobagoResourceBundle.getString(facesContext, "sheetPagingInfoEmptyPage"));
}
writer.endElement(HtmlElements.SPAN);
writer.endElement(HtmlElements.LI);
@@ -824,7 +824,7 @@ public class SheetRenderer extends Rende
} else {
tip += " - ";
}
- tip += ResourceManagerUtils.getPropertyNotNull(facesContext, "tobago", "sheetTipSorting");
+ tip += TobagoResourceBundle.getString(facesContext, "sheetTipSorting");
markup = markup.add(Markup.SORTABLE);
@@ -833,11 +833,11 @@ public class SheetRenderer extends Rende
final String sortTitle;
if (sheetState.isAscending()) {
sorterIcon = Icons.ANGLE_UP;
- sortTitle = ResourceManagerUtils.getPropertyNotNull(facesContext, "tobago", "sheetAscending");
+ sortTitle = TobagoResourceBundle.getString(facesContext, "sheetAscending");
markup = markup.add(Markup.ASCENDING);
} else {
sorterIcon = Icons.ANGLE_DOWN;
- sortTitle = ResourceManagerUtils.getPropertyNotNull(facesContext, "tobago", "sheetDescending");
+ sortTitle = TobagoResourceBundle.getString(facesContext, "sheetDescending");
markup = markup.add(Markup.DESCENDING);
}
if (sortTitle != null) {
@@ -872,20 +872,20 @@ public class SheetRenderer extends Rende
writer.writeClassAttribute(BootstrapClass.DROPDOWN_ITEM);
writer.writeAttribute(HtmlAttributes.TYPE, HtmlButtonTypes.BUTTON);
writer.writeAttribute(DataAttributes.COMMAND, "sheetSelectAll", false);
- writer.writeText(ResourceManagerUtils.getPropertyNotNull(facesContext, "tobago", "sheetMenuSelect"));
+ writer.writeText(TobagoResourceBundle.getString(facesContext, "sheetMenuSelect"));
writer.endElement(HtmlElements.BUTTON);
writer.startElement(HtmlElements.BUTTON);
writer.writeClassAttribute(BootstrapClass.DROPDOWN_ITEM);
writer.writeAttribute(HtmlAttributes.TYPE, HtmlButtonTypes.BUTTON);
writer.writeAttribute(DataAttributes.COMMAND, "sheetDeselectAll", false);
- writer.writeText(ResourceManagerUtils.getPropertyNotNull(facesContext, "tobago", "sheetMenuUnselect"));
+ writer.writeText(TobagoResourceBundle.getString(facesContext, "sheetMenuUnselect"));
writer.endElement(HtmlElements.BUTTON);
writer.startElement(HtmlElements.BUTTON);
writer.writeClassAttribute(BootstrapClass.DROPDOWN_ITEM);
writer.writeAttribute(HtmlAttributes.TYPE, HtmlButtonTypes.BUTTON);
writer.writeAttribute(DataAttributes.COMMAND, "sheetToggleAll", false);
writer
- .writeText(ResourceManagerUtils.getPropertyNotNull(facesContext, "tobago", "sheetMenuToggleselect"));
+ .writeText(TobagoResourceBundle.getString(facesContext, "sheetMenuToggleselect"));
writer.endElement(HtmlElements.BUTTON);
writer.endElement(HtmlElements.DIV);
writer.endElement(HtmlElements.DIV);
@@ -1002,7 +1002,7 @@ public class SheetRenderer extends Rende
}
final Locale locale = facesContext.getViewRoot().getLocale();
- final String message = ResourceManagerUtils.getPropertyNotNull(facesContext, "tobago", "sheet" + action.getToken());
+ final String message = TobagoResourceBundle.getString(facesContext, "sheet" + action.getToken());
final String tip = new MessageFormat(message, locale).format(new Integer[]{target}); // needed fot ToPage
final TobagoResponseWriter writer = getResponseWriter(facesContext);
Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/TabGroupRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/TabGroupRenderer.java?rev=1771234&r1=1771233&r2=1771234&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/TabGroupRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/TabGroupRenderer.java Thu Nov 24 21:38:05 2016
@@ -27,7 +27,6 @@ import org.apache.myfaces.tobago.compone
import org.apache.myfaces.tobago.component.UITab;
import org.apache.myfaces.tobago.component.UITabGroup;
import org.apache.myfaces.tobago.context.Markup;
-import org.apache.myfaces.tobago.context.ResourceManagerUtils;
import org.apache.myfaces.tobago.event.TabChangeEvent;
import org.apache.myfaces.tobago.internal.behavior.EventBehavior;
import org.apache.myfaces.tobago.internal.component.AbstractUIPanelBase;
@@ -271,11 +270,12 @@ public class TabGroupRenderer extends Re
String image = tab.getImage();
// tab.getImage() resolves to empty string if el-expression resolves to null
if (image != null && !image.isEmpty()) {
- if (ResourceManagerUtils.isAbsoluteResource(image)) {
+// XXX RM
+ // if (ResourceManagerUtils.isAbsoluteResource(image)) {
// absolute Path to image : nothing to do
- } else {
- image = ResourceManagerUtils.getImageOrDisabledImageWithPath(facesContext, image, disabled);
- }
+// } else {
+// image = ResourceManagerUtils.getImageOrDisabledImageWithPath(facesContext, image, disabled);
+// }
writer.startElement(HtmlElements.IMG);
writer.writeAttribute(HtmlAttributes.SRC, image, true);
// TBD writer.writeClassAttribute(Classes.create(tab, (label.getLabel() != null? "image-right-margin" : "image")));
Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/TreeIndentRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/TreeIndentRenderer.java?rev=1771234&r1=1771233&r2=1771234&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/TreeIndentRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/TreeIndentRenderer.java Thu Nov 24 21:38:05 2016
@@ -22,15 +22,14 @@ package org.apache.myfaces.tobago.intern
import org.apache.myfaces.tobago.component.UITree;
import org.apache.myfaces.tobago.component.UITreeIndent;
import org.apache.myfaces.tobago.context.Markup;
-import org.apache.myfaces.tobago.context.ResourceManagerUtils;
import org.apache.myfaces.tobago.internal.component.AbstractUIData;
import org.apache.myfaces.tobago.internal.component.AbstractUITreeNodeBase;
+import org.apache.myfaces.tobago.internal.util.HtmlRendererUtils;
import org.apache.myfaces.tobago.renderkit.RendererBase;
import org.apache.myfaces.tobago.renderkit.css.BootstrapClass;
import org.apache.myfaces.tobago.renderkit.css.Classes;
import org.apache.myfaces.tobago.renderkit.css.Icons;
import org.apache.myfaces.tobago.renderkit.html.HtmlElements;
-import org.apache.myfaces.tobago.internal.util.HtmlRendererUtils;
import org.apache.myfaces.tobago.util.ComponentUtils;
import org.apache.myfaces.tobago.webapp.TobagoResponseWriter;
@@ -86,8 +85,8 @@ public class TreeIndentRenderer extends
throws IOException {
final boolean dropFirst = !showRoot || !showRootJunction && (showLines || showIcons);
- final String blank = ResourceManagerUtils.getImage(facesContext, "image/blank");
- final String perpendicular = ResourceManagerUtils.getImage(facesContext, "image/I");
+// final String blank = ResourceManagerUtils.getImage(facesContext, "image/blank");
+// final String perpendicular = ResourceManagerUtils.getImage(facesContext, "image/I");
for (int i = dropFirst ? 1 : 0; i < junctions.size() - 1; i++) {
final Boolean junction = junctions.get(i);
@@ -163,7 +162,7 @@ public class TreeIndentRenderer extends
writer.writeAttribute(HtmlAttributes.src, src, true);
if (folder) {
writer.writeAttribute(DataAttributes.SRC_OPEN, srcOpen, true);
- writer.writeAttribute(DataAttributes.SRC_CLOSE, srcClose, true);
+ writer.writeAttribute(DataAttributes.SRC_CLOSED, srcClose, true);
}
writer.writeAttribute(HtmlAttributes.alt, "", false);
writer.endElement(HtmlElements.IMG);
Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/TreeNodeRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/TreeNodeRenderer.java?rev=1771234&r1=1771233&r2=1771234&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/TreeNodeRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/TreeNodeRenderer.java Thu Nov 24 21:38:05 2016
@@ -22,12 +22,12 @@ package org.apache.myfaces.tobago.intern
import org.apache.myfaces.tobago.component.UITreeNode;
import org.apache.myfaces.tobago.component.UITreeSelect;
import org.apache.myfaces.tobago.context.Markup;
-import org.apache.myfaces.tobago.context.ResourceManagerUtils;
import org.apache.myfaces.tobago.internal.component.AbstractUIData;
import org.apache.myfaces.tobago.internal.component.AbstractUITree;
import org.apache.myfaces.tobago.internal.component.AbstractUITreeListbox;
import org.apache.myfaces.tobago.internal.component.AbstractUITreeMenu;
import org.apache.myfaces.tobago.internal.component.AbstractUITreeNodeBase;
+import org.apache.myfaces.tobago.internal.util.HtmlRendererUtils;
import org.apache.myfaces.tobago.layout.Display;
import org.apache.myfaces.tobago.layout.Measure;
import org.apache.myfaces.tobago.model.Selectable;
@@ -37,7 +37,6 @@ import org.apache.myfaces.tobago.renderk
import org.apache.myfaces.tobago.renderkit.html.DataAttributes;
import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
import org.apache.myfaces.tobago.renderkit.html.HtmlElements;
-import org.apache.myfaces.tobago.internal.util.HtmlRendererUtils;
import org.apache.myfaces.tobago.util.ComponentUtils;
import org.apache.myfaces.tobago.webapp.TobagoResponseWriter;
import org.slf4j.Logger;
@@ -197,6 +196,8 @@ public class TreeNodeRenderer extends Re
final FacesContext facesContext, final TobagoResponseWriter writer, final boolean expanded,
final AbstractUITreeNodeBase node)
throws IOException {
+ LOG.warn("todo: font-awesome icons");
+/* XXX
final String srcOpen = ResourceManagerUtils.getImage(facesContext, "image/treeMenuOpen");
final String srcClose = ResourceManagerUtils.getImage(facesContext, "image/treeMenuClose");
final String src = expanded ? srcOpen : srcClose;
@@ -204,9 +205,10 @@ public class TreeNodeRenderer extends Re
writer.writeClassAttribute(Classes.create(node, "toggle"));
writer.writeAttribute(HtmlAttributes.SRC, src, false);
writer.writeAttribute(DataAttributes.SRC_OPEN, srcOpen, false);
- writer.writeAttribute(DataAttributes.SRC_CLOSE, srcClose, false);
+ writer.writeAttribute(DataAttributes.SRC_CLOSED, srcClose, false);
writer.writeAttribute(HtmlAttributes.ALT, "", false);
writer.endElement(HtmlElements.IMG);
+*/
}
protected Measure leftOffset(AbstractUIData data, int level, boolean showRoot) {
Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/HtmlRendererUtils.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/HtmlRendererUtils.java?rev=1771234&r1=1771233&r2=1771234&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/HtmlRendererUtils.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/HtmlRendererUtils.java Thu Nov 24 21:38:05 2016
@@ -22,7 +22,6 @@ package org.apache.myfaces.tobago.intern
import org.apache.myfaces.tobago.component.Attributes;
import org.apache.myfaces.tobago.component.Visual;
import org.apache.myfaces.tobago.context.Markup;
-import org.apache.myfaces.tobago.context.ResourceManagerUtils;
import org.apache.myfaces.tobago.internal.webapp.TobagoResponseWriterWrapper;
import org.apache.myfaces.tobago.renderkit.LabelWithAccessKey;
import org.apache.myfaces.tobago.renderkit.css.Classes;
@@ -111,11 +110,12 @@ public final class HtmlRendererUtils {
if (image.startsWith("fa-")) {
writer.writeIcon(null, FontAwesomeIconEncoder.generateClass(image)); // todo: should not be static
} else {
- if (ResourceManagerUtils.isAbsoluteResource(image)) {
+ // XXX RM
+// if (ResourceManagerUtils.isAbsoluteResource(image)) {
// absolute Path to image: nothing to do
- } else {
- image = getImageWithPath(facesContext, image, disabled);
- }
+// } else {
+// image = getImageWithPath(facesContext, image, disabled);
+// }
writer.startElement(HtmlElements.IMG);
writer.writeAttribute(HtmlAttributes.SRC, image, true);
writer.writeAttribute(HtmlAttributes.ALT, "", false);
@@ -130,6 +130,8 @@ public final class HtmlRendererUtils {
}
}
+ // XXX RM
+/*
public static String getImageWithPath(final FacesContext facesContext, final String image, final boolean disabled) {
final int indexOfExtension = ResourceManagerUtils.indexOfExtension(image);
if (indexOfExtension == -1) {
@@ -138,6 +140,7 @@ public final class HtmlRendererUtils {
return ResourceManagerUtils.getImageOrDisabledImageWithPath(facesContext, image, disabled);
}
}
+*/
/**
* @deprecated since 3.0.0, use {@link org.apache.myfaces.tobago.renderkit.RendererBase#getResponseWriter}
@@ -243,7 +246,9 @@ public final class HtmlRendererUtils {
if (image != null) {
final Style style = new Style();
style.setBackgroundImage("url('"
- + ResourceManagerUtils.getImageOrDisabledImageWithPath(facesContext, image, item.isDisabled())
+// XXX RM
+ + image
+// + ResourceManagerUtils.getImageOrDisabledImageWithPath(facesContext, image, item.isDisabled())
+ "')");
writer.writeStyleAttribute(style);
}
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/CkeditorController.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/CkeditorController.java?rev=1771234&r1=1771233&r2=1771234&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/CkeditorController.java (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/CkeditorController.java Thu Nov 24 21:38:05 2016
@@ -20,7 +20,6 @@
package org.apache.myfaces.tobago.example.demo;
import org.apache.myfaces.tobago.config.TobagoConfig;
-import org.apache.myfaces.tobago.context.ResourceManagerUtils;
import javax.enterprise.context.SessionScoped;
import javax.faces.context.FacesContext;
@@ -37,10 +36,12 @@ public class CkeditorController extends
private boolean collapsed;
public CkeditorController() {
+/* XXX RM
editorAvailable = ResourceManagerUtils.getScripts(
FacesContext.getCurrentInstance(),
"content/20-component/110-wysiwyg/01-ckeditor/ckeditor/ckeditor.js")
.size() != 0;
+*/
final TobagoConfig tobagoConfig = TobagoConfig.getInstance(FacesContext.getCurrentInstance());
contentSecurityPolicyMode = tobagoConfig.getContentSecurityPolicy().getMode().getValue();
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/DemoController.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/DemoController.java?rev=1771234&r1=1771233&r2=1771234&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/DemoController.java (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/DemoController.java Thu Nov 24 21:38:05 2016
@@ -21,7 +21,6 @@ package org.apache.myfaces.tobago.exampl
import org.apache.deltaspike.core.api.scope.WindowScoped;
import org.apache.myfaces.tobago.component.UISheet;
-import org.apache.myfaces.tobago.context.ResourceManagerUtils;
import org.apache.myfaces.tobago.example.data.Salutation;
import org.apache.myfaces.tobago.model.SelectItem;
import org.apache.myfaces.tobago.model.Selectable;
@@ -105,34 +104,26 @@ public class DemoController implements S
sheetConfig = new SheetConfig();
}
- private static SelectItem[] getSalutationSelectItems(final String bundle) {
+ private static SelectItem[] getSalutationSelectItems() {
final Salutation[] salutations = Salutation.values();
final SelectItem[] items = new SelectItem[salutations.length];
for (int i = 0; i < items.length; i++) {
- String label = ResourceManagerUtils.getProperty(
- FacesContext.getCurrentInstance(), bundle, salutations[i].getKey());
+ String label = DemoBundle.getString(FacesContext.getCurrentInstance(),salutations[i].getKey());
if (LOG.isTraceEnabled()) {
LOG.trace("label = " + label + "");
}
- if (label == null) {
- label = salutations[i].getKey();
- }
items[i] = new SelectItem(salutations[i], label);
}
return items;
}
- private static SelectItem[] getSelectItems(final Selectable[] keys, final String bundle) {
+ private static SelectItem[] getSelectItems(final Selectable[] keys) {
final SelectItem[] items = new SelectItem[keys.length];
for (int i = 0; i < items.length; i++) {
- String label = ResourceManagerUtils.getProperty(
- FacesContext.getCurrentInstance(), bundle, keys[i].name());
+ String label = DemoBundle.getString(FacesContext.getCurrentInstance(), keys[i].name());
if (LOG.isTraceEnabled()) {
LOG.trace("label = " + label + "");
}
- if (label == null) {
- label = keys[i].name();
- }
items[i] = new SelectItem(keys[i], label);
}
return items;
@@ -177,22 +168,22 @@ public class DemoController implements S
}
public SelectItem[] getItems() {
- return getSalutationSelectItems("demo");
+ return getSalutationSelectItems();
}
public SelectItem[] getItems2() {
- return getSelectItems(TREE_SELECT_MODE_KEYS, "demo");
+ return getSelectItems(TREE_SELECT_MODE_KEYS);
}
public SelectItem[] getTreeSelectModeItems() {
- return getSelectItems(TREE_SELECT_MODE_KEYS, "demo");
+ return getSelectItems(TREE_SELECT_MODE_KEYS);
}
public SelectItem[] getTreeListboxSelectModeItems() {
- return getSelectItems(TREELISTBOX_SELECT_MODE_KEYS, "demo");
+ return getSelectItems(TREELISTBOX_SELECT_MODE_KEYS);
}
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/NavigationNode.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/NavigationNode.java?rev=1771234&r1=1771233&r2=1771234&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/NavigationNode.java (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/NavigationNode.java Thu Nov 24 21:38:05 2016
@@ -19,8 +19,9 @@
package org.apache.myfaces.tobago.example.demo;
-import org.apache.myfaces.tobago.context.ResourceManagerUtils;
import org.apache.myfaces.tobago.model.TreePath;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import javax.faces.context.FacesContext;
import javax.swing.tree.DefaultMutableTreeNode;
@@ -29,6 +30,8 @@ import java.util.regex.Pattern;
public class NavigationNode extends DefaultMutableTreeNode implements Comparable {
+ private static final Logger LOG = LoggerFactory.getLogger(NavigationNode.class);
+
private final String name;
private final String branch;
private final String title;
@@ -51,8 +54,14 @@ public class NavigationNode extends Defa
name = matcher.group(2);
final String extension = matcher.group(3);
final String key = name.replaceAll("\\+|\\-", "_");
- final String t = ResourceManagerUtils.getProperty(FacesContext.getCurrentInstance(), "demo", key);
- title = t != null ? t : name;
+ String t;
+ try {
+ t = DemoBundle.getString(FacesContext.getCurrentInstance(), key);
+ } catch (Exception e) {
+ LOG.error("Not found key '{}' in bundle", key);
+ t = name;
+ }
+ title = t;
}
@Override
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/main.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/main.xhtml?rev=1771234&r1=1771233&r2=1771234&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/main.xhtml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/main.xhtml Thu Nov 24 21:38:05 2016
@@ -30,10 +30,10 @@
<tc:dataAttribute name="tobago-log-level" value="DEBUG"/>
-->
- <tc:script file="script/demo.js"/>
- <tc:script file="script/prism.js"/>
- <tc:style file="style/demo.css"/>
- <tc:style file="style/prism.css"/>
+ <tc:script file="#{request.contextPath}/script/demo.js"/>
+ <tc:script file="#{request.contextPath}/script/prism.js"/>
+ <tc:style file="#{request.contextPath}/style/demo.css"/>
+ <tc:style file="#{request.contextPath}/style/prism.css"/>
<ui:include src="/menu.xhtml"/>
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/java/org/apache/myfaces/tobago/example/test/ResourceEntry.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/java/org/apache/myfaces/tobago/example/test/ResourceEntry.java?rev=1771234&r1=1771233&r2=1771234&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/java/org/apache/myfaces/tobago/example/test/ResourceEntry.java (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/java/org/apache/myfaces/tobago/example/test/ResourceEntry.java Thu Nov 24 21:38:05 2016
@@ -19,8 +19,6 @@
package org.apache.myfaces.tobago.example.test;
-import org.apache.myfaces.tobago.context.ResourceManagerUtils;
-
import javax.faces.context.FacesContext;
public class ResourceEntry {
@@ -47,6 +45,7 @@ public class ResourceEntry {
}
public boolean check(final FacesContext facesContext) {
+/*
switch (type) {
case IMAGE:
valid = ResourceManagerUtils.getImageWithPath(facesContext, name) != null;
@@ -58,6 +57,10 @@ public class ResourceEntry {
throw new IllegalArgumentException("Unknown type " + type);
}
return valid;
+*/
+ //XXX RM
+
+ return true;
}
public String getName() {
Modified: myfaces/tobago/trunk/tobago-extension/tobago-sandbox/src/main/java/org/apache/myfaces/tobago/renderkit/html/sandbox/standard/tag/NumberSliderRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-extension/tobago-sandbox/src/main/java/org/apache/myfaces/tobago/renderkit/html/sandbox/standard/tag/NumberSliderRenderer.java?rev=1771234&r1=1771233&r2=1771234&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-extension/tobago-sandbox/src/main/java/org/apache/myfaces/tobago/renderkit/html/sandbox/standard/tag/NumberSliderRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-extension/tobago-sandbox/src/main/java/org/apache/myfaces/tobago/renderkit/html/sandbox/standard/tag/NumberSliderRenderer.java Thu Nov 24 21:38:05 2016
@@ -19,17 +19,16 @@
package org.apache.myfaces.tobago.renderkit.html.sandbox.standard.tag;
-import org.apache.myfaces.tobago.context.ResourceManagerUtils;
import org.apache.myfaces.tobago.internal.component.AbstractUINumberSlider;
+import org.apache.myfaces.tobago.internal.util.HtmlRendererUtils;
import org.apache.myfaces.tobago.layout.Measure;
+import org.apache.myfaces.tobago.layout.Position;
import org.apache.myfaces.tobago.renderkit.RendererBase;
import org.apache.myfaces.tobago.renderkit.css.Classes;
-import org.apache.myfaces.tobago.layout.Position;
import org.apache.myfaces.tobago.renderkit.css.Style;
import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
import org.apache.myfaces.tobago.renderkit.html.HtmlElements;
import org.apache.myfaces.tobago.renderkit.html.HtmlRoleValues;
-import org.apache.myfaces.tobago.internal.util.HtmlRendererUtils;
import org.apache.myfaces.tobago.util.ComponentUtils;
import org.apache.myfaces.tobago.webapp.TobagoResponseWriter;
@@ -172,8 +171,8 @@ public class NumberSliderRenderer extend
}
private String getAbsoluteImagePath(final FacesContext facesContext, final String relativeImagePath) {
- return facesContext.getExternalContext().getRequestContextPath()
- + ResourceManagerUtils.getImage(facesContext, relativeImagePath);
+ return facesContext.getExternalContext().getRequestContextPath()/*
+ + ResourceManagerUtils.getImage(facesContext, relativeImagePath)*/;
}
private String getIdForInputField(final FacesContext context, final UIComponent component) {
Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/tobago-config.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/tobago-config.xml?rev=1771234&r1=1771233&r2=1771234&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/tobago-config.xml (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/tobago-config.xml Thu Nov 24 21:38:05 2016
@@ -25,6 +25,7 @@
<name>tobago-theme-standard</name>
+ <!--XXX RM-->
<resource-dir>org/apache/myfaces/tobago/renderkit</resource-dir>
<content-security-policy mode="on">
@@ -359,46 +360,46 @@
</renderer>
</renderers>
<resources production="true">
- <script name="jquery/jquery-2.2.4.js"/>
- <script name="jquery-ui/1.12.1.custom/jquery-ui.js"/>
- <script name="tether/1.1.1/js/tether.js"/>
- <script name="bootstrap/4.0.0-alpha.4/js/bootstrap.js"/>
- <script name="moment/2.13.0/moment-with-locales.js"/>
- <script name="bootstrap-datetimepicker/4.17.37/js/bootstrap-datetimepicker.js"/>
- <script name="script/tobago.js"/>
- <script name="typeahead/0.11.1-patched-with-1212/typeahead.js"/>
- <style name="tether/1.1.1/css/tether.css"/>
- <style name="bootstrap/4.0.0-alpha.4/css/bootstrap.css"/>
- <style name="font-awesome/4.6.1/css/font-awesome.css"/>
- <style name="style/tobago.css"/>
- <style name="bootstrap-datetimepicker/4.17.37/css/bootstrap-datetimepicker.css"/>
+ <script name="/org/apache/myfaces/tobago/renderkit/html/standard/standard/jquery/jquery-2.2.4.js"/>
+ <script name="/org/apache/myfaces/tobago/renderkit/html/standard/standard/jquery-ui/1.12.1.custom/jquery-ui.js"/>
+ <script name="/org/apache/myfaces/tobago/renderkit/html/standard/standard/tether/1.1.1/js/tether.js"/>
+ <script name="/org/apache/myfaces/tobago/renderkit/html/standard/standard/bootstrap/4.0.0-alpha.4/js/bootstrap.js"/>
+ <script name="/org/apache/myfaces/tobago/renderkit/html/standard/standard/moment/2.13.0/moment-with-locales.js"/>
+ <script name="/org/apache/myfaces/tobago/renderkit/html/standard/standard/bootstrap-datetimepicker/4.17.37/js/bootstrap-datetimepicker.js"/>
+ <script name="/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js"/>
+ <script name="/org/apache/myfaces/tobago/renderkit/html/standard/standard/typeahead/0.11.1-patched-with-1212/typeahead.js"/>
+ <style name="/org/apache/myfaces/tobago/renderkit/html/standard/standard/tether/1.1.1/css/tether.css"/>
+ <style name="/org/apache/myfaces/tobago/renderkit/html/standard/standard/bootstrap/4.0.0-alpha.4/css/bootstrap.css"/>
+ <style name="/org/apache/myfaces/tobago/renderkit/html/standard/standard/font-awesome/4.6.1/css/font-awesome.css"/>
+ <style name="/org/apache/myfaces/tobago/renderkit/html/standard/standard/style/tobago.css"/>
+ <style name="/org/apache/myfaces/tobago/renderkit/html/standard/standard/bootstrap-datetimepicker/4.17.37/css/bootstrap-datetimepicker.css"/>
</resources>
<resources production="false">
- <script name="jquery/jquery-2.2.4.js"/>
- <script name="jquery-ui/1.12.1.custom/jquery-ui.js"/>
- <script name="tether/1.1.1/js/tether.js"/>
- <script name="bootstrap/4.0.0-alpha.4/js/bootstrap.js"/>
- <script name="moment/2.13.0/moment-with-locales.js"/>
- <script name="bootstrap-datetimepicker/4.17.37/js/bootstrap-datetimepicker.js"/>
- <script name="script/tobago-jsf.js"/>
- <script name="script/tobago.js"/>
- <script name="script/tobago-calendar.js"/>
- <script name="script/tobago-console.js"/>
- <script name="script/tobago-in.js"/>
- <script name="script/tobago-layout.js"/>
- <script name="script/tobago-overlay.js"/>
- <script name="script/tobago-popup.js"/>
- <script name="script/tobago-sheet.js"/>
- <script name="script/tobago-suggest.js"/>
- <script name="script/tobago-tab.js"/>
- <script name="script/tobago-tree.js"/>
- <script name="script/tobago-utils.js"/>
- <script name="typeahead/0.11.1-patched-with-1212/typeahead.js"/>
- <style name="tether/1.1.1/css/tether.css"/>
- <style name="bootstrap/4.0.0-alpha.4/css/bootstrap.css"/>
- <style name="font-awesome/4.6.1/css/font-awesome.css"/>
- <style name="style/tobago.css"/>
- <style name="bootstrap-datetimepicker/4.17.37/css/bootstrap-datetimepicker.css"/>
+ <script name="/org/apache/myfaces/tobago/renderkit/html/standard/standard/jquery/jquery-2.2.4.js"/>
+ <script name="/org/apache/myfaces/tobago/renderkit/html/standard/standard/jquery-ui/1.12.1.custom/jquery-ui.js"/>
+ <script name="/org/apache/myfaces/tobago/renderkit/html/standard/standard/tether/1.1.1/js/tether.js"/>
+ <script name="/org/apache/myfaces/tobago/renderkit/html/standard/standard/bootstrap/4.0.0-alpha.4/js/bootstrap.js"/>
+ <script name="/org/apache/myfaces/tobago/renderkit/html/standard/standard/moment/2.13.0/moment-with-locales.js"/>
+ <script name="/org/apache/myfaces/tobago/renderkit/html/standard/standard/bootstrap-datetimepicker/4.17.37/js/bootstrap-datetimepicker.js"/>
+ <script name="/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-jsf.js"/>
+ <script name="/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js"/>
+ <script name="/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-calendar.js"/>
+ <script name="/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-console.js"/>
+ <script name="/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-in.js"/>
+ <script name="/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-layout.js"/>
+ <script name="/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-overlay.js"/>
+ <script name="/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-popup.js"/>
+ <script name="/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js"/>
+ <script name="/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-suggest.js"/>
+ <script name="/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-tab.js"/>
+ <script name="/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-tree.js"/>
+ <script name="/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-utils.js"/>
+ <script name="/org/apache/myfaces/tobago/renderkit/html/standard/standard/typeahead/0.11.1-patched-with-1212/typeahead.js"/>
+ <style name="/org/apache/myfaces/tobago/renderkit/html/standard/standard/tether/1.1.1/css/tether.css"/>
+ <style name="/org/apache/myfaces/tobago/renderkit/html/standard/standard/bootstrap/4.0.0-alpha.4/css/bootstrap.css"/>
+ <style name="/org/apache/myfaces/tobago/renderkit/html/standard/standard/font-awesome/4.6.1/css/font-awesome.css"/>
+ <style name="/org/apache/myfaces/tobago/renderkit/html/standard/standard/style/tobago.css"/>
+ <style name="/org/apache/myfaces/tobago/renderkit/html/standard/standard/bootstrap-datetimepicker/4.17.37/css/bootstrap-datetimepicker.css"/>
</resources>
</theme-definition>
</theme-definitions>