Package tool.model

Examples of tool.model.ToolComponent


  public void launch(IEditorPart editor, String mode) {
    this.fMode = mode;
    if (mode.equalsIgnoreCase("debug"))
      return;
    IEditorInput input = editor.getEditorInput();
        ToolComponent toolElement =
            (ToolComponent) input.getAdapter(ToolComponent.class);
        if (toolElement != null) {
          //TODO launch from method or class editor
        }
  }
View Full Code Here


        ToolPlan tpm = ToolPlan.getInstance(modelFile);
        IProjectComponent[] tpcs = tpm.getComponents();
        return tpcs;
      }
    } else if (parentElement instanceof ToolClass){
      ToolComponent cls = (ToolComponent)parentElement;
      return cls.getComponents();
    } else if (parentElement instanceof ToolInterface){
      ToolComponent cls = (ToolComponent)parentElement;
      return cls.getComponents();
    } else if (parentElement instanceof ToolCType){
      ToolComponent cls = (ToolComponent)parentElement;
      return cls.getComponents();
    } else if (parentElement instanceof IClassComponent){
        return NO_CHILDREN;
    }
    return children != null ? children : NO_CHILDREN;
 
View Full Code Here

      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;
      return cls.getComponents();
    } else if (parentElement instanceof ToolCType){
      ToolComponent cls = (ToolComponent)parentElement;
      return cls.getComponents();
    } else if (parentElement instanceof IClassComponent){
      return NO_CHILDREN;
    } else if (parentElement instanceof IFolder &&
        ((IFolder)parentElement).getName().equals(ToolProjectSupport.UDS_LIBRARY_FOLDER_NAME)) {
      Collection <ToolPlan> plans = ToolPlan.getForteLibraryCache().values();
View Full Code Here

  public void removePropertyChangeListener(PropertyChangeListener listener) {
    propertyChangeSupport.removePropertyChangeListener(listener);
  }
  public static ToolComponent show(IProject project, ISelection selection){
    ToolComponent cls = null;
    Shell shell = Display.getDefault().getActiveShell();
    FindTypeDialog dialog = new FindTypeDialog(shell, project, selection);
    int option = dialog.open();
    cls = dialog.selectedClass;
    return cls;
View Full Code Here

  public String getText(Object element) {
    if (element == null)
      return "Null model element - Check content provider";
    if (element instanceof ToolComponent){
      ToolComponent component = (ToolComponent)element;
      return component.getLabelText(this.options);
    } else if (element instanceof ToolCMember){
      ToolCMember component = (ToolCMember)element;
      return component.getName() + " : " + component.getType();
    }
    return element.toString();
  }
View Full Code Here

  @Override
  public void run(IAction action) {
    ISelection selection = this.selectionService.getSelection();
    MethodEditorInput input = (MethodEditorInput)this.currentEditorPart.getEditorInput();
    IProject project = input.getFile().getProject();
    ToolComponent cls = FindTypeDialog.show(project, selection);
    if (cls != null){
      OpenClassDelegate.showInEditor(cls);
    }
  }
View Full Code Here

    lookupButton.addSelectionListener(new SelectionAdapter() {
      @Override
      public void widgetSelected(SelectionEvent e) {
        String typeString = getAttribute().getType();
        String[] parts = typeString.split("\\.");
        ToolComponent type = ToolType.findType(getAttribute().getProject(), parts[0].trim(), parts[1].trim());
        if (type != null){
          ToolType newType = (ToolType) SelectType.select((ToolType)getAttribute().getParent(), type);
          if (newType != null){
            attribute.setType(newType.getFullName());
          }
View Full Code Here

    Button findTypeButton = new Button(container, SWT.NONE);
    findTypeButton.addSelectionListener(new SelectionAdapter() {
      @Override
      public void widgetSelected(SelectionEvent e) {
        String typeName = getVirtualAttribute().getType();
        ToolComponent myClass = (ToolComponent) getVirtualAttribute().getParent();
        ToolComponent typeClass = ToolClass.fetch(myClass.getProject(), typeName);
        ToolType newClass = (ToolType) SelectType.select(myClass, typeClass);
        getVirtualAttribute().setType(newClass.getFullName());
      }
    });
    findTypeButton.setImage(ResourceManager.getPluginImage("Tool", "icons/look_up.gif"));
View Full Code Here

      project = input.getFile().getProject();
    } else if (selection instanceof TreeSelection){
      project = getProjectFromSelection(selection);
    }
    if (project != null){
      ToolComponent cls = FindTypeDialog.show(project, selection);
      if (cls != null){
        OpenClassDelegate.showInEditor(cls);
      }
    }
    return null;
View Full Code Here

      } else if (object instanceof ToolComponent){
        /*
         * we are going to find the file of the component or its parent, then locate the project
         */
        IFile file = null;
        ToolComponent subject = (ToolComponent)object;
        while (file == null){
          file = subject.getFile();
          if (file == null)
            subject = (ToolComponent) subject.getParent();
        }
        project = file.getProject();
      }
    }
    return project;
View Full Code Here

TOP

Related Classes of tool.model.ToolComponent

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.