/** * Դ�������ƣ�StandardFieldListPage.java * �������Ȩ���������ӹɷ����޹�˾ ��Ȩ���� * ϵͳ���ƣ�JRES Studio * ģ�����ƣ�com.hundsun.ares.studio.jres.metadata.ui * ����˵����Ԫ�����û��༭��UIչ����ع��� * ����ĵ��� * ���ߣ� */ package com.hundsun.ares.studio.jres.metadata.ui.editors; import org.eclipse.swt.widgets.Composite; import org.eclipse.ui.forms.widgets.FormToolkit; import com.hundsun.ares.studio.jres.metadata.ui.block.StandardFieldListViewerBlock; import com.hundsun.ares.studio.jres.model.metadata.MetadataPackage; import com.hundsun.ares.studio.ui.editor.EMFFormEditor; import com.hundsun.ares.studio.ui.editor.blocks.ColumnViewerBlock; import com.hundsun.ares.studio.ui.editor.validate.EReferenceValidateUnit; import com.hundsun.ares.studio.validate.ValidateUtil; public class StandardFieldListPage extends AbstractMetadataFormPage { StandardFieldListViewerBlock standardFieldViewBlock; /** * ��׼�ֶ��б���� * @param editor * @param id * @param title */ public StandardFieldListPage(EMFFormEditor editor,String id, String title) { super(editor, id, title); } /* (non-Javadoc) * @see com.hundsun.ares.studio.jres.ui.pages.ColumnViewerListPage#configureValidateControl() */ @Override protected void configureValidateControl() { getValidateControl().addValidateUnit(new EReferenceValidateUnit(getInfo(), MetadataPackage.Literals.METADATA_RESOURCE_DATA__ROOT)); getValidateControl().addValidateUnit(new EReferenceValidateUnit(getInfo(), MetadataPackage.Literals.METADATA_RESOURCE_DATA__ITEMS)); getValidateControl().setContext(ValidateUtil.getValidateContext(getEditor().getARESResource())); } /** * @return the standardFieldViewBlock */ public StandardFieldListViewerBlock getStandardFieldViewBlock() { return standardFieldViewBlock; } @Override protected void createMetadataComposite(Composite composite,FormToolkit toolkit){ standardFieldViewBlock = new StandardFieldListViewerBlock(this, getEditingDomain(), getSite(), getEditor().getARESResource(), getProblemPool()); standardFieldViewBlock.setEditableControl(getEditableControl()); standardFieldViewBlock.createControl(composite, toolkit); getEditor().getActionBarContributor().addGlobalActionHandlerProvider(standardFieldViewBlock); addPropertyListener(standardFieldViewBlock); getEditingDomain().getCommandStack().addCommandStackListener(standardFieldViewBlock); } @Override public void infoChange() { standardFieldViewBlock.setInput(getInfo()); super.infoChange(); } @Override public void dispose() { removePropertyListener(standardFieldViewBlock); getEditingDomain().getCommandStack().removeCommandStackListener(standardFieldViewBlock); super.dispose(); } /* (non-Javadoc) * @see com.hundsun.ares.studio.jres.metadata.ui.editors.AbstractMetadataFormPage#getViewerBlock() */ @Override protected ColumnViewerBlock getViewerBlock() { return standardFieldViewBlock; } }