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 org.openide.loaders.*; 27 import org.openide.nodes.*; 28 import org.openide.util.NbBundle; 29 30 import org.openoffice.netbeans.modules.office.nodes.*; 31 import org.openoffice.netbeans.modules.office.actions.*; 32 33 /** A node to represent this object. 34 * 35 * @author tomaso 36 */ 37 public class ParcelDescriptorDataNode extends DataNode { 38 ParcelDescriptorDataNode(ParcelDescriptorDataObject obj)39 public ParcelDescriptorDataNode(ParcelDescriptorDataObject obj) { 40 this(obj, Children.LEAF); 41 } 42 ParcelDescriptorDataNode(ParcelDescriptorDataObject obj, Children ch)43 public ParcelDescriptorDataNode(ParcelDescriptorDataObject obj, Children ch) { 44 super(obj, ch); 45 setHidden(true); 46 setIconBase("/org/openoffice/netbeans/modules/office/resources/OfficeIcon"); 47 } 48 getParcelDescriptorDataObject()49 protected ParcelDescriptorDataObject getParcelDescriptorDataObject() { 50 return (ParcelDescriptorDataObject)getDataObject(); 51 } 52 canRename()53 public boolean canRename() { 54 return false; 55 } 56 57 /* Example of adding Executor / Debugger / Arguments to node: 58 protected Sheet createSheet() { 59 Sheet sheet = super.createSheet(); 60 Sheet.Set set = sheet.get(ExecSupport.PROP_EXECUTION); 61 if (set == null) { 62 set = new Sheet.Set(); 63 set.setName(ExecSupport.PROP_EXECUTION); 64 set.setDisplayName(NbBundle.getMessage(ParcelDescriptorDataNode.class, "LBL_DataNode_exec_sheet")); 65 set.setShortDescription(NbBundle.getMessage(ParcelDescriptorDataNode.class, "HINT_DataNode_exec_sheet")); 66 } 67 ((ExecSupport)getCookie(ExecSupport.class)).addProperties(set); 68 // Maybe: 69 ((CompilerSupport)getCookie(CompilerSupport.class)).addProperties(set); 70 sheet.put(set); 71 return sheet; 72 } 73 */ 74 75 // Don't use getDefaultAction(); just make that first in the data loader's getActions list 76 77 } 78