Package jSimMacs.data

Examples of jSimMacs.data.RemoteProject


    // selectedNode.add(new ProjectEntryMutuableTreeNode(new
    // File(filePath)));
    DefaultTreeModel model = (DefaultTreeModel) getModel();
    if (selectedNode instanceof RemoteProjectMutuableTreeNode) {
      RemoteProjectMutuableTreeNode rNode = (RemoteProjectMutuableTreeNode) selectedNode;
      RemoteProject rProject = rNode.getRemoteProject();
      JSimMutuableTreeNode node = new RemoteProjectMutuableTreeNode(
          rProject, rNode.getPathString(), JSimLogic.getInstance()
              .getDirectoryEntry(rProject, filePath));
      model.insertNodeInto(node, selectedNode, selectedNode
          .getChildCount());
View Full Code Here


      model.insertNodeInto(node, localRoot, localRoot.getChildCount());
      // int []childIndices = new int[1];
      // childIndices[0] = localRoot.getChildCount()-1;
      // model.nodesWereInserted(localRoot, childIndices);
    } else if (location == ProjectLocation.SSH) {
      RemoteProject remoteProject = (RemoteProject) project;
      JSimMutuableTreeNode node = new RemoteProjectMutuableTreeNode(
          JSimLogic.getInstance().getDirectoryEntry(remoteProject,
              remoteProject.getPath() + remoteProject.getName()),
          remoteProject);
      model.insertNodeInto(node, sshRoot, sshRoot.getChildCount());
    }
  }
View Full Code Here

  }
 
  public Project getProject(){
    Project project = null;
    if(sshEnabled){
      project = new RemoteProject(getProjectName());
      ((RemoteProject)project).setHostname(getSshHostname());
      ((RemoteProject)project).setPort(Integer.parseInt(getSshPort()));
      ((RemoteProject)project).setUsername(getSshUser());
      ((RemoteProject)project).setPath(getSshPath());
      ((RemoteProject)project).setUseCertificate(sshCertificate.isSelected());
View Full Code Here

    if (selectedNode instanceof RemoteProjectMutuableTreeNode) {
      if (selectedNode.getLevel() == 2) {
        popupMenu.addSeparator();
        popupMenu.add(projectSettings);
        RemoteProjectMutuableTreeNode rNode = (RemoteProjectMutuableTreeNode) selectedNode;
        RemoteProject rProject = rNode.getRemoteProject();
        if (rProject.isOpenConnection())
          popupMenu.add(closeProject);
        else {
          popupMenu.add(openProject);
          popupMenu.remove(newDirectory);
          popupMenu.remove(newFile);
View Full Code Here

        }
      }
    } else if (es == openProject) {
      if (selectedNode instanceof RemoteProjectMutuableTreeNode) {
        RemoteProjectMutuableTreeNode rNode = (RemoteProjectMutuableTreeNode) selectedNode;
        RemoteProject rProject = rNode.getRemoteProject();
        JSimLogic.getInstance().openConnection(rProject);
        SFTPv3DirectoryEntry entry = JSimLogic.getInstance()
            .getDirectoryEntry(rProject,
                rProject.getPath() + rProject.getName());
        if (entry != null) {
          rNode.setJSimNode(entry);
          rNode.createNodes(true);

          model.nodeStructureChanged(selectedNode);
          JSimLogic.getInstance().refreshSimpleRemoteTree();
        } else
          JSimLogic.getInstance().closeConnection(rProject);
      }
    } else if (es == closeProject) {
      if (selectedNode instanceof RemoteProjectMutuableTreeNode) {
        RemoteProjectMutuableTreeNode rNode = (RemoteProjectMutuableTreeNode) selectedNode;
        RemoteProject rProject = rNode.getRemoteProject();
        JSimLogic.getInstance().closeConnection(rProject);
        rNode.removeAllChildren();
        rNode.setJSimNode(null);

        model.nodeStructureChanged(selectedNode);
        JSimLogic.getInstance().refreshSimpleRemoteTree();
      }
    } else if (es == projectSettings) {
      if (selectedNode instanceof RemoteProjectMutuableTreeNode) {
        JSimLogic.getInstance().showProjectSettingsDialog(
            ((JSimMutuableTreeNode) selectedNode).getProject());
      }
    } else if (es == importFile) {
      if (selectedNode instanceof RemoteProjectMutuableTreeNode) {
        RemoteProjectMutuableTreeNode rNode = (RemoteProjectMutuableTreeNode) selectedNode;
        RemoteProject rProject = rNode.getRemoteProject();
        ImportFileDialog importDialog = new ImportFileDialog(rNode
            .getPathString(), rProject);
        importDialog.pack();
        importDialog.setSize(500, 350);
        // importDialog.setLocationRelativeTo(this);
View Full Code Here

   * Writes a file to the server (SSHDataHandler)
   * @param tab
   * @throws IOException
   */
  public void writeFile(GroTab tab) throws IOException {
    RemoteProject rProject = tab.getRemoteProject();
    if (rProject != null) {
      SSHDataHandler handler = (SSHDataHandler) rProject.getDataHandler();
      if (handler != null) {
        handler.copyToServer(tab.getFile());
      }
    }

View Full Code Here

   * Creates a new project
   * @param project
   * @return boolean if it worked
   */
  public boolean createProject(Project project) {
    RemoteProject remoteProject = null;
    if (project instanceof RemoteProject)
      remoteProject = (RemoteProject) project;

    DataHandler dataHandler = DataHandlerFactory.getDataHandler(project);

    // String projectDirectory = workspaceDir;

    // projectDirectory += projectName;
    try {
      dataHandler.initialize();
      if (project.getLocation() == ProjectLocation.SSH) {
        remoteProject.setDataHandler(dataHandler);
        remoteProject.setOpenConnection(true);
        remoteProjects.add(remoteProject);
        frame.addRemoteProjectRunMenu(remoteProject);
      } else {
        localProjects.add(project);
        frame.addLocalProjectRunMenu(project);
View Full Code Here

   * @return DataHandler
   * @throws IOException
   */
  private DataHandler createDataHandler(Project project) throws IOException {
    DataHandler handler = null;
    RemoteProject rProject = null;
    if (project.getLocation() == ProjectLocation.SSH) {
      // RemoteProjectMutuableTreeNode rNode =
      // (RemoteProjectMutuableTreeNode) treeNode;
      rProject = (RemoteProject) project;
      handler = rProject.getDataHandler();
      if (handler != null && !((SSHDataHandler) handler).isConnected())
        handler.initialize();
    }
    if (handler == null) {
      // Project project = de.getProject();
      // ProjectLocation location = treeNode.getProjectLocation();
      handler = DataHandlerFactory.getDataHandler(project);
      handler.initialize();
      if (project.getLocation() == ProjectLocation.SSH)
        rProject.setDataHandler(handler);
    }
    return handler;
  }
View Full Code Here

      String path;
      if (project.getLocation() == ProjectLocation.LOCALE)
        path = workspaceDir + project.getPathName()
            + JSimConstants.PROJECTCONFFILE;
      else {
        RemoteProject rProject = (RemoteProject) project;
        path = rProject.getPath() + rProject.getPathName()
            + JSimConstants.PROJECTCONFFILE;
      }
      File projectFile = handler.readFile(path);

      if (!projectFile.exists()) {
View Full Code Here

    String remotePath = "";
    if (projectLocation == ProjectLocation.LOCALE) {
      projectFile = workspaceDir + project.getPathName()
          + JSimConstants.PROJECTCONFFILE;
    } else {
      RemoteProject rmProject = (RemoteProject) project;
      handler = (SSHDataHandler) rmProject.getDataHandler();
      remotePath = rmProject.getPath() + rmProject.getName() + "/"
          + JSimConstants.PROJECTCONFFILE;
      projectFile = handler
          .createTempPath(rmProject.getPath() + rmProject.getName()
              + "/" + JSimConstants.PROJECTCONFFILE);
      projectFile += JSimConstants.PROJECTCONFFILE;
    }
    IXMLWriter projectWriter = new ProjectSAXWriter(project);
    try {
View Full Code Here

TOP

Related Classes of jSimMacs.data.RemoteProject

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.