Package org.cishell.reference.service.metatype

Examples of org.cishell.reference.service.metatype.BasicObjectClassDefinition


     
     

    ObjectClassDefinition oldDefinition = originalProvider.getObjectClassDefinition(this.pid, null);

    BasicObjectClassDefinition definition;
    try {
      definition = new BasicObjectClassDefinition(oldDefinition.getID(), oldDefinition.getName(), oldDefinition.getDescription(), oldDefinition.getIcon(16));
    } catch (IOException e) {
      definition = new BasicObjectClassDefinition(oldDefinition.getID(), oldDefinition.getName(), oldDefinition.getDescription(), null);
    }

    definition.addAttributeDefinition(ObjectClassDefinition.REQUIRED,
        new BasicAttributeDefinition(SELECTED_CONVERTER_PARAM_ID,
            "Converter To Test",
            "The converter that you wish to test",
            AttributeDefinition.STRING,
            converterNames,
            converterNames));
   
     definition.addAttributeDefinition(ObjectClassDefinition.REQUIRED,
          new BasicAttributeDefinition(TEST_ALL_CONVS_PARAM_ID,
              "Test All Converters?",
              "Should we test all the converters or just the one selected?",
              AttributeDefinition.BOOLEAN));
     
      definition.addAttributeDefinition(ObjectClassDefinition.REQUIRED,
              new BasicAttributeDefinition(NUM_HOPS_PARAM_ID,
                  "Max Test Path Length",
                  "What is the maximum length a test path should have to be included",
                  AttributeDefinition.INTEGER,
                  "6"));
View Full Code Here


          }
    } catch (InvalidSyntaxException e) {

    }
   
      return new BasicMetaTypeProvider(new BasicObjectClassDefinition(servicePID,"","",null));
    }
View Full Code Here

    }
   
  public ObjectClassDefinition mutateParameters(Data[] data,
      ObjectClassDefinition parameters) {

    BasicObjectClassDefinition definition;
    definition = new BasicObjectClassDefinition("fileViewWithDefinition", "Application Viewer Type", "Please choose an application viewer to read this file.", null);
         
        Display.getDefault().syncExec(new Runnable() {
            public void run() {
                programTxt = Program.findProgram("txt");
            }});

        Display.getDefault().syncExec(new Runnable() {
            public void run() {
                programDoc = Program.findProgram("doc");
            }});
       
        Display.getDefault().syncExec(new Runnable() {
            public void run() {
                programHtml = Program.findProgram("htm");
               
            }});
        //TC181
        Display.getDefault().syncExec(new Runnable() {
            public void run() {
                programCsv = Program.findProgram("csv");
               
            }});
   
    String[] defValStringArray = null; //doesn't actually work yet...
   
    int possiblePrograms = 0;
    int counter = 0;
    if (programHtml != null) {
      possiblePrograms++;
    }
    if (programDoc != null) {
      possiblePrograms++;
    }
    if (programTxt != null) {
      possiblePrograms++;
    }
    if (programCsv != null) {
      possiblePrograms++;
    }
   
    String[] myOptionLabels = new String[possiblePrograms];
    String[] myOptionValues = new String[possiblePrograms];
    if (programHtml != null) {
      myOptionLabels[counter] = programHtml.getName();
      myOptionValues[counter++] = "html";
    }
    if (programDoc != null) {
      myOptionLabels[counter] = programDoc.getName();
      myOptionValues[counter++] = "doc";
    }
    if (programTxt != null) {
      myOptionLabels[counter] = programTxt.getName();
      myOptionValues[counter++] = "txt";
    }
    //TC181
    if (programTxt != null) {
      myOptionLabels[counter] = programCsv.getName();
      myOptionValues[counter++] = "csv";
    }
   
   
    AttributeDefinition ad = new BasicAttributeDefinition("viewWith", "View file as", "Type of viewer", AttributeDefinition.STRING, 0, defValStringArray, null, myOptionLabels, myOptionValues);
    definition.addAttributeDefinition(ObjectClassDefinition.REQUIRED, ad);

    return definition;
  }
View Full Code Here

   */
  public static BasicObjectClassDefinition apply(
      AttributeDefinitionTransformer transformer,
      ObjectClassDefinition oldObjectClassDefinition,
      Collection<String> attributesToIgnore) {   
    BasicObjectClassDefinition newOCD =
      MutateParameterUtilities.createNewParameters(oldObjectClassDefinition);
   
    // For each kind of AttributeDefinition filter ..
    for (Iterator<Integer> filterIt = ATOMIC_ATTRIBUTE_DEFINITION_FILTERS.iterator();
        filterIt.hasNext();) {
      int filter = filterIt.next().intValue();
     
      // Grab all matching AttributeDefinitions and transform them.
      AttributeDefinition[] oldAttributeDefintions =
        oldObjectClassDefinition.getAttributeDefinitions(filter);

      for (AttributeDefinition attributeDefinition : oldAttributeDefintions) {
        if (!attributesToIgnore.contains(attributeDefinition.getID())) {
          newOCD.addAttributeDefinition(
            filter, transformer.transform(attributeDefinition));
        }
      }
    }
   
View Full Code Here

  }
 
  public static BasicObjectClassDefinition createNewParameters(
      ObjectClassDefinition oldParameters) {
    try {
      return new BasicObjectClassDefinition(
        oldParameters.getID(),
        oldParameters.getName(),
        oldParameters.getDescription(),
        oldParameters.getIcon(16));
    }
    catch (IOException e) {
      return new BasicObjectClassDefinition(
        oldParameters.getID(),
        oldParameters.getName(),
        oldParameters.getDescription(),
        null);
    }
View Full Code Here

TOP

Related Classes of org.cishell.reference.service.metatype.BasicObjectClassDefinition

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.