Package com.google.collide.dto

Examples of com.google.collide.dto.RunTarget


        toggleDropdownStyle(false);

        // Update the runTarget for this workspace
        // TODO: Consider checking to see if there has actually
        // been a change
        RunTarget runTarget = targetPopup.getRunTarget();
        updateRunTarget(runTarget);
      }

      @Override
      public void onShow() {
View Full Code Here


   * A listener which handles events in the file tree which may affect the current RunTarget.
   */
  public class FileTreeChangeListener extends FileTreeModel.AbstractTreeModelChangeListener {
    @Override
    public void onNodeAdded(PathUtil parentDirPath, FileTreeNode newNode) {
      RunTarget currentTarget = targetPopup.getRunTarget();
      if (currentTarget.getRunMode() == RunMode.ALWAYS_RUN
          && currentTarget.getAlwaysRunFilename().contains("app.yaml")) {
        return;
      }

      // did the user add an app.yaml?
      if (newNode.isFile() && newNode.getName().equals("app.yaml")) {
        // lets set the run target to run the app.yaml
        RunTarget target = RunTargetImpl.make().setRunMode(RunMode.ALWAYS_RUN)
            .setAlwaysRunFilename(newNode.getNodePath().getPathString()).setAlwaysRunUrlOrQuery("");
       
        updateRunTarget(target);

        targetPopup.setRunTarget(target);
View Full Code Here

    }

    @Override
    public void onNodeMoved(
        PathUtil oldPath, FileTreeNode node, PathUtil newPath, FileTreeNode newNode) {
      RunTarget currentTarget = targetPopup.getRunTarget();
      if (currentTarget == null || currentTarget.getAlwaysRunFilename() == null) {
        return;
      }

      PathUtil currentAlwaysRunPath = new PathUtil(currentTarget.getAlwaysRunFilename());
      PathUtil relativePath = currentAlwaysRunPath.makeRelativeToParent(oldPath);
      if (relativePath != null) {
        // Either this node, or some ancestor node got renamed.
        PathUtil newFilePath = PathUtil.concatenate(newPath, relativePath);
        RunTargetImpl impl = (RunTargetImpl) currentTarget;
View Full Code Here

      }
    }

    @Override
    public void onNodesRemoved(JsonArray<FileTreeNode> oldNodes) {
      RunTarget target = targetPopup.getRunTarget();
      // we should clear the current file if the user deleted that one
      // we should revert the run target to preview if the user deleted the
      // "always run target".

      // If this gets more complicated, make it a visitor type thing
      boolean isAlwaysRun = target.getRunMode() == RunMode.ALWAYS_RUN;
      boolean hasClearedCurrentFile = currentFilePath == null;
      boolean hasClearedAlwaysRun = !isAlwaysRun;
      PathUtil alwaysRunPath = isAlwaysRun ? new PathUtil(target.getAlwaysRunFilename()) : null;

      for (int i = 0; (!hasClearedCurrentFile || !hasClearedAlwaysRun) && i < oldNodes.size();
          i++) {
        FileTreeNode node = oldNodes.get(i);
        if (!hasClearedCurrentFile) {
          if (node.getNodePath().containsPath(currentFilePath)) {
            updateCurrentFile(null);
            hasClearedCurrentFile = true;
          }
        }
        if (!hasClearedAlwaysRun) {
          if (node.getNodePath().containsPath(alwaysRunPath)) {
            RunTarget newTarget = RunTargetImpl.make().setRunMode(RunMode.PREVIEW_CURRENT_FILE);
            updateRunTarget(newTarget);
            targetResetTooltip.show(TOOLTIP_DISPLAY_TIMEOUT_MS);

            hasClearedAlwaysRun = true;
          }
View Full Code Here

TOP

Related Classes of com.google.collide.dto.RunTarget

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.