Package org.pdfsam.guiclient.plugins.models

Examples of org.pdfsam.guiclient.plugins.models.PluginDataModel


    if(plugsNode!=null && className!=null){
      Enumeration<DefaultMutableTreeNode> plugsEnumeration = plugsNode.preorderEnumeration();
      while(plugsEnumeration.hasMoreElements()){
        DefaultMutableTreeNode currentNode = plugsEnumeration.nextElement();
        if(currentNode.getUserObject() instanceof PluginDataModel){
          PluginDataModel selectedPlug = (PluginDataModel)currentNode.getUserObject();
          if(className.equals(selectedPlug.getClassName())){
            retVal = new TreePath(currentNode.getPath());
            break;
          }
        }
      }
View Full Code Here


    String retVal = null;
    DefaultMutableTreeNode node = getSelectedNode()
    if (node != null && node.isLeaf()) {
      Object selectedObject = node.getUserObject();
      if(selectedObject instanceof PluginDataModel){
        PluginDataModel selectedPlug = (PluginDataModel)selectedObject;
        retVal = selectedPlug.getClassName();
      }
    }
    return retVal;
  }
View Full Code Here

      for(String className : classList){ 
        try{
          Class<?> currentClass = urlClassLoader.loadClass(className);
          if((currentClass.getSuperclass().isAssignableFrom(PLUGIN_SUPER_CLASS))){
            AbstractPlugablePanel instance = (AbstractPlugablePanel) currentClass.newInstance();
            PluginDataModel pluginDataModel = new PluginDataModel(instance.getPluginName(), instance.getVersion(), instance.getPluginAuthor(), className);
            retMap.put(pluginDataModel, instance);
            log.info(pluginDataModel.getName()+GettextResource.gettext(Configuration.getInstance().getI18nResourceBundle()," plugin loaded."));
          }else{
            log.error(GettextResource.gettext(Configuration.getInstance().getI18nResourceBundle(),"Unable to load a plugin that is not JPanel subclass."));
          }
        }catch(Exception e){
          log.error(GettextResource.gettext(Configuration.getInstance().getI18nResourceBundle(),"Error loading class ")+className, e);
View Full Code Here

    JPanel plugsPanel = container.getMainPanel();
    DefaultMutableTreeNode node = container.getTreePanel().getSelectedNode();
    if (node != null && node.isLeaf()) {
      Object selectedObject = node.getUserObject();
      if(selectedObject instanceof PluginDataModel){
        PluginDataModel selectedPlug = (PluginDataModel)selectedObject;
        AbstractPlugablePanel panel = container.getPluginsMap().get(selectedPlug);
        statusPanel.setText(selectedPlug.getName());
        statusPanel.setIcon(panel.getIcon());
        CardLayout cl = (CardLayout)(plugsPanel.getLayout());
        cl.show(plugsPanel, selectedPlug.getName());    
        container.setFocusTraversalPolicy(panel.getFocusPolicy());
        container.setMainPanelPreferredSize(panel.getPreferredSize());
      }
    }
  }
View Full Code Here

          PlugInsLoader pluginsLoader = new PlugInsLoader(Configuration.getInstance().getPluginAbsolutePath());
          pluginsMap = pluginsLoader.loadPlugins();
     
      //Info panel
      JInfoPanel infoPanel = new JInfoPanel(pluginsMap);
      PluginDataModel infoDataModel = new PluginDataModel(infoPanel.getPluginName(), infoPanel.getVersion(), infoPanel.getPluginAuthor(), infoPanel.getClass().getName());
      mainPanel.add(infoPanel,infoPanel.getPluginName());
     
          //Settings panel
          JSettingsPanel settingsPanel = new JSettingsPanel();
      PluginDataModel settingsDataModel = new PluginDataModel(settingsPanel.getPluginName(), settingsPanel.getVersion(), settingsPanel.getPluginAuthor(), settingsPanel.getClass().getName());
      mainPanel.add(settingsPanel,settingsPanel.getPluginName());
     
          //sets main panel
          mainPanel.setPreferredSize(new Dimension(670,500));
          for(AbstractPlugablePanel instance: pluginsMap.values()){
View Full Code Here

TOP

Related Classes of org.pdfsam.guiclient.plugins.models.PluginDataModel

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.