下面列出了javax.swing.SwingUtilities#getAncestorNamed ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
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();
}
}
}
}
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();
}
}
}
}
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();
}
}
}
}
@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();
}
}
}
}
@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();
}
}
}
}
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();
}
}
}
}
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();
}
}
}
}
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();
}
}
}
}
@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();
}
}
}
}
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();
}
}
}
}
@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();
}
}
}
}