java.awt.event.ContainerEvent Java Examples

The following examples show how to use java.awt.event.ContainerEvent. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: WebAccordionModel.java    From weblaf with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void componentRemoved ( final ContainerEvent e )
{
    // Removing state for the removed pane
    final AccordionPane pane = ( AccordionPane ) e.getChild ();
    states.remove ( pane.getId () );

    // Validating states
    validateStates ();

    // Inform layout about removal
    if ( accordion != null )
    {
        final AccordionLayout layout = accordion.getLayout ();
        if ( layout != null )
        {
            layout.paneRemoved ( accordion, pane );
        }
    }
}
 
Example #2
Source File: Wizard.java    From tn5250j with GNU General Public License v2.0 6 votes vote down vote up
public void componentRemoved(ContainerEvent e) {
   if (e.getChild() instanceof WizardPage) {
      WizardPage wp = (WizardPage)e.getChild();
      JButton b;
      b = wp.getNextButton();
      if (b != null) {
         b.removeActionListener(nextListener);
      }
      b = wp.getPreviousButton();
      if (b != null) {
         b.removeActionListener(previousListener);
      }
      b = wp.getFinishButton();
      if (b != null) {
         b.removeActionListener(finishListener);
      }
      b = wp.getCancelButton();
      if (b != null) {
         b.removeActionListener(cancelListener);
      }
      b = wp.getHelpButton();
      if (b != null) {
         b.removeActionListener(helpListener);
      }
   }
}
 
Example #3
Source File: CloseTabPaneUI.java    From iBioSim with Apache License 2.0 6 votes vote down vote up
@Override
public void componentAdded(ContainerEvent e) {
	JTabbedPane tp = (JTabbedPane) e.getContainer();
	Component child = e.getChild();
	if (child instanceof UIResource) {
		return;
	}
	int index = tp.indexOfComponent(child);
	String title = tp.getTitleAt(index);
	boolean isHTML = BasicHTML.isHTMLString(title);
	if (isHTML) {
		if (htmlViews == null) { // Initialize vector
			htmlViews = createHTMLVector();
		}
		else { // Vector already exists
			View v = BasicHTML.createHTMLView(tp, title);
			htmlViews.insertElementAt(v, index);
		}
	}
	else { // Not HTML
		if (htmlViews != null) { // Add placeholder
			htmlViews.insertElementAt(null, index);
		} // else nada!
	}
}
 
Example #4
Source File: Wizard.java    From tn5250j with GNU General Public License v2.0 6 votes vote down vote up
public void componentAdded(ContainerEvent e) {
   if (e.getChild() instanceof WizardPage) {
      WizardPage wp = (WizardPage)e.getChild();
      JButton b;
      b = wp.getNextButton();
      if (b != null) {
         b.addActionListener(nextListener);
      }
      b = wp.getPreviousButton();
      if (b != null) {
         b.addActionListener(previousListener);
      }
      b = wp.getFinishButton();
      if (b != null) {
         b.addActionListener(finishListener);
      }
      b = wp.getCancelButton();
      if (b != null) {
         b.addActionListener(cancelListener);
      }
      b = wp.getHelpButton();
      if (b != null) {
         b.addActionListener(helpListener);
      }
   }
}
 
Example #5
Source File: SynthScrollPaneUI.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
public void componentAdded(ContainerEvent e) {
    if (e.getChild() instanceof JTextComponent) {
        e.getChild().addFocusListener(this);
        viewportViewHasFocus = e.getChild().isFocusOwner();
        scrollpane.repaint();
    }
}
 
Example #6
Source File: WMenuBarInputListener.java    From weblaf with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void componentAdded ( final ContainerEvent e )
{
    final Component child = e.getChild ();
    if ( child instanceof JMenu )
    {
        ( ( JMenu ) child ).getModel ().addChangeListener ( WMenuBarInputListener.this );
    }
}
 
Example #7
Source File: SynthScrollPaneUI.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
public void componentAdded(ContainerEvent e) {
    if (e.getChild() instanceof JTextComponent) {
        e.getChild().addFocusListener(this);
        viewportViewHasFocus = e.getChild().isFocusOwner();
        scrollpane.repaint();
    }
}
 
Example #8
Source File: SynthScrollPaneUI.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
public void componentAdded(ContainerEvent e) {
    if (e.getChild() instanceof JTextComponent) {
        e.getChild().addFocusListener(this);
        viewportViewHasFocus = e.getChild().isFocusOwner();
        scrollpane.repaint();
    }
}
 
Example #9
Source File: SeaGlassDesktopPaneUI.java    From seaglass with Apache License 2.0 5 votes vote down vote up
public void componentRemoved(ContainerEvent e) {
    if (e.getChild() instanceof JInternalFrame) {
        JInternalFrame f = (JInternalFrame) e.getChild();
        if (!f.isIcon()) {
            // Frame was removed without using setClosed(true)
            remove(f.getDesktopIcon());
            f.removeComponentListener(this);
            revalidate();
            repaint();
        }
    }
}
 
Example #10
Source File: CGraphWindow.java    From binnavi with Apache License 2.0 5 votes vote down vote up
@Override
public void componentAdded(final ContainerEvent event) {
  for (final IGraphWindowListener listener : m_graphPanelListener) {
    // ESCA-JAVA0166: Catch Exception because we are calling a listener function
    try {
      listener.graphPanelOpened((CGraphPanel) event.getChild());
    } catch (final Exception e) {
      CUtilityFunctions.logException(e);
    }
  }
}
 
Example #11
Source File: SynthScrollPaneUI.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public void componentAdded(ContainerEvent e) {
    if (e.getChild() instanceof JTextComponent) {
        e.getChild().addFocusListener(this);
        viewportViewHasFocus = e.getChild().isFocusOwner();
        scrollpane.repaint();
    }
}
 
Example #12
Source File: SynthScrollPaneUI.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public void componentAdded(ContainerEvent e) {
    if (e.getChild() instanceof JTextComponent) {
        e.getChild().addFocusListener(this);
        viewportViewHasFocus = e.getChild().isFocusOwner();
        scrollpane.repaint();
    }
}
 
Example #13
Source File: SynthScrollPaneUI.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
public void componentAdded(ContainerEvent e) {
    if (e.getChild() instanceof JTextComponent) {
        e.getChild().addFocusListener(this);
        viewportViewHasFocus = e.getChild().isFocusOwner();
        scrollpane.repaint();
    }
}
 
Example #14
Source File: SynthScrollPaneUI.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public void componentAdded(ContainerEvent e) {
    if (e.getChild() instanceof JTextComponent) {
        e.getChild().addFocusListener(this);
        viewportViewHasFocus = e.getChild().isFocusOwner();
        scrollpane.repaint();
    }
}
 
Example #15
Source File: BasicLizziePaneUI.java    From lizzie with GNU General Public License v3.0 5 votes vote down vote up
public void componentAdded(ContainerEvent evt) {
  Component c = evt.getChild();

  if (lizziePaneFocusListener != null) {
    c.addFocusListener(lizziePaneFocusListener);
  }
}
 
Example #16
Source File: HyperlinkSupport.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
public void componentAdded(ContainerEvent e) {
    Component c = e.getChild();
    while(((c = c.getParent()) != null)) {
        if(c instanceof TopComponent) {
            RequestProcessor.Task t = (RequestProcessor.Task) ((TopComponent)c).getClientProperty(REGISTER_TASK);
            if(t != null) {
                t.schedule(1000);
            } 
            break;
        }
    }
}
 
Example #17
Source File: UndoRedoSupport.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
public void componentAdded(ContainerEvent e) {
    Component c = e.getChild();
    while(((c = c.getParent()) != null)) {
        if(c instanceof TopComponent) {
            RequestProcessor.Task t = (RequestProcessor.Task) ((TopComponent)c).getClientProperty(REGISTER_TASK);
            if(t != null) {
                t.schedule(1000);
            } 
            break;
        }
    }
}
 
Example #18
Source File: BEToolBarUI.java    From beautyeye with Apache License 2.0 5 votes vote down vote up
public void componentRemoved(ContainerEvent evt) {
    Component c = evt.getChild();

    if (toolBarFocusListener != null) {
        c.removeFocusListener(toolBarFocusListener);
    }

    // Revert the button border
    setBorderToNormal(c);
}
 
Example #19
Source File: PlainAquaToolbarUI.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public void componentAdded(ContainerEvent e) {
    Container c = (Container) e.getSource();
    boolean isEditorToolbar = "editorToolbar".equals (c.getName());
    installButtonUI (e.getChild(), isEditorToolbar);
    if (isEditorToolbar) {
        //It's an editor toolbar.  Aqua's combo box ui paints outside
        //of its literal component bounds, and doesn't honor opacity.
        //Need to ensure the toolbar is tall enough that its border is
        //not hidden.
        Dimension min = new Dimension (32, 34);
        ((JComponent)e.getContainer()).setPreferredSize(min);
    }
}
 
Example #20
Source File: AbstractMenuFactory.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public void componentAdded(ContainerEvent e) {
    JMenu menu = (JMenu) e.getContainer();
    JComponent item = (JComponent) e.getChild();
    //Mark the child as belonging to the parent container context
    String containerContext = getContainerContext(menu);
    
    item.putClientProperty (KEY_CONTAINERCONTEXT, containerContext);
}
 
Example #21
Source File: SynthScrollPaneUI.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public void componentAdded(ContainerEvent e) {
    if (e.getChild() instanceof JTextComponent) {
        e.getChild().addFocusListener(this);
        viewportViewHasFocus = e.getChild().isFocusOwner();
        scrollpane.repaint();
    }
}
 
Example #22
Source File: SynthScrollPaneUI.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public void componentAdded(ContainerEvent e) {
    if (e.getChild() instanceof JTextComponent) {
        e.getChild().addFocusListener(this);
        viewportViewHasFocus = e.getChild().isFocusOwner();
        scrollpane.repaint();
    }
}
 
Example #23
Source File: JButtonBar.java    From orbit-image-analysis with GNU General Public License v3.0 5 votes vote down vote up
public void componentAdded(ContainerEvent e) {
  JButtonBar container = (JButtonBar)e.getContainer();
  if (e.getChild() instanceof AbstractButton) {
    ((ButtonBarUI)container.ui).installButtonBarUI(
      (AbstractButton)e.getChild());
    ((AbstractButton)e.getChild()).addPropertyChangeListener(
      "UI",
      JButtonBar.uiUpdater);
  }
}
 
Example #24
Source File: BasicOutlookBarUI.java    From CodenameOne with GNU General Public License v2.0 4 votes vote down vote up
public void componentAdded(ContainerEvent e) {
  if (!(e.getChild() instanceof UIResource)) {
    Component newTab = e.getChild();
    tabAdded(newTab);
  }
}
 
Example #25
Source File: DropDownListButton.java    From nextreports-designer with Apache License 2.0 4 votes vote down vote up
public void componentRemoved(ContainerEvent e) {
    ((AbstractButton) e.getChild()).removeActionListener(menuActionListener);
}
 
Example #26
Source File: MnemonicContainerListener.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Override
public void componentRemoved(ContainerEvent event) {
  removeFrom(event.getChild());
}
 
Example #27
Source File: MnemonicContainerListener.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Override
public void componentAdded(ContainerEvent event) {
  addTo(event.getChild());
}
 
Example #28
Source File: SynthScrollPaneUI.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public void componentRemoved(ContainerEvent e) {
    if (e.getChild() instanceof JTextComponent) {
        e.getChild().removeFocusListener(this);
    }
}
 
Example #29
Source File: DockTab.java    From gcs with Mozilla Public License 2.0 4 votes vote down vote up
@Override
public void componentAdded(ContainerEvent event) {
    getLayout().setColumns(getComponentCount());
}
 
Example #30
Source File: DropDownListButton.java    From nextreports-designer with Apache License 2.0 4 votes vote down vote up
public void componentAdded(ContainerEvent e) {
    ((AbstractButton) e.getChild()).addActionListener(menuActionListener);
}