本文整理汇总了Python中muntjac.api.Label.removeStyleName方法的典型用法代码示例。如果您正苦于以下问题:Python Label.removeStyleName方法的具体用法?Python Label.removeStyleName怎么用?Python Label.removeStyleName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类muntjac.api.Label
的用法示例。
在下文中一共展示了Label.removeStyleName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: FeatureView
# 需要导入模块: from muntjac.api import Label [as 别名]
# 或者: from muntjac.api.Label import removeStyleName [as 别名]
#.........这里部分代码省略.........
self._srcWindow.removeAllComponents()
self._srcWindow.addComponent( CodeLabel(source) )
if self._srcWindow.getParent() is None:
self.getWindow().addWindow(self._srcWindow)
def resetExample(self):
if self._currentFeature is not None:
w = self.getWindow()
w.removeSubwindows()
f = self._currentFeature
self._currentFeature = None
if f in self._exampleCache:
del self._exampleCache[f]
self.setFeature(f)
def setFeature(self, feature):
from muntjac.demo.sampler.SamplerApplication import SamplerApplication
if feature != self._currentFeature:
self._currentFeature = feature
self._right.removeAllComponents()
self._left.removeAllComponents()
self._left.addComponent(self._controls)
self._title.setValue('<span>' + feature.getName() + '</span>')
if feature.getSinceVersion().isNew():
self._title.addStyleName('new')
else:
self._title.removeStyleName('new')
self._left.addComponent(self.getExampleFor(feature))
self._right.setCaption('Description and Resources')
# Do not show parent description if it's directly inside the root
alll = SamplerApplication.getAllFeatures()
parent = alll.getParent(feature)
isRoot = alll.getParent(parent) is None
desc = parent.getDescription()
hasParentDesc = False
if parent is not None and not isRoot:
parentLabel = Label(parent.getDescription())
if desc is not None and desc != '':
parentLabel.setContentMode(Label.CONTENT_XHTML)
self._right.addComponent(parentLabel)
hasParentDesc = True
desc = feature.getDescription()
if desc is not None and desc != '':
# Sample description uses additional decorations if a parent
# description is found
l = Label(("<div class=\"outer-deco\"><div class=\"deco\">"
"<span class=\"deco\"></span>")
+ desc + "</div></div>", Label.CONTENT_XHTML)
self._right.addComponent(l)
if hasParentDesc:
l.setStyleName('sample-description')
else:
l.setStyleName('description')
# open src in new window -link