Package Framework

Examples of Framework.MsgCatalog


      // widget based on the message catalog
      // TF:Mar 8, 2010:Re-used methods to reduce dependency on hard-coded strings
      int msgNum = getMsgNumber(comp);
      int msgSet = getMsgSet(comp);
      if (msgNum > 0 && msgSet > 0) {
        MsgCatalog catalog = MsgCatalog.getInstance();
        if (catalog != null) {
          if (comp instanceof JTextComponent) {
            TextData value = TextValue.get((JTextComponent)comp);
            String text = catalog.getString(msgSet, msgNum, value == null ? null : value.toString());
            TextValue.set((JTextComponent)comp, text);
          }
          else if (comp instanceof JLabel) {
            TextData value = TextValue.get((JLabel)comp);
            String text = catalog.getString(msgSet, msgNum, value == null ? null : value.toString());
            TextValue.set((JLabel)comp, text);
          }
          else if (comp instanceof JMenuItem) {
            TextData value = MenuText.get((JMenuItem)comp);
            String text = catalog.getString(msgSet, msgNum, value == null ? null : value.toString());
            MenuText.set((JMenuItem)comp, text);
          }
          else if (comp instanceof JButton) {
            TextData value = TextValue.get((JButton)comp);
            String text = catalog.getString(msgSet, msgNum, value == null ? null : value.toString());
            TextValue.set((JButton)comp, text);
          }
          //PM:24/4/08 added support for Panel and GridField
          else if (comp instanceof Panel) {
            TextData value = Caption.get((Panel)comp);
            String text = catalog.getString(msgSet, msgNum, value == null ? null : value.toString());
            Caption.set((Panel)comp, text);
          }
          else if (comp instanceof GridField) {
            TextData value = Caption.get((GridField)comp);
            String text = catalog.getString(msgSet, msgNum, value == null ? null : value.toString());
            Caption.set((GridField)comp, text);
          }
          // CraigM:28/04/2008: Added support for check boxes
          else if (comp instanceof JCheckBox) {
            String value = ((JCheckBox)comp).getText();
            String text = catalog.getString(msgSet, msgNum, value);
            ((JCheckBox)comp).setText(text);
          }
          // TF:26/06/2008:Added support for radio lists
          else if (comp instanceof JCheckBox) {
            String value = ((JCheckBox)comp).getText();
            String text = catalog.getString(msgSet, msgNum, value);
            ((JCheckBox)comp).setText(text);
          }
        }
      }
        //PM:2/5/08
View Full Code Here


     * @param comp
     * @param msgSet
     */
    public static void reloadTitle(JFrame frame, int titleSet, int titleNum) {
      if (titleSet != 0 && titleNum != 0) {
        MsgCatalog catalog = MsgCatalog.getInstance();
        if (catalog != null) {
          String value = frame.getTitle();
          String text = catalog.getString(titleSet, titleNum, value);
          frame.setTitle(text);
        }
      }
    }
View Full Code Here

    public String getCurrentLocale() {
        return this.currentLocale;
    }

    public void setExpressMsgCatalog(MsgCatalog expressMsgCatalog) {
        MsgCatalog oldValue = this.expressMsgCatalog;
        this.expressMsgCatalog = expressMsgCatalog;
        this.qq_Listeners.firePropertyChange("expressMsgCatalog", oldValue, this.expressMsgCatalog);
    }
View Full Code Here

      // widget based on the message catalog
      // TF:Mar 8, 2010:Re-used methods to reduce dependency on hard-coded strings
      int msgNum = getMsgNumber(comp);
      int msgSet = getMsgSet(comp);
      if (msgNum > 0 && msgSet > 0) {
        MsgCatalog catalog = MsgCatalog.getInstance();
        if (catalog != null) {
          if (comp instanceof JTextComponent) {
            TextData value = TextValue.get((JTextComponent)comp);
            String text = catalog.getString(msgSet, msgNum, value == null ? null : value.toString());
            TextValue.set((JTextComponent)comp, text);
          }
          else if (comp instanceof JLabel) {
            TextData value = TextValue.get((JLabel)comp);
            String text = catalog.getString(msgSet, msgNum, value == null ? null : value.toString());
            TextValue.set((JLabel)comp, text);
          }
          else if (comp instanceof JMenuItem) {
            TextData value = MenuText.get((JMenuItem)comp);
            String text = catalog.getString(msgSet, msgNum, value == null ? null : value.toString());
            MenuText.set((JMenuItem)comp, text);
          }
          else if (comp instanceof JButton) {
            TextData value = TextValue.get((JButton)comp);
            String text = catalog.getString(msgSet, msgNum, value == null ? null : value.toString());
            TextValue.set((JButton)comp, text);
          }
          //PM:24/4/08 added support for Panel and GridField
          else if (comp instanceof Panel) {
            TextData value = Caption.get((Panel)comp);
            String text = catalog.getString(msgSet, msgNum, value == null ? null : value.toString());
            Caption.set((Panel)comp, text);
          }
          else if (comp instanceof GridField) {
            TextData value = Caption.get((GridField)comp);
            String text = catalog.getString(msgSet, msgNum, value == null ? null : value.toString());
            Caption.set((GridField)comp, text);
          }
          // CraigM:28/04/2008: Added support for check boxes
          else if (comp instanceof JCheckBox) {
            String value = ((JCheckBox)comp).getText();
            String text = catalog.getString(msgSet, msgNum, value);
            ((JCheckBox)comp).setText(text);
          }
          // TF:26/06/2008:Added support for radio lists
          else if (comp instanceof JCheckBox) {
            String value = ((JCheckBox)comp).getText();
            String text = catalog.getString(msgSet, msgNum, value);
            ((JCheckBox)comp).setText(text);
          }
        }
      }
        //PM:2/5/08
View Full Code Here

     * @param comp
     * @param msgSet
     */
    public static void reloadTitle(JFrame frame, int titleSet, int titleNum) {
      if (titleSet != 0 && titleNum != 0) {
        MsgCatalog catalog = MsgCatalog.getInstance();
        if (catalog != null) {
          String value = frame.getTitle();
          String text = catalog.getString(titleSet, titleNum, value);
          frame.setTitle(text);
        }
      }
    }
View Full Code Here

    public String getCurrentLocale() {
        return this.currentLocale;
    }

    public void setExpressMsgCatalog(MsgCatalog expressMsgCatalog) {
        MsgCatalog oldValue = this.expressMsgCatalog;
        this.expressMsgCatalog = expressMsgCatalog;
        this.qq_Listeners.firePropertyChange("expressMsgCatalog", oldValue, this.expressMsgCatalog);
    }
View Full Code Here

TOP

Related Classes of Framework.MsgCatalog

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.