Modifies the selection focus in the project side bar. A file can either be selected
in the working set (the open files) or in the file tree, but not both.
@param {String} fileSelectionFocus - either PROJECT_MANAGER or WORKING_SET_VIEW
967323
function setFileViewFocus(fileSelectionFocus) {
        if (fileSelectionFocus !== PROJECT_MANAGER && fileSelectionFocus !== WORKING_SET_VIEW) {
            console.error("Bad parameter passed to FileViewController.setFileViewFocus");
            return;
        }

        if (_fileSelectionFocus !== fileSelectionFocus) {
            _fileSelectionFocus = fileSelectionFocus;
            exports.trigger("fileViewFocusChange");
        }
    }
189385
private void doOpenFile()
	{
		FileChooserResult selectedFile = Helpers.selectFileNameFor(this, searchPath, "Load a Sound-File", fileFilterLoad, 0, true, false);
		if (selectedFile!=null) 
			doOpenFile(selectedFile.getSelectedFiles());
	}
1338636
public static void setFolderBrowsingOnWidgets( JTextField pathTextField, JButton browseButton ) {
        browseButton.addActionListener(e -> {
            File lastFile = GuiUtilities.getLastFile();
            File[] res = showOpenFolderDialog(browseButton, "Select folder", false, lastFile);
            if (res != null && res.length == 1) {
                String absolutePath = res[0].getAbsolutePath();
                pathTextField.setText(absolutePath);
                setLastPath(absolutePath);
            }
        });
    }
573351
function searchFocus() {
  			if (dropDown.style.display !== "none") {
  				return;
  			}

  			dropDown.style.display = "block";
  			addEvent(document$$1, "click", hideHandler);
  			addEvent(document$$1, "keydown", hideHandler);

  			// Hide on Escape keydown or outside-container click
  			function hideHandler(e) {
  				var inContainer = moduleFilter.contains(e.target);

  				if (e.keyCode === 27 || !inContainer) {
  					if (e.keyCode === 27 && inContainer) {
  						moduleSearch.focus();
  					}
  					dropDown.style.display = "none";
  					removeEvent(document$$1, "click", hideHandler);
  					removeEvent(document$$1, "keydown", hideHandler);
  					moduleSearch.value = "";
  					searchInput();
  				}
  			}
  		}
595153
function( image ) {
			// Bring editor focused to restore selection.
			var editor = this.editor,
				sel;

			if ( image.bookmarks ) {
				editor.focus();
				// Retrieve the selection beforehand. (#8324)
				sel = editor.getSelection();
			}

			// Start transaction - do not allow any mutations to the
			// snapshots stack done when selecting bookmarks (much probably
			// by selectionChange listener).
			this.locked = { level: 999 };

			this.editor.loadSnapshot( image.contents );

			if ( image.bookmarks )
				sel.selectBookmarks( image.bookmarks );
			else if ( CKEDITOR.env.ie ) {
				// IE BUG: If I don't set the selection to *somewhere* after setting
				// document contents, then IE would create an empty paragraph at the bottom
				// the next time the document is modified.
				var $range = this.editor.document.getBody().$.createTextRange();
				$range.collapse( true );
				$range.select();
			}

			this.locked = null;

			this.index = image.index;
			this.currentImage = this.snapshots[ this.index ];

			// Update current image with the actual editor
			// content, since actualy content may differ from
			// the original snapshot due to dom change. (#4622)
			this.update();
			this.refreshState();

			editor.fire( 'change' );
		}
1128431
function(setFocus) {
			var res,
				node = this.activeNode;

			if (!node) {
				return _getResolvedPromise();
			}
			this.activeNode = null; // Force re-activating
			res = node.setActive(true, { noFocus: true });
			if (setFocus) {
				node.setFocus();
			}
			return res;
		}
389139
private void buttonGraphvizDotFileActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonGraphvizDotFileActionPerformed
      final JFileChooser fileChooser = new JFileChooser(this.textFieldPathToGraphvizDot.getText());
      fileChooser.setDialogTitle("Select GraphViz dot executable file");
      fileChooser.setApproveButtonText("Select");
      fileChooser.setAcceptAllFileFilterUsed(true);
      fileChooser.setMultiSelectionEnabled(false);

      fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);

      if (fileChooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {
        final File file = fileChooser.getSelectedFile();
        this.textFieldPathToGraphvizDot.setText(file.getAbsolutePath());
      }
    }
1105958
protected void openFileChooser()
   {
      if (m_model.getShowDialog())
      {
         if (m_fileChooser.showOpenDialog(m_parent) == JFileChooser.APPROVE_OPTION)
         {
            m_model.setFile(m_fileChooser.getSelectedFile());
         }
         m_model.setShowDialog(false);
      }
   }
1112552
function _updatePicker() {
        var filter = getActiveFilter();
        if (filter && filter.patterns.length) {
            var label = filter.name || _getCondensedForm(filter.patterns);
            _picker.setButtonLabel(StringUtils.format(Strings.EXCLUDE_FILE_FILTER, label));
        } else {
            _picker.setButtonLabel(Strings.NO_FILE_FILTER);
        }
    }
1093905
function onApply(file) {
      //console.log(file);
      dataValue.type = file.type;
      dataValue.id = file.id;
      dataValue.updatedAt = file.updatedAt;
      helpers.setFilePath(dataValue, file.location);
    }
819107
def set_selection(self, taskfile):
        
        self.set_project(taskfile.task.project)
        self.set_releasetype(taskfile.releasetype)
        if taskfile.task.department.assetflag:
            browser = self.assetbrws
            verbrowser = self.assetverbrws
            tabi = 0
            rootobj = taskfile.task.element.atype
        else:
            browser = self.shotbrws
            verbrowser = self.shotverbrws
            tabi = 1
            rootobj = taskfile.task.element.sequence

        self.set_level(browser, 0, rootobj)
        self.set_level(browser, 1, taskfile.task.element)
        self.set_level(browser, 2, taskfile.task)
        self.set_level(browser, 3, [taskfile.descriptor])
        self.set_level(verbrowser, 0, taskfile)

        self.selection_tabw.setCurrentIndex(tabi)
574170
private void directoryButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_directoryButtonActionPerformed
        // Select save directory
        JFileChooser chooser = new JFileChooser();
        chooser.setDialogTitle("Directory Select");
        chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
        chooser.setAcceptAllFileFilterUsed(false);
        if (chooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {
            folderField.setText(chooser.getSelectedFile().getAbsolutePath()
                    + File.separator);
        }
    }
628908
function handleShowInOS() {
        var entry = ProjectManager.getSelectedItem();
        if (entry) {
            brackets.app.showOSFolder(entry.fullPath, function (err) {
                if (err) {
                    console.error("Error showing '" + entry.fullPath + "' in OS folder:", err);
                }
            });
        }
    }
1355822
function(event) {
      if(this.layer) {
         if(this.layer.focusedContainer && this.layer.focusedContainer != this) {
            this.layer.focusedContainer.removeFocus();
         }
         this.setFocus();
         this.layer.focusedContainer = this;
      }
   }
697091
function filesChanged(fileList) {
        if (FindUtils.isNodeSearchDisabled() || !fileList || fileList.length === 0) {
            return;
        }
        var updateObject = {
            "fileList": fileList
        };
        if (searchModel.filter) {
            updateObject.filesInSearchScope = FileFilters.getPathsMatchingFilter(searchModel.filter, fileList);
            _searchScopeChanged();
        }
        searchDomain.exec("filesChanged", updateObject);
    }
414016
private void menuNewFileActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuNewFileActionPerformed
    File currentFolder = this.explorerTree.getCurrentFocusedFolder();
    if (currentFolder == null) {
      currentFolder = this.explorerTree.findFirstProjectFolder();
    }

    final JFileChooser fileChooser = new JFileChooser(currentFolder);
    fileChooser.setDialogTitle("New file");

    class Filter extends FileFilter {

      final String extension;
      final String description;

      Filter(@Nonnull final String extension, @Nonnull final String description) {
        this.extension = '.' + extension;
        this.description = description;
      }

      @Override
      public boolean accept(@Nonnull final File f) {
        return f.isDirectory() || f.getName().toLowerCase(Locale.ENGLISH).endsWith(this.extension);
      }

      @Override
      @Nonnull
      public String getDescription() {
        return this.description;
      }
    }

    fileChooser.setAcceptAllFileFilterUsed(false);
    final Filter filerMindMap = new Filter("mmd", "Mind Map file (*.mmd)");
    final Filter filerText = new Filter("txt", "Text file (*.txt)");
    final Filter filerPuml = new Filter("puml", "PantUML file (*.puml)");

    fileChooser.addChoosableFileFilter(filerMindMap);
    fileChooser.addChoosableFileFilter(filerText);
    fileChooser.addChoosableFileFilter(filerPuml);

    fileChooser.setFileFilter(filerMindMap);

    if (fileChooser.showDialog(this, "Create") == JFileChooser.APPROVE_OPTION) {
      final Filter choosenFilter = (Filter) fileChooser.getFileFilter();
      File selectedFile = fileChooser.getSelectedFile();

      if (!selectedFile.getName().contains(".")) {
        selectedFile = new File(selectedFile.getParent(), selectedFile.getName() + choosenFilter.extension);
      }

      final String text;

      if (choosenFilter == filerMindMap) {
        final MindMap model = new MindMap(null, true);
        model.setAttribute("showJumps", "true"); //NOI18N
        final Topic root = model.getRoot();
        if (root != null) {
          root.setText("Root"); //NOI18N
        }

        try {
          text = model.write(new StringWriter()).toString();
        } catch (IOException ex) {
          throw new Error("Unexpected error", ex);
        }
      } else if (choosenFilter == filerPuml) {
        final String nextLine = GetUtils.ensureNonNull(System.getProperty("line.separator"), "\n");
        text = "@startuml " + nextLine + nextLine + "@enduml";
      } else {
        text = "";
      }

      try {
        org.apache.commons.io.FileUtils.write(selectedFile, text, "UTF-8");
        this.explorerTree.addFileIfPossible(selectedFile, true);
      } catch (IOException ex) {
        LOGGER.error("Can't create file : " + selectedFile);
        JOptionPane.showMessageDialog(this, "Can't create file", "Error", JOptionPane.ERROR_MESSAGE);
      }
    }
  }
1015826
function _handleEditFilter(e) {
        var filterSets  = PreferencesManager.get("fileFilters") || [],
            filterIndex = $(e.target).parent().data("index") - FIRST_FILTER_INDEX;

        // Don't let the click bubble upward.
        e.stopPropagation();

        // Close the dropdown first before opening the edit filter dialog
        // so that it will restore focus to the DOM element that has focus
        // prior to opening it.
        _picker.closeDropdown();

        editFilter(filterSets[filterIndex], filterIndex);
    }