新 GWT 组件的新样式
我正在使用 SmartGWT 2.4,并且有两种类型的 TabSet,每种类型都有不同的外观和感觉,而我在实现它时遇到了问题。
新的 TabSet 已实现如下:
public class MainTabSet extends TabSet{
public MainTabSet(){
super.setStylePrimaryName("MainTabSet");
build();
}
private void build(){
setMargin(6);
setWidth100();
setHeight100();
setStyleName("nt-main-tabset");
Tab inboxTab = new Tab("Inbox");
inboxTab.setPane(new InboxPane().get());
}
}
基于最后一段(多次查找相同的组件类型)这里:
我定义了一个新类,它拥有与上面使用的相同的主要名称:
isc.defineClass("MainTabSet", "TabSet");
然后我向它添加了一些属性:
isc.MainTabSet.addProperties({
tabBarThickness:100,
scrollerButtonSize:100,
pickerButtonSize:100,
symmetricScroller:false,
symmetricPickerButton:false,
scrollerSrc:"nothing",
pickerButtonSrc:"nothingg",
closeTabIconSize:100
})
上面的代码是写在 load_skin.js 文件中第 6 部分(TabSet)的顶部。
现在,我仍然在 MainTabSet 中获得相同的旧 TabSet 外观和感觉。
我现在的问题是:
我是否遵循正确的步骤来实现我的目标?
我如何考虑为 TabSet 的某些子元素(例如 TabBar-)添加新类,但仅限于新组件(MainTabSet)?
谢谢你们。
I am using SmartGWT 2.4, and I have two types of TabSet(s), each one has a different look and feel, and I am facing a problem implementing that.
The new TabSet has been implemented as the following :
public class MainTabSet extends TabSet{
public MainTabSet(){
super.setStylePrimaryName("MainTabSet");
build();
}
private void build(){
setMargin(6);
setWidth100();
setHeight100();
setStyleName("nt-main-tabset");
Tab inboxTab = new Tab("Inbox");
inboxTab.setPane(new InboxPane().get());
}
}
based on the last paragraph (Multiple looks for the same component type) here :
I've defined a new class that holds the same primary name I used above :
isc.defineClass("MainTabSet", "TabSet");
and then I've added some properties to it :
isc.MainTabSet.addProperties({
tabBarThickness:100,
scrollerButtonSize:100,
pickerButtonSize:100,
symmetricScroller:false,
symmetricPickerButton:false,
scrollerSrc:"nothing",
pickerButtonSrc:"nothingg",
closeTabIconSize:100
})
The code above has been written at the top of section 6 (TabSet) in load_skin.js file.
Now, I am still getting the same old TabSet look and feel in MainTabSet.
my Questions now are :
did I follow the right steps to achieve my goal ?
how could I consider new classes to some sub elements of TabSet -like TabBar- but only for the new component (MainTabSet)?
Thank you guys.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据文章的最后一段,您已经提到过,您应该调用 setScClassName("MainTabSet") 将 smartClient 的 js 类应用到您的 java 类。我认为应该是这样的:
According to last paragraph of the article that you have mentioned, you were suppose to call
setScClassName("MainTabSet")
to apply smartClient's js class to your java class. I think that should be something like this: