示例#1
0
 @Override
 protected boolean validateOptionsGroup() {
   return getArtifactParser() != null
       && //
       selectionLatch.areSelectionsValid()
       && !selectionLatch.hasChanged()
       && //
       getArtifactType() != null
       && //
       (!updateExistingArtifacts.getSelection()
           || updateByGuid.getSelection()
           || getNonChangingAttributes() != null);
 }
示例#2
0
  private synchronized void updateExtractedElements() {
    selectionLatch.setCurrentValues(getDestinationArtifact(), getSourceFile(), getArtifactParser());
    if (selectionLatch.areSelectionsValid()) {
      selectionLatch.latch();

      collector.reset();

      final Artifact destinationArtifact = selectionLatch.currentSelected.destinationArtifact;
      final File sourceFile = selectionLatch.currentSelected.sourceFile;
      final IArtifactExtractor extractor = selectionLatch.currentSelected.extractor;

      operationReportMessages.setLength(0);

      IOperation op =
          ArtifactImportOperationFactory.createArtifactsCompOperation(
              "Extracting data from source",
              sourceFile,
              destinationArtifact,
              new OperationLogger() {
                @Override
                public void log(String... row) {
                  for (String warningMessage : row) {
                    operationReportMessages.append(warningMessage);
                  }
                };
              },
              extractor,
              collector,
              selectedArtifactTypes,
              true);

      selectedArtifactTypes.clear();

      if (executeOperation(op)) {
        artifactTypeSelectPanel.setAllowedArtifactTypes(selectedArtifactTypes);
        try {
          if (getArtifactType() != null) {
            ArtifactType specificArtifactType = ArtifactTypeManager.getType(getArtifactType());
            attributeTypeSelectPanel.setAllowedAttributeTypes(
                specificArtifactType.getAttributeTypes(getDestinationArtifact().getFullBranch()));
          }
        } catch (Exception ex) {
          OseeLog.log(Activator.class, Level.SEVERE, ex);
        }
      }
    }
  }
示例#3
0
  @Override
  public void createControl(Composite parent) {
    initializeDialogUnits(parent);

    Composite composite = new Composite(parent, SWT.NULL);
    composite.setLayout(new GridLayout(1, false));
    composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    composite.setFont(parent.getFont());

    createDestinationArtifactSelectArea(composite);
    createSourceFileArea(composite);
    createParserSelectionArea(composite);
    createArtifactTypeSelectArea(composite);
    createNonChangingAttributeTypeSelectArea(composite);

    restoreWidgetValues();
    updateWidgetEnablements();
    setPageComplete(determinePageCompletion());
    setControl(composite);
    selectionLatch.setCurrentValues(getDestinationArtifact(), getSourceFile(), getArtifactParser());
    selectionLatch.latch();
  }