예제 #1
0
  private void makeLanguageMenu() {
    final int languageAmount = 2;
    languageItems = new JMenuItem[languageAmount];
    languageItems[0] =
        new JMenuItem(InternationalMessages.getString("ZTerm.Language_English_Item"));
    languageItems[0].setToolTipText(
        InternationalMessages.getString("ZTerm.Language_English_ToolTip"));
    languageItems[0].addActionListener(actionController);
    languageItems[1] =
        new JMenuItem(InternationalMessages.getString("ZTerm.Language_TraditionalChinese_Item"));
    languageItems[1].setToolTipText(
        InternationalMessages.getString("ZTerm.Language_TraditionalChinese_ToolTip"));
    languageItems[1].addActionListener(actionController);

    for (int i = 0; i < languageItems.length; i++) {
      languageMenu.add(languageItems[i]);
    }
  }
예제 #2
0
  /** Close current tab which is showing on the screen. */
  public void closeCurrentTab() {
    final SessionPane session = getCurrentSession();

    if (session != null) {

      // 連線中則詢問是否要斷線
      if (!session.isClosed()) {
        if (model.showConfirm(
                InternationalMessages.getString("ZTerm.Message_Confirm_Close"),
                InternationalMessages.getString("ZTerm.Title_Confirm_Close"),
                JOptionPane.YES_NO_OPTION)
            != JOptionPane.YES_OPTION) { // $NON-NLS-1$ //$NON-NLS-2$
          return;
        }

        // 通知 session 要中斷連線了
        session.close(false);

        if (!resource.getBooleanValue(Resource.REMOVE_MANUAL_DISCONNECT)) {
          return;
        }
      }

      // 通知 session 要被移除了
      session.remove();

      tabbedPane.remove(session);
      model.getSessions().remove(session);

      // 刪除分頁會影響分頁編號
      model.updateTabTitle();

      // 讓現在被選取的分頁取得 focus.
      model.updateTab();
    }
  }
예제 #3
0
 public void updateText() {
   fileMenu.setText(InternationalMessages.getString("ZTerm.Connect_Menu_Text")); // $NON-NLS-1$
   languageMenu.setText("Language");
   languageMenu.setToolTipText("Change your language");
   historyMenu.setText(InternationalMessages.getString("ZTerm.Site_Menu_Text"));
   viewMenu.setText(InternationalMessages.getString("ZTerm.View_Menu_Text")); // $NON-NLS-1$
   historyMenu.setText(InternationalMessages.getString("ZTerm.History_Menu_Text")); // $NON-NLS-1$
   editMenu.setText(InternationalMessages.getString("ZTerm.Edit_Menu_Text")); // $NON-NLS-1$
   toolsMenu.setText(InternationalMessages.getString("ZTerm.Option_Menu_Text")); // $NON-NLS-1$
   helpMenu.setText(InternationalMessages.getString("ZTerm.Help_Menu_Text")); // $NON-NLS-1$
   encodingMenu.setText(
       InternationalMessages.getString("ZTerm.Encoding_Menu_Text")); // $NON-NLS-1$
   openItem.setText(InternationalMessages.getString("ZTerm.Open_MenuItem_Text")); // $NON-NLS-1$
   closeItem.setText(InternationalMessages.getString("ZTerm.Close_MenuItem_Text")); // $NON-NLS-1$
   reopenItem.setText(InternationalMessages.getString("ZTerm.Reopen_Item_Text")); // $NON-NLS-1$
   copyItem.setText(InternationalMessages.getString("ZTerm.Copy_MenuItem_Text")); // $NON-NLS-1$
   pasteItem.setText(InternationalMessages.getString("ZTerm.Paste_MenuItem_Text")); // $NON-NLS-1$
   colorCopyItem.setText(
       InternationalMessages.getString("ZTerm.ColorCopy_MenuItem_Text")); // $NON-NLS-1$
   colorPasteItem.setText(
       InternationalMessages.getString("ZTerm.ColorPaste_MenuItem_Text")); // $NON-NLS-1$
   preferenceItem.setText(
       InternationalMessages.getString("ZTerm.Preference_MenuItem_Text")); // $NON-NLS-1$
   siteManagerItem.setText(
       InternationalMessages.getString("ZTerm.SiteManager_MenuItem_Text")); // $NON-NLS-1$
   usageItem.setText(InternationalMessages.getString("ZTerm.Usage_MenuItem_Text")); // $NON-NLS-1$
   faqItem.setText(InternationalMessages.getString("ZTerm.FAQ_MenuItem_Text")); // $NON-NLS-1$
   aboutItem.setText(InternationalMessages.getString("ZTerm.About_MenuItem_Text")); // $NON-NLS-1$
   big5Item.setText(InternationalMessages.getString("ZTerm.Big5_MenuItem_Text")); // $NON-NLS-1$
   utf8Item.setText(InternationalMessages.getString("ZTerm.UTF8_MenuItem_Text")); // $NON-NLS-1$
   hideMenuBarItem.setText(
       InternationalMessages.getString("ZTerm.HideMenuBar_MenuItem_Text")); // $NON-NLS-1$
   showMenuBarItem.setText(
       InternationalMessages.getString("ZTerm.ShowMenuBar_MenuItem_Text")); // $NON-NLS-1$
   popupCopyLinkItem.setText(
       InternationalMessages.getString("ZTerm.Popup_CopyLink_MenuItem_Text")); // $NON-NLS-1$
   popupCopyItem.setText(
       InternationalMessages.getString("ZTerm.Copy_MenuItem_Text")); // $NON-NLS-1$
   popupPasteItem.setText(
       InternationalMessages.getString("ZTerm.Paste_MenuItem_Text")); // $NON-NLS-1$
   popupColorCopyItem.setText(
       InternationalMessages.getString("ZTerm.ColorCopy_MenuItem_Text")); // $NON-NLS-1$
   popupColorPasteItem.setText(
       InternationalMessages.getString("ZTerm.ColorPaste_MenuItem_Text")); // $NON-NLS-1$
   popupCloseItem.setText(InternationalMessages.getString("ZTerm.Close_MenuItem_Text"));
 }