Search in sources :

Example 1 with MultiStatus

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);
}
Also used : IMultiStatus(org.eclipse.scout.rt.platform.status.IMultiStatus) MultiStatus(org.eclipse.scout.rt.platform.status.MultiStatus)

Example 2 with MultiStatus

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);
}
Also used : MultiStatus(org.eclipse.scout.rt.platform.status.MultiStatus) IMultiStatus(org.eclipse.scout.rt.platform.status.IMultiStatus)

Example 3 with MultiStatus

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);
        }
    }
}
Also used : MultiStatus(org.eclipse.scout.rt.platform.status.MultiStatus) IMultiStatus(org.eclipse.scout.rt.platform.status.IMultiStatus)

Example 4 with MultiStatus

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());
}
Also used : InvalidSequenceStatus(org.eclipse.scout.rt.client.ui.form.fields.sequencebox.InvalidSequenceStatus) Status(org.eclipse.scout.rt.platform.status.Status) IMultiStatus(org.eclipse.scout.rt.platform.status.IMultiStatus) MultiStatus(org.eclipse.scout.rt.platform.status.MultiStatus) IMultiStatus(org.eclipse.scout.rt.platform.status.IMultiStatus) MultiStatus(org.eclipse.scout.rt.platform.status.MultiStatus) Test(org.junit.Test)

Example 5 with MultiStatus

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);
}
Also used : MultiStatus(org.eclipse.scout.rt.platform.status.MultiStatus) IMultiStatus(org.eclipse.scout.rt.platform.status.IMultiStatus)

Aggregations

MultiStatus (org.eclipse.scout.rt.platform.status.MultiStatus)9 IMultiStatus (org.eclipse.scout.rt.platform.status.IMultiStatus)8 Test (org.junit.Test)4 InvalidSequenceStatus (org.eclipse.scout.rt.client.ui.form.fields.sequencebox.InvalidSequenceStatus)3 Status (org.eclipse.scout.rt.platform.status.Status)3 ParsingFailedStatus (org.eclipse.scout.rt.client.ui.form.fields.ParsingFailedStatus)1