All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jdplus.toolkit.desktop.plugin.ui.variables.VariablesTopComponent Maven / Gradle / Ivy

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package jdplus.toolkit.desktop.plugin.ui.variables;

import jdplus.toolkit.desktop.plugin.workspace.WorkspaceFactory;
import jdplus.toolkit.desktop.plugin.workspace.WorkspaceItem;
import jdplus.toolkit.desktop.plugin.workspace.ui.WorkspaceTopComponent;
import jdplus.toolkit.base.api.timeseries.regression.TsDataSuppliers;
import org.netbeans.api.settings.ConvertAsProperties;
import org.openide.awt.ActionID;
import org.openide.awt.ActionReference;
import org.openide.explorer.ExplorerManager;
import org.openide.util.NbBundle;
import org.openide.windows.TopComponent;
import org.openide.util.NbBundle.Messages;

/**
 * Top component which displays something.
 */
@ConvertAsProperties(
    dtd = "-//demetra.desktop.ui.variables//Variables//EN",
autostore = false)
@TopComponent.Description(
    preferredID = "VariablesTopComponent",
//iconBase="SET/PATH/TO/ICON/HERE", 
persistenceType = TopComponent.PERSISTENCE_ALWAYS)
@TopComponent.Registration(mode = "editor", openAtStartup = false)
@ActionID(category = "Window", id = "demetra.desktop.ui.variables.VariablesTopComponent")
@ActionReference(path = "Menu/Window" /*, position = 333 */)
@TopComponent.OpenActionRegistration(
    displayName = "#CTL_VariablesAction",
preferredID = "VariablesTopComponent")
@Messages({
    "CTL_VariablesAction=Variables",
    "CTL_VariablesTopComponent=Variables Window",
    "HINT_VariablesTopComponent=This is a Variables window"
})
public final class VariablesTopComponent extends WorkspaceTopComponent {
    
    private final ExplorerManager mgr = new ExplorerManager();
    
    private JTsVariableList list;

     private static VariablesDocumentManager manager() {
        return WorkspaceFactory.getInstance().getManager(VariablesDocumentManager.class);
    }

    public VariablesTopComponent() {
       this(null);
    }

    public VariablesTopComponent(WorkspaceItem doc) {
        super(doc);
        initComponents();
        setToolTipText(NbBundle.getMessage(VariablesTopComponent.class, "HINT_VariablesTopComponent"));
      }

     @Override
    public WorkspaceItem newDocument() {
        return manager().create(WorkspaceFactory.getInstance().getActiveWorkspace());
    }

    @Override
    public void componentOpened() {
        super.componentOpened();
        initComponents();
    }

   /**
     * 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.
     */
    // //GEN-BEGIN:initComponents
    private void initComponents() {

        setLayout(new java.awt.BorderLayout());
        list=new JTsVariableList(getElement());
        add(list);
    }// //GEN-END:initComponents

    // Variables declaration - do not modify//GEN-BEGIN:variables
    // End of variables declaration//GEN-END:variables

    void writeProperties(java.util.Properties p) {
        // better to version settings since initial version as advocated at
        // http://wiki.apidesign.org/wiki/PropertyFiles
        p.setProperty("version", "1.0");
        // TODO store your settings
    }

    void readProperties(java.util.Properties p) {
        String version = p.getProperty("version");
        // TODO read your settings according to their version
    }

    @Override
    public ExplorerManager getExplorerManager() {
        return mgr;
    }
    
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy