当前位置: 首页>>代码示例>>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;未经允许,请勿转载。