Search in sources :

Example 1 with PropertyViewAdapter

use of org.hibernate.eclipse.graph.model.PropertyViewAdapter in project jbosstools-hibernate by jbosstools.

the class PropertyEditPart method createFigure.

protected IFigure createFigure() {
    IProperty property = ((PropertyViewAdapter) getModel()).getProperty();
    String label = property.getName();
    Label propertyLabel = new EditableLabel(label);
    propertyLabel.setIcon(((PropertyViewAdapter) getModel()).getImage());
    return propertyLabel;
}
Also used : EditableLabel(org.hibernate.eclipse.graph.figures.EditableLabel) IProperty(org.jboss.tools.hibernate.runtime.spi.IProperty) EditableLabel(org.hibernate.eclipse.graph.figures.EditableLabel) Label(org.eclipse.draw2d.Label) PropertyViewAdapter(org.hibernate.eclipse.graph.model.PropertyViewAdapter)

Example 2 with PropertyViewAdapter

use of org.hibernate.eclipse.graph.model.PropertyViewAdapter in project jbosstools-hibernate by jbosstools.

the class PersistentClassEditPart method getModelChildren.

protected List<PropertyViewAdapter> getModelChildren() {
    List<PropertyViewAdapter> list = new ArrayList<PropertyViewAdapter>();
    IProperty identifierProperty = getPersistentClass().getIdentifierProperty();
    if (identifierProperty != null) {
        list.add(new PropertyViewAdapter(getPersistentClassViewAdapter(), identifierProperty));
    }
    Iterator<IProperty> propertyIterator = getPersistentClass().getPropertyIterator();
    while (propertyIterator.hasNext()) {
        list.add(new PropertyViewAdapter(getPersistentClassViewAdapter(), propertyIterator.next()));
    }
    return list;
}
Also used : IProperty(org.jboss.tools.hibernate.runtime.spi.IProperty) ArrayList(java.util.ArrayList) PropertyViewAdapter(org.hibernate.eclipse.graph.model.PropertyViewAdapter)

Aggregations

PropertyViewAdapter (org.hibernate.eclipse.graph.model.PropertyViewAdapter)2 IProperty (org.jboss.tools.hibernate.runtime.spi.IProperty)2 ArrayList (java.util.ArrayList)1 Label (org.eclipse.draw2d.Label)1 EditableLabel (org.hibernate.eclipse.graph.figures.EditableLabel)1