コード例 #1
0
 /**
  * Reset the image rollover icon as enabled/disabled.
  *
  * @param enabled, the status to draw the image rollover icon for.
  */
 public void updateImageRollover(boolean enabled) {
   if (enabled) {
     pbImageRollover.setIcon(UIImages.get(IMAGE_ROLLOVER_ICON));
   } else {
     pbImageRollover.setIcon(UIImages.get(IMAGE_ROLLOVEROFF_ICON));
   }
 }
コード例 #2
0
  /** Update the look and feel of the toolbar. */
  public void updateLAF() {

    if (pbOpen != null) {
      pbOpen.setIcon(UIImages.get(OPEN_ICON));
    }
    if (pbClose != null) {
      pbClose.setIcon(UIImages.get(CLOSE_ICON));
    }
    pbCut.setIcon(UIImages.get(CUT_ICON));
    pbCopy.setIcon(UIImages.get(COPY_ICON));
    pbPaste.setIcon(UIImages.get(PASTE_ICON));
    pbDelete.setIcon(UIImages.get(DELETE_ICON));
    pbUndo.setIcon(UIImages.get(UNDO_ICON));
    pbRedo.setIcon(UIImages.get(REDO_ICON));
    pbShowBackHistory.setIcon(UIImages.get(PREVIOUS_ICON));
    pbBack.setIcon(UIImages.get(BACK_ICON));
    pbForward.setIcon(UIImages.get(FORWARD_ICON));
    pbShowForwardHistory.setIcon(UIImages.get(NEXT_ICON));
    pbSearch.setIcon(UIImages.get(SEARCH_ICON));
    pbHelp.setIcon(UIImages.get(HELP_ICON));

    if (FormatProperties.imageRollover) {
      pbImageRollover.setIcon(UIImages.get(IMAGE_ROLLOVER_ICON));
    } else {
      pbImageRollover.setIcon(UIImages.get(IMAGE_ROLLOVEROFF_ICON));
    }

    if (tbrToolBar != null) SwingUtilities.updateComponentTreeUI(tbrToolBar);
  }
コード例 #3
0
  /**
   * Creates and return the main toolbar (for example, cut/copy/paste/open/close etc.).
   *
   * @return UIToolBar, the toolbar with all the main options.
   */
  private UIToolBar createToolBarItems() {

    if (!bSimpleInterface) {
      pbOpen =
          tbrToolBar.createToolBarButton(
              LanguageProperties.getString(
                  LanguageProperties.TOOLBARS_BUNDLE, "UIToolBarMain.open"),
              UIImages.get(OPEN_ICON)); // $NON-NLS-1$
      pbOpen.addActionListener(this);
      pbOpen.setEnabled(false);
      tbrToolBar.add(pbOpen);
      CSH.setHelpIDString(pbOpen, "toolbars.main"); // $NON-NLS-1$

      pbClose =
          tbrToolBar.createToolBarButton(
              LanguageProperties.getString(
                  LanguageProperties.TOOLBARS_BUNDLE, "UIToolBarMain.close"),
              UIImages.get(CLOSE_ICON)); // $NON-NLS-1$
      pbClose.addActionListener(this);
      pbClose.setEnabled(true);
      tbrToolBar.add(pbClose);
      CSH.setHelpIDString(pbClose, "toolbars.main"); // $NON-NLS-1$

      tbrToolBar.addSeparator();
    }

    pbCut =
        tbrToolBar.createToolBarButton(
            LanguageProperties.getString(LanguageProperties.TOOLBARS_BUNDLE, "UIToolBarMain.cut"),
            UIImages.get(CUT_ICON)); // $NON-NLS-1$
    pbCut.addActionListener(this);
    pbCut.setEnabled(false);
    tbrToolBar.add(pbCut);
    CSH.setHelpIDString(pbCut, "toolbars.main"); // $NON-NLS-1$

    pbCopy =
        tbrToolBar.createToolBarButton(
            LanguageProperties.getString(LanguageProperties.TOOLBARS_BUNDLE, "UIToolBarMain.copy"),
            UIImages.get(COPY_ICON)); // $NON-NLS-1$
    pbCopy.addActionListener(this);
    pbCopy.setEnabled(false);
    tbrToolBar.add(pbCopy);
    CSH.setHelpIDString(pbCopy, "toolbars.main"); // $NON-NLS-1$

    pbPaste =
        tbrToolBar.createToolBarButton(
            LanguageProperties.getString(LanguageProperties.TOOLBARS_BUNDLE, "UIToolBarMain.paste"),
            UIImages.get(PASTE_ICON)); // $NON-NLS-1$
    pbPaste.addActionListener(this);
    pbPaste.setEnabled(false);
    tbrToolBar.add(pbPaste);
    CSH.setHelpIDString(pbPaste, "toolbars.main"); // $NON-NLS-1$

    pbDelete =
        tbrToolBar.createToolBarButton(
            LanguageProperties.getString(
                LanguageProperties.TOOLBARS_BUNDLE, "UIToolBarMain.delete"),
            UIImages.get(DELETE_ICON)); // $NON-NLS-1$
    pbDelete.addActionListener(this);
    pbDelete.setEnabled(false);
    tbrToolBar.add(pbDelete);
    CSH.setHelpIDString(pbDelete, "toolbars.main"); // $NON-NLS-1$

    tbrToolBar.addSeparator();

    pbUndo =
        tbrToolBar.createToolBarButton(
            LanguageProperties.getString(LanguageProperties.TOOLBARS_BUNDLE, "UIToolBarMain.undo"),
            UIImages.get(UNDO_ICON)); // $NON-NLS-1$
    pbUndo.addActionListener(this);
    pbUndo.setEnabled(false);
    tbrToolBar.add(pbUndo);
    CSH.setHelpIDString(pbUndo, "toolbars.main"); // $NON-NLS-1$

    pbRedo =
        tbrToolBar.createToolBarButton(
            LanguageProperties.getString(LanguageProperties.TOOLBARS_BUNDLE, "UIToolBarMain.redo"),
            UIImages.get(REDO_ICON)); // $NON-NLS-1$
    pbRedo.addActionListener(this);
    pbRedo.setEnabled(false);
    tbrToolBar.add(pbRedo);
    CSH.setHelpIDString(pbRedo, "toolbars.main"); // $NON-NLS-1$

    tbrToolBar.addSeparator();

    pbShowBackHistory =
        tbrToolBar.createToolBarButton(
            LanguageProperties.getString(
                LanguageProperties.TOOLBARS_BUNDLE, "UIToolBarMain.backTo"),
            UIImages.get(PREVIOUS_ICON)); // $NON-NLS-1$
    pbShowBackHistory.addActionListener(this);
    pbShowBackHistory.setEnabled(false);
    tbrToolBar.add(pbShowBackHistory);
    CSH.setHelpIDString(pbShowBackHistory, "toolbars.main"); // $NON-NLS-1$

    pbBack =
        tbrToolBar.createToolBarButton(
            LanguageProperties.getString(LanguageProperties.TOOLBARS_BUNDLE, "UIToolBarMain.back"),
            UIImages.get(BACK_ICON)); // $NON-NLS-1$
    pbBack.addActionListener(this);
    pbBack.setEnabled(false);
    tbrToolBar.add(pbBack);
    CSH.setHelpIDString(pbBack, "toolbars.main"); // $NON-NLS-1$

    pbForward =
        tbrToolBar.createToolBarButton(
            LanguageProperties.getString(
                LanguageProperties.TOOLBARS_BUNDLE, "UIToolBarMain.forward"),
            UIImages.get(FORWARD_ICON)); // $NON-NLS-1$
    pbForward.addActionListener(this);
    pbForward.setEnabled(false);
    tbrToolBar.add(pbForward);
    CSH.setHelpIDString(pbForward, "toolbars.main"); // $NON-NLS-1$

    pbShowForwardHistory =
        tbrToolBar.createToolBarButton(
            LanguageProperties.getString(
                LanguageProperties.TOOLBARS_BUNDLE, "UIToolBarMain.forwardTo"),
            UIImages.get(NEXT_ICON)); // $NON-NLS-1$
    pbShowForwardHistory.addActionListener(this);
    pbShowForwardHistory.setEnabled(false);
    tbrToolBar.add(pbShowForwardHistory);
    CSH.setHelpIDString(pbShowForwardHistory, "toolbars.main"); // $NON-NLS-1$

    tbrToolBar.addSeparator();

    pbImageRollover =
        tbrToolBar.createToolBarButton(
            LanguageProperties.getString(
                LanguageProperties.TOOLBARS_BUNDLE, "UIToolBarMain.imageRollover"),
            UIImages.get(IMAGE_ROLLOVER_ICON)); // $NON-NLS-1$
    pbImageRollover.addActionListener(this);
    pbImageRollover.setEnabled(true);
    tbrToolBar.add(pbImageRollover);
    CSH.setHelpIDString(pbImageRollover, "toolbars.main"); // $NON-NLS-1$

    pbSearch =
        tbrToolBar.createToolBarButton(
            LanguageProperties.getString(
                LanguageProperties.TOOLBARS_BUNDLE, "UIToolBarMain.search"),
            UIImages.get(SEARCH_ICON)); // $NON-NLS-1$
    pbSearch.addActionListener(this);
    pbSearch.setEnabled(true);
    tbrToolBar.add(pbSearch);
    CSH.setHelpIDString(pbSearch, "toolbars.main"); // $NON-NLS-1$

    pbHelp =
        tbrToolBar.createToolBarButton(
            LanguageProperties.getString(
                LanguageProperties.TOOLBARS_BUNDLE, "UIToolBarMain.helpOnItem"),
            UIImages.get(HELP_ICON)); // $NON-NLS-1$
    if (((UIToolBarManager) oManager).getHelpBroker() != null) {
      pbHelp.addActionListener(
          new CSH.DisplayHelpAfterTracking(((UIToolBarManager) oManager).getHelpBroker()));
    }

    pbHelp.setEnabled(true);
    tbrToolBar.add(pbHelp);

    return tbrToolBar;
  }