All Downloads are FREE. Search and download functionalities are using the official Maven repository.

java.fedora.client.objecteditor.DatastreamsPane Maven / Gradle / Ivy

Go to download

The Fedora Client is a Java Library that allows API access to a Fedora Repository. The client is typically one part of a full Fedora installation.

The newest version!
/*
 * -----------------------------------------------------------------------------
 *
 * 

License and Copyright: The contents of this file are subject to the * Apache License, Version 2.0 (the "License"); you may not use * this file except in compliance with the License. You may obtain a copy of * the License at * http://www.fedora-commons.org/licenses.

* *

Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for * the specific language governing rights and limitations under the License.

* *

The entire file consists of original code.

*

Copyright © 2008 Fedora Commons, Inc.
*

Copyright © 2002-2007 The Rector and Visitors of the University of * Virginia and Cornell University
* All rights reserved.

* * ----------------------------------------------------------------------------- */ package fedora.client.objecteditor; import java.awt.*; import java.awt.event.*; import java.io.*; import java.util.*; import javax.swing.*; import org.apache.log4j.Logger; import fedora.client.Administrator; import fedora.server.types.gen.Datastream; /** * Shows a tabbed pane, one for each datastream in the object, and one * special tab for "New...", which handles the creation of new datastreams. * * @author [email protected] * @version $Id: DatastreamsPane.java 5418 2006-12-12 23:13:55Z haschart $ */ public class DatastreamsPane extends JPanel implements PotentiallyDirty, TabDrawer { /** Logger for this class. */ private static final Logger LOG = Logger.getLogger( DatastreamsPane.class.getName()); private static final long serialVersionUID = 1L; private String m_pid; private JTabbedPane m_tabbedPane; private DatastreamPane[] m_datastreamPanes; private ObjectEditorFrame m_owner; private ArrayList m_dsListeners; private Datastream[] m_currentVersions; private Map m_currentVersionMap; public String[] ALL_KNOWN_MIMETYPES = new String[] { "text/xml", "text/plain", "text/html", "text/html+xml", "text/svg+xml", "text/rtf", "image/jpeg", "image/jp2", "image/gif", "image/bmp", "image/png", "image/tiff", "audio/mpeg", "audio/x-aiff", "audio/x-wav", "audio/x-pn-realaudio", "video/mpeg", "video/quicktime", "application/postscript", "application/pdf", "application/rdf+xml", "application/ms-word", "application/ms-excel", "application/ms-powerpoint", "application/smil", "application/octet-stream", "application/x-tar", "application/zip", "application/x-gtar", "application/x-gzip", "application/xml", "application/xhtml+xml", "application/xslt+xml", "application/xml-dtd", }; public String[] XML_MIMETYPE = new String[] {"text/xml"}; static ImageIcon newIcon=new ImageIcon(Administrator.cl.getResource("images/standard/general/New16.gif")); /** * Build the pane. */ public DatastreamsPane(ObjectEditorFrame owner, String pid) throws Exception { m_pid=pid; m_owner=owner; m_currentVersionMap=new HashMap(); // this(m_tabbedPane) m_dsListeners=new ArrayList(); // m_tabbedPane(DatastreamPane[]) m_tabbedPane=new JTabbedPane(SwingConstants.LEFT); m_currentVersions=Administrator.APIM. getDatastreams(pid, null, null); m_datastreamPanes=new DatastreamPane[m_currentVersions.length]; for (int i=0; ii) { newArray[x-1]=m_datastreamPanes[x-1]; } } m_datastreamPanes=newArray; // then make sure dirtiness indicators are corrent m_owner.indicateDirtiness(); } public boolean isDirty() { for (int i=0; i




© 2015 - 2025 Weber Informatics LLC | Privacy Policy