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 org.slf4j.Logger;
018import org.slf4j.LoggerFactory;
019
020import org.eclipse.swt.SWT;
021import org.eclipse.swt.layout.FillLayout;
022import org.eclipse.swt.layout.GridData;
023import org.eclipse.swt.widgets.Composite;
024import org.eclipse.swt.widgets.Text;
025
026import hdf.object.Datatype;
027import hdf.object.HObject;
028import hdf.view.DataView.DataViewManager;
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        super(parentComposite, viewer, theObj);
050    }
051
052    @Override
053    protected void addObjectSpecificContent() {
054        super.addObjectSpecificContent();
055
056        org.eclipse.swt.widgets.Group datatypeInfoGroup = new org.eclipse.swt.widgets.Group(generalObjectInfoPane, SWT.NONE);
057        datatypeInfoGroup.setFont(curFont);
058        datatypeInfoGroup.setText("Type");
059        datatypeInfoGroup.setLayout(new FillLayout());
060        datatypeInfoGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));
061
062        Text infoArea = new Text(datatypeInfoGroup, SWT.MULTI);
063        infoArea.setFont(curFont);
064        infoArea.setText(((Datatype) dataObject).getDescription());
065        infoArea.setEditable(false);
066    }
067
068}