|
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-2003 Sun * Microsystems, Inc. All Rights Reserved. */ package org.netbeans.modules.web.dd; import java.io.IOException; import org.openide.actions.*; import org.openide.filesystems.FileObject; import org.openide.loaders.UniFileLoader; import org.openide.loaders.MultiDataObject; import org.openide.loaders.DataObjectExistsException; import org.openide.util.actions.SystemAction; import org.openide.util.NbBundle; /** Recognizes deployment descriptors of web application (web.xml file). * * @author Milan Kuchtiak */ public class DDDataLoader extends UniFileLoader { static final long serialVersionUID = 8616780278674213886L; private static final String REQUIRED_MIME_PREFIX = "text/x-dd-servlet"; // NOI18N public DDDataLoader () { super ("org.netbeans.modules.web.dd.DDDataObject"); // NOI18N } protected String defaultDisplayName () { return NbBundle.getMessage (DDDataLoader.class, "LBL_loaderName"); } protected SystemAction[] defaultActions () { return new SystemAction[] { SystemAction.get (EditAction.class), SystemAction.get (FileSystemAction.class), null, SystemAction.get (CutAction.class), SystemAction.get (CopyAction.class), SystemAction.get (PasteAction.class), null, SystemAction.get (DeleteAction.class), null, SystemAction.get (SaveAsTemplateAction.class), null, SystemAction.get (ToolsAction.class), SystemAction.get (PropertiesAction.class), }; } protected FileObject findPrimaryFile(FileObject fo) { String mimeType = fo.getMIMEType(); if (mimeType==null) return null; else return (mimeType.startsWith(REQUIRED_MIME_PREFIX)?fo:null); } protected MultiDataObject createMultiObject (FileObject primaryFile) throws DataObjectExistsException, IOException { return new DDDataObject (primaryFile, this); } } |
... 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.