PLSQL/FileType/src/org/netbeans/modules/plsql/filetype/PrototypeDataObject.java
branchmultiview_prototype
changeset 19 cd34d58c6d85
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/PLSQL/FileType/src/org/netbeans/modules/plsql/filetype/PrototypeDataObject.java	Sun Sep 18 15:31:13 2011 +0200
     1.3 @@ -0,0 +1,38 @@
     1.4 +/*
     1.5 + * To change this template, choose Tools | Templates and open the template in
     1.6 + * the editor.
     1.7 + */
     1.8 +package org.netbeans.modules.plsql.filetype;
     1.9 +
    1.10 +import java.io.IOException;
    1.11 +import org.netbeans.core.spi.multiview.MultiViewElement;
    1.12 +import org.netbeans.core.spi.multiview.text.MultiViewEditorElement;
    1.13 +import org.openide.filesystems.FileObject;
    1.14 +import org.openide.loaders.DataObjectExistsException;
    1.15 +import org.openide.loaders.MultiDataObject;
    1.16 +import org.openide.loaders.MultiFileLoader;
    1.17 +import org.openide.util.Lookup;
    1.18 +import org.openide.windows.TopComponent;
    1.19 +
    1.20 +public class PrototypeDataObject extends MultiDataObject {
    1.21 +
    1.22 +    public PrototypeDataObject(FileObject pf, MultiFileLoader loader) throws DataObjectExistsException, IOException {
    1.23 +        super(pf, loader);
    1.24 +        registerEditor("text/x-plsql-prototype", true);
    1.25 +    }
    1.26 +
    1.27 +    @Override
    1.28 +    protected int associateLookup() {
    1.29 +        return 1;
    1.30 +    }
    1.31 +
    1.32 +    @MultiViewElement.Registration(displayName = "#LBL_Prototype_EDITOR",
    1.33 +    iconBase = "SET/PATH/TO/ICON/HERE",
    1.34 +    mimeType = "text/x-plsql-prototype",
    1.35 +    persistenceType = TopComponent.PERSISTENCE_ONLY_OPENED,
    1.36 +    preferredID = "Prototype",
    1.37 +    position = 1000)
    1.38 +    public static MultiViewEditorElement createEditor(Lookup lkp) {
    1.39 +        return new MultiViewEditorElement(lkp);
    1.40 +    }
    1.41 +}