コード例 #1
0
 /**
  * {@inheritDoc}
  *
  * @see
  *     org.eclipse.emf.eef.subPackageNonRegForFilters.parts.TestFilterPropertiesEditionPart#setTestAEOFCV(EObject
  *     newValue)
  */
 public void setTestAEOFCV(EObject newValue) {
   if (newValue != null) {
     testAEOFCV.setSelection(new StructuredSelection(newValue));
   } else {
     testAEOFCV.setSelection(new StructuredSelection()); // $NON-NLS-1$
   }
 }
コード例 #2
0
 /**
  * {@inheritDoc}
  *
  * @see
  *     org.eclipse.emf.eef.subPackageNonRegForFilters.parts.TestFilterPropertiesEditionPart#initTestAEOFCV(ResourceSet
  *     allResources, EObject current)
  */
 public void initTestAEOFCV(ResourceSet allResources, EObject current) {
   testAEOFCV.setInput(allResources);
   if (current != null) {
     testAEOFCV.setSelection(new StructuredSelection(current));
     testAEOFCV.setMainResource(current.eResource());
   }
 }
コード例 #3
0
 /**
  * {@inheritDoc}
  *
  * @see
  *     org.eclipse.emf.eef.subPackageNonRegForFilters.parts.TestFilterPropertiesEditionPart#addBusinessFilterTestAEOFCV(ViewerFilter
  *     filter)
  */
 public void addBusinessFilterToTestAEOFCV(ViewerFilter filter) {
   testAEOFCV.addBusinessRuleFilter(filter);
 }
コード例 #4
0
 /**
  * {@inheritDoc}
  *
  * @see
  *     org.eclipse.emf.eef.subPackageNonRegForFilters.parts.TestFilterPropertiesEditionPart#addFilterTestAEOFCV(ViewerFilter
  *     filter)
  */
 public void addFilterToTestAEOFCV(ViewerFilter filter) {
   testAEOFCV.addFilter(filter);
 }
コード例 #5
0
 /**
  * {@inheritDoc}
  *
  * @see
  *     org.eclipse.emf.eef.subPackageNonRegForFilters.parts.TestFilterPropertiesEditionPart#setTestAEOFCVButtonMode(ButtonsModeEnum
  *     newValue)
  */
 public void setTestAEOFCVButtonMode(ButtonsModeEnum newValue) {
   testAEOFCV.setButtonMode(newValue);
 }
コード例 #6
0
 /**
  * {@inheritDoc}
  *
  * @see
  *     org.eclipse.emf.eef.subPackageNonRegForFilters.parts.TestFilterPropertiesEditionPart#getTestAEOFCV()
  */
 public EObject getTestAEOFCV() {
   return testAEOFCV.getSelection();
 }
コード例 #7
0
  /** @param groupGroup */
  protected void createTestAEOFCVFlatComboViewer(Composite parent, FormToolkit widgetFactory) {
    FormUtils.createPartLabel(
        widgetFactory,
        parent,
        NonregMessages.TestFilterPropertiesEditionPart_TestAEOFCVLabel,
        propertiesEditionComponent.isRequired(
            NonregViewsRepository.TestFilter.testAEOFCV, NonregViewsRepository.FORM_KIND));
    // create callback listener
    EObjectFlatComboViewerListener<NamedElement> listener =
        new EObjectFlatComboViewerListener<NamedElement>() {
          public void handleSet(NamedElement element) {
            propertiesEditionComponent.firePropertiesChanged(
                new PropertiesEditionEvent(
                    TestFilterPropertiesEditionPartForm.this,
                    NonregViewsRepository.TestFilter.testAEOFCV,
                    PropertiesEditionEvent.COMMIT,
                    PropertiesEditionEvent.SET,
                    null,
                    element));
          }

          public void navigateTo(NamedElement element) {}

          public NamedElement handleCreate() {
            NamedElement eObject = MiddlenonregFactory.eINSTANCE.createNamedElement();
            if (current != null
                && current instanceof ForFilters
                && ((ForFilters) current).getEOFCV() != null) {
              eObject = (NamedElement) EcoreUtil.copy(((ForFilters) current).getEOFCV());
            }
            IPropertiesEditionPolicyProvider policyProvider =
                PropertiesEditionPolicyProviderService.getInstance().getProvider(eObject);
            IPropertiesEditionPolicy editionPolicy = policyProvider.getEditionPolicy(eObject);
            if (editionPolicy != null) {
              EObject propertiesEditionObject =
                  editionPolicy.getPropertiesEditionObject(
                      new EObjectPropertiesEditionContext(
                          propertiesEditionComponent, eObject, resourceSet));
              if (propertiesEditionObject != null) {
                propertiesEditionComponent.firePropertiesChanged(
                    new PropertiesEditionEvent(
                        TestFilterPropertiesEditionPartForm.this,
                        NonregViewsRepository.TestFilter.testAEOFCV,
                        PropertiesEditionEvent.COMMIT,
                        PropertiesEditionEvent.SET,
                        null,
                        propertiesEditionObject));
                return (NamedElement) propertiesEditionObject;
              }
              if (current != null
                  && current instanceof ForFilters
                  && ((ForFilters) current).getEOFCV() != null) return eObject;
              return null;
            }
            return null;
          }
        };
    // create widget
    testAEOFCV =
        new AdvancedEObjectFlatComboViewer<NamedElement>(
            NonregMessages.TestFilterPropertiesEditionPart_TestAEOFCVLabel,
            resourceSet,
            testAEOFCVFilter,
            MiddlenonregPackage.eINSTANCE.getNamedElement(),
            listener);
    testAEOFCV.createControls(parent, widgetFactory);
    GridData testAEOFCVData = new GridData(GridData.FILL_HORIZONTAL);
    testAEOFCV.setLayoutData(testAEOFCVData);
    FormUtils.createHelpButton(
        widgetFactory,
        parent,
        propertiesEditionComponent.getHelpContent(
            NonregViewsRepository.TestFilter.testAEOFCV, NonregViewsRepository.FORM_KIND),
        null); //$NON-NLS-1$
  }