⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hibernatecfform.java

📁 eclipse的hibernate插件,支持eclipse2.*版本
💻 JAVA
字号:
/* * Created on 2003-7-27 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments */package com.tanghan.plugin.hibernate.editor.formpages;import java.util.ResourceBundle;import org.apache.log4j.Logger;import org.eclipse.swt.layout.GridData;import org.eclipse.swt.layout.GridLayout;import org.eclipse.swt.widgets.Composite;import org.eclipse.swt.widgets.Control;import org.eclipse.update.ui.forms.internal.ScrollableSectionForm;import com.tanghan.plugin.TanghanPlugin;import com.tanghan.plugin.hibernate.editor.HibernateCFModel;import com.tanghan.plugin.hibernate.editor.elements.HibernateTreeObject;import com.tanghan.util.Log;/** * @author Jerry Tang * * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and Comments */public class HibernateCFForm extends ScrollableSectionForm implements IHibernateSelectionChange {	private static ResourceBundle res =		TanghanPlugin.getDefault().getResourceBundle();			private static Logger log = Log.getInstanse().getLogger(HibernateCFForm.class);		HibernateCFFormPage page = null;	protected Composite sectionContainer;	private HibernateCFTreeSection hibernateCFTreeSection;	private HibernateContentSection hibernateContentSection;		public HibernateCFForm(HibernateCFFormPage page) {		this.page = page;		this.setHeadingText(res.getString("Tanghan.Plugin.Hibernate.Edit.Title")); //$NON-NLS-1$		setVerticalFit(true);		log.debug("create HibernateCFForm"); //$NON-NLS-1$	}		/* (non-Javadoc)	 * @see org.eclipse.update.ui.forms.internal.SectionForm#createFormClient(org.eclipse.swt.widgets.Composite)	 */	protected void createFormClient(Composite parent) {		GridLayout layout = new GridLayout();		layout.numColumns = 2;		layout.marginWidth = 10;		layout.horizontalSpacing = 15;		parent.setLayout(layout);		GridData gd;		Control control;		getHibernateCFTreeSection().setCollapsable(true);		control =  getHibernateCFTreeSection().createControl(parent, getFactory());		((HibernateCFModel)page.getModel()).addModelChangedListener(getHibernateCFTreeSection());		gd = new GridData(GridData.FILL_BOTH);		control.setLayoutData(gd);		sectionContainer = parent;		sectionContainer.setMenu(null);				setHibernateCFContentSection(new HibernateContentSection(page,null));		getHibernateCFContentSection().setCollapsable(true);		control = getHibernateCFContentSection().createControl(sectionContainer, getFactory());		gd = new GridData(GridData.FILL_BOTH);		gd.widthHint = 200;		control.setLayoutData(gd);								registerSection(getHibernateCFTreeSection());		registerSection(getHibernateCFContentSection());	}	protected void disposeIfAppliqued() {				if ( hibernateContentSection != null ) {			unregisterSection(getHibernateCFContentSection());			getHibernateCFContentSection().dispose();			setHibernateCFContentSection(null);			} 	}		protected void createHibernateCFContentSection(HibernateTreeObject hibernateElemObject){		//注销当前内容页面		disposeIfAppliqued();				setHibernateCFContentSection(new HibernateContentSection(page,hibernateElemObject));		getHibernateCFContentSection().setCollapsable(true);		GridData gd;		Control control;		control = getHibernateCFContentSection().createControl(sectionContainer, getFactory());		gd = new GridData(GridData.FILL_BOTH);		gd.widthHint = 200;		control.setLayoutData(gd);			registerSection(getHibernateCFContentSection());		//updateScrollBars();		getHibernateCFContentSection().update();			}	public HibernateCFTreeSection getHibernateCFTreeSection() {		if(hibernateCFTreeSection==null){			hibernateCFTreeSection = new HibernateCFTreeSection(page);			hibernateCFTreeSection.addSelectionChanged(this);		}		return hibernateCFTreeSection;	}	protected HibernateContentSection getHibernateCFContentSection(){		return hibernateContentSection;	}	protected void setHibernateCFContentSection(HibernateContentSection hibernateContentSection){		this.hibernateContentSection = hibernateContentSection;	}		/* (non-Javadoc)	 * @see org.eclipse.update.ui.forms.internal.IForm#initialize(java.lang.Object)	 */	public void initialize(Object model) {		super.initialize(model);	}	/* (non-Javadoc)	 * @see com.tanghan.plugin.hibernate.editor.formpages.IHibernateSelectionChange#selectionChanged(java.lang.Object)	 */	public void selectionChanged(Object selection) {		if(selection!=null && (selection instanceof HibernateTreeObject)){			createHibernateCFContentSection((HibernateTreeObject)selection);		}else{			createHibernateCFContentSection(null);		}	}	/* (非 Javadoc)	 * @see org.eclipse.update.ui.forms.internal.IForm#dispose()	 */	public void dispose() {		((HibernateCFModel)page.getModel()).removeModelChangedListener(getHibernateCFTreeSection());		super.dispose();	}}

⌨️ 快捷键说明

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