| /* |
| * To change this template, choose Tools | Templates |
| * and open the template in the editor. |
| */ |
| |
| /* |
| * MyEditor.java |
| * |
| * Created on 10-apr-2011, 20:24:51 |
| */ |
| package org.myorg.myeditor; |
| |
| import org.openide.awt.ActionID; |
| import org.openide.awt.ActionReference; |
| import org.openide.explorer.ExplorerManager; |
| import org.openide.explorer.ExplorerUtils; |
| import org.openide.explorer.view.OutlineView; |
| import org.openide.nodes.AbstractNode; |
| import org.openide.nodes.Children; |
| import org.openide.windows.TopComponent; |
| |
| /** |
| * |
| * @author gwielenga |
| */ |
| @TopComponent.Description(preferredID = "MyEditorTopComponent", persistenceType = TopComponent.PERSISTENCE_NEVER) |
| @TopComponent.Registration(mode = "explorer", openAtStartup = false) |
| @TopComponent.OpenActionRegistration(displayName = "#CTL_MyEditorAction") |
| @ActionID(category = "Window", id = "org.myorg.myviewer.MyEditorTopComponent") |
| @ActionReference(path = "Menu/Window") |
| public class MyEditor extends TopComponent implements ExplorerManager.Provider { |
| |
| /** Creates new form MyEditor */ |
| public MyEditor() { |
| initComponents(); |
| associateLookup(ExplorerUtils.createLookup(mgr, getActionMap())); |
| mgr.setRootContext(new AbstractNode(Children.create(new MyChildren(), true))); |
| } |
| |
| private final ExplorerManager mgr = new ExplorerManager(); |
| |
| @Override |
| public ExplorerManager getExplorerManager() { |
| return mgr; |
| } |
| |
| /** This method is called from within the constructor to |
| * initialize the form. |
| * WARNING: Do NOT modify this code. The content of this method is |
| * always regenerated by the Form Editor. |
| */ |
| @SuppressWarnings("unchecked") |
| // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents |
| private void initComponents() { |
| |
| OutlineView ov = new OutlineView(); |
| ov.setPropertyColumns("date", "Date"); |
| jScrollPane1 = ov; |
| |
| setLayout(new java.awt.BorderLayout()); |
| add(jScrollPane1, java.awt.BorderLayout.CENTER); |
| }// </editor-fold>//GEN-END:initComponents |
| // Variables declaration - do not modify//GEN-BEGIN:variables |
| private javax.swing.JScrollPane jScrollPane1; |
| // End of variables declaration//GEN-END:variables |
| } |