当前位置: 首页>>代码示例>>Java>>正文


Java NavigatorPanel.panelDeactivated方法代码示例

本文整理汇总了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;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:35,代码来源:NavigatorController.java

示例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);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:53,代码来源:NavigatorController.java

示例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;
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:77,代码来源:NavigatorController.java


注:本文中的org.netbeans.spi.navigator.NavigatorPanel.panelDeactivated方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。