use of org.eclipse.scout.rt.platform.status.MultiStatus in project scout.rt by eclipse.
the class Cell method addErrorStatuses.
/**
* Adds an error status
*/
public void addErrorStatuses(List<IStatus> newStatus) {
final MultiStatus status = ensureMultiStatus(getErrorStatusInternal());
status.addAll(newStatus);
setErrorStatusInternal(status);
notifyObserver(ERROR_STATUS_BIT);
}
use of org.eclipse.scout.rt.platform.status.MultiStatus in project scout.rt by eclipse.
the class FormFieldTest method testGetErrorStatus.
@Test
public void testGetErrorStatus() throws Exception {
SimpleTestFormField testField = new SimpleTestFormField();
final MultiStatus ms = new MultiStatus();
ms.add(new Status("error"));
testField.setErrorStatus(ms);
assertEquals(ms, testField.getErrorStatus());
assertNotSame(ms, testField.getErrorStatus());
// get always returns a new object
assertNotSame(testField.getErrorStatus(), testField.getErrorStatus());
}
use of org.eclipse.scout.rt.platform.status.MultiStatus in project scout.rt by eclipse.
the class FormFieldTest method testSetSameErrorStatus.
@Test
public void testSetSameErrorStatus() 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();
// new object, but same content
ms2.add(new Status("error"));
testField.setErrorStatus(ms2);
assertEquals(ms2, testField.getErrorStatus());
assertNotSame(ms2, testField.getErrorStatus());
assertEquals(1, counter.getCount());
}
use of org.eclipse.scout.rt.platform.status.MultiStatus in project scout.rt by eclipse.
the class CellTest method testAddRemoveMultistatus.
/**
* {@link Cell#setErrorStatus(org.eclipse.scout.rt.platform.status.IStatus)}
*/
@Test
public void testAddRemoveMultistatus() {
Cell c = new Cell();
ParsingFailedStatus errorStatus = new ParsingFailedStatus("failed", "rawString");
MultiStatus ms = new MultiStatus();
ms.add(errorStatus);
c.addErrorStatuses(ms.getChildren());
c.removeErrorStatus(ParsingFailedStatus.class);
assertNull(c.getErrorStatus());
}
Aggregations