How to hide a pane?


#1

Hi,

how can i hide a pane without destroying it?
(and on demand toggle the state)

The documentation states that if a pane is destroyed, so are its items.
What i am trying to achieve is, loading a xml file containing xml markup language.
A new pane is created and the grammar set to a simplified language set.
In the new Pane with a TextEditor the changes are made and updated (synchron or asynchron)
in the hidden or visible pane.

Hope someone can help me to get on.

thanks in advance


#2

There is no way to hide a pane or tab in Atom’s API.

I’m not sure what you’re trying to do here. Can you include a screenshot? Or maybe step-by-step instructions?


#3

Okay so we have the following Use-Case:

  1. We have our own XML Markup Language (Lets call it CakeML describing Recipes in XML)

  2. For CakeML we also have a simplified syntax that has all relevant information without the XML overhead.

3.1 In Atom we want to primarily work with the simplified syntax and under the hood convert it to xml (during save process)

3.2 We want to be able to also open an existing CakeML file and show the simplified syntax

Similar like with api-workbench package we consider real time editing.
The Image below shows the Outline and Details context.
If i click a line on the left, it jumps to the corresponding line on the right.
On the Details pane i can make changes to the original file in real time.
If the api.raml file is closed the api-workbench packages throws an exception, saying that "This TextEditor has been destroyed".

We wanna be able to keep editing the simplified syntax, even if the original xml content is hidden.
Closing the pane also destroys its items and therefore its not possible to continue editing.

Is it possible to manually open a file (using own showOpenDialog), load it into TextBuffer and create a pane with a TextEditor on demand? And then work with the simplified syntax and update the TextBuffer, containing the XML.
If the user wants to see the XML output he can execute a command, a new pane with TextEditor is created and the TextBuffer visualized?

I am pretty much stuck at the moment. What we have so far is a package for the grammar of the new simplified syntax and autocompletion for the new simplified syntax.


#4

Atom’s API doesn’t have a concept of “hidden”. If you want to have something like that, you would have to add it yourself and I’m not sure how Atom’s API would cope with a TextEditor that exists but isn’t displayed on the screen.

No, there isn’t support in Atom for this. TextEditors and TextBuffers always come in sets.