Package org.sintef.umt.propertyeditor

Examples of org.sintef.umt.propertyeditor.PropertyGroup


  public boolean findProjectWithSource (File source) {
    try {
      String sname = source.getAbsolutePath();
        System.out.println ("findProjectWithSource: " + sname);         
      PropertyManager project_properties;
      PropertyGroup group;
      for (Iterator projects = _propertymanager.getPropertyGroups(); projects.hasNext();) {
        PropertyGroup project = (PropertyGroup) projects.next();
        Map props = project.getProperties();     
        String location = ((String[])props.get("location"))[0];
        if (ProjectEditor.projectExists(location)) {
          project_properties = ProjectEditor.getPropertiesForLocation(location);
          if (project_properties != null) {
            group = project_properties.getPropertyGroupForItem("files");
            String projectsource = group.getProperty("source");
            System.out.println ("comparing with: " + projectsource);           
            if (projectsource.equalsIgnoreCase(sname)) {
              doOpenProject (project.getId());
              notifyListeners ("open");
              return true;
            }
          }
        }
View Full Code Here


       System.out.println ("\n\n Available transformations:\n");
       System.out.println ("--------------------------------");
       // String [] names = transformationeditor.getTransformationNames();
       // System.out.println ("Transformation names: " + names.length);
       while(it.hasNext()) {
         PropertyGroup pg = (PropertyGroup)it.next();        
         System.out.println("\t" + pg.getName());
       }
       System.out.println ("--------------------------------");             
     } else {
       doTransformation (source, input_file, output_dir, output_file, transformation, false);
     }
View Full Code Here

         /* xmi light file */
         xmil = pimviewer.parseHutnFile(infile);
       } else {
         xmil = pimviewer.xmiTransform(infile);        
       }
       PropertyGroup group = transformationeditor.getPropertyManager().getPropertyGroupForItem(transformation);
       if (group == null) {
         printError ("Non-existing transformation given ....: " + transformation);
       } else {

        String type = group.getProperty("Type");
        String outputtype = group.getProperty("Outputtype");
        String implementation = group.getProperty("Implementation");
        String direction = group.getProperty("Direction");       
        TransformerEngineFactory trefactory = new TransformerEngineFactory (output, false);
        TransformerEngine tre = trefactory.createTransformer(type, outputtype, implementation, direction);
       
        System.out.println ("Created transformer " + tre);       
        if (tre != null) {
View Full Code Here

    JPopupMenu pop = new JPopupMenu ();
    if (stereotype == null) stereotype = "";
    _actionPropertyMgr.reload();
    Iterator groups = _actionPropertyMgr.getSubgroupsForStereotypedItem (nodename, stereotype);
    while (groups.hasNext()) {
      PropertyGroup group = (PropertyGroup)groups.next();
      Map props = group.getProperties();
     
      JMenu menu = new JMenu (group.getName());
      pop.add (menu);
     
      for (Iterator it = props.keySet().iterator ();it.hasNext ();){
        String name = (String) it.next ();
        String value = ((String[]) props.get(name))[0];
View Full Code Here

    pimviewer.clearLineColors();

    output.addLine("Validation : initializing");
    Validator theValidator = new Validator(output);
    XmiSchema theSchema = new DOMXmiSchema(UMTMain.resource_dir + "extxmi.xsd");
    PropertyGroup theProfile = profileeditor.getChosenProfile();
    Profile2XSD transformer = new Profile2XSD();

    try{
      DocumentBuilderFactory theFact = DocumentBuilderFactory.newInstance();   
      DocumentBuilder bobTheBuilder = theFact.newDocumentBuilder();
     
      InputSource toParse = new InputSource(new StringReader(pimviewer.getHutnBuffer()));
         
      Document theModel = bobTheBuilder.parse(toParse);
   
      theSchema = transformer.doTransformation(theProfile,theModel);
      String theProfileName = "No profile selected.";
      if (theProfile != null)
        theProfileName = theProfile.getName();
      if (theProfileName == null || theProfileName.equals(""))
        theProfileName = "(no profile)";
      output.addLine("Validation : starting validation. Profile = " + theProfileName);
      theValidator.validateAgainstSchema(theModel,theSchema);
      output.addLine("Validation : validation done")      ;
View Full Code Here

   * @return
   */
  public static String getProperty (String property) {
    try {
      PropertyEditor editor = new PropertyEditor (preference_file);   
      PropertyGroup pg = editor.getPropertyManager().getPropertyGroupForItem("Preferences");
      return pg.getProperty(property);
    } catch (Exception ex) {
      return "";
    }
  }
View Full Code Here

  public void setTransformationItemsForMenu (JMenu menu, Element context, String trans_direction) {   
    _transformationcontext = context;
    transformationActionListener = new TransformationActionListener ();
    Iterator transformations = transformationeditor.getPropertyManager().getPropertyGroups();   
    for (;transformations.hasNext();){
      PropertyGroup transformation = (PropertyGroup) transformations.next();
      String direction = transformation.getProperty("Direction");
      String profile = transformation.getProperty("Profile");
      JMenuItem item = new JMenuItem (transformation.getName());
      if (direction.equalsIgnoreCase("Forward") && trans_direction.equalsIgnoreCase("forward")){
        menu.add (item);
        item.addActionListener (transformationActionListener);        
      } else if (direction.equalsIgnoreCase("Reverse") && trans_direction.equalsIgnoreCase("reverse")){
        menu.add (item);
View Full Code Here

TOP

Related Classes of org.sintef.umt.propertyeditor.PropertyGroup

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.