001/* 002 * Copyright 2010, 2011 Institut Pasteur. 003 * 004 * This file is part of ICY. 005 * 006 * ICY is free software: you can redistribute it and/or modify 007 * it under the terms of the GNU General Public License as published by 008 * the Free Software Foundation, either version 3 of the License, or 009 * (at your option) any later version. 010 * 011 * ICY is distributed in the hope that it will be useful, 012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 014 * GNU General Public License for more details. 015 * 016 * You should have received a copy of the GNU General Public License 017 * along with ICY. If not, see <http://www.gnu.org/licenses/>. 018 */ 019package plugins.tutorial.basics; 020 021import icy.gui.frame.progress.AnnounceFrame; 022import icy.plugin.PluginDescriptor; 023import icy.plugin.PluginLoader; 024import icy.plugin.abstract_.PluginActionable; 025 026/** 027 * This tutorial displays the registered plugins ( installed and recognized plugins in ICY ). 028 * It uses the PluginLoader and the PluginDescriptor classes. 029 * The display is in the stdio. 030 * 031 * @author Fabrice de Chaumont 032 * @author Stephane Dallongeville 033 */ 034public class ListOfRegisteredPlugins extends PluginActionable 035{ 036 @Override 037 public void run() 038 { 039 new AnnounceFrame( 040 "This plugin display infos about presents plugins and display it in the output tab (or console)."); 041 042 // Loop over all registered plugins ( recognized at startup ) 043 for (PluginDescriptor pluginDescriptor : PluginLoader.getPlugins()) 044 { 045 // output the name and the author in the console ( visible in the output tab of the 046 // inspector ) 047 System.out.println("Name: " + pluginDescriptor.getName() + " Version: " + pluginDescriptor.getVersion()); 048 System.out.println(" Author: " + pluginDescriptor.getAuthor()); 049 050 // pluginDescriptor contains a lot of infos about plugins, you can check for update, 051 // look for dependencies, get 052 // the beta version, full changelog, icons, description , author email, url, web link 053 // (...). 054 } 055 } 056}