Examples of PropertyGroup


Examples of org.andromda.core.metafacade.MetafacadeMapping.PropertyGroup

            namespace,
            null,
            null);
        assertNotNull(mapping);
        assertEquals(METAFACADE_IMPL_5, mapping.getMetafacadeClass().getName());
        PropertyGroup group = mapping.getMappingProperties();
        Collection mappingProperties = group.getProperties();
        assertNotNull(mappingProperties);
        assertEquals(1, mappingProperties.size());
        assertEquals(
            PROPERTY,
            ((MetafacadeMapping.Property)mappingProperties.iterator().next())
                .getName());
        assertEquals("false", ((MetafacadeMapping.Property)mappingProperties
            .iterator().next()).getValue());

        // get a property that has a value defined
        mapping = mappings.getMetafacadeMapping(
            MAPPING_OBJECT_4,
            namespace,
            null,
            null);
        assertNotNull(mapping);
        assertEquals(METAFACADE_IMPL_6, mapping.getMetafacadeClass().getName());
        group = mapping.getMappingProperties();
        mappingProperties = group.getProperties();
        assertNotNull(mappingProperties);
        assertEquals(1, mappingProperties.size());
        assertEquals(
            MAPPING_PROPERTY,
            ((MetafacadeMapping.Property)mappingProperties.iterator().next())
                .getName());
        assertEquals("true", ((MetafacadeMapping.Property)mappingProperties
            .iterator().next()).getValue());

        // get a metafacade that has no ancestors
        mapping = mappings.getMetafacadeMapping(
            MAPPING_OBJECT_3,
            namespace,
            null,
            null);
        assertNotNull(mapping);
        assertEquals(METAFACADE_IMPL_5, mapping.getMetafacadeClass().getName());
        assertEquals(1, mappingProperties.size());
        assertEquals(
            MAPPING_PROPERTY,
            ((MetafacadeMapping.Property)mappingProperties.iterator().next())
                .getName());
        assertEquals("true", ((MetafacadeMapping.Property)mappingProperties
            .iterator().next()).getValue());

        // get a mapping by context and property
        mapping = mappings.getMetafacadeMapping(
            MAPPING_OBJECT_6,
            namespace,
            METAFACADE_5,
            null);
        assertNotNull(mapping);
        assertEquals(MAPPING_OBJECT_6.getClass().getName(), mapping
            .getMappingClassName());
        assertEquals(METAFACADE_5, mapping.getContext());
        group = mapping.getMappingProperties();
        mappingProperties = group.getProperties();
        assertNotNull(mappingProperties);
        assertEquals(1, mappingProperties.size());
        assertEquals(
            MAPPING_PROPERTY,
            ((MetafacadeMapping.Property)mappingProperties.iterator().next())
                .getName());
        assertEquals("", ((MetafacadeMapping.Property)mappingProperties
            .iterator().next()).getValue());

        // attempt to get a mapping that has 2 properties with one being invalid
        mapping = mappings.getMetafacadeMapping(
            MAPPING_OBJECT_8,
            namespace,
            null,
            null);
        assertNull(mapping);

        // attempt to get a mapping that has 2 properties with both being valid
        mapping = mappings.getMetafacadeMapping(
            MAPPING_OBJECT_9,
            namespace,
            null,
            null);
        assertNotNull(mapping);
        assertEquals(METAFACADE_IMPL_8, mapping.getMetafacadeClass().getName());
        group = mapping.getMappingProperties();
        mappingProperties = group.getProperties();
        assertNotNull(mappingProperties);
        assertEquals(2, mappingProperties.size());
        Iterator propertyIterator = mappingProperties.iterator();
        MetafacadeMapping.Property propertyOne = (MetafacadeMapping.Property)propertyIterator
            .next();
        assertEquals(PROPERTY_ONE, propertyOne.getName());
        assertEquals("", propertyOne.getValue());
        MetafacadeMapping.Property propertyTwo = (MetafacadeMapping.Property)propertyIterator
            .next();
        assertEquals(PROPERTY_TWO, propertyTwo.getName());
        assertEquals("SomeValue", propertyTwo.getValue());

        // attempt to get a mapping that is mapped twice
        // each one using a different property of the
        // metafacade
        mapping = mappings.getMetafacadeMapping(
            MAPPING_OBJECT_10,
            namespace,
            null,
            null);
        assertNotNull(mapping);
        assertEquals(METAFACADE_IMPL_9, mapping.getMetafacadeClass().getName());
        group = mapping.getMappingProperties();
        mappingProperties = group.getProperties();
        assertNotNull(mappingProperties);
        assertEquals(1, mappingProperties.size());
        propertyIterator = mappingProperties.iterator();
        propertyOne = (MetafacadeMapping.Property)propertyIterator.next();
        assertEquals(PROPERTY_ONE, propertyOne.getName());
        assertEquals("", propertyOne.getValue());
       
        // attempt with two mappings pointing to the metafacade with
        // mutually exclusive properties (the first one listed should
        // be retrieved).
        mapping = mappings.getMetafacadeMapping(
            MAPPING_OBJECT_11,
            namespace,
            null,
            null);
        assertNotNull(mapping);
        assertEquals(METAFACADE_IMPL_10, mapping.getMetafacadeClass().getName());
        group = mapping.getMappingProperties();
        mappingProperties = group.getProperties();
        assertNotNull(mappingProperties);
        assertEquals(1, mappingProperties.size());
        propertyIterator = mappingProperties.iterator();
        propertyOne = (MetafacadeMapping.Property)propertyIterator.next();
        assertEquals(PROPERTY_TWO, propertyOne.getName());
View Full Code Here

Examples of org.jresearch.flexess.umi.provider.impl.PropertyGroup

    Collection<? extends IProviderPropertyGroupInfo> groups = providerInfo.getPropertyGroups();

    for (IProviderPropertyGroupInfo group : groups) {

      Collection<? extends IProviderPropertyInfo> properties = group.getConfigurationInfo();
      PropertyGroup propertyGroup = new PropertyGroup();
      propertyGroup.setName(group.getName());

      for (IProviderPropertyInfo property : properties) {
        NamedValue nv = new NamedValue();
        nv.setName(property.getName());
        nv.setValue(property.getDefaultValue());
        propertyGroup.addProperty(nv);
      }

      settings.addGroup(propertyGroup);
    }
    return settings;
View Full Code Here

Examples of org.sintef.umt.propertyeditor.PropertyGroup

      output.addLine("Transformation in progress (" + new Date().toString() + ")");
      pimviewer.setTransforming(true);
      try{
        fileviewer.clear ();
        setLastTransformation (action);
        PropertyGroup group = transformationeditor.getPropertyManager().getPropertyGroupForItem(action);
        String type = group.getProperty("Type");
        String outputtype = group.getProperty("Outputtype");
        String implementation = FileUtils.replaceSeparator(group.getProperty("Implementation"));
        String direction = group.getProperty("Direction");             
        String gendir = "src";
               
        if (current_store_dir != null && !(current_store_dir.equals(""))){
          gendir = current_store_dir + System.getProperty("file.separator") + gendir;
        }
        ProjectEditor current = null;
        try {
          current = projectmanager.getCurrentProject();
        if (current != null) {
          gendir = current.getGenDir ();
          gendir = current.getLocation() + System.getProperty("file.separator") + gendir;
          String userfile = current.getUserPropertiesFile();
          PropertyGroup userprops = current.getUserProperties();
         
          if (userfile != null && !userfile.equals("")) {
            // Create the user parameters and store them to the file
           
            // get directory from the location of the 'implementation'
           
            File implfile = new File (implementation);
            String dir = implfile.getParent();
           
            if(dir != null) {
              PrintWriter pf = null;
              try {
                File file = new File (dir + System.getProperty("file.separator") + userfile);
                pf = new PrintWriter( new FileWriter (file));
               
                pf.println("<xsl:stylesheet version=\"1.0\" xmlns:xsl=\"http:// www.w3.org/1999/XSL/Transform\">");
                pf.println("\n\n<!-- Generated file for user properties.-->\n\n");
                Map userproperties = userprops.getProperties();
                Iterator names = userproperties.keySet().iterator();
                               
                while (names.hasNext()) {
                  String name = (String)names.next();
                  String[] value = (String[])userproperties.get(name);
View Full Code Here

Examples of org.sintef.umt.propertyeditor.PropertyGroup

      else if (val[0].equalsIgnoreCase("dependency"))
        theSchema.addValidStereotypeForItem("enumAssociationStereoTypeType",key);
    }
   
    // Then to do basic type set.  This is stored in the <PropertyGroup item="types" name="types" stereotype="" type="types">
    PropertyGroup profile = pm.getPropertyGroupForItem (profileName);
    Map types = profile.getAllPropertiesForItem("types");
   

     
    // For the time being, the types are stored in the types variable
    // The extxmi.xsd schema needs to be changed so there is a smart place to add these types
View Full Code Here

Examples of org.sintef.umt.propertyeditor.PropertyGroup

  public PropertyGroup loadProfile(String profileName, String profileFile){
    PropertyManager pm = new PropertyManager(profileFile);
   
    pm.loadProperties();
   
    PropertyGroup pg = pm.getPropertyGroupForItem(profileName);
   
    return pg;
  }
View Full Code Here

Examples of org.sintef.umt.propertyeditor.PropertyGroup

  /**
   *
   * @return user variable properties
   */
  public PropertyGroup getUserProperties () {
    PropertyGroup pg = _propertymanager.getPropertyGroupForItem("User Variables");
    return pg;
  }
View Full Code Here

Examples of org.sintef.umt.propertyeditor.PropertyGroup

    _propertymanager.setProperty(group, "", property);
    _propertymanager.storeProperties();       
  }
 
  private String getPropertyForGroupItem (String group, String property_name) {
    PropertyGroup pg = _propertymanager.getPropertyGroupForItem(group);
    String property_value = pg.getProperty(property_name);
    return property_value;   
  }
View Full Code Here

Examples of org.sintef.umt.propertyeditor.PropertyGroup

   * Returns all properties for a specific group
   * @param group
   * @return
   */
  private Collection getPropertiesForGroupItem (String group) {
    PropertyGroup pg = _propertymanager.getPropertyGroupForItem(group);
    return pg.getProperties().values();
  }
View Full Code Here

Examples of org.sintef.umt.propertyeditor.PropertyGroup

  private void initProjectList () {
    try {
      Vector newdata = new Vector ();
      _project_ids.clear();
      for (Iterator projects = _propertymanager.getPropertyGroups();projects.hasNext();) {
        PropertyGroup pg = (PropertyGroup)projects.next();
        newdata.add(pg.getItem());
        _project_ids.add(pg.getId());
      }
      _projectlist.setListData(newdata);
      _projectlist.revalidate();
      _projectlist.setSelectedIndex(_projectlist.getModel().getSize() - 1);
      int index = _projectlist.getSelectedIndex();
View Full Code Here

Examples of org.sintef.umt.propertyeditor.PropertyGroup

   */
 
  public void deleteProjectByName (String project, String location) {
    Iterator it = _propertymanager.getPropertyGroups();
    for (;it.hasNext();){
      PropertyGroup projectgroup = (PropertyGroup)it.next();
      String current_location = projectgroup.getProperty("location");     
      if (projectgroup.getName().equals(project) && current_location.equalsIgnoreCase(location)) {
        // this project matches....
        // _propertymanager.removePropertyGroup(project, project, "");
        _propertymanager.removePropertyGroup(projectgroup);
        initProjectList ()
        _propertymanager.storeProperties();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.