content: package org.netbeans.modules.python;
  
  import java.io.IOException;
  import org.netbeans.core.spi.multiview.MultiViewElement;
  import org.netbeans.core.spi.multiview.text.MultiViewEditorElement;
  import org.netbeans.modules.textmate.lexer.api.GrammarRegistration;
  import org.openide.awt.ActionID;
  import org.openide.awt.ActionReference;
  import org.openide.awt.ActionReferences;
  import org.openide.filesystems.FileObject;
  import org.openide.filesystems.MIMEResolver;
  import org.openide.loaders.DataObject;
  import org.openide.loaders.DataObjectExistsException;
  import org.openide.loaders.MultiDataObject;
  import org.openide.loaders.MultiFileLoader;
  import org.openide.util.Lookup;
  import org.openide.util.NbBundle.Messages;
  import org.openide.windows.TopComponent;
  
  @Messages({
      "LBL_Python_LOADER=Files of Python"
  })
  @MIMEResolver.ExtensionRegistration(
          displayName = "#LBL_Python_LOADER",
          mimeType = PythonUtility.PYTHON_MIME_TYPE,
          extension = {"py", "pyc", "pyd", "pyo", "pyw", "pyz", "pyi"}
  )
  @DataObject.Registration(
          mimeType = PythonUtility.PYTHON_MIME_TYPE,
          iconBase = "org/netbeans/modules/python/python-2.png",
          displayName = "#LBL_Python_LOADER",
          position = 300
  )
  @ActionReferences({
      @ActionReference(
              path = "Loaders/text/x-python/Actions",
              id = @ActionID(category = "System", id = "org.openide.actions.OpenAction"),
              position = 100,
              separatorAfter = 200
      ),
      @ActionReference(
              path = "Loaders/text/x-python/Actions",
              id = @ActionID(category = "Edit", id = "org.openide.actions.CutAction"),
              position = 300
      ),
      @ActionReference(
              path = "Loaders/text/x-python/Actions",
              id = @ActionID(category = "Edit", id = "org.openide.actions.CopyAction"),
              position = 400,
              separatorAfter = 500
      ),
      @ActionReference(
              path = "Loaders/text/x-python/Actions",
              id = @ActionID(category = "Edit", id = "org.openide.actions.DeleteAction"),
              position = 600
      ),
      @ActionReference(
              path = "Loaders/text/x-python/Actions",
              id = @ActionID(category = "System", id = "org.openide.actions.RenameAction"),
              position = 700,
              separatorAfter = 800
      ),
      @ActionReference(
              path = "Loaders/text/x-python/Actions",
              id = @ActionID(category = "System", id = "org.openide.actions.SaveAsTemplateAction"),
              position = 900,
              separatorAfter = 1000
      ),
      @ActionReference(
              path = "Loaders/text/x-python/Actions",
              id = @ActionID(category = "System", id = "org.openide.actions.FileSystemAction"),
              position = 1100,
              separatorAfter = 1200
      ),
      @ActionReference(
              path = "Loaders/text/x-python/Actions",
              id = @ActionID(category = "System", id = "org.openide.actions.ToolsAction"),
              position = 1300
      ),
      @ActionReference(
              path = "Loaders/text/x-python/Actions",
              id = @ActionID(category = "System", id = "org.openide.actions.PropertiesAction"),
              position = 1400
      ),
      @ActionReference(
              path = "Loaders/text/x-python/Actions",
              id = @ActionID(category = "Project", id = "org.netbeans.modules.project.ui.RunSingle"),
              position = 250
      )
  })
  
  @GrammarRegistration(grammar = "MagicPython.tmLanguage.json", mimeType
          = PythonUtility.PYTHON_MIME_TYPE)
  public class PythonDataObject extends MultiDataObject {
  
      private static final long serialVersionUID = 1L;
  
      public PythonDataObject(FileObject pf, MultiFileLoader loader)
              throws DataObjectExistsException, IOException {
          super(pf, loader);
          registerEditor(PythonUtility.PYTHON_MIME_TYPE, true);
      }
  
      @Override
      protected int associateLookup() {
          return 1;
      }
  
      @MultiViewElement.Registration(
              displayName = "#LBL_Python_EDITOR",
              iconBase = "org/netbeans/modules/python/python-2.png",
              mimeType = PythonUtility.PYTHON_MIME_TYPE,
              persistenceType = TopComponent.PERSISTENCE_ONLY_OPENED,
              preferredID = "Python",
              position = 1000
      )
      @Messages("LBL_Python_EDITOR=Source")
      public static MultiViewEditorElement createEditor(Lookup lkp) {
          return new MultiViewEditorElement(lkp);
      }
  
  }
  