Class MainWindow

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants

public class MainWindow extends JFrame
See Also:
  • Field Details

  • Method Details

    • getInstance

      public static MainWindow getInstance()
      Get the application main window instance.
      Returns:
      MainWindow of the application.
    • getRibbon

      public Ribbon getRibbon()
      Gets the application ribbon to interact with
      Returns:
      the Ribbon of the application
    • getSchemaExcplorerPanel

      public SchemaExplorerPanel getSchemaExcplorerPanel()
    • hasOneEditorNamed

      public boolean hasOneEditorNamed(String title)
      Searches for the given title and returns trus if it finds at leat one in the editor tabs.
      Parameters:
      title - the title we want to check it is existing in the editor abs
      Returns:
      true isf the editor tabs have one given title, false if not found.
    • setSelectedEditor

      public void setSelectedEditor(String title)
      Selects the first editor tab whose title is equals to the given title. Does nothing if title is not found.
      Parameters:
      title - the title for tab component when want to select
    • addNewEditorTab

      public void addNewEditorTab(JComponent comp, String title)
      Add a new tab in the editor's area with the provided components and title to display.
      Parameters:
      comp - the component to display in the editors tab
      title - the tab title
    • removeCurrentEditorTab

      public void removeCurrentEditorTab()
      Removes the current editor tab. If no selection then does nothing.
    • setEditorTabTitle

      public void setEditorTabTitle(JComponent comp, String title)
      Defines the title of the given editor component. It searches for the component in the editor tabs and set the title for the first encountered. If not found does nothing.
      Parameters:
      comp - the Component in the editor tabs when want to set the title for the tab.
      title - title to set.
    • getCurrentEditorTabComponent

      public Component getCurrentEditorTabComponent()
      Get the component of the currently selected editor tab
      Returns:
      Component instance of the current editor tab, and null if none selected
    • getEditorTabIndexOf

      public int getEditorTabIndexOf(String title, boolean autoSelect)
      Returns the index of the first editor tab with given title. Can be selected automatically if found.
      Parameters:
      title - the title with search for an editor
      autoSelect - set to true to select the found editor if any
      Returns:
      index of the editor whose title is equals to the given one and -1 if not found