use of org.eclipse.scout.rt.client.ui.form.fields.IFormField in project scout.rt by eclipse.
the class ColumnEditableTest method testFieldInEditableColumn.
/**
* Tests, if a field in the editable column is valid
*/
@Test
public void testFieldInEditableColumn() {
EditableTestTable testTable = new EditableTestTable();
testTable.setEnabled(true);
testTable.addRowByArray(getTestRow());
IColumn editableCol = testTable.getEditableTestColumn();
assertTrue(editableCol.isEditable());
assertTrue(testTable.getCell(0, 0).isEditable());
IFormField field = editableCol.prepareEdit(testTable.getRow(0));
assertNotNull(field);
assertTrue(field.isEnabled());
}
use of org.eclipse.scout.rt.client.ui.form.fields.IFormField in project scout.rt by eclipse.
the class ExtensionRegistryInstantiationTest method testExtensionForGroupBoxWithSecondInnerField.
@Test
public void testExtensionForGroupBoxWithSecondInnerField() throws Exception {
IExtensionRegistry registry = BEANS.get(IExtensionRegistry.class);
registry.register(TopBoxExtension.class);
// test code
BasicForm basicForm = new BasicForm();
assertExtensions(basicForm.getAllExtensions());
assertExtensions(basicForm.getTopBox().getAllExtensions(), TopBoxExtension.class);
List<IFormField> topBoxFields = basicForm.getTopBox().getFields();
assertEquals(2, topBoxFields.size());
assertTrue(topBoxFields.get(0) instanceof BasicForm.MainBox.TopBox.NameField);
assertFalse(topBoxFields.get(0) instanceof TopBoxExtension.SecondNameField);
assertTrue(topBoxFields.get(1) instanceof TopBoxExtension.SecondNameField);
}
use of org.eclipse.scout.rt.client.ui.form.fields.IFormField in project scout.rt by eclipse.
the class FindFieldByFormDataIdVisitorTest method testGetThirdFieldOnMainForm.
@Test
public void testGetThirdFieldOnMainForm() throws Exception {
FindFieldByFormDataIdVisitor visitor = new FindFieldByFormDataIdVisitor(THIRD_FIELD_DATA_ID, m_mainForm);
m_mainForm.visitFields(visitor);
IFormField field = visitor.getField();
assertNotNull(field);
assertSame(m_mainForm.getWrappedFormField().getInnerForm().getWrappedFormField().getInnerForm().getThirdField(), field);
}
use of org.eclipse.scout.rt.client.ui.form.fields.IFormField in project scout.rt by eclipse.
the class FindFieldByFormDataIdVisitorTest method testGetSecondFieldWithoutForm.
/* --------------------------------------------------------------------------
* second field
* --------------------------------------------------------------------------
*/
@Test
public void testGetSecondFieldWithoutForm() throws Exception {
FindFieldByFormDataIdVisitor visitor = new FindFieldByFormDataIdVisitor(SECOND_FIELD_DATA_ID);
m_mainForm.visitFields(visitor);
IFormField field = visitor.getField();
assertNotNull(field);
assertSame(m_mainForm.getWrappedFormField().getInnerForm().getSecondField(), field);
}
use of org.eclipse.scout.rt.client.ui.form.fields.IFormField in project scout.rt by eclipse.
the class FindFieldByFormDataIdVisitorTest method testGetSecondFieldOnMainForm.
@Test
public void testGetSecondFieldOnMainForm() throws Exception {
FindFieldByFormDataIdVisitor visitor = new FindFieldByFormDataIdVisitor(SECOND_FIELD_DATA_ID, m_mainForm);
m_mainForm.visitFields(visitor);
IFormField field = visitor.getField();
assertNotNull(field);
assertSame(m_mainForm.getWrappedFormField().getInnerForm().getSecondField(), field);
}
Aggregations