childcomponentdelegate.java

来自「Hibernate开发及整合应用大全 蔡雪焘编著 本书用典型的示例剖析Hiber」· Java 代码 · 共 50 行

JAVA
50
字号
package net.sf.hibernate.console.docking;import javax.swing.JSplitPane;import javax.swing.JTabbedPane;import javax.swing.plaf.basic.BasicSplitPaneDivider;import javax.swing.plaf.basic.BasicSplitPaneUI;import net.eleritec.docking.DockingPort;import net.eleritec.docking.defaults.SubComponentProvider;public class ChildComponentDelegate implements SubComponentProvider {	public DockingPort createChildPort() {		ElegantDockingPort port = new ElegantDockingPort();		port.setComponentProvider(this);		return port;	}	public JSplitPane createSplitPane() {		JSplitPane split = new JSplitPane();		// remove the border from the split pane		split.setBorder(null);		// set the divider size for a more reasonable, less bulky look 		split.setDividerSize(3);		// check the UI.  If we can't work with the UI any further, then		// exit here.		if (!(split.getUI() instanceof BasicSplitPaneUI))			return split;		//  grab the divider from the UI and remove the border from it		BasicSplitPaneDivider divider = 				((BasicSplitPaneUI) split.getUI()).getDivider();		if (divider != null)			divider.setBorder(null);		return split;	}	public JTabbedPane createTabbedPane() {		return new JTabbedPane(JTabbedPane.BOTTOM);	}	public double getInitialDividerLocation() {		return 0.5d;	}}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?