Package tool.model

Examples of tool.model.ToolPlan


    // $ANTLR start "project"
    // /Users/peter/Documents/workspace/ToolModel/src/tool/model/grammar/ForteAST.g:50:1: project returns [ToolPlan newPlan] : ^( PROJECT projName= IDENTIFIER planType ( supplierPlans )? ( forward )* ( constantDeclaration[true] )* ( forward )* ( cDataTypeDeclatation[$projName.text] )* ( objectTypeDeclaration[$projName.text] )* ( serviceDeclaration[$projName.text] )* ( cursorDeclaration[$projName.text] )* ( methodImplementation )* ( project_property )* ( include )* ) ;
    public final ToolPlan project() throws RecognitionException {
        project_stack.push(new project_scope());
        ToolPlan newPlan = null;

        CommonTree projName=null;

        try {
            // /Users/peter/Documents/workspace/ToolModel/src/tool/model/grammar/ForteAST.g:61:3: ( ^( PROJECT projName= IDENTIFIER planType ( supplierPlans )? ( forward )* ( constantDeclaration[true] )* ( forward )* ( cDataTypeDeclatation[$projName.text] )* ( objectTypeDeclaration[$projName.text] )* ( serviceDeclaration[$projName.text] )* ( cursorDeclaration[$projName.text] )* ( methodImplementation )* ( project_property )* ( include )* ) )
            // /Users/peter/Documents/workspace/ToolModel/src/tool/model/grammar/ForteAST.g:61:5: ^( PROJECT projName= IDENTIFIER planType ( supplierPlans )? ( forward )* ( constantDeclaration[true] )* ( forward )* ( cDataTypeDeclatation[$projName.text] )* ( objectTypeDeclaration[$projName.text] )* ( serviceDeclaration[$projName.text] )* ( cursorDeclaration[$projName.text] )* ( methodImplementation )* ( project_property )* ( include )* )
            {
            match(input,PROJECT,FOLLOW_PROJECT_in_project80); if (state.failed) return newPlan;

            match(input, Token.DOWN, null); if (state.failed) return newPlan;
            projName=(CommonTree)match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_project84); if (state.failed) return newPlan;
            if ( state.backtracking==0 ) {

                  System.out.println("=== ToolPlan: " + (projName!=null?projName.getText():null));
                  ((project_scope)project_stack.peek()).currentPlan = new ToolPlan((projName!=null?projName.getText():null));
                  ((project_scope)project_stack.peek()).currentPlan.setFile((IFile)this.sourceResource);
                  //addPlanToProject(((project_scope)project_stack.peek()).currentPlan);
                 
            }
            pushFollow(FOLLOW_planType_in_project95);
View Full Code Here


      }
    }
  }

  protected ToolPlan findToolPlan(IStructuredSelection selection){
    ToolPlan plan = null;
    Object firstElement = selection.getFirstElement();
    if (firstElement instanceof IFolder){
      if (ToolProjectSupport.isPlanFolder((IFolder)firstElement)){
        plan = ToolProjectSupport.getPlanFromFolder((IFolder)firstElement);
      } else if (firstElement instanceof IFile){
View Full Code Here

      return NO_CHILDREN;
    } else if(parentElement instanceof IFile) {
      /* possible model file */
      IFile modelFile = (IFile) parentElement;
      if(PLAN_EXT.equals(modelFile.getFileExtension())) {       
        ToolPlan tpm = ToolPlan.getInstance(modelFile);
        IProjectComponent[] tpcs = tpm.getComponents();
        return tpcs;
      }
    } else if (parentElement instanceof ToolClass){
      ToolComponent cls = (ToolComponent)parentElement;
      return cls.getComponents();
View Full Code Here

  public Object[] getChildren(Object parentElement) {
    Object[] children = null;
    if (parentElement instanceof ToolConstant) {
      return NO_CHILDREN;
    } else if (parentElement instanceof ToolPlan){
      ToolPlan plan = (ToolPlan)parentElement;
      return plan.getComponents();
    } else if (parentElement instanceof ToolClass){
      ToolComponent cls = (ToolComponent)parentElement;
      return cls.getComponents();
    } else if (parentElement instanceof ToolInterface){
      ToolComponent cls = (ToolComponent)parentElement;
View Full Code Here

    }
    if(source instanceof IFile) {
      /* possible model file */
      IFile modelFile = (IFile) source;
      if(PLAN_EXT.equals(modelFile.getFileExtension())) { 
        ToolPlan plan = ToolPlan.getInstance(modelFile);
        IProjectComponent[] tpcs = null;
        tpcs = plan.getComponents();
        return tpcs;
      }
    }
   
    if(source instanceof IFolder) {
      IErrorReporter plan = ToolProjectSupport.getPlanFromFolder((IFolder)source);
      if (plan != null){
        source = plan;
        this.showType = CONSTANTS;
      }
    }

    if (source instanceof ToolPlan){
      ToolPlan plan = (ToolPlan)source;
      IProjectComponent[] tpcs = null;
      tpcs = plan.getComponents();
      return tpcs;
    }  
    return children != null ? children : NO_CHILDREN;
 
View Full Code Here

  }

  @Override
  public Object[] getChildren(Object parentElement) {
    if (parentElement instanceof ToolPlan){
      ToolPlan plan = (ToolPlan)parentElement;
      List<ToolClass> classes = plan.getClasses();
      List<ToolInterface> interfaces = plan.getInterfaces();
      List<ToolCType> cTypes = plan.getCTypes();
      Object[] kids = new Object[classes.size() + interfaces.size() + cTypes.size()];
      int j = 0;
      for (ToolType cls : classes){
        kids[j] = cls;
        j++;
View Full Code Here

    ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(
        Display.getDefault().getActiveShell(),
          new LabelProvider(),
          new SupplierContentProvider(project));
   
      ToolPlan rootPlan = null;
      if (component instanceof ToolServiceObject){
        rootPlan = ((ToolServiceObject)component).getPlan();
      } else if (component instanceof ToolType){
        rootPlan = ((ToolType)component).getPlan();
      }
      Set<String> planNames = new HashSet<String>(rootPlan.getSupplierPlans());
      planNames.add(rootPlan.getToolName());
      dialog.setTitle("Type Selection");
      dialog.setMessage("Select the type from the tree:");
      dialog.setInput(planNames);
      dialog.setAllowMultiple(false);
      dialog.setEmptyListMessage("No types available");
View Full Code Here

    // $ANTLR start "project"
    // /Users/peter/Documents/workspace/Tool/src/tool/model/grammar/ForteAST.g:40:1: project returns [ToolPlan newPlan] : ^( PROJECT projName= IDENTIFIER planType ( supplierPlans )? ( forward )* ( constantDeclaration[true] )* ( cDataTypeDeclatation[$projName.text] )* ( objectTypeDeclaration[$projName.text] )* ( serviceDeclaration[$projName.text] )* ( cursorDeclaration[$projName.text] )* ( methodImplementation )* ( project_property )* ( include )* ) ;
    public final ToolPlan project() throws RecognitionException {
        project_stack.push(new project_scope());
        ToolPlan newPlan = null;


        CommonTree projName=null;

        try {
            // /Users/peter/Documents/workspace/Tool/src/tool/model/grammar/ForteAST.g:51:3: ( ^( PROJECT projName= IDENTIFIER planType ( supplierPlans )? ( forward )* ( constantDeclaration[true] )* ( cDataTypeDeclatation[$projName.text] )* ( objectTypeDeclaration[$projName.text] )* ( serviceDeclaration[$projName.text] )* ( cursorDeclaration[$projName.text] )* ( methodImplementation )* ( project_property )* ( include )* ) )
            // /Users/peter/Documents/workspace/Tool/src/tool/model/grammar/ForteAST.g:51:5: ^( PROJECT projName= IDENTIFIER planType ( supplierPlans )? ( forward )* ( constantDeclaration[true] )* ( cDataTypeDeclatation[$projName.text] )* ( objectTypeDeclaration[$projName.text] )* ( serviceDeclaration[$projName.text] )* ( cursorDeclaration[$projName.text] )* ( methodImplementation )* ( project_property )* ( include )* )
            {
            match(input,PROJECT,FOLLOW_PROJECT_in_project78); if (state.failed) return newPlan;

            match(input, Token.DOWN, null); if (state.failed) return newPlan;
            projName=(CommonTree)match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_project82); if (state.failed) return newPlan;

            if ( state.backtracking==0 ) {
                ((project_scope)project_stack.peek()).currentPlan = new ToolPlan((projName!=null?projName.getText():null));
                addPlanToProject(((project_scope)project_stack.peek()).currentPlan);
                }

            pushFollow(FOLLOW_planType_in_project93);
            planType();
View Full Code Here

      IProjectComponent model = (IProjectComponent)element;
      return ToolPlugin.getImage(model.getIconString());
    } else if (element instanceof IClassComponent){
      return ToolPlugin.getImage(((IClassComponent)element).getIconString());
    } else if (element instanceof ToolPlan){
      ToolPlan plan = (ToolPlan)element;
      if (plan.isFortePlan() || plan.isLibrary())
        return ToolPlugin.getImage("icons/library.gif");
      else
        return ToolPlugin.getImage("icons/package.gif");
    } else if (element instanceof IFolder && ToolProjectSupport.isSourceFolder((IFolder)element)){
      return ToolPlugin.getImage("icons/packagefolder.gif");
View Full Code Here

    IFolder newPlanFolder = sourceFolder.getFolder(planName);
    newPlanFolder.create(IResource.FORCE, true, null);
    newPlanFolder.setPersistentProperty(toolPlanNameQualifiedName, planName);

    ToolPlan newToolPlan = ToolPlan.newPlan(newPlanFolder, planName, display, dataBase);

    prxFile = newToolPlan.getFile();
    return prxFile;
  }
View Full Code Here

TOP

Related Classes of tool.model.ToolPlan

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.