javax.swing.SwingUtilities#getAncestorNamed ( )源码实例Demo

下面列出了javax.swing.SwingUtilities#getAncestorNamed ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: netbeans   文件: PopupUtil.java
public void eventDispatched(java.awt.AWTEvent aWTEvent) {
    if (aWTEvent instanceof MouseEvent) {
        MouseEvent mv = (MouseEvent)aWTEvent;
        if (mv.getID() == MouseEvent.MOUSE_CLICKED && mv.getClickCount() > 0) {
            //#118828
            if (! (aWTEvent.getSource() instanceof Component)) {
                hidePopup();
                return;
            }
            
            Component comp = (Component)aWTEvent.getSource();
            Container par = SwingUtilities.getAncestorNamed(POPUP_NAME, comp); //NOI18N
            // Container barpar = SwingUtilities.getAncestorOfClass(PopupUtil.class, comp);
            // if (par == null && barpar == null) {
            if ( par == null ) {
                hidePopup();
            }
        }
    }
}
 
源代码2 项目: netbeans   文件: StatusLineComponent.java
public @Override void eventDispatched(java.awt.AWTEvent aWTEvent) {
    if (aWTEvent instanceof MouseEvent) {
        MouseEvent mv = (MouseEvent)aWTEvent;
        if (mv.getClickCount() > 0) {
            //#118828
            if (! (aWTEvent.getSource() instanceof Component)) {
                return;
            }
            Component comp = (Component)aWTEvent.getSource();
            Container par = SwingUtilities.getAncestorNamed("progresspopup", comp); //NOI18N
            Container barpar = SwingUtilities.getAncestorOfClass(StatusLineComponent.class, comp);
            if (par == null && barpar == null) {
                hidePopup();
            }
        }
    }
}
 
源代码3 项目: netbeans   文件: PopupUtil.java
public void eventDispatched(java.awt.AWTEvent aWTEvent) {
    if (aWTEvent instanceof MouseEvent) {
        MouseEvent mv = (MouseEvent)aWTEvent;
        if (mv.getID() == MouseEvent.MOUSE_CLICKED && mv.getClickCount() > 0) {
            //#118828
            if (! (aWTEvent.getSource() instanceof Component)) {
                hidePopup();
                return;
            }
            
            Component comp = (Component)aWTEvent.getSource();
            Container par = SwingUtilities.getAncestorNamed(POPUP_NAME, comp); //NOI18N
            if ( par == null ) {
                hidePopup();
            }
        }
    }
}
 
源代码4 项目: netbeans   文件: SymfonyGoToViewActionPopup.java
@Override
public void eventDispatched(java.awt.AWTEvent aWTEvent) {
    if (aWTEvent instanceof MouseEvent) {
        MouseEvent mv = (MouseEvent) aWTEvent;
        if (mv.getID() == MouseEvent.MOUSE_CLICKED && mv.getClickCount() > 0) {
            if (!(aWTEvent.getSource() instanceof Component)) {
                hide();
                return;
            }
            
            Component comp = (Component) aWTEvent.getSource();
            Container par = SwingUtilities.getAncestorNamed(POPUP_NAME, comp);
            if (par == null) {
                hide();
            }
        }
    }
}
 
源代码5 项目: netbeans   文件: PopupUtil.java
@Override
public void eventDispatched(java.awt.AWTEvent aWTEvent) {
    if (aWTEvent instanceof MouseEvent) {
        MouseEvent mv = (MouseEvent) aWTEvent;
        if (mv.getID() == MouseEvent.MOUSE_CLICKED && mv.getClickCount() > 0) {
            //#118828
            if (!(aWTEvent.getSource() instanceof Component)) {
                hidePopup();
                return;
            }

            Component comp = (Component) aWTEvent.getSource();
            Container par = SwingUtilities.getAncestorNamed(POPUP_NAME, comp); //NOI18N
            // Container barpar = SwingUtilities.getAncestorOfClass(PopupUtil.class, comp);
            // if (par == null && barpar == null) {
            if (par == null) {
                hidePopup();
            }
        }
    }
}
 
源代码6 项目: netbeans   文件: HintsUI.java
public void eventDispatched(java.awt.AWTEvent aWTEvent) {
    if (aWTEvent instanceof MouseEvent) {
        MouseEvent mv = (MouseEvent)aWTEvent;
        if (mv.getID() == MouseEvent.MOUSE_CLICKED && mv.getClickCount() > 0) {
            //#118828
            if (! (aWTEvent.getSource() instanceof Component)) {
                removePopup();
                return;
            }
            
            Component comp = (Component)aWTEvent.getSource();
            Container par1 = SwingUtilities.getAncestorNamed(POPUP_NAME, comp); //NOI18N
            Container par2 = SwingUtilities.getAncestorNamed(SUB_POPUP_NAME, comp); //NOI18N
            // Container barpar = SwingUtilities.getAncestorOfClass(PopupUtil.class, comp);
            // if (par == null && barpar == null) {
            if ( par1 == null && par2 == null ) {
                removePopup();
            }
        }
    }
}
 
源代码7 项目: netbeans   文件: PopupUtil.java
public void eventDispatched(java.awt.AWTEvent aWTEvent) {
    if (aWTEvent instanceof MouseEvent) {
        MouseEvent mv = (MouseEvent)aWTEvent;
        if (mv.getID() == MouseEvent.MOUSE_CLICKED && mv.getClickCount() > 0) {
            //#118828
            if (! (aWTEvent.getSource() instanceof Component)) {
                hidePopup();
                return;
            }
            
            Component comp = (Component)aWTEvent.getSource();
            Container par = SwingUtilities.getAncestorNamed(POPUP_NAME, comp); //NOI18N
            // Container barpar = SwingUtilities.getAncestorOfClass(PopupUtil.class, comp);
            // if (par == null && barpar == null) {
            if ( par == null ) {
                hidePopup();
            }
        }
    }
}
 
源代码8 项目: netbeans   文件: PopupUtil.java
public void eventDispatched(java.awt.AWTEvent aWTEvent) {
    if (aWTEvent instanceof MouseEvent) {
        MouseEvent mv = (MouseEvent)aWTEvent;
        if (mv.getID() == MouseEvent.MOUSE_CLICKED && mv.getClickCount() > 0) {
            //#118828
            if (! (aWTEvent.getSource() instanceof Component)) {
                hidePopup();
                return;
            }
            
            Component comp = (Component)aWTEvent.getSource();
            Container par = SwingUtilities.getAncestorNamed(POPUP_NAME, comp); //NOI18N
            // Container barpar = SwingUtilities.getAncestorOfClass(PopupUtil.class, comp);
            // if (par == null && barpar == null) {
            if ( par == null ) {
                hidePopup();
            }
        }
    }
}
 
源代码9 项目: netbeans   文件: CompletionLayoutPopup.java
@Override
public void eventDispatched(AWTEvent aWTEvent) {
    if (aWTEvent instanceof MouseEvent) {
        MouseEvent mv = (MouseEvent) aWTEvent;
        if (mv.getID() == MouseEvent.MOUSE_CLICKED && mv.getClickCount() > 0) {
            //#118828
            if (!(aWTEvent.getSource() instanceof Component)) {
                hide();
                return;
            }

            Component comp = (Component) aWTEvent.getSource();
            Container par1 = SwingUtilities.getAncestorNamed(POPUP_NAME, comp); //NOI18N
            if (par1 == null) {
                hide();
            }
        }
    }
}
 
源代码10 项目: netbeans   文件: PopupUtil.java
public void eventDispatched(java.awt.AWTEvent aWTEvent) {
    if (aWTEvent instanceof MouseEvent) {
        MouseEvent mv = (MouseEvent)aWTEvent;
        if (mv.getID() == MouseEvent.MOUSE_CLICKED && mv.getClickCount() > 0) {
            //#118828
            if (! (aWTEvent.getSource() instanceof Component)) {
                hidePopup();
                return;
            }
            
            Component comp = (Component)aWTEvent.getSource();
            Container par = SwingUtilities.getAncestorNamed(POPUP_NAME, comp); //NOI18N
            // Container barpar = SwingUtilities.getAncestorOfClass(PopupUtil.class, comp);
            // if (par == null && barpar == null) {
            if ( par == null ) {
                hidePopup();
            }
        }
    }
}
 
源代码11 项目: cakephp3-netbeans   文件: PopupUtil.java
@Override
public void eventDispatched(java.awt.AWTEvent aWTEvent) {
    if (aWTEvent instanceof MouseEvent) {
        MouseEvent mv = (MouseEvent) aWTEvent;
        if (mv.getID() == MouseEvent.MOUSE_CLICKED && mv.getClickCount() > 0) {
            //#118828
            if (!(aWTEvent.getSource() instanceof Component)) {
                hidePopup();
                return;
            }

            Component comp = (Component) aWTEvent.getSource();
            Container par = SwingUtilities.getAncestorNamed(POPUP_NAME, comp); //NOI18N
            // Container barpar = SwingUtilities.getAncestorOfClass(PopupUtil.class, comp);
            // if (par == null && barpar == null) {
            if (par == null) {
                hidePopup();
            }
        }
    }
}