Author: scabanovich
Date: 2010-10-13 06:30:17 -0400 (Wed, 13 Oct 2010)
New Revision: 25779
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/palette/PaletteAdapter.java
Log:
https://jira.jboss.org/browse/JBIDE-7322
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/palette/PaletteAdapter.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/palette/PaletteAdapter.java 2010-10-13
09:49:07 UTC (rev 25778)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/palette/PaletteAdapter.java 2010-10-13
10:30:17 UTC (rev 25779)
@@ -76,6 +76,7 @@
public void initActionBars() {
IActionBars bars = viewPart.getActionBars();
if(bars != null) {
+ createPaletteTabs();
IMenuManager menuManager = bars.getMenuManager();
bars.getToolBarManager().add(new PaletteEditAction());
@@ -125,6 +126,7 @@
private void createPaletteTabs() {
IActionBars bars = viewPart.getActionBars();
+ if(bars == null) return;
IMenuManager menuManager = bars.getMenuManager();
IPaletteNode root = model.getRoot();
IPaletteNode[] nodes = root.getChildren();
@@ -264,8 +266,8 @@
public void dispose() {
dropManager.dispose();
descriptionManager.dispose();
- model.removeModelTreeListener(modelListener);
- viewPart.getActionBars().getToolBarManager().removeAll();
+ if(model != null) model.removeModelTreeListener(modelListener);
+ if(viewPart.getActionBars() != null)
viewPart.getActionBars().getToolBarManager().removeAll();
try {
if (selectedTab != null) {
ModelUIPlugin.getWorkspace().getRoot().setPersistentProperty(persistentTabQualifiedName,
selectedTab);