本文整理汇总了Java中org.netbeans.spi.navigator.NavigatorPanel.panelDeactivated方法的典型用法代码示例。如果您正苦于以下问题:Java NavigatorPanel.panelDeactivated方法的具体用法?Java NavigatorPanel.panelDeactivated怎么用?Java NavigatorPanel.panelDeactivated使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.netbeans.spi.navigator.NavigatorPanel
的用法示例。
在下文中一共展示了NavigatorPanel.panelDeactivated方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: navigatorTCClosed
import org.netbeans.spi.navigator.NavigatorPanel; //导入方法依赖的package包/类
/** Stops listening to selected nodes and active component */
private void navigatorTCClosed() {
if (panelLookupNodesResult == null || closed) {
return;
}
LOG.fine("Entering navigatorTCClosed");
curNodesRes.removeLookupListener(this);
curHintsRes.removeLookupListener(this);
panelLookupNodesResult.removeLookupListener(panelLookupListener);
curNodesRes = null;
curHintsRes = null;
synchronized (CUR_NODES_LOCK) {
curNodes = Collections.emptyList();
}
weakNodesL = Collections.emptyList();
// #113764: mem leak fix - update lookup - force ClientsLookup to free its delegates
clientsLookup.lookup(Object.class);
panelLookupWithNodes.setNodes(null);
// #104145: panelDeactivated called if needed
NavigatorPanel selPanel = navigatorTC.getSelectedPanel();
if (selPanel != null) {
selPanel.panelDeactivated();
}
lastActivatedRef = null;
currentPanels = null;
navigatorTC.setPanels(null, null);
panelLookupNodesResult = null;
LOG.fine("navigatorTCClosed: activated nodes: " + navigatorTC.getTopComponent().getActivatedNodes());
if (navigatorTC.getTopComponent().getActivatedNodes() != null) {
LOG.fine("navigatorTCClosed: clearing act nodes...");
navigatorTC.getTopComponent().setActivatedNodes(new Node[0]);
}
closed = true;
}
示例2: activatePanel
import org.netbeans.spi.navigator.NavigatorPanel; //导入方法依赖的package包/类
/** Activates given panel. Throws IllegalArgumentException if panel is
* not available for activation.
*/
public void activatePanel (NavigatorPanel panel) {
LOG.fine("activatePanel - entered, panel: " + panel);
String iaeText = "Panel is not available for activation: "; //NOI18N
if (currentPanels == null) {
if (inUpdate) {
LOG.fine("activatePanel - premature exit - currentPanels == null, inUpdate == true");
cacheLastSelPanel(panel);
return;
} else {
throw new IllegalArgumentException(iaeText + panel);
}
}
NavigatorPanel toActivate = null;
boolean contains = false;
for (NavigatorPanel navigatorPanel : currentPanels) {
if (navigatorPanel instanceof LazyPanel) {
contains = ((LazyPanel) navigatorPanel).panelMatch(panel);
} else if (panel instanceof LazyPanel) {
contains = ((LazyPanel) panel).panelMatch(navigatorPanel);
} else {
contains = navigatorPanel.equals(panel);
}
if (contains) {
toActivate = navigatorPanel;
break;
}
}
if (!contains) {
if (inUpdate) {
LOG.fine("activatePanel - premature exit - panel is not contained in currenPanels");
cacheLastSelPanel(panel);
return;
} else {
throw new IllegalArgumentException(iaeText + panel + " - not part of " + currentPanels);
}
}
NavigatorPanel oldPanel = navigatorTC.getSelectedPanel();
if (!toActivate.equals(oldPanel)) {
if (oldPanel != null) {
oldPanel.panelDeactivated();
}
toActivate.panelActivated(clientsLookup);
navigatorTC.setSelectedPanel(toActivate);
// selected panel changed, update selPanelLookup to listen correctly
panelLookup.lookup(Object.class);
LOG.fine("activatePanel - normal exit - caching panel: " + panel);
cacheLastSelPanel(toActivate);
}
}
示例3: showProviders
import org.netbeans.spi.navigator.NavigatorPanel; //导入方法依赖的package包/类
/** Shows obtained navigator providers
* @param providers obtained providers
* @force if true that update is forced even if it means clearing navigator content
*/
private void showProviders(List<NavigatorPanel> providers, String mimeType, boolean force) {
try {
List oldProviders = currentPanels;
final boolean areNewProviders = providers != null && !providers.isEmpty();
// navigator remains empty, do nothing
if (oldProviders == null && providers == null) {
LOG.fine("Exit because nav remain empty, force: " + force);
return;
}
NavigatorPanel selPanel = navigatorTC.getSelectedPanel();
// don't call panelActivated/panelDeactivated if the same provider is
// still available, it's client's responsibility to listen to
// context changes while active
if (oldProviders != null && oldProviders.contains(selPanel)
&& providers != null && providers.contains(selPanel)) {
// trigger resultChanged() call on client side
clientsLookup.lookup(Node.class);
// #93123: refresh providers list if needed
if (!oldProviders.equals(providers)) {
currentPanels = providers;
navigatorTC.setPanels(providers, selPanel);
}
// #100122: update activated nodes of Navigator TC
updateActNodesAndTitle();
LOG.fine("Exit because same provider and panel, notified. Force: " + force);
return;
}
if (selPanel != null) {
// #61334: don't deactivate previous providers if there are no new ones
if (!areNewProviders && !force) {
LOG.fine("Exit because no new providers, force: " + force);
return;
}
selPanel.panelDeactivated();
}
// #67849: curNode's lookup cleanup, held through ClientsLookup delegates
clientsLookup.lookup(Node.class);
NavigatorPanel newSel = null;
if (areNewProviders) {
newSel = getLastSelPanel(providers, mimeType);
if (newSel == null) {
newSel = providers.get(0);
}
newSel.panelActivated(clientsLookup);
}
currentPanels = providers;
navigatorTC.setPanels(providers, newSel);
// selected panel changed, update selPanelLookup to listen correctly
panelLookup.lookup(Object.class);
updateActNodesAndTitle();
updateWhenActivated = false;
LOG.fine("Normal exit, change to new provider, force: " + force);
} finally {
inUpdate = false;
navigatorTC.getTopComponent().makeBusy(false);
//in case of asynch obtain providers it is needed to request focus while TC is activated
if (tcActivating && navigatorTC.allowAsyncUpdate()) {
navigatorTC.getTopComponent().requestFocus();
tcActivating = false;
}
}
}