Подробнее описана глава "Тема в десктоп-приложениях"

This commit is contained in:
Mariya Sukhova 2013-03-22 12:39:47 +00:00
parent 0124a79668
commit 537cdf2f90
10 changed files with 12618 additions and 12556 deletions

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 532 B

File diff suppressed because it is too large Load Diff

View File

@ -1,2 +1,2 @@
cuba.desktop.resourceLocations = com/haulmont/cuba/desktop/res \
com/haulmont/ext/desktop/res
com/sample/sales/desktop/res

View File

@ -0,0 +1,14 @@
public class UnderlinedLabelDecorator implements ComponentDecorator {
@Override
@SuppressWarnings("unchecked")
public void decorate(Object component, Set<String> state) {
DesktopLabel item = (DesktopLabel) component;
JLabel jlabel = item.getComponent();
Font originalFont = jlabel.getFont();
Map attributes = originalFont.getAttributes();
attributes.put(TextAttribute.UNDERLINE, TextAttribute.UNDERLINE_ON);
jlabel.setFont(originalFont.deriveFont(attributes));
}
}

View File

@ -0,0 +1,5 @@
<theme xmlns="http://schemas.haulmont.com/cuba/4.0/desktop-theme.xsd">
<style name="label-underlined" component="com.haulmont.cuba.desktop.gui.components.DesktopLabel">
<custom class="com.sample.sales.desktop.gui.decorators.UnderlinedLabelDecorator"/>
</style>
</theme>

View File

@ -0,0 +1 @@
<label id="label1" stylename="label-underlined" value="Label"/>