|
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-2004 Sun * Microsystems, Inc. All Rights Reserved. */ package org.netbeans.modules.properties; import java.io.IOException; import org.openide.actions.*; import org.openide.filesystems.FileObject; import org.openide.loaders.MultiDataObject; import org.openide.loaders.ExtensionList; import org.openide.loaders.MultiFileLoader; import org.openide.util.actions.SystemAction; import org.openide.util.NbBundle; import org.openide.util.io.SafeException; /** * Data loader which recognizes properties files. * This class is final only for performance reasons, * can be unfinaled if desired. * * @author Ian Formanek, Petr Jiricka */ public final class PropertiesDataLoader extends MultiFileLoader { /** Extension for properties files. */ static final String PROPERTIES_EXTENSION = "properties"; // NOI18N /** Character used to separate parts of bundle properties file name */ public static final char PRB_SEPARATOR_CHAR = '_'; /** Generated serial version UID. */ static final long serialVersionUID =4384899552891479449L; /** name of property with extensions */ public static final String PROP_EXTENSIONS = "extensions"; // NOI18N /** Creates new PropertiesDataLoader. */ public PropertiesDataLoader() { super("org.netbeans.modules.properties.PropertiesDataObject"); // NOI18N // Set extentions. Due performance reasons do it here instead in initialize method. // During startup it's in findPrimaryFile method called getExtensions method. If the // extentions list was not set in constructor the initialize method would be called // during startup, but we want to avoid the initialize call since we don't need // actions and display name initialized during startup time. ExtensionList extList = new ExtensionList(); extList.addExtension(PROPERTIES_EXTENSION); // Add .impl for CORBA module. extList.addExtension("impl"); // NOI18N setExtensions(extList); } /** */ protected String defaultDisplayName() { return NbBundle.getMessage(PropertiesDataLoader.class, "PROP_PropertiesLoader_Name"); //NOI18N } protected SystemAction[] defaultActions() { return new SystemAction[] { // Open as text by default, but leave the ability to open // the table view, and the ability to customize the // default. First item in the list serves as the default // action by default. SystemAction.get(EditAction.class), SystemAction.get(OpenAction.class), SystemAction.get(FileSystemAction.class), null, SystemAction.get(CutAction.class), SystemAction.get(CopyAction.class), SystemAction.get(PasteAction.class), null, SystemAction.get(DeleteAction.class), SystemAction.get(RenameAction.class), null, SystemAction.get(NewAction.class), SystemAction.get(SaveAsTemplateAction.class), null, SystemAction.get(ToolsAction.class), SystemAction.get(PropertiesAction.class) }; } /** * @return |
... 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.