Icefaces 的默认外观以及如何自定义它

发布于 2024-07-30 15:03:59 字数 251 浏览 3 评论 0原文

我有一个关于 Icefaces 造型的问题。 我有一个可以使用 Icefaces 组件的最小应用程序,但是当我使用它们并查看页面时,组件没有样式(例如按钮具有默认外观,选项卡根本没有外观,没有图像,什么都没有)。 我想知道这是为什么,以及我应该做什么才能让默认的 Icefaces 外观发挥作用。

接下来我不明白的是如何通过更改一些自动应用于组件的默认 css 样式类来自定义外观,因此我使用的每个组件都会获得更改后的样式。

谢谢您的回答!

I have a question about styling Icefaces. I have a minimal application that can use Icefaces components, but when I use them and view the page, the components are not styled (for example the buttons have the default look and tabs have no look at all, no images, nothing). I was wondering why that is and what I should do so I would get the default Icefaces look to work.

Next thing I don't get is how do I customize the look by changing some default css style classes that get applied to the components automatically, so every component I use gets the changed style.

Thank you for your answers!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

丢了幸福的猪 2024-08-06 15:04:02
There are three predefined ICEfaces style sheets included:

(1) xp.css
(2) royale.css
(3) rime.css

Developers may also create their own custom style sheet based on a predefined ICEfaces style sheet. If the style class names match those defined in the ICEfaces style sheets, the ICEfaces components will use the specified styles by default, without the need to specify the style class names explicitly on each component.

(1) Where to find CSS class names ?

IMPORTANT : The default CSS class names associated with each component are listed in the component's TLD (taglib) description.

(2) How To use a predefined style :


<link rel="stylesheet" type="text/css" href="./xmlhttp/css/xp/xp.css" />

     OR


<ice:outputStyle href="./xmlhttp/css/xp/xp.css" rel="stylesheet" type="text/css"  />

(3) Is there any Advantages of using ICEFaces OutputStyle ?

The ice:outputStyle component has the following advantages over the HTML link tag:

- Automatically includes browser-specific variants of the main style sheet in the page to adapt the theme styling to account for differences in each browsers' CSS support. See the TLD (taglib) documentation for the ice:outputStyle component for details.
- Provides the ability to dynamically change the theme style sheet at runtime via a value binding on the component's `href` attribute.

(4) What is meant by xmlhttp ?

The xmlhttp->css->xp path is automatically resolved by ICEfaces and all needed resources are loaded from the ICEfaces.jar

Hope this helps..!! :)
There are three predefined ICEfaces style sheets included:

(1) xp.css
(2) royale.css
(3) rime.css

Developers may also create their own custom style sheet based on a predefined ICEfaces style sheet. If the style class names match those defined in the ICEfaces style sheets, the ICEfaces components will use the specified styles by default, without the need to specify the style class names explicitly on each component.

(1) Where to find CSS class names ?

IMPORTANT : The default CSS class names associated with each component are listed in the component's TLD (taglib) description.

(2) How To use a predefined style :


<link rel="stylesheet" type="text/css" href="./xmlhttp/css/xp/xp.css" />

     OR


<ice:outputStyle href="./xmlhttp/css/xp/xp.css" rel="stylesheet" type="text/css"  />

(3) Is there any Advantages of using ICEFaces OutputStyle ?

The ice:outputStyle component has the following advantages over the HTML link tag:

- Automatically includes browser-specific variants of the main style sheet in the page to adapt the theme styling to account for differences in each browsers' CSS support. See the TLD (taglib) documentation for the ice:outputStyle component for details.
- Provides the ability to dynamically change the theme style sheet at runtime via a value binding on the component's `href` attribute.

(4) What is meant by xmlhttp ?

The xmlhttp->css->xp path is automatically resolved by ICEfaces and all needed resources are loaded from the ICEfaces.jar

Hope this helps..!! :)
似最初 2024-08-06 15:04:01

我建议您采用 ICEfaces 包中包含的现有样式表之一(检查下载的 ICEfaces-1.8.1-bin.zip 的resources文件夹):

  • rime
  • Royale
  • xp

You可以在 ICEfaces 展示中预览它们

将其包含在您的 *.xhtml 文件中通过 标签:

(portlet)
<ice:outputStyle href="/xmlhttp/css/rime/rime-portlet.css"/>

(servlet)
<ice:outputStyle href="./css/demo_template.css"/>

从这里开始,您可以随意操作所选的样式表,或者 - 我喜欢 - 在 ICEfaces 的样式表之后包含您自己的样式表并覆盖所需的样式。

关于你的第二个问题:
基本上每个 ICEfaces 组件都有自己的样式类。 只需浏览展示并使用 Firebug 检查组件即可。 我还没有找到很多在不同组件之间重用的类。 因此,您必须自己自定义每个组件 - 或者通过 styleClass 属性将您自己的通用样式类应用到您使用的每个组件。

<ice:panelGrid styleClass="myCommonStyleClass">
<ice:inputField styleClass="myCommonStyleClass">

I suggest that you take one of the existing style-sheets, which are included within the ICEfaces package (check the resources folder of the downloaded ICEfaces-1.8.1-bin.zip):

  • rime
  • royale
  • xp

You can preview them in the ICEfaces showcase

Include it within your *.xhtml file via the <ice:outputStyle> tag:

(portlet)
<ice:outputStyle href="/xmlhttp/css/rime/rime-portlet.css"/>

(servlet)
<ice:outputStyle href="./css/demo_template.css"/>

Starting from here, feel free to either manipulate the chosen stylesheets or - which I favor - include your own stylesheets after ICEfaces' ones and overwrite the needed styles.

Regarding your second question:
Basically every ICEfaces component has its own style class. Just browse around the showcase and inspect the components with Firebug. I've not found many classes, which have been reused between different components. Therefore, you'll have to customize each and every component on your own - or apply your own common style class to every component you use via the styleClass property.

<ice:panelGrid styleClass="myCommonStyleClass">
<ice:inputField styleClass="myCommonStyleClass">
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文