private View createView(ViewComponentPlugin plugin) { View sv = new View(plugin, workspace); sv.pinned = true; return sv; }
private View createView(ViewComponentPlugin plugin) { View sv = new View(plugin, workspace); sv.pinned = true; return sv; }
private View createView(ViewComponentPlugin plugin) { View sv = new View(plugin, workspace); sv.pinned = true; return sv; }
public JComponent createComponent(Map<String, String> properties) { String pluginId = properties.get("pluginId"); ViewComponentPluginLoader loader = new ViewComponentPluginLoader(workspace); for (ViewComponentPlugin plugin : loader.getPlugins()) { if (plugin.getId().equals(pluginId)) { return new View(plugin, workspace); } } // we need to return a fully functioning view so that the close button works return new View(getEmptyPlugin(pluginId, "Couldn't load view plugin: " + pluginId), workspace); }
public JComponent createComponent(Map<String, String> properties) { String pluginId = properties.get("pluginId"); ViewComponentPluginLoader loader = new ViewComponentPluginLoader(workspace); for (ViewComponentPlugin plugin : loader.getPlugins()) { if (plugin.getId().equals(pluginId)) { return new View(plugin, workspace); } } // we need to return a fully functioning view so that the close button works return new View(getEmptyPlugin(pluginId, "Couldn't load view plugin: " + pluginId), workspace); }
public JComponent createComponent(Map<String, String> properties) { String pluginId = properties.get("pluginId"); ViewComponentPluginLoader loader = new ViewComponentPluginLoader(workspace); for (ViewComponentPlugin plugin : loader.getPlugins()) { if (plugin.getId().equals(pluginId)) { return new View(plugin, workspace); } } // we need to return a fully functioning view so that the close button works String msg = String.format( "<html><body>" + "<div style='font-weight: bold; padding-bottom: 20px;'>This view could not be loaded because its content is " + "provided by a view " + "plugin that could not be found.</div>" + "<div style='padding-bottom: 20px;'>" + "This problem may have been caused because the plugin is not installed or it may have been " + "caused by incompatible changes to the plugin in question.</div>" + "<div>Please check that the relevant plugin is installed. You can also try resetting " + "the tab to its default state to see if " + "this solves the issue.</div>" + "</body></html>" ); return new View(getEmptyPlugin(pluginId, msg), workspace); }
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; }
protected void createUI() { setLayout(new BorderLayout()); ViewComponentPlugin plugin = getViewComponentPlugin(); view = new View(plugin, editorKit.getWorkspace()); view.setPinned(true); view.setSyncronizing(false); view.createUI(); view.setShowViewBanner(false); add(view); setBorder(BorderFactory.createCompoundBorder(BorderFactory.createLineBorder(Color.LIGHT_GRAY), BorderFactory.createEmptyBorder(2, 2, 2, 2))); // only attach change listeners once the component is shown // (as those that use a view component are lazilly created) view.addHierarchyListener(new HierarchyListener(){ public void hierarchyChanged(HierarchyEvent event) { if (!registeredListener){ addSelectionListener(new ChangeListener(){ public void stateChanged(ChangeEvent event) { boolean valid = getSelectedObjects() != null && !getSelectedObjects().isEmpty(); for (InputVerificationStatusChangedListener l : validateListeners){ l.verifiedStatusChanged(valid); } isValid = valid; } }); registeredListener = true; } } }); }
protected void createUI() { setLayout(new BorderLayout()); ViewComponentPlugin plugin = getViewComponentPlugin(); view = new View(plugin, editorKit.getWorkspace()); view.setPinned(true); view.setSyncronizing(false); view.createUI(); view.setShowViewBanner(false); add(view); setBorder(BorderFactory.createCompoundBorder(BorderFactory.createLineBorder(Color.LIGHT_GRAY), BorderFactory.createEmptyBorder(2, 2, 2, 2))); // only attach change listeners once the component is shown // (as those that use a view component are lazilly created) view.addHierarchyListener(new HierarchyListener(){ public void hierarchyChanged(HierarchyEvent event) { if (!registeredListener){ addSelectionListener(new ChangeListener(){ public void stateChanged(ChangeEvent event) { boolean valid = getSelectedObjects() != null && !getSelectedObjects().isEmpty(); for (InputVerificationStatusChangedListener l : validateListeners){ l.verifiedStatusChanged(valid); } isValid = valid; } }); registeredListener = true; } } }); }
/** * Shows the view that is identified by the specified id. * @param viewId The id of the view to be shown. * @return The <code>View</code> that was shown. If the * <code>View</code> could not be shown then the return * value is <code>null</code>. */ public View showView(String viewId) { ViewComponentPlugin plugin = pluginMap.get(viewId); if (plugin == null) { return null; } // We need to get hold of the views tab Workspace ws = plugin.getWorkspace(); if (ws instanceof TabbedWorkspace) { WorkspaceTab tab = ((TabbedWorkspace) ws).getSelectedTab(); // if (tab instanceof WorkspaceViewsTab) { View view = new View(plugin, plugin.getWorkspace()); DynamicConfigPanel pan = new DynamicConfigPanel(tab); pan.setCurrentComponent(view, plugin.getLabel()); pan.activate(); // ((WorkspaceViewsTab) tab).getViewsPane().addView(view, plugin.getLabel()); // } } return null; } }
/** * Shows the view that is identified by the specified id. * @param viewId The id of the view to be shown. * @return The <code>View</code> that was shown. If the * <code>View</code> could not be shown then the return * value is <code>null</code>. */ public View showView(String viewId) { ViewComponentPlugin plugin = pluginMap.get(viewId); if (plugin == null) { return null; } // We need to get hold of the views tab Workspace ws = plugin.getWorkspace(); if (ws instanceof TabbedWorkspace) { WorkspaceTab tab = ((TabbedWorkspace) ws).getSelectedTab(); // if (tab instanceof WorkspaceViewsTab) { View view = new View(plugin, plugin.getWorkspace()); DynamicConfigPanel pan = new DynamicConfigPanel(tab); pan.setCurrentComponent(view, plugin.getLabel()); pan.activate(); // ((WorkspaceViewsTab) tab).getViewsPane().addView(view, plugin.getLabel()); // } } return null; } }
/** * Shows the view that is identified by the specified id. * @param viewId The id of the view to be shown. * @return The <code>View</code> that was shown. If the * <code>View</code> could not be shown then the return * value is <code>null</code>. */ public View showView(String viewId) { ViewComponentPlugin plugin = pluginMap.get(viewId); if (plugin == null) { return null; } // We need to get hold of the views tab Workspace ws = plugin.getWorkspace(); if (ws instanceof TabbedWorkspace) { WorkspaceTab tab = ((TabbedWorkspace) ws).getSelectedTab(); // if (tab instanceof WorkspaceViewsTab) { View view = new View(plugin, plugin.getWorkspace()); DynamicConfigPanel pan = new DynamicConfigPanel(tab); pan.setCurrentComponent(view, plugin.getLabel()); pan.activate(); // ((WorkspaceViewsTab) tab).getViewsPane().addView(view, plugin.getLabel()); // } } return null; } }
protected void createUI() { setLayout(new BorderLayout()); ViewComponentPlugin plugin = getViewComponentPlugin(); view = new View(plugin, editorKit.getWorkspace()); view.setPinned(true); view.setSyncronizing(false); view.createUI(); view.setShowViewBanner(false); add(view); // setBorder(BorderFactory.createCompoundBorder(BorderFactory.createLineBorder(Color.LIGHT_GRAY), // BorderFactory.createEmptyBorder(2, 2, 2, 2))); // only attach change listeners once the component is shown // (as those that use a view component are lazilly created) view.addHierarchyListener(event -> { if (!registeredListener){ addSelectionListener(e -> { boolean valid = getSelectedObjects() != null && !getSelectedObjects().isEmpty(); for (InputVerificationStatusChangedListener l : validateListeners){ l.verifiedStatusChanged(valid); } isValid = valid; }); registeredListener = true; } }); }
protected void createUI() { setLayout(new BorderLayout()); ViewComponentPlugin plugin = getViewComponentPlugin(); view = new View(plugin, editorKit.getWorkspace()); view.setPinned(true); view.setSyncronizing(false); view.createUI(); view.setShowViewBanner(false); add(view); // setBorder(BorderFactory.createCompoundBorder(BorderFactory.createLineBorder(Color.LIGHT_GRAY), // BorderFactory.createEmptyBorder(2, 2, 2, 2))); // only attach change listeners once the component is shown // (as those that use a view component are lazilly created) view.addHierarchyListener(event -> { if (!registeredListener){ addSelectionListener(e -> { boolean valid = getSelectedObjects() != null && !getSelectedObjects().isEmpty(); for (InputVerificationStatusChangedListener l : validateListeners){ l.verifiedStatusChanged(valid); } isValid = valid; }); registeredListener = true; } }); }
View view = new View(plugin, this); ViewComponent viewComponent = plugin.newInstance(); viewComponent.setup(plugin);
View view = new View(plugin, this); ViewComponent viewComponent = plugin.newInstance(); viewComponent.setup(plugin);