alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

What this is

This file is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

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-2003 Sun
 * Microsystems, Inc. All Rights Reserved.
 */
package org.netbeans.modules.css;

import java.lang.ref.Reference;
import java.lang.ref.SoftReference;
import java.io.IOException;
import java.net.URL;
import java.util.*;

import org.openide.filesystems.*;
import org.openide.loaders.*;
import org.openide.text.*;
import org.openide.cookies.*;
import org.openide.util.*;
import org.openide.util.actions.*;
import org.openide.nodes.*;

import org.netbeans.modules.css.text.*;

import org.xml.sax.SAXException;

/**
 * CSSDataObject wraps CSS data layer functionality.
 *
 * This class is final only for performance reasons,
 * can be unfinaled if desired.
 *
 * @author Petr Kuzel
 */
public final class CSSObject extends MultiDataObject {
    private static final long serialVersionUID = -3041598815183192198L;
    public static final String MIME_TYPE = "text/css"; // NOI18N


    public CSSObject(final FileObject obj,final UniFileLoader loader) throws DataObjectExistsException {
        super (obj, loader);

        CookieSet set = getCookieSet();
        set.add (new CSSEditorSupport(getPrimaryEntry()));

        getPrimaryFile().addFileChangeListener (FileUtil.weakFileChangeListener(new FileListener (), getPrimaryFile()));
    }

    /** Provides node that should represent this data object. When a node for representation
     * in a parent is requested by a call to getNode (parent) it is the exact copy of this node
     * with only parent changed. This implementation creates instance
     * DataNode.
     * 

* This method is called only once. * * @return the node representation for this data object * @see DataNode */ protected Node createNodeDelegate () { return new CSSNode (this); } public HelpCtx getHelpCtx() { return new HelpCtx (CSSObject.class); } ///////////////////// // class FileListener class FileListener extends FileChangeAdapter { /** Fired when a file is changed. * @param fe the event describing context where action has taken place */ public void fileChanged (FileEvent fe) { } } // end of inner class FileListener }

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

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.