/** * Creates an instance of the plugin. It is expected that * this instance will be "setup", but the instance's * initialise method will not have been called in the instantiation * process. */ public ViewComponent newInstance() throws ClassNotFoundException, IllegalAccessException, InstantiationException { ExtensionInstantiator<ViewComponent> instantiator = new ExtensionInstantiator<>(extension); ViewComponent viewComponent = instantiator.instantiate(); viewComponent.setup(this); return viewComponent; } }
/** * Creates an instance of the plugin. It is expected that * this instance will be "setup", but the instance's * initialise method will not have been called in the instantiation * process. */ public ViewComponent newInstance() throws ClassNotFoundException, IllegalAccessException, InstantiationException { ExtensionInstantiator<ViewComponent> instantiator = new ExtensionInstantiator<ViewComponent>(extension); ViewComponent viewComponent = instantiator.instantiate(); viewComponent.setup(this); return viewComponent; } }
/** * Creates an instance of the plugin. It is expected that * this instance will be "setup", but the instance's * initialise method will not have been called in the instantiation * process. */ public ViewComponent newInstance() throws ClassNotFoundException, IllegalAccessException, InstantiationException { ExtensionInstantiator<ViewComponent> instantiator = new ExtensionInstantiator<ViewComponent>(extension); ViewComponent viewComponent = instantiator.instantiate(); viewComponent.setup(this); return viewComponent; } }
public View showResultsView(ViewComponentPlugin plugin, boolean replace, int location) { try { ViewHolder viewHolder; if (location == BOTTOM_RESULTS_VIEW) { viewHolder = bottomResultsViewHolder; } else { viewHolder = leftResultsViewHolder; } if (replace) { View v = viewHolder.getView(plugin.getId()); if (v != null) { v.closeView(); } } View view = new View(plugin, this); ViewComponent viewComponent = plugin.newInstance(); viewComponent.setup(plugin); viewHolder.addView(view); return view; } catch (ClassNotFoundException | IllegalAccessException | InstantiationException e) { logger.error("An error occurred whilst instantiating the results view: {}", e); } return null; }
viewComponent.setup(plugin); viewHolder.addView(view); return view;
viewComponent.setup(plugin); viewHolder.addView(view); return view;