當前位置: 首頁>>代碼示例>>Java>>正文


Java ContainerEvent.getContainer方法代碼示例

本文整理匯總了Java中java.awt.event.ContainerEvent.getContainer方法的典型用法代碼示例。如果您正苦於以下問題:Java ContainerEvent.getContainer方法的具體用法?Java ContainerEvent.getContainer怎麽用?Java ContainerEvent.getContainer使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在java.awt.event.ContainerEvent的用法示例。


在下文中一共展示了ContainerEvent.getContainer方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: componentAdded

import java.awt.event.ContainerEvent; //導入方法依賴的package包/類
@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!
	}
}
 
開發者ID:MyersResearchGroup,項目名稱:iBioSim,代碼行數:26,代碼來源:CloseTabPaneUI.java

示例2: componentRemoved

import java.awt.event.ContainerEvent; //導入方法依賴的package包/類
@Override
public void componentRemoved(ContainerEvent e) {
	JTabbedPane tp = (JTabbedPane) e.getContainer();
	Component child = e.getChild();
	if (child instanceof UIResource) {
		return;
	}

	// NOTE 4/15/2002 (joutwate):
	// This fix is implemented using client properties since there is
	// currently no IndexPropertyChangeEvent. Once
	// IndexPropertyChangeEvents have been added this code should be
	// modified to use it.
	Integer indexObj = (Integer) tp.getClientProperty("__index_to_remove__");
	if (indexObj != null) {
		int index = indexObj.intValue();
		if (htmlViews != null && htmlViews.size() >= index) {
			htmlViews.removeElementAt(index);
		}
	}
}
 
開發者ID:MyersResearchGroup,項目名稱:iBioSim,代碼行數:22,代碼來源:CloseTabPaneUI.java

示例3: componentRemoved

import java.awt.event.ContainerEvent; //導入方法依賴的package包/類
@Override
public void componentRemoved( ContainerEvent e )
{
	if( e.getContainer( ) instanceof JTabbedPane )
	{
		JTabbedPane tabbedPane = ( JTabbedPane ) e.getContainer( );
		if( tabbedPane.getTabCount( ) == 0 )
		{
			Window ancestor = SwingUtilities.getWindowAncestor( tabbedPane );
			if( ancestor != null )
			{
				ancestor.dispose( );
			}
		}
	}
}
 
開發者ID:DJVUpp,項目名稱:Desktop,代碼行數:17,代碼來源:DefaultTabsRemovedHandler.java

示例4: componentAdded

import java.awt.event.ContainerEvent; //導入方法依賴的package包/類
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);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:9,代碼來源:AbstractMenuFactory.java

示例5: componentAdded

import java.awt.event.ContainerEvent; //導入方法依賴的package包/類
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);
  }
}
 
開發者ID:mstritt,項目名稱:orbit-image-analysis,代碼行數:11,代碼來源:JButtonBar.java

示例6: componentAdded

import java.awt.event.ContainerEvent; //導入方法依賴的package包/類
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);
  }
}
 
開發者ID:calibre2opds,項目名稱:calibre2opds,代碼行數:8,代碼來源:JButtonBar.java

示例7: componentAdded

import java.awt.event.ContainerEvent; //導入方法依賴的package包/類
public void componentAdded(ContainerEvent e) {
    JComponent jc = (JComponent) e.getChild();
    JToolBar tb = (JToolBar) e.getContainer();
    String ctx = (String) tb.getClientProperty(KEY_CONTAINERCTX);
    jc.putClientProperty (KEY_CONTAINERCTX, ctx);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:7,代碼來源:AbstractToolbarFactory.java

示例8: componentRemoved

import java.awt.event.ContainerEvent; //導入方法依賴的package包/類
public void componentRemoved(ContainerEvent e) {
    JComponent menu = (JComponent) e.getContainer();
    JComponent item = (JComponent) e.getChild();
    item.putClientProperty (KEY_CONTAINERCONTEXT, null);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:6,代碼來源:AbstractMenuFactory.java


注:本文中的java.awt.event.ContainerEvent.getContainer方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。