richfaces / richfaces-sandbox

Sandbox repository for Component Incubation
http://community.jboss.org/wiki/RichFaces40ComponentDevelopmentProcess
76 stars 101 forks source link

RFSBOX-86: refactor severity/scale to be string instead of enum #57

Closed pauldijou closed 11 years ago

buildhive commented 11 years ago

RichFaces » sandbox #280 SUCCESS This pull request looks good (what's this?)

lfryc commented 11 years ago

Hey Paul,

this is really nice solution.

Let's discuss it on team meeting.

I'm for including this as general solution.

One question - have you tried that suggestedValue works for IDE?

pauldijou commented 11 years ago

Nope... doesn't really work in my IDE, even with JBoss Tools on it (but it's a 3.x on a 4.2 Eclipse, I didn't update that plugin yet).

But I do see stuff like:

<property-name>severity</property-name>
<property-class>java.lang.String</property-class>
<suggested-value>success,info,error,danger</suggested-value>

in the generated faces-config.xml

lfryc commented 11 years ago

The "suggested-value" contains the value for the property or attribute in which this element resides. This value is advisory only and is intended for tools to use when populating pallettes.

https://github.com/richfaces/cdk/blob/develop/generator/src/main/resources/META-INF/schema/web-facesconfig_2_0.xsd#L2319

I think the attribute completion is solved by property-class - if it's enum type, enum values are suggested.

I wonder if we could use enum type directly, internally converted with overriden valueOf methodm whicj would return CUSTOM value when unknown value found.

buildhive commented 11 years ago

RichFaces » sandbox #286 SUCCESS This pull request looks good (what's this?)

lfryc commented 11 years ago

Hey Paul,

is it prepared to be merged or do you expect some more improvements?

I'm ready to merge it.

pauldijou commented 11 years ago

In fact, it's more complex than just the type of the attirbute and property-class and depends on the IDE. For example, JBoss Tools also use hard coded files ( https://issues.jboss.org/browse/RFSBOX-96 ).

Anyway, you can merge this pull request for now, we can keep the suggested-value even if they are not really used right now. So... go for it!

lfryc commented 11 years ago

Awesome job, Paul!

I'm looking forward to make it work with IDEs.