WidgetSelector [message #492091] |
Sun, 18 October 2009 14:47 |
Eclipse User |
|
|
|
Originally posted by: nlippke.t-online.de
Hi,
by looking at the matches function of the WidgetSelector I read:
private boolean matches( final Widget widget, final String[] constraints ) {
boolean result = true;
for( int i = 0; i < constraints.length && result; i++ ) {
String string = constraints[ i ];
if( string.startsWith( "." ) ) {
String variant = string.substring( 1 );
result &= hasVariant( widget, variant );
} else {
Constraint constraint = ( Constraint )constraintMap.get( string );
result &= constraint != null && constraint.matches( widget );
}
}
return result;
}
So any widget can have either a custom variant or a special state, but not
both.
So let's say if I have my own variant of a button, theming it like
button.custom:selected {
....
}
will not work. Right? Or am I missing something?
Regards,
Niels
|
|
|
Re: WidgetSelector [message #492092 is a reply to message #492091] |
Sun, 18 October 2009 15:09 |
Eclipse User |
|
|
|
Originally posted by: nlippke.t-online.de
Ok, I am missing something.
the state information is handled in the ConditionalValues somewhere else...
Sorry, forget about it ;)
"Niels Lippke" <nlippke@t-online.de> schrieb im Newsbeitrag
news:hbf9r5$lus$1@build.eclipse.org...
> Hi,
>
> by looking at the matches function of the WidgetSelector I read:
>
> private boolean matches( final Widget widget, final String[] constraints )
> {
> boolean result = true;
> for( int i = 0; i < constraints.length && result; i++ ) {
> String string = constraints[ i ];
> if( string.startsWith( "." ) ) {
> String variant = string.substring( 1 );
> result &= hasVariant( widget, variant );
> } else {
> Constraint constraint = ( Constraint )constraintMap.get( string );
> result &= constraint != null && constraint.matches( widget );
> }
> }
> return result;
> }
>
> So any widget can have either a custom variant or a special state, but
> not both.
> So let's say if I have my own variant of a button, theming it like
>
> button.custom:selected {
> ...
> }
>
> will not work. Right? Or am I missing something?
>
> Regards,
>
> Niels
|
|
|
Powered by
FUDForum. Page generated in 0.03000 seconds