2
0
Fork 0

[svn r269] removed some small bugs, for empty annotations collumns

This commit is contained in:
willemc 2007-08-08 21:02:56 +02:00
parent 8439348458
commit b1f6e870a3
5 changed files with 41 additions and 9 deletions

View file

@ -139,15 +139,19 @@ public class VascAnnotationParser {
if(property==null) {
Annotation anno = beanClass.getAnnotation(annotationType);
if (anno==null) {
return null; // no annotion avaible
// no annotion avaible
if (noAnnotationNullReturn) {
return null;
}
} else {
result = doAnnotation(anno);
if(result!=null) {
return result;
}
if (noAnnotationNullReturn) {
return null;
}
}
result = doAnnotation(anno);
if(result!=null) {
return result;
}
if (noAnnotationNullReturn) {
return null;
}
return beanClass.getName()+"."+annotationType.getSimpleName();
}
@ -188,6 +192,9 @@ public class VascAnnotationParser {
}
private Object doAnnotation(Annotation b) {
if (b==null) {
return null;
}
Class a = b.annotationType();
if (a.equals(VascName.class)) {

View file

@ -78,6 +78,7 @@ public class DefaultVascTableController implements VascTableController {
if (obj instanceof Integer) {
c.setWidth((Integer)obj);
}
c.setWidth(100);
// get KEY
}
if (c.getHelpId()==null) {

View file

@ -121,8 +121,13 @@ public class SwingVascViewRenderer implements VascViewRenderer {
public ImageIcon getImageIcon(String imageResource) {
/// TODO hack beter
String key = table.getVascTextValue().getTextValue(imageResource);
//logger.info("KEY======================="+key);
return SwingImageHelper.getImageIcon(key);
if (key.indexOf("META-INF")>0 | key.indexOf("resource")>0) {
return SwingImageHelper.getImageIcon(key);
} else {
return null;
}
}
class TextListener implements DocumentListener {

View file

@ -104,6 +104,10 @@ public class TestTable {
column = new VascAnnotationTableColumn("description");
table.addTableColumns(column);
column = new VascAnnotationTableColumn("testModel");
//column.setColumnEditor(columnEditor);
table.addTableColumns(column);
return table;
}

View file

@ -36,6 +36,7 @@ import com.idcanet.vasc.annotations.VascColumnWidth;
import com.idcanet.vasc.annotations.VascDefaultValue;
import com.idcanet.vasc.annotations.VascHelpId;
import com.idcanet.vasc.annotations.VascImage;
import com.idcanet.vasc.annotations.VascModelReference;
import com.idcanet.vasc.annotations.VascName;
import com.idcanet.vasc.annotations.VascToolTip;
@ -46,12 +47,14 @@ import com.idcanet.vasc.annotations.VascToolTip;
* @author Willem Cazander
* @version 1.0 Mar 28, 2007
*/
@VascToolTip(key="En een tooltip op het model")
public class TestModel {
private String name = null;
private String description = null;
private Float price = null;
private Date date = null;
private TestModel testModel = null;
/**
* @return the date
@ -116,4 +119,16 @@ public class TestModel {
public void setPrice(Float price) {
this.price = price;
}
@VascImage(image="/resources/images/gabelfresser.gif")
@VascModelReference
@NotNull
@Max(value=10)
public TestModel getTestModel() {
return testModel;
}
public void setTestModel(TestModel testModel) {
this.testModel = testModel;
}
}