Rename Workspace::getPanes to Workspace::getPaneViews

This commit is contained in:
probablycorey
2014-02-18 15:13:27 -08:00
committed by Corey Johnson & Nathan Sobo
parent ef263580df
commit b042dffc2c
5 changed files with 20 additions and 13 deletions

View File

@@ -66,7 +66,7 @@ describe "PaneContainerView", ->
container.saveAll()
for pane in container.getPanes()
for pane in container.getPaneViews()
for item in pane.getItems()
expect(item.saved).toBeTruthy()
@@ -255,7 +255,7 @@ describe "PaneContainerView", ->
describe ".focusPreviousPane()", ->
it "focuses the pane preceding the focused pane or the last pane if no pane has focus", ->
container.attachToDom()
container.getPanes()[0].focus() # activate first pane
container.getPaneViews()[0].focus() # activate first pane
container.focusPreviousPane()
expect(pane3.activeItem).toMatchSelector ':focus'

View File

@@ -36,12 +36,12 @@ describe "WorkspaceView", ->
editorView1 = atom.workspaceView.getActiveView()
buffer = editorView1.getEditor().getBuffer()
editorView1.splitRight()
expect(atom.workspaceView.getActivePane()).toBe atom.workspaceView.getPanes()[1]
expect(atom.workspaceView.getActivePane()).toBe atom.workspaceView.getPaneViews()[1]
simulateReload()
expect(atom.workspaceView.getEditorViews().length).toBe 2
expect(atom.workspaceView.getActivePane()).toBe atom.workspaceView.getPanes()[1]
expect(atom.workspaceView.getActivePane()).toBe atom.workspaceView.getPaneViews()[1]
expect(atom.workspaceView.title).toBe "untitled - #{atom.project.getPath()}"
describe "when there are open editors", ->

View File

@@ -54,24 +54,24 @@ class PaneContainerView extends View
confirmClose: ->
saved = true
for pane in @getPanes()
for pane in @getPaneViews()
for item in pane.getItems()
if not pane.promptToSaveItem(item)
saved = false
break
saved
getPanes: ->
getPaneViews: ->
@find('.pane').views()
indexOfPane: (pane) ->
@getPanes().indexOf(pane.view())
@getPaneViews().indexOf(pane.view())
paneAtIndex: (index) ->
@getPanes()[index]
@getPaneViews()[index]
eachPaneView: (callback) ->
callback(pane) for pane in @getPanes()
callback(pane) for pane in @getPaneViews()
paneAttached = (e) -> callback($(e.target).view())
@on 'pane:attached', paneAttached
off: => @off 'pane:attached', paneAttached
@@ -117,7 +117,7 @@ class PaneContainerView extends View
pane = @getActivePane()
box = @boundingBoxForPane(pane)
panes = @getPanes()
panes = @getPaneViews()
.filter (otherPane) =>
otherBox = @boundingBoxForPane(otherPane)
switch direction
@@ -143,3 +143,6 @@ class PaneContainerView extends View
right: {x: boundingBox.right, y: boundingBox.top}
top: {x: boundingBox.left, y: boundingBox.top}
bottom: {x: boundingBox.left, y: boundingBox.bottom}
getPanes: ->
@getPaneViews()

View File

@@ -117,7 +117,7 @@ class PaneView extends View
# Public: Returns the next pane, ordered by creation.
getNextPane: ->
panes = @container?.getPanes()
panes = @container?.getPaneViews()
return unless panes.length > 1
nextIndex = (panes.indexOf(this) + 1) % panes.length
panes[nextIndex]

View File

@@ -272,8 +272,8 @@ class WorkspaceView extends View
eachPaneView: (callback) ->
@panes.eachPaneView(callback)
# Public: Returns an Array of all open {PaneView}s.
getPanes: ->
# Returns an Array of all open {PaneView}s.
getPaneViews: ->
@panes.getPanes()
# Public: Return the id of the given a {PaneView}
@@ -294,3 +294,7 @@ class WorkspaceView extends View
# Deprecated:
eachPane: (callback) ->
@eachPaneView(callback)
# Deprecated:
getPanes: ->
@getPaneViews()