/** * Tests to see whether the holder contains a view * with a particular id. * @param id The id of the view to test for. * @return <code>true</code> if the holder contains the view, * or <code>false</code> if the holder does not contain the * view. */ public boolean containsView(String id) { return getView(id) != null; }
public ViewHolder(String id, String loc, JSplitPane sp) { this.loc = loc; this.splitPane = sp; setLayout(new BorderLayout()); //setMinimumSize(new Dimension(5, 5)); addContainerListener(new ContainerListener() { public void componentAdded(ContainerEvent e) { if (getComponentCount() == 1) { splitPane.add(ViewHolder.this, ViewHolder.this.loc); } } public void componentRemoved(ContainerEvent e) { if (getComponentCount() == 0) { splitPane.remove(ViewHolder.this); } } }); createHolder(); setBorder(BorderFactory.createCompoundBorder(BorderFactory.createMatteBorder(1, 1, 1, 1, Color.LIGHT_GRAY), BorderFactory.createEmptyBorder(2, 2, 2, 2))); }
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; }
public void componentAdded(ContainerEvent e) { if (getComponentCount() == 1) { splitPane.add(ViewHolder.this, ViewHolder.this.loc); } }
public void componentRemoved(ContainerEvent e) { if (tabbedHolder.getComponentCount() == 0) { ViewHolder.this.remove(tabbedHolder); } } });
public void componentAdded(ContainerEvent e) { if (tabbedHolder.getComponentCount() == 1) { ViewHolder.this.add(tabbedHolder); } }
public ViewHolder(String id, String loc, JSplitPane sp) { this.loc = loc; this.splitPane = sp; setLayout(new BorderLayout()); //setMinimumSize(new Dimension(5, 5)); addContainerListener(new ContainerListener() { public void componentAdded(ContainerEvent e) { if (getComponentCount() == 1) { splitPane.add(ViewHolder.this, ViewHolder.this.loc); } } public void componentRemoved(ContainerEvent e) { if (getComponentCount() == 0) { splitPane.remove(ViewHolder.this); } } }); createHolder(); setBorder(BorderFactory.createCompoundBorder(BorderFactory.createMatteBorder(1, 1, 1, 1, Color.LIGHT_GRAY), BorderFactory.createEmptyBorder(2, 2, 2, 2))); }
public void componentRemoved(ContainerEvent e) { if (getComponentCount() == 0) { splitPane.remove(ViewHolder.this); } } });
public void componentRemoved(ContainerEvent e) { if (tabbedHolder.getComponentCount() == 0) { ViewHolder.this.remove(tabbedHolder); } } });
public void componentAdded(ContainerEvent e) { if (tabbedHolder.getComponentCount() == 1) { ViewHolder.this.add(tabbedHolder); } }
public ViewHolder(String id, String loc, JSplitPane sp) { this.loc = loc; this.splitPane = sp; setLayout(new BorderLayout()); //setMinimumSize(new Dimension(5, 5)); addContainerListener(new ContainerListener() { public void componentAdded(ContainerEvent e) { if (getComponentCount() == 1) { splitPane.add(ViewHolder.this, ViewHolder.this.loc); } } public void componentRemoved(ContainerEvent e) { if (getComponentCount() == 0) { splitPane.remove(ViewHolder.this); } } }); createHolder(); setBorder(BorderFactory.createCompoundBorder(BorderFactory.createMatteBorder(1, 1, 1, 1, Color.LIGHT_GRAY), BorderFactory.createEmptyBorder(2, 2, 2, 2))); }
/** * Tests to see whether the holder contains a view * with a particular id. * @param id The id of the view to test for. * @return <code>true</code> if the holder contains the view, * or <code>false</code> if the holder does not contain the * view. */ public boolean containsView(String id) { return getView(id) != null; }
public void componentAdded(ContainerEvent e) { if (getComponentCount() == 1) { splitPane.add(ViewHolder.this, ViewHolder.this.loc); } }
public void componentRemoved(ContainerEvent e) { if (tabbedHolder.getComponentCount() == 0) { ViewHolder.this.remove(tabbedHolder); } } });