public static int calculateByteSize ( final int offset, final TypeDefinition typeDefinition ) { if ( typeDefinition == null ) { return 0; } int max = 0; for ( final Variable var : typeDefinition.getVariables () ) { if ( var.getType () == null ) { continue; } max = Math.max ( max, offset + var.getType ().getIndex () + var.getType ().getLength () ); for ( final Attribute attr : var.getAttributes () ) { if ( attr.getType () == null ) { continue; } max = Math.max ( max, offset + attr.getType ().getIndex () + attr.getType ().getLength () ); } } return max; }
/** * This returns the label styled text for the adapted class. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object getStyledText ( Object object ) { String label = ( (Attribute)object ).getName (); StyledString styledLabel = new StyledString (); if ( label == null || label.length () == 0 ) { styledLabel.append ( getString ( "_UI_Attribute_type" ), StyledString.Style.QUALIFIER_STYLER ); } else { styledLabel.append ( getString ( "_UI_Attribute_type" ), StyledString.Style.QUALIFIER_STYLER ).append ( " " + label ); } return styledLabel; }
/** * This returns the label styled text for the adapted class. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object getStyledText ( Object object ) { String label = ( (Attribute)object ).getName (); StyledString styledLabel = new StyledString (); if ( label == null || label.length () == 0 ) { styledLabel.append ( getString ( "_UI_Attribute_type" ), StyledString.Style.QUALIFIER_STYLER ); } else { styledLabel.append ( getString ( "_UI_Attribute_type" ), StyledString.Style.QUALIFIER_STYLER ).append ( " " + label ); } return styledLabel; }
public static int calculateByteSize ( final int offset, final TypeDefinition typeDefinition ) { if ( typeDefinition == null ) { return 0; } int max = 0; for ( final Variable var : typeDefinition.getVariables () ) { if ( var.getType () == null ) { continue; } max = Math.max ( max, offset + var.getType ().getIndex () + var.getType ().getLength () ); for ( final Attribute attr : var.getAttributes () ) { if ( attr.getType () == null ) { continue; } max = Math.max ( max, offset + attr.getType ().getIndex () + attr.getType ().getLength () ); } } return max; }