use of org.eclipse.scout.rt.platform.status.MultiStatus in project scout.rt by eclipse.
the class Cell method addErrorStatus.
/**
* Adds an error status
*/
public void addErrorStatus(IStatus newStatus) {
final MultiStatus status = ensureMultiStatus(getErrorStatusInternal());
status.add(newStatus);
setErrorStatusInternal(status);
notifyObserver(ERROR_STATUS_BIT);
}
use of org.eclipse.scout.rt.platform.status.MultiStatus in project scout.rt by eclipse.
the class AbstractFormField method addErrorStatus.
/**
* Adds an error status
*/
@Override
public void addErrorStatus(IStatus newStatus) {
final MultiStatus status = ensureMultiStatus(getErrorStatusInternal());
// Create a copy, otherwise no PropertyChange event is fired
final MultiStatus copy = new MultiStatus(status);
copy.add(newStatus);
setErrorStatus(copy);
}
use of org.eclipse.scout.rt.platform.status.MultiStatus in project scout.rt by eclipse.
the class AbstractFormField method removeErrorStatus.
/**
* Remove IStatus of a specific type
*/
@Override
public void removeErrorStatus(Class<? extends IStatus> statusClazz) {
final MultiStatus ms = getErrorStatusInternal();
if (ms != null && ms.containsStatus(statusClazz)) {
// Create a copy, otherwise no PropertyChange event is fired
final MultiStatus copy = new MultiStatus(ms);
copy.removeAll(statusClazz);
if (copy.getChildren().isEmpty()) {
clearErrorStatus();
} else {
setErrorStatusInternal(copy);
}
}
}
use of org.eclipse.scout.rt.platform.status.MultiStatus in project scout.rt by eclipse.
the class FormFieldTest method testSetDifferentErrorStatus.
@Test
public void testSetDifferentErrorStatus() throws Exception {
SimpleTestFormField testField = new SimpleTestFormField();
P_PropertyChangeEventCounter counter = new P_PropertyChangeEventCounter();
testField.addPropertyChangeListener(IFormField.PROP_ERROR_STATUS, counter);
final MultiStatus ms = new MultiStatus();
ms.add(new Status("error"));
testField.setErrorStatus(ms);
assertEquals(ms, testField.getErrorStatus());
assertNotSame(ms, testField.getErrorStatus());
final MultiStatus ms2 = new MultiStatus();
// another object, should trigger its own event
ms2.add(new Status("another message"));
testField.setErrorStatus(ms2);
assertEquals(ms2, testField.getErrorStatus());
assertNotSame(ms2, testField.getErrorStatus());
assertEquals(2, counter.getCount());
}
use of org.eclipse.scout.rt.platform.status.MultiStatus in project scout.rt by eclipse.
the class AbstractForm method addStatus.
/**
* Adds an error status
*/
@Override
public void addStatus(IStatus newStatus) {
final MultiStatus status = ensureMultiStatus(getStatusInternal());
// Create a copy, otherwise no PropertyChange event is fired
final MultiStatus copy = new MultiStatus(status);
copy.add(newStatus);
setStatus(copy);
}
Aggregations