コード例 #1
0
  /**
   * {@inheritDoc}
   *
   * @see
   *     org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#initPart(java.lang.Class,
   *     int, org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.resource.ResourceSet)
   */
  public void initPart(java.lang.Class key, int kind, EObject elt, ResourceSet allResource) {
    setInitializing(true);
    if (gamePlayersPart != null && key == TarotViewsRepository.GamePlayers.class) {
      ((IPropertiesEditionPart) gamePlayersPart).setContext(elt, allResource);
      final Game game = (Game) elt;
      // init values
      gamePlayersPart.initPlayers(game, null, TarotPackage.eINSTANCE.getGame_Players());
      // init filters
      gamePlayersPart.addFilterToPlayers(
          new ViewerFilter() {

            /**
             * {@inheritDoc}
             *
             * @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer,
             *     java.lang.Object, java.lang.Object)
             */
            public boolean select(Viewer viewer, Object parentElement, Object element) {
              return (element instanceof Player);
            }
          });
      // Start of user code for additional businessfilters for players

      // End of user code

    }
    // init values for referenced views

    // init filters for referenced views

    setInitializing(false);
  }
コード例 #2
0
  /**
   * {@inheritDoc}
   *
   * @see
   *     org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#initPart(java.lang.Class,
   *     int, org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.resource.ResourceSet)
   */
  public void initPart(java.lang.Class key, int kind, EObject elt, ResourceSet allResource) {
    setInitializing(true);
    if (basePart != null && key == NonregViewsRepository.Combo.class) {
      ((IPropertiesEditionPart) basePart).setContext(elt, allResource);
      final Talk talk = (Talk) elt;
      // init values
      basePart.initCombo(allResource, talk.getPresenter());
      basePart.initComboRO(allResource, talk.getPresenter());
      // init filters
      basePart.addFilterToCombo(
          new ViewerFilter() {

            /*
             * (non-Javadoc)
             *
             * @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
             */
            public boolean select(Viewer viewer, Object parentElement, Object element) {
              return (element instanceof Person);
            }
          });
      // Start of user code for additional businessfilters for combo

      // End of user code
      basePart.addFilterToComboRO(
          new ViewerFilter() {

            /*
             * (non-Javadoc)
             *
             * @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
             */
            public boolean select(Viewer viewer, Object parentElement, Object element) {
              return (element instanceof Person);
            }
          });
      // Start of user code for additional businessfilters for comboRO

      // End of user code
    }
    // init values for referenced views

    // init filters for referenced views

    setInitializing(false);
  }