use of org.eclipse.wst.xsd.ui.internal.adt.design.IAnnotationProvider in project webtools.sourceediting by eclipse.
the class XSDBaseFieldEditPart method refreshVisuals.
/*
* (non-Javadoc)
*
* @see org.eclipse.gef.editparts.AbstractEditPart#refreshVisuals()
*/
protected void refreshVisuals() {
IFieldFigure figure = getFieldFigure();
IField field = (IField) getModel();
figure.getNameLabel().setText(field.getName());
figure.getTypeLabel().setText(field.getTypeName());
figure.refreshVisuals(getModel());
if (field.isReadOnly()) {
figure.setForegroundColor(ColorConstants.darkGray);
} else {
if (isHighContrast) {
figure.setForegroundColor(Display.getDefault().getSystemColor(SWT.COLOR_WIDGET_FOREGROUND));
figure.setBackgroundColor(Display.getDefault().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
} else
figure.setForegroundColor(ColorConstants.black);
}
// $NON-NLS-1$
String occurrenceDescription = "";
if (field instanceof IAnnotationProvider) {
occurrenceDescription = ((IAnnotationProvider) field).getNameAnnotationString();
}
refreshIcon();
figure.getNameAnnotationLabel().setText(occurrenceDescription);
figure.recomputeLayout();
if (getRoot() != null)
((GraphicalEditPart) getRoot()).getFigure().invalidateTree();
}
Aggregations