• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java IForm类的典型用法和代码示例

java 1次浏览

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

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

示例1: findEventNr

点赞 3

import org.eclipse.scout.rt.client.ui.form.IForm; //导入依赖的package包/类
/**
 * @return the nearest eventNr
 */
private Long findEventNr() {
  IForm currentSearchForm = getDesktop().getPageSearchForm();
  if (currentSearchForm != null && currentSearchForm instanceof SingleEventSearchForm) {
    return ((SingleEventSearchForm) currentSearchForm).getEventField().getValue();
  }
  if (currentSearchForm != null && currentSearchForm instanceof DownloadedECardsSearchForm) {
    return ((DownloadedECardsSearchForm) currentSearchForm).getEventField().getValue();
  }

  IPage page = getDesktop().getOutline().getActivePage().getParentPage();
  while (page != null) {
    if (page instanceof EventNodePage) {
      return ((EventNodePage) page).getEventNr();
    }
    page = page.getParentPage();
  }

  return null;
}
 

开发者ID:innovad,
项目名称:4mila-1.0,
代码行数:23,
代码来源:ToolsForm.java

示例2: after

点赞 3

import org.eclipse.scout.rt.client.ui.form.IForm; //导入依赖的package包/类
@After
public void after() throws ProcessingException {
  event.remove();
  runner.remove();
  runner2.remove();
  ecard.remove();
  if (ecard2 != null) {
    ecard2.remove();
  }
  if (newECardKey != null && newECardKey.getId() != null) {
    BEANS.get(IECardProcessService.class).delete(newECardKey);
  }
  for (IForm form : ClientSession.get().getDesktop().getDialogStack()) {
    form.doClose();
  }
}
 

开发者ID:innovad,
项目名称:4mila-1.0,
代码行数:17,
代码来源:SICardEntryJobTest.java

示例3: testFormFields

点赞 3

import org.eclipse.scout.rt.client.ui.form.IForm; //导入依赖的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

示例4: collectFieldValues

点赞 3

import org.eclipse.scout.rt.client.ui.form.IForm; //导入依赖的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

示例5: testNewMenu

点赞 3

import org.eclipse.scout.rt.client.ui.form.IForm; //导入依赖的package包/类
@Test
public void testNewMenu() throws ProcessingException {
  if (getNewMenu() != null) {
    Runnable runnableAfterButtonClick = new Runnable() {
      @Override
      public void run() {
        IForm form = FMilaClientTestUtility.findLastAddedForm(getForm());
        try {
          form.doCancel();
        }
        catch (ProcessingException e) {
          e.printStackTrace();
        }
      }
    };

    FMilaClientTestUtility.runBlockingMenu(getTablePage().getTable(), getNewMenu(), runnableAfterButtonClick);
  }
}
 

开发者ID:innovad,
项目名称:4mila-1.0,
代码行数:20,
代码来源:AbstractEntityTablePageTest.java

示例6: installDirtyListener

点赞 2

import org.eclipse.scout.rt.client.ui.form.IForm; //导入依赖的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

示例7: execFormActivated

点赞 2

import org.eclipse.scout.rt.client.ui.form.IForm; //导入依赖的package包/类
@Override
protected void execFormActivated() throws ProcessingException {
  IForm form = getWizard().getWizardForm();
  if (form != null && form instanceof WelcomeForm) {
    ((WelcomeForm) form).getUsernameField().requestFocus();
  }
}
 

开发者ID:innovad,
项目名称:4mila-1.0,
代码行数:8,
代码来源:SetupWizardContainerForm.java

示例8: findLastAddedForm

点赞 2

import org.eclipse.scout.rt.client.ui.form.IForm; //导入依赖的package包/类
public static <T extends IForm> T findLastAddedForm(Class<T> formType) {
  List<T> forms = IDesktop.CURRENT.get().findForms(formType);
  if (forms == null || forms.size() == 0) {
    return null;
  }

  return forms.get(forms.size() - 1);
}
 

开发者ID:innovad,
项目名称:4mila-1.0,
代码行数:9,
代码来源:FMilaClientTestUtility.java

示例9: fillFormFields

点赞 2

import org.eclipse.scout.rt.client.ui.form.IForm; //导入依赖的package包/类
/**
 * See description of {@link #fillFormFields(IForm, IFormFieldValueProvider, ArrayList<OrderedPair>, LinkedHashMap)}
 */
public static Map<String, Object> fillFormFields(IForm form, IFormFieldValueProvider filler, List<OrderedFieldPair> orderedFieldPairs, FieldValue... valueMappings) throws ProcessingException {
  LinkedHashMap<Class<? extends IValueField<?>>, Object> fixValues = new LinkedHashMap<Class<? extends IValueField<?>>, Object>();
  if (valueMappings != null) {
    for (FieldValue fieldValue : valueMappings) {
      if (fieldValue != null) {
        @SuppressWarnings("unchecked")
        Class<? extends IValueField<?>> fieldClass = (Class<? extends IValueField<?>>) fieldValue.getFieldClass();
        fixValues.put(fieldClass, fieldValue.getValue());
      }
    }
  }
  return fillFormFields(form, filler, orderedFieldPairs, fixValues);
}
 

开发者ID:innovad,
项目名称:4mila-1.0,
代码行数:17,
代码来源:FormTestUtility.java

示例10: assertValueFields

点赞 2

import org.eclipse.scout.rt.client.ui.form.IForm; //导入依赖的package包/类
/**
 * Goes through every value of <code> fieldValues </code> and checks whether the corresponding field in
 * <code> form </code> has the same value
 * 
 * @param expectedFieldValues
 *          the values expected, map of field ids with assigned values, created by {@link fillFormFields}
 * @param form
 *          the form to be checked
 */
public static void assertValueFields(Map<String, Object> expectedFieldValues, IForm form) {
  if (form == null || expectedFieldValues == null) {
    fail("form or fieldValues argument is null");
    return;
  }
  for (Map.Entry<String, Object> fieldValue : expectedFieldValues.entrySet()) {
    IFormField formField = form.getFieldById(fieldValue.getKey());
    if (!(formField instanceof IValueField<?>)) {
      continue;
    }
    IValueField<?> field = (IValueField<?>) formField;
    Object actualValue = field.getValue();
    if (field.getHolderType().isArray() && actualValue != null && fieldValue.getValue() != null) {
      Set<Object> actual = CollectionUtility.hashSet((Object[]) actualValue);
      Set<Object> expected = CollectionUtility.hashSet((Object[]) fieldValue.getValue());
      assertEquals("Unexpected values in field '" + field.getLabel() + "' [" + field.getClass().getName() + "]", expected, actual);
    }
    //DB may allow less fraction digits then a Double has, but still enough to return a number which gets displayed correctly
    else if (field instanceof INumberField && actualValue != null && fieldValue.getValue() != null) {
      int p = ((INumberField) field).getMaxIntegerDigits();
      assertEquals("Unexpected value in field '" + field.getLabel() + "' [" + field.getClass().getName() + "]", (Double) fieldValue.getValue(), (Double) actualValue, Math.pow(0.1, p + 1));
    }
    else {
      assertEquals("Unexpected value in field '" + field.getLabel() + "' [" + field.getClass().getName() + "]", fieldValue.getValue(), actualValue);
    }
  }
}
 

开发者ID:innovad,
项目名称:4mila-1.0,
代码行数:37,
代码来源:FormTestUtility.java

示例11: closeAllBlockingForms

点赞 2

import org.eclipse.scout.rt.client.ui.form.IForm; //导入依赖的package包/类
/**
 * Closes all open forms on the current session
 * 
 * @throws ProcessingException
 */
public static void closeAllBlockingForms() throws ProcessingException {
  IClientSession session = (IClientSession) IClientSession.CURRENT.get();
  if (session != null) {
    List<IForm> forms = session.getDesktop().getDialogs();
    for (IForm form : forms) {
      form.doClose();
    }
  }
  else {
    LOG.warn("Trying to close all forms, but ClientSession is null");
  }
}
 

开发者ID:innovad,
项目名称:4mila-1.0,
代码行数:18,
代码来源:FormTestUtility.java

示例12: checkFields

点赞 2

import org.eclipse.scout.rt.client.ui.form.IForm; //导入依赖的package包/类
private void checkFields(Class<?> formClass, File wikiPageRoot) {
  File pageHelp = new File(wikiPageRoot.getAbsolutePath() + "\\" + formClass.getSimpleName().toLowerCase() + ".txt");
  try {
    String pageHelpString = IOUtility.getContent(new FileReader(pageHelp));
    Object formInstance = formClass.newInstance();
    for (IFormField field : ((IForm) formInstance).getAllFields()) {
      findFields(formClass, field, pageHelpString);
    }
  }
  catch (Exception e) {
    e.printStackTrace();
    Assert.fail("Could not create form, " + e.getLocalizedMessage());
  }
}
 

开发者ID:innovad,
项目名称:4mila-1.0,
代码行数:15,
代码来源:FormHelpCompletenessTest.java

示例13: testEditMenu

点赞 2

import org.eclipse.scout.rt.client.ui.form.IForm; //导入依赖的package包/类
@Test
public void testEditMenu() throws ProcessingException {
  if (getEditMenu() != null) {
    Runnable runnableAfterButtonClick = new Runnable() {
      @Override
      public void run() {
        IForm form = FMilaClientTestUtility.findLastAddedForm(getForm());
        try {
          form.doCancel();
        }
        catch (ProcessingException e) {
          e.printStackTrace();
        }
      }
    };
    AbstractPageWithTable<?> tablePage = getTablePage();
    tablePage.loadChildren();
    for (ITableRow row : tablePage.getTable().getRows()) {
      for (IColumn<?> c : tablePage.getTable().getColumns()) {
        if (c.getClass().getSimpleName().equals(getPrimaryKeyColumn().getSimpleName())) {
          if (getPrimaryKey().equals(c.getValue(row))) {
            tablePage.getTable().deselectAllRows();
            tablePage.getTable().selectRow(row);
          }
        }
      }
    }

    FMilaClientTestUtility.runBlockingMenu(tablePage.getTable(), getEditMenu(), runnableAfterButtonClick);
  }
}
 

开发者ID:innovad,
项目名称:4mila-1.0,
代码行数:32,
代码来源:AbstractEntityTablePageTest.java

示例14: getConfiguredDetailForm

点赞 2

import org.eclipse.scout.rt.client.ui.form.IForm; //导入依赖的package包/类
@Override
protected Class<? extends IForm> getConfiguredDetailForm() {
	return AnagnostesForm.class;
}
 

开发者ID:boardend,
项目名称:tabularius,
代码行数:5,
代码来源:AnagnostesPage.java

示例15: getConfiguredDetailForm

点赞 2

import org.eclipse.scout.rt.client.ui.form.IForm; //导入依赖的package包/类
@Override
protected Class<? extends IForm> getConfiguredDetailForm() {
	return NumbersForm.class;
}
 

开发者ID:boardend,
项目名称:tabularius,
代码行数:5,
代码来源:NumbersPage.java

示例16: getConfiguredDetailForm

点赞 2

import org.eclipse.scout.rt.client.ui.form.IForm; //导入依赖的package包/类
@Override
protected Class<? extends IForm> getConfiguredDetailForm() {
	return DocumentForm.class;
}
 

开发者ID:boardend,
项目名称:tabularius,
代码行数:5,
代码来源:DocumentPage.java

示例17: getConfiguredDefaultDetailForm

点赞 2

import org.eclipse.scout.rt.client.ui.form.IForm; //导入依赖的package包/类
@Override
protected Class<? extends IForm> getConfiguredDefaultDetailForm() {
  return OrganizationOverview.class;
}
 

开发者ID:BSI-Business-Systems-Integration-AG,
项目名称:trading-network,
代码行数:5,
代码来源:DealOutline.java

示例18: getConfiguredDisplayHint

点赞 2

import org.eclipse.scout.rt.client.ui.form.IForm; //导入依赖的package包/类
@Override
protected int getConfiguredDisplayHint() {
  return IForm.DISPLAY_HINT_DIALOG;
}
 

开发者ID:BSI-Business-Systems-Integration-AG,
项目名称:trading-network,
代码行数:5,
代码来源:DealForm.java

示例19: uninstallDirtyListener

点赞 2

import org.eclipse.scout.rt.client.ui.form.IForm; //导入依赖的package包/类
private void uninstallDirtyListener(final IForm form) {
  final Object dirtyListener = form.getProperty(PROP_DIRTY_LISTENER);
  if (dirtyListener instanceof PropertyChangeListener) {
    form.removePropertyChangeListener((PropertyChangeListener) dirtyListener);
  }
}
 

开发者ID:BSI-Business-Systems-Integration-AG,
项目名称:trading-network,
代码行数:7,
代码来源:AbstractDirtyFormHandler.java

示例20: getConfiguredDisplayHint

点赞 2

import org.eclipse.scout.rt.client.ui.form.IForm; //导入依赖的package包/类
@Override
protected int getConfiguredDisplayHint() { // <4>
  return IForm.DISPLAY_HINT_VIEW;
}
 

开发者ID:BSI-Business-Systems-Integration-AG,
项目名称:trading-network,
代码行数:5,
代码来源:PersonForm.java

示例21: getConfiguredDisplayHint

点赞 2

import org.eclipse.scout.rt.client.ui.form.IForm; //导入依赖的package包/类
@Override
protected int getConfiguredDisplayHint() {
  return IForm.DISPLAY_HINT_VIEW;
}
 

开发者ID:BSI-Business-Systems-Integration-AG,
项目名称:trading-network,
代码行数:5,
代码来源:OrganizationForm.java

示例22: getConfiguredDisplayViewId

点赞 2

import org.eclipse.scout.rt.client.ui.form.IForm; //导入依赖的package包/类
@Override
protected String getConfiguredDisplayViewId() {
  return IForm.VIEW_ID_SW;
}
 

开发者ID:innovad,
项目名称:4mila-1.0,
代码行数:5,
代码来源:ECardStationStatusForm.java

示例23: getConfiguredModalityHint

点赞 2

import org.eclipse.scout.rt.client.ui.form.IForm; //导入依赖的package包/类
@Override
protected int getConfiguredModalityHint() {
  return IForm.MODALITY_HINT_MODELESS;
}
 

开发者ID:innovad,
项目名称:4mila-1.0,
代码行数:5,
代码来源:ECardStationStatusForm.java

示例24: getConfiguredModalityHint

点赞 2

import org.eclipse.scout.rt.client.ui.form.IForm; //导入依赖的package包/类
@Override
protected int getConfiguredModalityHint() {
  return IForm.MODALITY_HINT_MODAL;
}
 

开发者ID:innovad,
项目名称:4mila-1.0,
代码行数:5,
代码来源:HelpForm.java

示例25: loadSearchFormState

点赞 2

import org.eclipse.scout.rt.client.ui.form.IForm; //导入依赖的package包/类
@Override
protected void loadSearchFormState(IForm f, String pageFormIdentifier) throws ProcessingException {
  // no caching
}
 

开发者ID:innovad,
项目名称:4mila-1.0,
代码行数:5,
代码来源:FMilaMemoryPolicy.java

示例26: getForm

点赞 2

import org.eclipse.scout.rt.client.ui.form.IForm; //导入依赖的package包/类
@Override
protected Class<? extends IForm> getForm() {
  return MapForm.class;
}
 

开发者ID:innovad,
项目名称:4mila-1.0,
代码行数:5,
代码来源:MapsTablePageTest.java

示例27: getForm

点赞 2

import org.eclipse.scout.rt.client.ui.form.IForm; //导入依赖的package包/类
@Override
protected Class<? extends IForm> getForm() {
  return ECardForm.class;
}
 

开发者ID:innovad,
项目名称:4mila-1.0,
代码行数:5,
代码来源:ECardsTablePageTest.java

示例28: getForm

点赞 2

import org.eclipse.scout.rt.client.ui.form.IForm; //导入依赖的package包/类
@Override
protected Class<? extends IForm> getForm() {
  return ECardStationForm.class;
}
 

开发者ID:innovad,
项目名称:4mila-1.0,
代码行数:5,
代码来源:ECardStationsTablePageTest.java

示例29: getForm

点赞 2

import org.eclipse.scout.rt.client.ui.form.IForm; //导入依赖的package包/类
@Override
protected Class<? extends IForm> getForm() {
  return EventForm.class;
}
 

开发者ID:innovad,
项目名称:4mila-1.0,
代码行数:5,
代码来源:EventsTablePageTest.java

示例30: getForm

点赞 2

import org.eclipse.scout.rt.client.ui.form.IForm; //导入依赖的package包/类
@Override
protected Class<? extends IForm> getForm() {
  return CountryForm.class;
}
 

开发者ID:innovad,
项目名称:4mila-1.0,
代码行数:5,
代码来源:CountriesTablePageTest.java

示例31: getForm

点赞 2

import org.eclipse.scout.rt.client.ui.form.IForm; //导入依赖的package包/类
@Override
protected Class<? extends IForm> getForm() {
  return null;
}
 

开发者ID:innovad,
项目名称:4mila-1.0,
代码行数:5,
代码来源:ReportTemplatesTablePageTest.java

示例32: ensureAscending

点赞 2

import org.eclipse.scout.rt.client.ui.form.IForm; //导入依赖的package包/类
/**
 * Ascertains that the second field has a higher value than the first. <code>null</code> as value is always allowed.
 * 
 * @param form
 *          the form in which the fields are read or edited, so the condition is met.
 * @return map of field ids with assigned values, to be used with {@link #assertValueFields(Map, IForm)}; must be read
 *         from the last call;
 */
private static void ensureAscending(IForm form, OrderedFieldPair orderedPair) {
  IValueField<?> field1 = form.getFieldByClass(orderedPair.getFirstField());
  IValueField<?> field2 = form.getFieldByClass(orderedPair.getSecondField());
  if (field1.getValue() == null || field2.getValue() == null) {
    return;
  }
  assertTrue("both field values must be of the same type: " + field1.getClass() + " and " + field2.getClass(), field1.getValue().getClass().equals(field2.getValue().getClass()));

  if (field1 instanceof IDateField) {
    IDateField dateField1 = (IDateField) field1;
    IDateField dateField2 = (IDateField) field2;
    dateField2.setValue(DateUtility.addDays(dateField1.getValue(), 1d));
  }
  else if (field1 instanceof IBigDecimalField) {
    IBigDecimalField bigDecimalField1 = (IBigDecimalField) field1;
    IBigDecimalField bigDecimalField2 = (IBigDecimalField) field2;
    bigDecimalField2.setValue(bigDecimalField1.getValue().add(BigDecimal.valueOf(0.5d)));
  }
  else if (field1 instanceof INumberField) {
    INumberField doubleField1 = (INumberField) field1;
    INumberField doubleField2 = (INumberField) field2;
    doubleField2.setValue(((Double) doubleField1.getValue()) + 0.5d); // TODO MIG
  }
  else if (field1 instanceof IIntegerField) {
    IIntegerField integerField1 = (IIntegerField) field1;
    IIntegerField integerField2 = (IIntegerField) field2;
    integerField2.setValue(integerField1.getValue() + 1);
  }
  else if (field1 instanceof ILongField) {
    ILongField longField1 = (ILongField) field1;
    ILongField longField2 = (ILongField) field2;
    longField2.setValue(Long.valueOf(longField1.getValue() + 1L));

  }
  else if (field1 instanceof IBigIntegerField) {
    IBigIntegerField bigIntegerField1 = (IBigIntegerField) field1;
    IBigIntegerField bigIntegerField2 = (IBigIntegerField) field2;
    bigIntegerField2.setValue(bigIntegerField1.getValue().add(BigInteger.valueOf(1L)));
  }
  else {
    fail("type not supported: " + field1.getClass());
  }
  return;
}
 

开发者ID:innovad,
项目名称:4mila-1.0,
代码行数:53,
代码来源:FormTestUtility.java

示例33: getForm

点赞 2

import org.eclipse.scout.rt.client.ui.form.IForm; //导入依赖的package包/类
@Override
protected Class<? extends IForm> getForm() {
  return RunnerForm.class;
}
 

开发者ID:innovad,
项目名称:4mila-1.0,
代码行数:5,
代码来源:RunnersTablePageTest.java

示例34: getForm

点赞 2

import org.eclipse.scout.rt.client.ui.form.IForm; //导入依赖的package包/类
@Override
protected Class<? extends IForm> getForm() {
  return ClubForm.class;
}
 

开发者ID:innovad,
项目名称:4mila-1.0,
代码行数:5,
代码来源:ClubsTablePageTest.java

示例35: getConfiguredDisplayHint

点赞 2

import org.eclipse.scout.rt.client.ui.form.IForm; //导入依赖的package包/类
@Override
protected int getConfiguredDisplayHint() {
	// TODO Auto-generated method stub
	return IForm.DISPLAY_HINT_VIEW;
}
 

开发者ID:MSG134,
项目名称:IVCT_Framework,
代码行数:6,
代码来源:CbForm.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)