public LexicalSortingAction(TreeViewer treeViewer) {
    super(CUIPlugin.getResourceString(ACTION_NAME + ".label")); // $NON-NLS-1$

    setDescription(CUIPlugin.getResourceString(ACTION_NAME + ".description")); // $NON-NLS-1$
    setToolTipText(CUIPlugin.getResourceString(ACTION_NAME + ".tooltip")); // $NON-NLS-1$

    MakeUIImages.setImageDescriptors(
        this, MakeUIImages.T_TOOL, MakeUIImages.IMG_TOOLS_ALPHA_SORTING);

    fTreeViewer = treeViewer;
    fSorter = new LexicalCSorter();

    boolean checked = CUIPlugin.getDefault().getDialogSettings().getBoolean(DIALOG_STORE_KEY);
    valueChanged(checked, false);
  }
  private void valueChanged(boolean on, boolean store) {
    setChecked(on);
    fTreeViewer.setSorter(on ? fSorter : null);

    String key =
        ACTION_NAME + ".tooltip" + (on ? ".on" : ".off"); // $NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    setToolTipText(CUIPlugin.getResourceString(key));

    if (store) {
      CUIPlugin.getDefault().getDialogSettings().put(DIALOG_STORE_KEY, on);
    }
  }