use of com.servoy.j2db.smart.dataui.DataField in project servoy-client by Servoy.
the class J2DBClient method updateInsertModeIcon.
/**
* updates the insert mode icon for the given display
*
* @param display
*/
public void updateInsertModeIcon(IDisplay display) {
Icon icon = empty;
if (display instanceof DataField) {
DataField field = (DataField) display;
AbstractFormatterFactory formatterFactory = field.getFormatterFactory();
if (formatterFactory instanceof DefaultFormatterFactory) {
DefaultFormatterFactory factory = ((DefaultFormatterFactory) formatterFactory);
AbstractFormatter editFormatter = factory.getEditFormatter();
if (editFormatter == null)
editFormatter = factory.getDefaultFormatter();
if (editFormatter instanceof DefaultFormatter && !(editFormatter instanceof MaskFormatter)) {
if (((DefaultFormatter) editFormatter).getOverwriteMode()) {
icon = overwrite;
} else {
icon = insert;
}
}
}
} else if (display instanceof DataTextArea) {
if (((DataTextArea) display).getOverwriteMode()) {
icon = overwrite;
} else {
icon = insert;
}
}
insertModeLabel.setIcon(icon);
}
Aggregations