Search in sources :

Example 21 with IFormField

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());
}
Also used : IFormField(org.eclipse.scout.rt.client.ui.form.fields.IFormField) Test(org.junit.Test)

Example 22 with IFormField

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);
}
Also used : IFormField(org.eclipse.scout.rt.client.ui.form.fields.IFormField) BasicForm(org.eclipse.scout.rt.shared.extension.fixture.BasicForm) TopBoxExtension(org.eclipse.scout.rt.shared.extension.fixture.TopBoxExtension) Test(org.junit.Test)

Example 23 with IFormField

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);
}
Also used : IFormField(org.eclipse.scout.rt.client.ui.form.fields.IFormField) Test(org.junit.Test)

Example 24 with IFormField

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);
}
Also used : IFormField(org.eclipse.scout.rt.client.ui.form.fields.IFormField) Test(org.junit.Test)

Example 25 with IFormField

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);
}
Also used : IFormField(org.eclipse.scout.rt.client.ui.form.fields.IFormField) Test(org.junit.Test)

Aggregations

IFormField (org.eclipse.scout.rt.client.ui.form.fields.IFormField)60 Test (org.junit.Test)19 ArrayList (java.util.ArrayList)13 GridData (org.eclipse.scout.rt.client.ui.form.fields.GridData)12 IButton (org.eclipse.scout.rt.client.ui.form.fields.button.IButton)5 PlatformError (org.eclipse.scout.rt.platform.exception.PlatformError)5 PropertyChangeEvent (java.beans.PropertyChangeEvent)4 PropertyChangeListener (java.beans.PropertyChangeListener)4 HashMap (java.util.HashMap)4 HashSet (java.util.HashSet)4 IColumn (org.eclipse.scout.rt.client.ui.basic.table.columns.IColumn)4 IGroupBox (org.eclipse.scout.rt.client.ui.form.fields.groupbox.IGroupBox)4 IExtensibleObject (org.eclipse.scout.rt.shared.extension.IExtensibleObject)4 Map (java.util.Map)3 PlatformExceptionTranslator (org.eclipse.scout.rt.platform.exception.PlatformExceptionTranslator)3 LinkedList (java.util.LinkedList)2 ITable (org.eclipse.scout.rt.client.ui.basic.table.ITable)2 ICompositeField (org.eclipse.scout.rt.client.ui.form.fields.ICompositeField)2 IValueField (org.eclipse.scout.rt.client.ui.form.fields.IValueField)2 FindFieldByFormDataIdVisitor (org.eclipse.scout.rt.client.ui.form.internal.FindFieldByFormDataIdVisitor)2