Module cli

Class CLIWindowSupport

java.lang.Object
de.grogra.cli.ui.CLIPanelSupport
de.grogra.cli.ui.CLIWindowSupport
All Implemented Interfaces:
ExecutableComponent, RegistryContext, Context, Panel, Synchronizer.Callback, Window, Disposable

public class CLIWindowSupport extends CLIPanelSupport implements Window
  • Constructor Details

  • Method Details

    • addPanel

      public void addPanel(Panel p)
    • removePanel

      public void removePanel(int panelId)
    • removePanel

      public void removePanel(String panelId)
    • getPanelNb

      public int getPanelNb(String panelId)
    • consoleWrite

      public void consoleWrite(ComponentWrapper c)
      Push content into the frame (which is a CLITextComponent) Only take String for now
    • consoleWrite

      public void consoleWrite(String s)
    • getContent

      public ComponentWrapper getContent()
      Return the frame of the windows, which is a CLITextComponent for the CLIWindowSupport to display output text
      Specified by:
      getContent in interface Panel
      Overrides:
      getContent in class CLIPanelSupport
    • setCursor

      public void setCursor(int cursor)
      Specified by:
      setCursor in interface Panel
      Overrides:
      setCursor in class CLIPanelSupport
    • getWindow

      public Window getWindow()
      Description copied from interface: Context
      Determines the window of this GUI context.
      Specified by:
      getWindow in interface Context
      Overrides:
      getWindow in class CLIPanelSupport
      Returns:
      this context's window
    • getWorkbench

      public Workbench getWorkbench()
      Description copied from interface: Context
      Determines the workbench of this GUI context.
      Specified by:
      getWorkbench in interface Context
      Specified by:
      getWorkbench in interface Window
      Overrides:
      getWorkbench in class CLIPanelSupport
      Returns:
      this context's workbench
    • initializeWorkbench

      public void initializeWorkbench(Workbench workbench)
      Specified by:
      initializeWorkbench in interface Window
    • isVisible

      public boolean isVisible()
      Check if the window is currently displayed (i.e. if its workbench is currently selected) The components also have a visible parameter (get with getVisible() ).
      Specified by:
      isVisible in interface Window
    • getPanels

      public Panel[] getPanels(ObjectToBoolean<Panel> filter)
      Get all the open panels managed by this window.
      Specified by:
      getPanels in interface Window
    • getPanel

      public Panel getPanel(String panelId)
      Get a Panel managed by this window (it has be be opened) from its ID. It open the panel (i.e. commands are now pushed into the panel until it is closed or hided)
      Specified by:
      getPanel in interface Window
    • disposeImpl

      protected void disposeImpl()
      Overrides:
      disposeImpl in class CLIPanelSupport
    • setLayout

      public void setLayout(Layout layout, Map params)
      Specified by:
      setLayout in interface Window
    • getLayout

      public Layout getLayout()
      Specified by:
      getLayout in interface Window
    • setMenuVisibility

      public void setMenuVisibility(boolean value)
      Specified by:
      setMenuVisibility in interface Window
    • chooseFile

      public FileChooserResult chooseFile(String title, File directory, FileFilter[] filters, int type, boolean mustExist, FileFilter selectedFilter)
      Create a "dialog" (a request in the terminal) to get a path to a file.
      Specified by:
      chooseFile in interface Window
      Parameters:
      title - : the message displayed
      directory - : the base directory for the path
      filters - : the list of accepted filters for the file type
      type - : possible types from @link de.grogra.pf.ui.Window types: OPEN_FILE = 0; ADD_FILE = 1; SAVE_FILE = 2;
      mustExist - : the existance of the file is tested if true and return an error if its not the case.
      selectedfilter - : ?? Never used in GroIMP (always set as null) probably the default filter selected in the dialog
      Returns:
    • showChoiceDialog

      public int showChoiceDialog(String title, I18NBundle bundle, String keyBase, String[] options)
      Create a dialog where one of the options get selected. The option selected return its index in the options param.
      Specified by:
      showChoiceDialog in interface Window
      Parameters:
      title - not used here
      bundle - : a bundle from which to load text
      keyBase - : the key from the bundle to the message displayed
      options - : an array of options for the user to pick from.
    • showDialog

      public int showDialog(String title, Object message, int type)
      Specified by:
      showDialog in interface Window
    • showInputDialog

      public String showInputDialog(String title, Object message, String initial)
      Specified by:
      showInputDialog in interface Window
    • showWaitMessage

      public Disposable showWaitMessage(String toComplete)
      Specified by:
      showWaitMessage in interface Window
    • chooseDirectory

      public FileChooserResult chooseDirectory(String title, File directory, int type, boolean mustExist)
      Specified by:
      chooseDirectory in interface Window