mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
EA-43314 - NPE: ContentManagerImpl.getSelectedContent
This commit is contained in:
@@ -71,7 +71,7 @@ public final class ToolWindowImpl implements ToolWindowEx {
|
||||
private ToolWindowFactory myContentFactory;
|
||||
|
||||
private ActionCallback myActivation = new ActionCallback.Done();
|
||||
private BusyObject.Impl myShowing = new BusyObject.Impl() {
|
||||
private final BusyObject.Impl myShowing = new BusyObject.Impl() {
|
||||
@Override
|
||||
public boolean isReady() {
|
||||
return myComponent != null && myComponent.isShowing();
|
||||
@@ -79,7 +79,7 @@ public final class ToolWindowImpl implements ToolWindowEx {
|
||||
};
|
||||
private boolean myUseLastFocused = true;
|
||||
|
||||
private final static Logger LOG = Logger.getInstance(ToolWindowImpl.class);
|
||||
private static final Logger LOG = Logger.getInstance(ToolWindowImpl.class);
|
||||
|
||||
ToolWindowImpl(final ToolWindowManagerImpl toolWindowManager, final String id, boolean canCloseContent, @Nullable final JComponent component) {
|
||||
myToolWindowManager = toolWindowManager;
|
||||
@@ -151,7 +151,7 @@ public final class ToolWindowImpl implements ToolWindowEx {
|
||||
public final boolean isActive() {
|
||||
ApplicationManager.getApplication().assertIsDispatchThread();
|
||||
if (myToolWindowManager.isEditorComponentActive()) return false;
|
||||
return myToolWindowManager.isToolWindowActive(myId) || (myDecorator != null && myDecorator.isFocused());
|
||||
return myToolWindowManager.isToolWindowActive(myId) || myDecorator != null && myDecorator.isFocused();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -167,6 +167,7 @@ public final class ToolWindowImpl implements ToolWindowEx {
|
||||
IdeFocusManager.getInstance(myToolWindowManager.getProject()).doWhenFocusSettlesDown(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (myContentManager.isDisposed()) return;
|
||||
myContentManager.getReady(requestor).notify(result);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -172,11 +172,7 @@ public class ContentManagerImpl implements ContentManager, PropertyChangeListene
|
||||
|
||||
@Override
|
||||
public boolean isCycleRoot() {
|
||||
if (myUI instanceof SwitchProvider) {
|
||||
return ((SwitchProvider)myUI).isCycleRoot();
|
||||
}
|
||||
|
||||
return false;
|
||||
return myUI instanceof SwitchProvider && ((SwitchProvider)myUI).isCycleRoot();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -212,7 +208,7 @@ public class ContentManagerImpl implements ContentManager, PropertyChangeListene
|
||||
if (myContents.contains(content)) return;
|
||||
|
||||
((ContentImpl)content).setManager(this);
|
||||
final int insertIndex = (index == -1) ? myContents.size() : index;
|
||||
final int insertIndex = index == -1 ? myContents.size() : index;
|
||||
myContents.add(insertIndex, content);
|
||||
content.addPropertyChangeListener(this);
|
||||
fireContentAdded(content, insertIndex, ContentManagerEvent.ContentOperation.add);
|
||||
@@ -531,9 +527,8 @@ public class ContentManagerImpl implements ContentManager, PropertyChangeListene
|
||||
|
||||
if (requestFocus) {
|
||||
return requestFocus(content, forcedFocus);
|
||||
} else {
|
||||
return new ActionCallback.Done();
|
||||
}
|
||||
return new ActionCallback.Done();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -547,9 +542,8 @@ public class ContentManagerImpl implements ContentManager, PropertyChangeListene
|
||||
selection.run().notify(result);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
return selection.run().notify(result);
|
||||
}
|
||||
return selection.run().notify(result);
|
||||
}
|
||||
else {
|
||||
return selection.run().notify(result);
|
||||
|
||||
Reference in New Issue
Block a user