Class ResourceChooser

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class ResourceChooser extends JPanel
Class for selecting from built-in resources. In many cases this shall be offered to the user as an alternative or additionally chosing a file from a local file system. CatalogByString serves as a data base, because internationalization is required anyhow.
We impose the following restrictions:
  • key is a concatenation of the String "resource" and a number. The resources are numbered sequentially (FIXME RAUS !!)
  • qi is an url to the original web ("I"nternet) resource
  • qf is the file name, ie. the path of the resource in the jar file relative to a known class.
Currently the lanugage is FIXED when calling populate(CatalogByString,String), and only one(1) language is displayed.
Currently for executing the selection pane, use GenericDialog.
See Also:
  • Field Details

  • Constructor Details

    • ResourceChooser

      public ResourceChooser(String name, MessageReceiver<SimpleMessage> msg)
      Create a new instance
      Parameters:
      name - CURRENTLY IGNORED
      msg - for signalling problems with the data base
  • Method Details

    • catalogError

      protected void catalogError(String e)
      When the catalog file cannot be parsed.
    • populate

      public void populate(CatalogByString data, String lang)
      Update the data and select the language.
    • addentry

      protected void addentry(int num)
      Adds a new entry to the gui pane.
      The number is converted to a key to the muli catalog data.
      The translation is presented graphically, together with the "original web source", if any.
      The file name ist stored to button2filenames for later retrieval. Initially, the very first button is selected.
    • getSelectedFilePath

      protected String getSelectedFilePath()
      Return the file name currently selected (or null). Uses button2filenames