Adds a plugin tool to the first available toolbar slot, or to the last slot if the toolbar is full.
(PlugInTool tool)
| 1953 | /** Adds a plugin tool to the first available toolbar slot, |
| 1954 | or to the last slot if the toolbar is full. */ |
| 1955 | public static void addPlugInTool(PlugInTool tool) { |
| 1956 | if (instance==null) return; |
| 1957 | String nameAndIcon = tool.getToolName()+" - "+tool.getToolIcon(); |
| 1958 | instance.addingSingleTool = true; |
| 1959 | int id = instance.addTool(nameAndIcon); |
| 1960 | instance.addingSingleTool = false; |
| 1961 | if (id!=-1) { |
| 1962 | instance.tools[id] = tool; |
| 1963 | if (instance.menus[id]!=null) |
| 1964 | instance.menus[id].removeAll(); |
| 1965 | instance.repaintTool(id); |
| 1966 | if (!instance.installingStartupTool) |
| 1967 | instance.setTool(id); |
| 1968 | else |
| 1969 | instance.installingStartupTool = false; |
| 1970 | instance.setPrefs(id); |
| 1971 | } |
| 1972 | } |
| 1973 | |
| 1974 | public static PlugInTool getPlugInTool() { |
| 1975 | PlugInTool tool = null; |
no test coverage detected