Examples of SwitchLanguage


Examples of kameleon.gui.language.SwitchLanguage

  public void update()
      throws FileReadingException, UnknownKeyException {
    // Update the format icon
    if (this.model.selectionHasChanged()) {
      // Update the cursor
      SwitchLanguage sl = SwitchLanguage.getInstance() ;
     
      // Determine the new icon and tooltip
      String newTooltip = null ;
      ImageIcon newIcon  = null ;
      int cursorType = Cursor.HAND_CURSOR ;
      FileInfo currentFile = this.model.getSelectedFileInfo() ;
      PlugInInfo newAnalyzer = null ;
     
      boolean formatIsUnknown = true ;
      if (currentFile != null) {
        newAnalyzer = this.model.getAnalyzer(
            currentFile.getIdFormat()) ;
        formatIsUnknown = (newAnalyzer == null) ;
      }// if
     
      if (formatIsUnknown) {
        newTooltip = sl.getText(UNKNOWN_FORMAT) ;
        newIcon = UNKNOWN_FORMAT_IMAGE ;
        cursorType = Cursor.HAND_CURSOR ;
        this.currentAnalyzer = null ;
      } else {
        // A new icon has to be loaded
View Full Code Here

Examples of kameleon.gui.language.SwitchLanguage

   * @throws   UnknownKeyException
   *       if an error occurred while updating the text of this view
   */
  @Override
  public void reloadLanguage() throws UnknownKeyException {
    SwitchLanguage sl = SwitchLanguage.getInstance() ;
    TitledBorder border = (TitledBorder) this.getBorder() ;
    border.setTitle(sl.getText(FORMAT_TITLE_BORDER)) ;
    if (!this.model.fileIsSelected()
        || (this.model.getCurrentFileFormat() == null)) {
      this.formatIcon.setToolTipText(
          sl.getText(LanguageConstants.UNKNOWN_FORMAT)) ;
    }// if
  }// reloadLanguage()
View Full Code Here

Examples of kameleon.gui.language.SwitchLanguage

        Arrays.toString(this.plugInInfo.getExtensions())
          .replaceAll("[\\[\\]]", ""), //$NON-NLS-1$ //$NON-NLS-2$
        String.format("%s.kpl", this.plugInInfo.getJarName()) //$NON-NLS-1$
    } ;
   
    SwitchLanguage sl = SwitchLanguage.getInstance() ;
    int nRows = (textKeys.length == values.length) ?
        textKeys.length : -1 ;
    for(int row=0; row < nRows; ++row) {
      label = new JLabel(sl.getText(textKeys[row])) ;
      value = new JLabel(values[row]) ;
      value.setFont(valueFont) ;
     
      container.add(label) ;
      gridbagLayout.setConstraints(label, labelConstraints) ;
View Full Code Here

Examples of kameleon.gui.language.SwitchLanguage

   * @throws   UnknownKeyException
   *       if an error occurred while updating the text of this view
   */
  @Override
  public void update() throws UnknownKeyException {
    SwitchLanguage sl = SwitchLanguage.getInstance() ;
   
    if (this.model.fileIsSelected()) {
      this.fileName.setText(this.model.getSelectedFileInfo().getName()) ;
      this.fileName.setFont(this.PLAIN) ;
      String last = this.model.getFileLastGenerationDate() ;
      if (last == null) {
        this.lastModificationDate.setText(sl.getText(NEVER_GENERATED));
      } else {
        this.lastModificationDate.setText(last) ;
      }// if
      this.lastModificationDate.setFont(this.PLAIN) ;
    } else {
      this.fileName.setText(sl.getText(NO_FILE)) ;
      this.fileName.setFont(this.ITALIC) ;
      this.lastModificationDate.setText(sl.getText(NO_FILE)) ;
      this.lastModificationDate.setFont(this.ITALIC) ;
    }// if
   
    this.moreInfo.setEnabled(SelectionView.this.model.fileIsSelected()
        && (this.model.getSelectedFileInfo().getLastGeneration() != null)) ;
View Full Code Here

Examples of kameleon.gui.language.SwitchLanguage

   * @throws   UnknownKeyException
   *       if an error occurred while updating the text of this view
   */
  @Override
  public void reloadLanguage() throws UnknownKeyException {
    SwitchLanguage sl = SwitchLanguage.getInstance() ;
   
    this.setBorder(BorderFactory.createTitledBorder(
        sl.getText(SELECTION_TITLE_BORDER)));
    this.titleName.setText(sl.getText(NAME_LABEL)) ;
    this.dateTitle.setText(sl.getText(LAST_GENERATED)) ;
    this.encodingTitle.setText(sl.getText(CHARSET_SELECTION)) ;
    this.moreInfo.setToolTipText((sl.getText(MORE_INFO_BUTTON))) ;
    if (!this.model.fileIsSelected()) {
      this.lastModificationDate.setText(sl.getText(NO_FILE)) ;
      this.fileName.setText(sl.getText(NO_FILE)) ;
    } else {
      String last = this.model.getFileLastGenerationDate() ;
      if (last == null) {
        this.lastModificationDate.setText(sl.getText(NEVER_GENERATED)) ;
      } else {
        this.lastModificationDate.setText(last) ;
      }// if
    }// if
  }// reloadLanguage()
View Full Code Here

Examples of kameleon.gui.language.SwitchLanguage

   * @throws   UnknownKeyException
   *       if the new language file doesn't support a needed key
   */
  @Override
  public void reloadLanguage() throws UnknownKeyException {
    SwitchLanguage sl = SwitchLanguage.getInstance() ;
   
    // Disable only the menu item of the current language
    //TODO Add access to the previously selected language to boost efficiency
    GuiLanguage currentLang = sl.getCurrentLanguage() ;
    this.frenchLang.setEnabled(
        !GuiLanguage.FRENCH.equals(currentLang)) ;
    this.englishLang.setEnabled(
        !GuiLanguage.ENGLISH.equals(currentLang)) ;

    // Update displaeyd text
    this.settings.setText(sl.getText(CONFIGURATION_MENU)) ;
    this.settings.setToolTipText(
        sl.getText(CONFIGURATION_MENU_TOOLTIP)) ;

    this.languages.setText(sl.getText(LANGUAGE_SELECTION_MENU)) ;
    this.languages.setToolTipText(
        sl.getText(LANGUAGE_SELECTION_MENU_TOOLTIP)) ;

    this.frenchLang.setText(
        sl.getText(LANGUAGE_SELECTION_MENU_FR)) ;
   
    this.englishLang.setText(
        sl.getText(LANGUAGE_SELECTION_MENU_EN)) ;

    this.lookAndFeel.setText(sl.getText(LOOK_AND_FEEL_MENU)) ;

    this.plugIns.setText(sl.getText(TOOLS_MENU)) ;
    this.plugIns.setToolTipText(sl.getText(TOOLS_MENU_TOOLTIP)) ;

    this.deleteAnalyzer.setText(sl.getText(DELETE_ANALYZER_MENU)) ;
    this.deleteAnalyzer.setToolTipText(
        sl.getText(DELETE_ANALYZER_MENU_TOOLTIP)) ;

    this.deleteGenerator.setText(sl.getText(DELETE_GENERATOR_MENU)) ;
    this.deleteGenerator.setToolTipText(
        sl.getText(DELETE_GENERATOR_MENU_TOOLTIP)) ;
  }// reloadLanguage()
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.