1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 package org.openoffice.netbeans.modules.office.loader; 25 26 import java.io.IOException; 27 import java.io.File; 28 29 import org.openide.actions.*; 30 import org.openide.filesystems.*; 31 import org.openide.loaders.*; 32 import org.openide.util.NbBundle; 33 import org.openide.util.actions.SystemAction; 34 35 import org.openoffice.netbeans.modules.office.actions.*; 36 import org.openoffice.idesupport.zip.ParcelZipper; 37 38 /** Recognizes single files in the Repository as being of a certain type. 39 * 40 * @author tomaso 41 */ 42 public class ParcelDataLoader extends UniFileLoader { 43 ParcelDataLoader()44 public ParcelDataLoader() { 45 this("org.openoffice.netbeans.modules.office.loader.ParcelDataObject"); 46 } 47 48 // Can be useful for subclasses: ParcelDataLoader(String recognizedObjectClass)49 protected ParcelDataLoader(String recognizedObjectClass) { 50 super(recognizedObjectClass); 51 } 52 defaultDisplayName()53 protected String defaultDisplayName() { 54 return "Office Script Parcel"; 55 } 56 initialize()57 protected void initialize() { 58 super.initialize(); 59 60 ExtensionList extensions = new ExtensionList(); 61 extensions.addExtension(ParcelZipper.PARCEL_EXTENSION); 62 setExtensions(extensions); 63 } 64 defaultActions()65 protected SystemAction[] defaultActions() { 66 return new SystemAction[] { 67 // SystemAction.get(MountParcelAction.class), 68 SystemAction.get(DeployParcelAction.class), 69 null, 70 SystemAction.get(CutAction.class), 71 SystemAction.get(CopyAction.class), 72 // SystemAction.get(PasteAction.class), 73 null, 74 SystemAction.get(DeleteAction.class), 75 SystemAction.get(RenameAction.class), 76 null, 77 // SystemAction.get(ToolsAction.class), 78 SystemAction.get(PropertiesAction.class), 79 }; 80 } 81 createMultiObject(FileObject primaryFile)82 protected MultiDataObject createMultiObject(FileObject primaryFile) throws DataObjectExistsException, IOException { 83 return new ParcelDataObject(primaryFile, this); 84 } 85 } 86