当前位置: 首页>>代码示例>>Java>>正文


Java IFormField类代码示例

本文整理汇总了Java中org.eclipse.scout.rt.client.ui.form.fields.IFormField的典型用法代码示例。如果您正苦于以下问题:Java IFormField类的具体用法?Java IFormField怎么用?Java IFormField使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


IFormField类属于org.eclipse.scout.rt.client.ui.form.fields包,在下文中一共展示了IFormField类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: injectFieldsInternal

import org.eclipse.scout.rt.client.ui.form.fields.IFormField; //导入依赖的package包/类
@Override
protected void injectFieldsInternal(OrderedCollection<IFormField> fields) {
	AtomicInteger counter = new AtomicInteger(0);
	field.input.numbers.forEach(n -> {
		AbstractStringField stringField = new AbstractStringField() {
			@Override
			public String classId() {
				return UUID.randomUUID().toString();
			}
		};
		stringField.setValue(String.valueOf(field.evaluation.eval.get(n).character));
		stringField.setEnabled(false);
		stringField.setFocusable(false);
		stringField.setLabelVisible(false);
		stringField.setStatusVisible(false);
		stringField.setOrder(counter.incrementAndGet());
		fields.addLast(stringField);
	});

	super.injectFieldsInternal(fields);
}
 
开发者ID:boardend,项目名称:tabularius,代码行数:22,代码来源:FieldForm.java

示例2: execRowsSelected

import org.eclipse.scout.rt.client.ui.form.fields.IFormField; //导入依赖的package包/类
@Override
protected void execRowsSelected(List<? extends ITableRow> rows) throws ProcessingException {
  boolean isFieldChanging = false;
  for (IFormField field : getForm().getAllFields()) {
    if (field.isFieldChanging()) {
      isFieldChanging = true;
      break;
    }
  }
  if (rows.size() > 0 && !isFieldChanging) {
    updateFormFromRunnerRow(rows.get(0));
  }
  for (ITableRow row : getTable().getRows()) {
    updateModifyHtml(row);
  }
}
 
开发者ID:innovad,项目名称:4mila-1.0,代码行数:17,代码来源:EntryForm.java

示例3: execPrepareEdit

import org.eclipse.scout.rt.client.ui.form.fields.IFormField; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
protected IFormField execPrepareEdit(ITableRow row) throws ProcessingException {
  IFormField field = super.execPrepareEdit(row);
  if (getStartTimeColumn().getValue(row) == null) {
    Long eventNr = getEventNrColumn().getValue(row);
    if (eventNr != null) {
      Date proposalDate = eventConfiguration.getEvent(eventNr).getEvtZero();
      proposalDate = DateUtility.nvl(proposalDate, new Date());
      if (field instanceof IValueField<?>) {
        ((IValueField<Date>) field).setValue(proposalDate);
      }
    }
  }
  return field;
}
 
开发者ID:innovad,项目名称:4mila-1.0,代码行数:17,代码来源:EntryForm.java

示例4: injectFieldsInternal

import org.eclipse.scout.rt.client.ui.form.fields.IFormField; //导入依赖的package包/类
@Override
protected void injectFieldsInternal(OrderedCollection<IFormField> fieldList) {
  TemplateBox field1 = new TemplateBox(TEXTS.get("ReportTemplateHeaderFooter"), IReportTemplateProcessService.TEMPLATE_SUFFIX_JRXML, ReportTemplateType.GENERIC_TABLE, true);
  TemplateBox field2 = new TemplateBox(TEXTS.get("ReportTemplateStyle"), IReportTemplateProcessService.TEMPLATE_SUFFIX_JRTX, ReportTemplateType.GENERIC_TABLE, false);
  TemplateBox field3 = new TemplateBox(TEXTS.get("ReportTemplateMain"), IReportTemplateProcessService.TEMPLATE_SUFFIX_JRXML, ReportTemplateType.CUSTOM_TEMPLATE, true);
  TemplateBox field4 = new TemplateBox(TEXTS.get("ReportTemplateTable"), IReportTemplateProcessService.TEMPLATE_SUFFIX_JRXML, ReportTemplateType.CUSTOM_TEMPLATE, false);
  templateFields = new ArrayList<>();
  templateFields.add(field1);
  templateFields.add(field2);
  templateFields.add(field3);
  templateFields.add(field4);
  fieldList.addLast(field1);
  fieldList.addLast(field2);
  fieldList.addLast(field3);
  fieldList.addLast(field4);
  super.injectFieldsInternal(fieldList);
}
 
开发者ID:innovad,项目名称:4mila-1.0,代码行数:18,代码来源:ReportTemplateForm.java

示例5: testAdditionalInformationFeeDouble

import org.eclipse.scout.rt.client.ui.form.fields.IFormField; //导入依赖的package包/类
@Test
public void testAdditionalInformationFeeDouble() throws ProcessingException {
  event = new EventWithIndividualClassTestDataProvider();
  currency = new CurrencyTestDataProvider();
  runner = new RunnerTestDataProvider();

  createFee(null, null, null, null, 66.66);

  createAdditionalInformation(AdditionalInformationTypeCodeType.DoubleCode.ID, 3.33d);

  // create entry
  EntryForm entry = createEntry();

  // match: 2 * addInfo
  Assert.assertEquals(3.33 * 66.66, entry.getFeesField().getTable().getAmountColumn().getValue(0), 0.01);

  // match: 0 * addInfo
  ITableRow row = entry.getAdditionalInformationEntryField().getTable().getRow(0);
  IFormField edit = entry.getAdditionalInformationEntryField().getTable().getValueColumn().prepareEdit(row);
  ((AbstractDoubleField) edit).setValue(0d);
  entry.getAdditionalInformationEntryField().getTable().getValueColumn().completeEdit(row, edit);
  Assert.assertEquals(0, entry.getFeesField().getTable().getRowCount());
  Assert.assertTrue(entry.getFeesBox().getLabel().contains("0"));

  entry.doClose();
}
 
开发者ID:innovad,项目名称:4mila-1.0,代码行数:27,代码来源:FeeFormTest.java

示例6: testFormFields

import org.eclipse.scout.rt.client.ui.form.fields.IFormField; //导入依赖的package包/类
public static void testFormFields(IForm form) {
  Method[] methods = form.getClass().getMethods();

  for (IFormField field : form.getAllFields()) {
    for (Method m : methods) {
      if (m.getName().equalsIgnoreCase("get" + field.getClass().getSimpleName())) {
        Assert.assertEquals(0, m.getParameterTypes().length);
        try {
          Object o = m.invoke(form);
          Assert.assertEquals(field.getClass(), o.getClass());
        }
        catch (Exception e) {
          Assert.fail(e.getMessage());
        }
      }
    }
  }
}
 
开发者ID:innovad,项目名称:4mila-1.0,代码行数:19,代码来源:FMilaClientTestUtility.java

示例7: doColumnEdit

import org.eclipse.scout.rt.client.ui.form.fields.IFormField; //导入依赖的package包/类
@SuppressWarnings({"rawtypes", "unchecked"})
public static void doColumnEdit(AbstractColumn<?> col, int rowId, Object newValue) throws ProcessingException {
  if (!col.isEditable()) {
    Assert.fail("Column is not editable");
  }
  ITableRow row = col.getTable().getRow(rowId);
  IFormField field = col.prepareEdit(row);
  if (field instanceof IValueField<?>) {
    IValueField valueField = (IValueField<?>) field;
    valueField.setValue(newValue);
  }
  else {
    Assert.fail("Column Editing Field is no Value Field");
  }
  col.completeEdit(row, field);
}
 
开发者ID:innovad,项目名称:4mila-1.0,代码行数:17,代码来源:FMilaClientTestUtility.java

示例8: collectFieldValues

import org.eclipse.scout.rt.client.ui.form.fields.IFormField; //导入依赖的package包/类
private static Map<String, Object> collectFieldValues(IForm form) {
  Map<String, Object> result = new HashMap<String, Object>();
  for (IFormField formField : form.getAllFields()) {
    if (formField.getParentField() instanceof AbstractTableField) {
      continue;
    }
    if (formField.getParentField() instanceof AbstractListBoxFilterBox) {
      continue;
    }
    if (formField instanceof IValueField && formField.isEnabled() && ClientTestingUtility.isFieldVisible(formField)) {
      IValueField<?> valueField = (IValueField<?>) formField;
      result.put(valueField.getFieldId(), valueField.getValue());
    }
  }
  return result;
}
 
开发者ID:innovad,项目名称:4mila-1.0,代码行数:17,代码来源:FormTestUtility.java

示例9: testSearchForm

import org.eclipse.scout.rt.client.ui.form.fields.IFormField; //导入依赖的package包/类
private void testSearchForm(IFormFieldValueProvider valueProvider) throws ProcessingException {
  T tablePage = getTablePage();
  ISearchForm searchForm = tablePage.getSearchFormInternal();
  if (searchForm == null) {
    return;
  }
  for (IFormField field : searchForm.getAllFields()) {
    if (field instanceof IValueField) {
      searchForm.doReset();
      fillMandatoryFields(searchForm, valueProvider);
      valueProvider.fillValueField((IValueField<?>) field, null);
      searchForm.resetSearchFilter();
      tablePage.loadChildren();
    }
  }
}
 
开发者ID:innovad,项目名称:4mila-1.0,代码行数:17,代码来源:AbstractTablePageTest.java

示例10: installDirtyListener

import org.eclipse.scout.rt.client.ui.form.fields.IFormField; //导入依赖的package包/类
private void installDirtyListener(final IForm form) {
  final Set<IFormField> dirtyFields = new HashSet<>();

  final PropertyChangeListener dirtyListener = new PropertyChangeListener() {

    @Override
    public void propertyChange(final PropertyChangeEvent evt) {
      if (form.isFormLoading()) {
        return;
      }

      // Check whether this field is dirty
      final IFormField formField = (IFormField) evt.getSource();
      formField.checkSaveNeeded();
      if (formField.isSaveNeeded()) {
        dirtyFields.add(formField);
      }
      else {
        dirtyFields.remove(formField);
      }

      final boolean dirty = dirtyFields.isEmpty();
      form.setIconId(dirty ? null : Icons.Pencil);

      try {
        execDirtyStatusChanged(dirty);
      }
      catch (final Exception e) {
        BEANS.get(ExceptionHandler.class).handle(e);
      }
    }
  };
  form.setProperty(PROP_DIRTY_LISTENER, dirtyListener);

  for (final IFormField field : form.getAllFields()) {
    field.addPropertyChangeListener(IValueField.PROP_DISPLAY_TEXT, dirtyListener);
  }
}
 
开发者ID:BSI-Business-Systems-Integration-AG,项目名称:trading-network,代码行数:39,代码来源:AbstractDirtyFormHandler.java

示例11: execCompleteEdit

import org.eclipse.scout.rt.client.ui.form.fields.IFormField; //导入依赖的package包/类
@Override
protected void execCompleteEdit(ITableRow row, IFormField editingField) throws ProcessingException {
  super.execCompleteEdit(row, editingField);
  List<Long> availableEvents = getEventsField().getTable().getEventNrColumn().getValues();
  EntryFormUtility.validateRacesTable(getRacesField().getTable(), availableEvents, eventConfiguration);
  updateFormFromRunnerRow(row);
}
 
开发者ID:innovad,项目名称:4mila-1.0,代码行数:8,代码来源:EntryForm.java

示例12: execCompleteEdit

import org.eclipse.scout.rt.client.ui.form.fields.IFormField; //导入依赖的package包/类
@Override
protected void execCompleteEdit(ITableRow row, IFormField editingField) throws ProcessingException {
  StartlistSettingFormData formData = new StartlistSettingFormData();
  formData.setStartlistSettingNr(getStartlistSettingNrColumn().getValue(row));
  formData = BEANS.get(IStartlistSettingProcessService.class).load(formData);
  formData.getStartInterval().setValue(((AbstractLongField) editingField).getValue());
  BEANS.get(IStartlistSettingProcessService.class).store(formData);
  reloadPage();
}
 
开发者ID:innovad,项目名称:4mila-1.0,代码行数:10,代码来源:StartlistSettingsTablePage.java

示例13: testPrepareStartTime

import org.eclipse.scout.rt.client.ui.form.fields.IFormField; //导入依赖的package包/类
@Test
public void testPrepareStartTime() throws Exception {
  event = new EventTestDataProvider();

  entry = new EntryForm();
  entry.startNew();

  FMilaClientTestUtility.doColumnEdit(entry.getEventsField().getTable().getEventNrColumn(), 0, event.getEventNr());
  Assert.assertNull("Start Time null", entry.getEventsField().getTable().getStartTimeColumn().getValue(0));

  IFormField field = entry.getEventsField().getTable().getStartTimeColumn().prepareEdit(entry.getEventsField().getTable().getRow(0));
  Assert.assertEquals("Start Time = Evt Zero", event.getForm().getZeroTimeField().getValue(), ((IValueField<?>) field).getValue());

  entry.doClose();
}
 
开发者ID:innovad,项目名称:4mila-1.0,代码行数:16,代码来源:EntryFormValidationTest.java

示例14: testAdditionalInformationFeeInteger

import org.eclipse.scout.rt.client.ui.form.fields.IFormField; //导入依赖的package包/类
@Test
public void testAdditionalInformationFeeInteger() throws ProcessingException {
  event = new EventWithIndividualClassTestDataProvider();
  currency = new CurrencyTestDataProvider();
  runner = new RunnerTestDataProvider();

  createFee(null, null, null, null, 77.77);

  createAdditionalInformation(AdditionalInformationTypeCodeType.IntegerCode.ID, 2L);

  // create entry
  EntryForm entry = createEntry();

  // match: 2 * addInfo
  Assert.assertEquals(2 * 77.77, entry.getFeesField().getTable().getAmountColumn().getValue(0), 0.01);

  // no match: 0 * addInfo
  ITableRow row = entry.getAdditionalInformationEntryField().getTable().getRow(0);
  IFormField edit = entry.getAdditionalInformationEntryField().getTable().getValueColumn().prepareEdit(row);
  ((AbstractLongField) edit).setValue(0L);
  entry.getAdditionalInformationEntryField().getTable().getValueColumn().completeEdit(row, edit);
  Assert.assertEquals(0, entry.getFeesField().getTable().getRowCount());
  Assert.assertTrue(entry.getFeesBox().getLabel().contains("0"));

  // match: 4 * addInfo
  Assert.assertEquals(1, entry.getAdditionalInformationEntryField().getTable().getRowCount());
  Assert.assertEquals(addInfo.getAdditionalInformationUid(), entry.getAdditionalInformationEntryField().getTable().getAdditionalInformationUidColumn().getValue(0));
  row = entry.getAdditionalInformationEntryField().getTable().getRow(0);
  edit = entry.getAdditionalInformationEntryField().getTable().getValueColumn().prepareEdit(row);
  ((AbstractLongField) edit).setValue(4L);
  entry.getAdditionalInformationEntryField().getTable().getValueColumn().completeEdit(row, edit);
  Assert.assertEquals(4 * 77.77, entry.getFeesField().getTable().getAmountColumn().getValue(0), 0.01);

  entry.doClose();
}
 
开发者ID:innovad,项目名称:4mila-1.0,代码行数:36,代码来源:FeeFormTest.java

示例15: testAdditionalInformationFeeText

import org.eclipse.scout.rt.client.ui.form.fields.IFormField; //导入依赖的package包/类
@Test
public void testAdditionalInformationFeeText() throws ProcessingException {
  event = new EventWithIndividualClassTestDataProvider();
  currency = new CurrencyTestDataProvider();
  runner = new RunnerTestDataProvider();

  createFee(null, null, null, null, 19.75);

  createAdditionalInformation(AdditionalInformationTypeCodeType.TextCode.ID, "Hallo");

  // create entry
  EntryForm entry = createEntry();

  // match: text is set
  Assert.assertEquals(19.75, entry.getFeesField().getTable().getAmountColumn().getValue(0), 0.01);

  // no match: empty text
  ITableRow row = entry.getAdditionalInformationEntryField().getTable().getRow(0);
  IFormField edit = entry.getAdditionalInformationEntryField().getTable().getValueColumn().prepareEdit(row);
  ((AbstractStringField) edit).setValue("");
  entry.getAdditionalInformationEntryField().getTable().getValueColumn().completeEdit(row, edit);
  Assert.assertEquals(0, entry.getFeesField().getTable().getRowCount());
  Assert.assertTrue(entry.getFeesBox().getLabel().contains("0"));

  // match: text is set
  row = entry.getAdditionalInformationEntryField().getTable().getRow(0);
  edit = entry.getAdditionalInformationEntryField().getTable().getValueColumn().prepareEdit(row);
  ((AbstractStringField) edit).setValue("x");
  entry.getAdditionalInformationEntryField().getTable().getValueColumn().completeEdit(row, edit);
  Assert.assertEquals(1, entry.getFeesField().getTable().getRowCount());
  Assert.assertTrue(entry.getFeesBox().getLabel().contains("19"));
  Assert.assertTrue(entry.getFeesBox().getLabel().contains("75"));

  entry.doClose();
}
 
开发者ID:innovad,项目名称:4mila-1.0,代码行数:36,代码来源:FeeFormTest.java


注:本文中的org.eclipse.scout.rt.client.ui.form.fields.IFormField类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。