use of org.eclipse.scout.rt.client.ui.form.fields.smartfield.SmartFieldTest.TestForm.MainBox.StyleField in project scout.rt by eclipse.
the class SmartFieldTest method testHierarchyNoResult.
@Test
public void testHierarchyNoResult() {
StyleField f = m_styleField;
f.setBrowseHierarchy(true);
m_styleField.getUIFacade().openProposalChooserFromUI("unknown", false, false);
waitForProposalResult(IProposalChooser.PROP_STATUS);
// single result
assertTrue(m_styleField.isProposalChooserRegistered());
assertEquals("unknown", m_styleField.getDisplayText());
// verifies tree is loaded containing a single node
@SuppressWarnings("unchecked") TreeProposalChooser<Long> treeProposalChooser = (TreeProposalChooser<Long>) f.getProposalChooser();
ITree tree = treeProposalChooser.getModel();
ITreeNode rootNode = tree.getRootNode();
assertEquals(0, rootNode.getChildNodes().size());
}
use of org.eclipse.scout.rt.client.ui.form.fields.smartfield.SmartFieldTest.TestForm.MainBox.StyleField in project scout.rt by eclipse.
the class SmartFieldTest method testThrowingLookupCall.
@Test
public void testThrowingLookupCall() {
StyleField f = m_styleField;
f.setBrowseHierarchy(true);
((StyleLookupCall) f.getLookupCall()).allowLookup(false);
m_styleField.getUIFacade().openProposalChooserFromUI("Red", false, false);
waitForProposalResult(IProposalChooser.PROP_STATUS);
@SuppressWarnings("unchecked") TreeProposalChooser<Long> treeProposalChooser = ((TreeProposalChooser<Long>) f.getProposalChooser());
ITree tree = treeProposalChooser.getModel();
ITreeNode rootNode = tree.getRootNode();
assertEquals(0, rootNode.getChildNodes().size());
assertEquals(IStatus.ERROR, treeProposalChooser.getStatus().getSeverity());
}
use of org.eclipse.scout.rt.client.ui.form.fields.smartfield.SmartFieldTest.TestForm.MainBox.StyleField in project scout.rt by eclipse.
the class SmartFieldTest method testHierarchicalBrowse.
@Test
public void testHierarchicalBrowse() {
StyleField f = m_styleField;
f.setBrowseHierarchy(true);
m_styleField.getUIFacade().openProposalChooserFromUI("*", true, false);
waitForProposalResult(IProposalChooser.PROP_SEARCH_RESULT);
// single result
assertTrue(m_styleField.isProposalChooserRegistered());
assertEquals("*", m_styleField.getDisplayText());
// verifies tree is loaded containing a single node
@SuppressWarnings("unchecked") TreeProposalChooser<Long> treeProposalChooser = (TreeProposalChooser<Long>) f.getProposalChooser();
ITree tree = treeProposalChooser.getModel();
ITreeNode rootNode = tree.getRootNode();
assertEquals(5, rootNode.getChildNodes().size());
assertEquals("Red", rootNode.getChildNode(0).getCell().getText());
}
use of org.eclipse.scout.rt.client.ui.form.fields.smartfield.SmartFieldTest.TestForm.MainBox.StyleField in project scout.rt by eclipse.
the class SmartFieldTest method testStyle_UIFacade.
@Test
public void testStyle_UIFacade() throws Throwable {
StyleField f = m_styleField;
f.getUIFacade().acceptProposalFromUI("Red", false, false);
assertRedFieldStyle(f);
f.getUIFacade().acceptProposalFromUI("Empty", false, false);
assertDefaultFieldStyle(f);
f.getUIFacade().acceptProposalFromUI("Yellow", false, false);
assertYellowFieldStyle(f);
f.getUIFacade().acceptProposalFromUI(null, false, false);
assertDefaultFieldStyle(f);
}
use of org.eclipse.scout.rt.client.ui.form.fields.smartfield.SmartFieldTest.TestForm.MainBox.StyleField in project scout.rt by eclipse.
the class SmartFieldTest method testStyle_AcceptProposal.
@Test
public void testStyle_AcceptProposal() throws Throwable {
StyleField f = m_styleField;
f.acceptProposal(createRedLookupRow());
assertRedFieldStyle(f);
f.acceptProposal(new LookupRow<Long>(50L, "Empty"));
assertDefaultFieldStyle(f);
f.acceptProposal(createYellowLookupRow());
assertYellowFieldStyle(f);
f.setValue(null);
assertDefaultFieldStyle(f);
}
Aggregations