Class CustomView

java.lang.Object
org.eclipse.core.commands.common.EventManager
org.eclipse.ui.part.WorkbenchPart
org.eclipse.ui.part.ViewPart
com.eco.bio7.collection.CustomView
All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable, org.eclipse.core.runtime.IExecutableExtension, org.eclipse.ui.IPersistable, org.eclipse.ui.IViewPart, org.eclipse.ui.IWorkbenchPart, org.eclipse.ui.IWorkbenchPart2, org.eclipse.ui.IWorkbenchPart3, org.eclipse.ui.part.IWorkbenchPartOrientation

public class CustomView extends org.eclipse.ui.part.ViewPart
This class provides some static methods for the creation of custom views inside the Bio7 application.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected org.eclipse.ui.IViewPart
     
    protected int
     
    protected boolean
     

    Fields inherited from interface org.eclipse.ui.IWorkbenchPart

    PROP_TITLE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    createPartControl(org.eclipse.swt.widgets.Composite parent)
     
    org.eclipse.swt.widgets.Composite
    Returns a SWT composite and creates a custom view with a tab.
    org.eclipse.swt.widgets.Composite
    getComposite(String id, org.eclipse.swt.graphics.Image image)
    Returns a SWT composite and creates a custom view with a tab.
    protected org.eclipse.swt.widgets.Composite
     
    static org.eclipse.swt.widgets.Display
    Returns the display of the view.
    org.eclipse.draw2d.LightweightSystem
    Returns a Draw2d LightweightSystem and creates a custom view with a tab.
    org.eclipse.draw2d.LightweightSystem
    getDraw2d(String id, org.eclipse.swt.graphics.Image image)
    Returns a Draw2d LightweightSystem and creates a custom view with a tab.
    boolean
    Returns true if the view is displayed in fullscreen mode.
    boolean
    Returns true if the view can be displayed in fullscreen mode.
    protected void
     
    protected void
    setCustomViewParent(org.eclipse.swt.widgets.Composite parent2)
     
    void
     
    void
    setFullscreen(boolean fullscreen)
    Displays the view in fullscreen mode or returns to the view.
    void
    setFullscreen(int monitor)
    Displays the view in fullscreen mode on the given monitor or moves the fullscreen mode to the monitor.
    void
    setFullscreenEnabled(boolean enabled)
    Enables or disables the fullscreen mode of this view (the tool bar action and the keys F2 to F5), e.g., for a view with a tool window (UI thread).
    void
    setPanel(Panel panel, String id)
    Creates a given Panel tab inside a custom view.
    void
    setPanel(Panel panel, String id, org.eclipse.swt.graphics.Image image)
    Creates a given Panel tab inside a custom view.
    void
    setPanel(JPanel jpanel, String id)
    Creates a given JPanel tab inside a custom view.
    void
    setPanel(JPanel jpanel, String id, org.eclipse.swt.graphics.Image image)
    Creates a given JPanel tab inside a custom view.
    void
    setSingleView(boolean singleView)
     

    Methods inherited from class org.eclipse.ui.part.ViewPart

    checkSite, getViewSite, init, init, saveState, setContentDescription, setInitializationData, setPartName

    Methods inherited from class org.eclipse.ui.part.WorkbenchPart

    addPartPropertyListener, addPropertyListener, dispose, firePartPropertyChanged, firePropertyChange, getAdapter, getConfigurationElement, getContentDescription, getDefaultImage, getOrientation, getPartName, getPartProperties, getPartProperty, getSite, getTitle, getTitleImage, getTitleToolTip, removePartPropertyListener, removePropertyListener, setPartProperty, setSite, setTitle, setTitleImage, setTitleToolTip, showBusy

    Methods inherited from class org.eclipse.core.commands.common.EventManager

    addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • insertMark

      protected int insertMark
    • activated

      protected org.eclipse.ui.IViewPart activated
    • singleView

      protected boolean singleView
  • Constructor Details

    • CustomView

      public CustomView()
    • CustomView

      public CustomView(String name)
  • Method Details

    • createPartControl

      public void createPartControl(org.eclipse.swt.widgets.Composite parent)
      Specified by:
      createPartControl in interface org.eclipse.ui.IWorkbenchPart
      Specified by:
      createPartControl in class org.eclipse.ui.part.WorkbenchPart
    • setFullscreenEnabled

      public void setFullscreenEnabled(boolean enabled)
      Enables or disables the fullscreen mode of this view (the tool bar action and the keys F2 to F5), e.g., for a view with a tool window (UI thread).
    • isFullscreenEnabled

      public boolean isFullscreenEnabled()
      Returns true if the view can be displayed in fullscreen mode.
    • setFocus

      public void setFocus()
      Specified by:
      setFocus in interface org.eclipse.ui.IWorkbenchPart
      Specified by:
      setFocus in class org.eclipse.ui.part.WorkbenchPart
    • setPanel

      public void setPanel(JPanel jpanel, String id)
      Creates a given JPanel tab inside a custom view.
      Parameters:
      jpanel - a JPanel
      id - the id and name of the tab.
    • setPanel

      public void setPanel(JPanel jpanel, String id, org.eclipse.swt.graphics.Image image)
      Creates a given JPanel tab inside a custom view.
      Parameters:
      jpanel - a JPanel
      id - the id and name of the tab.
      image - the image of the tab.
    • setPanel

      public void setPanel(Panel panel, String id)
      Creates a given Panel tab inside a custom view.
      Parameters:
      panel - a Panel
      id - the id and name of the tab.
    • setPanel

      public void setPanel(Panel panel, String id, org.eclipse.swt.graphics.Image image)
      Creates a given Panel tab inside a custom view.
      Parameters:
      panel - a Panel
      id - the id and name of the tab.
      image - the image of the tab.
    • getComposite

      public org.eclipse.swt.widgets.Composite getComposite(String id)
      Returns a SWT composite and creates a custom view with a tab.
      Parameters:
      id - the id and name of the tab.
      Returns:
      a swt composite.
    • getComposite

      public org.eclipse.swt.widgets.Composite getComposite(String id, org.eclipse.swt.graphics.Image image)
      Returns a SWT composite and creates a custom view with a tab.
      Parameters:
      id - the id and name of the tab.
      image - the image of the tab.
      Returns:
      a swt composite.
    • getDraw2d

      public org.eclipse.draw2d.LightweightSystem getDraw2d(String id)
      Returns a Draw2d LightweightSystem and creates a custom view with a tab.
      Parameters:
      id - the id and name of the tab.
      Returns:
      a LightweightSystem component.
    • getDraw2d

      public org.eclipse.draw2d.LightweightSystem getDraw2d(String id, org.eclipse.swt.graphics.Image image)
      Returns a Draw2d LightweightSystem and creates a custom view with a tab.
      Parameters:
      id - the id and name of the tab.
      image - the image of the tab.
      Returns:
      a LightweightSystem component.
    • getDisplay

      public static org.eclipse.swt.widgets.Display getDisplay()
      Returns the display of the view.
      Returns:
      the display of the view.
    • setAwtCurrent

      protected void setAwtCurrent(Panel current)
    • getCustomViewParent

      protected org.eclipse.swt.widgets.Composite getCustomViewParent()
    • setCustomViewParent

      protected void setCustomViewParent(org.eclipse.swt.widgets.Composite parent2)
    • setFullscreen

      public void setFullscreen(boolean fullscreen)
      Displays the view in fullscreen mode or returns to the view. Several views can be displayed in fullscreen mode, one per monitor (another view on the monitor is replaced). The fullscreen mode can also be toggled with the F2 key and closed with the ESC key.
      Parameters:
      fullscreen - true to display the view in fullscreen mode.
    • setFullscreen

      public void setFullscreen(int monitor)
      Displays the view in fullscreen mode on the given monitor or moves the fullscreen mode to the monitor. The monitors are numbered with the primary monitor first (0: primary, 1: secondary, 2: tertiary monitor, etc.). If the monitor is not available the view is displayed on the monitor of the view.
      Parameters:
      monitor - the index of the monitor.
    • isFullscreen

      public boolean isFullscreen()
      Returns true if the view is displayed in fullscreen mode.
      Returns:
      true if the view is displayed in fullscreen mode.
    • setSingleView

      public void setSingleView(boolean singleView)