001/*****************************************************************************
002 * Copyright by The HDF Group.                                               *
003 * Copyright by the Board of Trustees of the University of Illinois.         *
004 * All rights reserved.                                                      *
005 *                                                                           *
006 * This file is part of the HDF Java Products distribution.                  *
007 * The full copyright notice, including terms governing use, modification,   *
008 * and redistribution, is contained in the COPYING file, which can be found  *
009 * at the root of the source code distribution tree,                         *
010 * or in https://www.hdfgroup.org/licenses.                                  *
011 * If you do not have access to either file, you may request a copy from     *
012 * help@hdfgroup.org.                                                        *
013 ****************************************************************************/
014
015package hdf.view.MetaDataView;
016
017import hdf.object.Datatype;
018import hdf.object.HObject;
019import hdf.view.DataView.DataViewManager;
020
021import org.slf4j.Logger;
022import org.slf4j.LoggerFactory;
023
024import org.eclipse.swt.SWT;
025import org.eclipse.swt.layout.FillLayout;
026import org.eclipse.swt.layout.GridData;
027import org.eclipse.swt.widgets.Composite;
028import org.eclipse.swt.widgets.Text;
029
030/**
031 *
032 *The metadata view interface for displaying datatype metadata information
033 */
034public class DefaultDatatypeMetaDataView extends DefaultLinkMetaDataView implements MetaDataView {
035
036    private static final Logger log = LoggerFactory.getLogger(DefaultDatatypeMetaDataView.class);
037
038    /**
039     *The metadata view interface for displaying datatype metadata information
040     *
041     * @param parentComposite
042     *        the parent visual object
043     * @param viewer
044     *        the viewer to use
045     * @param theObj
046     *        the object to display the metadata info
047     */
048    public DefaultDatatypeMetaDataView(Composite parentComposite, DataViewManager viewer, HObject theObj)
049    {
050        super(parentComposite, viewer, theObj);
051    }
052
053    @Override
054    protected void addObjectSpecificContent()
055    {
056        super.addObjectSpecificContent();
057
058        org.eclipse.swt.widgets.Group datatypeInfoGroup =
059            new org.eclipse.swt.widgets.Group(generalObjectInfoPane, SWT.NONE);
060        datatypeInfoGroup.setFont(curFont);
061        datatypeInfoGroup.setText("Type");
062        datatypeInfoGroup.setLayout(new FillLayout());
063        datatypeInfoGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));
064
065        Text infoArea = new Text(datatypeInfoGroup, SWT.MULTI);
066        infoArea.setFont(curFont);
067        infoArea.setText(((Datatype)dataObject).getDescription());
068        infoArea.setEditable(false);
069    }
070}