Package net.datacrow.core.plugin

Examples of net.datacrow.core.plugin.Plugin


                modules.add(pm);
        }

        for (DcModule pm : modules) {
            try {
                Plugin plugin = Plugins.getInstance().get("ManageItem", dco, null, viewIdx,  pm.getIndex());
                if (    plugin != null &&SecurityCentre.getInstance().getUser().isAuthorized(plugin) &&
                        UserMode.isCorrectXpLevel(plugin.getXpLevel())) {
                   
                    JMenuItem item = ComponentFactory.getMenuItem(plugin);
                    item.setEnabled(plugin.isEnabled());
                    item.setIcon(plugin.getIcon());
                   
                    menuAdmin.add(item);
                }
            } catch (InvalidPluginException e) {
                logger.error(e, e);
            }
        }
       
        if (menuAdmin.getItemCount() > 0)
            add(menuAdmin);
       
        addSeparator();
        PluginHelper.add(this, "ViewSettings");
       
        if (viewType == View._TYPE_SEARCH) {
            FileImporter importer = module.getImporter();
            if (importer != null && importer.allowReparsing() && module.getFileField() != null) {
                addSeparator();
                PluginHelper.add(this, "AttachFileInfo");
            }
        }
       
        addSeparator();
       
        if (current.getIndex() != DcModules._ITEM) {
            PluginHelper.add(this, "UpdateAll", module.getIndex());
            PluginHelper.add(this, "FindReplace", module.getIndex());
        }
       
        if (file != null && dco.getModule().isFileBacked())
            PluginHelper.add(this, "FileLauncher", module.getIndex());
       
        Collection<Plugin> plugins = Plugins.getInstance().getUserPlugins(dco, viewType, module.getIndex());
        for (Plugin plugin : plugins) {
            if (plugin.isShowInPopupMenu()) {
                addSeparator();
                add(ComponentFactory.getMenuItem(plugin));
            }
        }
    }
View Full Code Here


       
        if (e.getStateChange() == ItemEvent.SELECTED) {
            for (Component c : getMenuComponents()) {
                if (c instanceof DcMenuItem && ((DcMenuItem) c).getAction() instanceof Plugin) {
                    DcMenuItem mi = (DcMenuItem) c;
                    Plugin plugin = (Plugin) mi.getAction();
                    mi.setIcon(plugin.getIcon());
                    mi.setEnabled(plugin.isEnabled());
                    mi.setText(plugin.getLabel());
                }
            }
        }
    }
View Full Code Here

TOP

Related Classes of net.datacrow.core.plugin.Plugin

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.