|
What this is
Other links
The source code/* * Sun Public License Notice * * The contents of this file are subject to the Sun Public License * Version 1.0 (the "License"). You may not use this file except in * compliance with the License. A copy of the License is available at * http://www.sun.com/ * * The Original Code is NetBeans. The Initial Developer of the Original * Code is Sun Microsystems, Inc. Portions Copyright 1997-2002 Sun * Microsystems, Inc. All Rights Reserved. */ package org.netbeans.modules.xml.catalog.impl.oasis; import java.awt.*; import java.io.*; import org.xml.sax.*; import org.openide.loaders.XMLDataObject; import org.openide.xml.*; import org.netbeans.modules.xml.catalog.spi.*; import org.netbeans.modules.xml.catalog.impl.*; /** * * @author Petr Kuzel * @version */ public class Catalog extends AbstractCatalog implements Externalizable, CatalogReader, CatalogDescriptor { private String desc = null; private static final long serialVersionUID = -319032714636844856L; //desc property /** Creates new Catalog */ public Catalog() { } public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException { setLocation((String)in.readObject()); } public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException { out.writeObject(getLocation()); } // CatalogDescriptor ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /** * Return visuaized state of given catalog. * @param type of icon defined by JavaBeans specs * @return icon representing current state or null */ public Image getIcon(int type) { return null; } /** * @return I18N display name */ public String getDisplayName() { return Util.THIS.getString("PROP_display_name", getLocation()); } /** * @return I18N short description describing state */ public String getShortDescription() { return desc; } private void setShortDescription(String desc) { this.desc = desc; } // Catalog Reader Interface ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /** * Reload the catalog from its original location. */ public void refresh() { // if ( Util.THIS.isLoggable() ) /* then */ Util.THIS.debug("Refreshing catalog...impl..."); // NOI18N // loadCatalog(getSource()); setLocation(getLocation()); } public void setLocation(String loc) { super.setLocation(loc); try { setShortDescription(Util.THIS.getString("MSG_parsing")); CatalogHandler handler = new CatalogHandlerImpl(this); CatalogParser parser = new CatalogParser(handler); Parser reader = XMLDataObject.createParser(true); reader.setEntityResolver(EntityCatalog.getDefault()); reader.setDocumentHandler(parser); reader.parse(loc); setShortDescription(Util.THIS.getString("MSG_parsed_ok")); } catch (IOException ex) { setShortDescription(Util.THIS.getString("MSG_parsing_failed", ex.getLocalizedMessage())); } catch (SAXException ex) { setShortDescription(Util.THIS.getString("MSG_parsing_failed", ex.getLocalizedMessage())); } finally { } } } |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.