Commit Graph

108 Commits

Author SHA1 Message Date
Nathan Sobo
8a12be9a8d Return empty array from getPanes when PaneContainer is destroyed
Signed-off-by: Max Brunsfeld <maxbrunsfeld@github.com>
2016-09-13 11:01:40 -06:00
Aaron Contreras
6b118a8061 Add convenience commands to copy/move active item between panes
Give focus to destination pane and set the copied/moved item as active
2016-02-09 00:36:37 +01:00
Nathan Sobo
84aa8471b4 Pass AppDelegate to Workspace, Pane instead of bound functions
Signed-off-by: Max Brunsfeld <maxbrunsfeld@github.com>
2015-10-13 18:54:48 -06:00
Nathan Sobo
d4c88cc7fd Merge branch 'master' into ns-alternative-test-env 2015-10-12 15:55:28 -06:00
Ross Allen
41984a2317 Add onDidStopChangingActivePaneItem for async callbacks
`onDidChangeActivePaneItem` is called synchronously when the active pane
item changes, and several non-critical actions preform work on that
event. Critical UI feedback, like changing the active tab, needs to
happen synchronously, but most other functionality should be run
asynchronously.
2015-10-12 10:24:07 -07:00
Max Brunsfeld
369f3d2648 Don't use atom.{notifications,config,deserializers,confirm} in Pane
Still need to get rid of one use of showSaveDialogSync
2015-10-09 17:18:26 -07:00
Nathan Sobo
4808c9f9e8 Eliminate config and confirm global references in Pane 2015-10-07 16:32:47 -05:00
Max Brunsfeld
9924288a6f Use atom environment argument to deserialize in Pane, PaneAxis 2015-10-07 15:25:05 -05:00
Nathan Sobo
fd7fbbfea5 Move PaneContainer.deserialize to an instance method
Signed-off-by: Max Brunsfeld <maxbrunsfeld@github.com>
2015-10-07 15:24:55 -05:00
Nathan Sobo
e0d426b817 Register deserializers, view providers, and commands in Atom constructor
Previously, these registrations were scattered all over the codebase and
required that `global.atom` be defined, which creating weird ordering
issues. Registering them all from the global makes the relationships
clearer and means we don’t have to assign a global to set up a fully-
functional environment.
2015-10-07 15:24:52 -05:00
Nathan Sobo
ddb08d0c46 Avoid redundant onDidAddPaneItem notifications
Refs #9012
2015-10-05 12:34:49 -06:00
Nathan Sobo
17b4725b44 Don’t use Serializable mixin in PaneContainer 2015-09-22 10:46:30 -06:00
Thomas Johansen
bfc81ff829 🔥 Remove deprecations from PaneContainer 2015-09-22 10:37:06 -06:00
George Ogata
45694dcda0 Fire event before a pane is destroyed. 2015-07-23 18:47:38 -04:00
Daniel Hengeveld
b13ee1c9cb re-add Pane require 2015-07-08 17:21:39 -07:00
Daniel Hengeveld
afee699137 Move view registration for Pane & Gutter related views earlier
Registering them in pane-container led to packages deserializing
before e.g. Gutter was available.
2015-07-08 17:07:26 -07:00
Jess Lin
6319c9722a [Gutter][View Registry] Add Gutter view providers to the ViewRegistry 2015-04-22 07:28:58 -07:00
Kevin Sawicki
b54177eb5e Remove property always set in constructor 2015-04-06 15:14:26 -07:00
Kevin Sawicki
96b95b74e9 Conditionally include Pane model properties and behaviors 2015-04-06 11:04:10 -07:00
Kevin Sawicki
312c03e6d2 Conditionally include activePane/activePaneItem properties 2015-04-06 11:04:10 -07:00
Kevin Sawicki
590a4b0fd5 Add explicit return after for loop 2015-03-19 11:48:40 -07:00
Kevin Sawicki
fd1d872840 Prompt split editors to save on close
Previously an editor that was split into multiple panes would not
prompt to save correctly when the window was unloading.

This adds a new `windowCloseRequested` option passed through from the
beforeunload handler to the editor so that it can specially handle this
case.

Closes #5257
2015-02-04 17:14:46 -08:00
Cheng Zhao
93181d8a54 Array::find is undefined in Chrome 40 2015-01-28 14:06:14 -08:00
Nathan Sobo
7f8ab72f53 Capitalize initialisms
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-01-12 22:00:24 -08:00
Nathan Sobo
fbc9c05096 Add Workspace::onDidDestroyPane
This helps with the background-tips conversion
2014-12-02 11:57:38 -07:00
Nathan Sobo
1eab423a1c Clarify that we’re taking an event in the parameter name 2014-12-02 11:57:38 -07:00
Nathan Sobo
9a9347e3a5 Simplify ViewRegistry::addViewProvider API
It now takes two arguments, a model constructor and a create view
callback that is passed the model.

Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2014-12-01 17:53:03 -08:00
Nathan Sobo
4591f00a65 Remove view registry references from the workspace model layer
Removed various ::getView methods from the model. Using the atom.views
global in the views for now, but going to switch them over to using a
locally assigned view registry instead in a subsequent commit.
2014-12-01 16:28:33 -08:00
Nathan Sobo
7dc9d0c8ce Add Workspace::onWillDestroyPaneItem
It is needed by the autosave package which previously relied on DOM
bubbling to coalesce events from various panes.
2014-12-01 10:39:29 -07:00
Nathan Sobo
0a92b6b681 Add Workspace::paneForItem 2014-11-10 08:20:59 -07:00
Nathan Sobo
b8d2bd6c30 Disallow activation of panes that aren't in the PaneContainer
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2014-11-07 15:46:47 -07:00
Nathan Sobo
6934b83acc Fall back to first pane if activePaneId is invalid
When deserializing PaneContainer.

Fixes #4069

Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2014-11-07 15:44:59 -07:00
Nathan Sobo
003b67ee19 Add TextEditorElement and make TextEditorView a wrapper around it
This is the next step on converting all internal views to custom
elements instead of using SpacePen. The TextEditorElement instances
are associated with ::__spacePenView fields that are used for supporting
legacy access paths via atom.workspaceView.
2014-10-08 12:13:13 -07:00
Nathan Sobo
1c58438124 Move PaneContainerView::confirmClose to the model layer 2014-09-24 15:46:01 -06:00
Nathan Sobo
465d2afd95 Remove the old root view properly 2014-09-24 15:28:34 -06:00
Nathan Sobo
da87f321e8 Add PaneAxisElement 2014-09-24 15:28:34 -06:00
Nathan Sobo
2710c06313 WIP: First stab at custom element for panes
Still need to create a SpacePen shim for access via `atom.workspaceView`
property so we’re backward compatible with packages, but it basically
works.
2014-09-24 15:28:33 -06:00
Nathan Sobo
55cce48af1 Throw an exception if the same pane item is added twice in the workspace 2014-09-19 16:24:13 -06:00
Nathan Sobo
0877721ce9 Construct PaneAxisViews and PaneViews via ViewRegistry 2014-09-19 16:24:12 -06:00
Nathan Sobo
53bd1c8958 Use Workspace::getView to build PaneContainerView 2014-09-19 16:24:12 -06:00
Nathan Sobo
a33706ddbc Add PaneContainer::onDidAddPaneItem and ::observePaneItems 2014-08-28 17:42:12 -06:00
Nathan Sobo
cee7539e35 Add PaneContainer::observePanes and ::onDidAddPane 2014-08-28 17:22:28 -06:00
Nathan Sobo
5471e9bccc Add PaneContainer::onDidDestroyPaneItem 2014-08-28 16:58:38 -06:00
Nathan Sobo
9223361c22 Add PaneContainer::onDidChange/observeRoot
Also, don’t use a behavior to monitor root changes
2014-08-28 14:42:13 -06:00
Nathan Sobo
74b2f26540 Add PaneContainer::onDidChangeActivePaneItem 2014-08-28 14:41:56 -06:00
Nathan Sobo
87cdc1a45d Don’t invoke ::onDidChangeActivePane events unless it really changes 2014-08-28 11:43:08 -06:00
Nathan Sobo
2b63f8a4ee Add PaneContainer::onDidChangeActivePane 2014-08-28 11:43:07 -06:00
Nathan Sobo
2d58d9c8b5 Add Pane::onDidActivate 2014-08-28 11:43:07 -06:00
Nathan Sobo
b2c70f9e69 Move serialization of active pane from Pane to PaneContainer
Fixes #2694
Fixel #2853

Previously, we were storing an `active` boolean for each pane. We've
had some strange bugs where every pane is serializing `active: false`,
which causes exceptions when loading up the stored data.

This new approach serializes the activePaneId on the PaneContainer
itself. Since the PaneContainer is the source of truth regarding the
active pane, it makes more sense to handle it here.

This unfortunately changes the serialization version for the
PaneContainer, so people won't have their state persisted after
upgrading. But it seems better than leaving cruft to handle the old
serialization situation.
2014-07-07 16:36:10 -06:00
Corey Johnson
d6ec73886f Add PaneContainer::getActivePane 2014-04-15 14:55:28 -07:00