use of org.talend.core.model.properties.InformationLevel in project tdi-studio-se by Talend.
the class Problems method computePropertyMaxInformationLevel.
/**
* See also AbstractEMFRepositoryFactory.computePropertyMaxInformationLevel
*
* @param property
*/
public static void computePropertyMaxInformationLevel(Property property, boolean allowUpdateProperty) {
EList<Information> informations = property.getInformations();
InformationLevel maxLevel = null;
for (int i = 0; i < informations.size(); i++) {
Information information = informations.get(i);
if (i == 0) {
maxLevel = information.getLevel();
continue;
}
int value = information.getLevel().getValue();
if (maxLevel == null || value > maxLevel.getValue()) {
maxLevel = information.getLevel();
}
}
// TDI-22098
// after run the job , if the modified the property ,should be save .
InformationLevel propertyMaxLevel = property.getMaxInformationLevel();
boolean isModified = false;
if (maxLevel != null) {
if (!maxLevel.equals(propertyMaxLevel)) {
property.setMaxInformationLevel(maxLevel);
isModified = true;
}
} else if (!InformationLevel.DEBUG_LITERAL.equals(propertyMaxLevel)) {
property.setMaxInformationLevel(InformationLevel.DEBUG_LITERAL);
isModified = true;
}
// save the property
if (isModified && allowUpdateProperty) {
IRepositoryService service = CorePlugin.getDefault().getRepositoryService();
IProxyRepositoryFactory factory = service.getProxyRepositoryFactory();
Item item = property.getItem();
try {
factory.save(item, false);
} catch (PersistenceException e) {
ExceptionHandler.process(e);
}
}
}
use of org.talend.core.model.properties.InformationLevel in project tdi-studio-se by Talend.
the class AbstractMultiPageTalendEditor method updateTitleImage.
private void updateTitleImage(Property property) {
Image image = null;
InformationLevel level = property.getMaxInformationLevel();
image = ImageProvider.getImage(getEditorTitleImage());
if (level.equals(InformationLevel.ERROR_LITERAL)) {
image = OverlayImageProvider.getImageWithError(image).createImage();
}
setTitleImage(image);
}
use of org.talend.core.model.properties.InformationLevel in project tesb-studio-se by Talend.
the class ESBRepositoryContentHandler method computePropertyMaxInformationLevel.
private void computePropertyMaxInformationLevel(Property property) {
EList<Information> informations = property.getInformations();
InformationLevel maxLevel = null;
for (Information information : informations) {
int value = information.getLevel().getValue();
if (maxLevel == null || value > maxLevel.getValue()) {
maxLevel = information.getLevel();
}
}
property.setMaxInformationLevel(maxLevel);
}
Aggregations