[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Newsgroup Home]
|
[news.eclipse.platform.rcp] Empty panes or empty stacks
|
- From: mowry_889@xxxxxxxxx (mowry)
- Date: Wed, 12 Mar 2008 19:12:22 +0000 (UTC)
- Newsgroups: eclipse.platform.rcp
- Organization: Eclipse
- User-agent: NewsPortal/0.36 (http://florian-amrhein.de/newsportal)
When I drag and drop editors side by side, and I relaunch application I
see empty panes in the editor area.
In my all editors persistable is returns null.
I fixed by removing editor stacks except first one in the workbench.xml
file.
I was wondering are there any side effects with this approach.
Thanks,
Mowry
Here is the code:
@Override
public void preStartup() {
try
{
IPath path = Platform.getLocation();
String fileLocation =
path.toFile().getAbsolutePath().concat("/.metadata/.plugins/org.eclipse.ui.workbench/workbench.xml");
File file = new File(fileLocation);
DocumentBuilderFactory docFactory =
DocumentBuilderFactory.newInstance();
DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
Document doc = docBuilder.parse(file);
NodeList list = XPathAPI.selectNodeList(doc.getFirstChild(),
"window/page/editors/editorArea/info");
for (int i = list.getLength()-1; i > 0;i--)
{
Node node = list.item(i);
node.getParentNode().removeChild(node);
}
// Prepare the DOM document for writing
Source source = new DOMSource(doc);
Result result = new StreamResult(file);
// Write the DOM document to the file
Transformer xformer =
TransformerFactory.newInstance().newTransformer();
xformer.transform(source, result);
}
catch(Exception e)
{
e.printStackTarce();
}
super.preStartup();
}