isModified = mod; updateCurrSize();
    public void actionPerformed(ActionEvent ae)    {        if (ae.getActionCommand().startsWith("textList"))        {            String tmp = ae.getActionCommand().substring(8, 11);            for (int i = 0; i < tabShortNames.length; i++)            {                if (tmp.equals(tabShortNames[i]))                {                    //                    currentList = i;                    //                    currentSelection = Integer.parseInt(ae.getActionCommand()                    //                        .substring(11));                    //                    showInfo();                    showInfo(i, Integer.parseInt(ae.getActionCommand()                        .substring(11)));                    return;                }            }            System.out.println("textList action code failed");        }        else if (ae.getActionCommand().equals("copy"))        {            ta.copy();        }        else if (ae.getActionCommand().equals("cut"))        {            ta.cut();        }        else if (ae.getActionCommand().equals("paste"))        {            ta.paste();        }        else if (ae.getActionCommand().equals("delete"))        {            ta.replaceSelection("");        }        else if (ae.getActionCommand().equals("undo"))        {            undo();        }        else if (ae.getActionCommand().equals("redo"))        {            redo();        }        else if (ae.getActionCommand().equals("useComp"))        {            updateCurrSize();        }        else if (ae.getActionCommand().equals("find"))        {            initFindWindow();            findWindow.setVisible(true);        }        else if (ae.getActionCommand().equals("findNext"))        {            find();        }        else if (ae.getActionCommand().equals("goto"))        {            if (!gotoDialogInited)            {                gotoDialogInited = true;                initGotoDialog();            }            gotoDialog.setVisible(true);        }        else if (ae.getActionCommand().equals("codesOnly"))        {            CCInfo cct = cc[TEXT_CC_TYPE[currentList]]; //current CC Type            String text = useComp.isSelected()                && cct.getStringLength(ta.getText(), true) > 0 ? cct                .compressString(ta.getText()) : ta.getText();            String tmp = cct.deparseString(text);            if (tmp == null)            {                JOptionPane.showMessageDialog(mainWindow,                    "Please check that all square brackets [ & ]\n"                        + "are paired and that only the characters \n"                        + "0123456789ABCDEFabcdef<space>\n"                        + "appear between brackets.", "Bracket Error",                    JOptionPane.ERROR_MESSAGE);                codesOnly.setSelected(!codesOnly.isSelected());                return;            }            if (isCodesOnly())            {                ta.setText(cct.parseCodesOnly(tmp, prefs                    .getValueAsBoolean("eb_text_editor.codes_caps")));            }            else            {                ta.setText(cct.parseString(tmp, prefs                    .getValueAsBoolean("eb_text_editor.codes_caps")));            }        }        else if (ae.getActionCommand().equals("codesCaps"))        {            CCInfo cct = cc[TEXT_CC_TYPE[currentList]]; //current CC Type            String text = useComp.isSelected()                && cct.getStringLength(ta.getText(), true) > 0 ? cct                .compressString(ta.getText()) : ta.getText();            String tmp = cct.deparseString(text);            if (tmp == null)            {                JOptionPane.showMessageDialog(mainWindow,                    "Please check that all square brackets [ & ]\n"                        + "are paired and that only the characters \n"                        + "0123456789ABCDEFabcdef<space>\n"                        + "appear between brackets.", "Bracket Error",                    JOptionPane.ERROR_MESSAGE);                codesCaps.setSelected(!codesOnly.isSelected());                return;            }            if (isCodesOnly())            {                ta.setText(cct.parseCodesOnly(tmp, prefs                    .getValueAsBoolean("eb_text_editor.codes_caps")));            }            else            {                ta.setText(cct.parseString(tmp, prefs                    .getValueAsBoolean("eb_text_editor.codes_caps")));            }        }        else if (ae.getActionCommand().equals("showCodeHelp"))        {            if (codeHelp == null)                initCodeHelp();            codeHelp.setVisible(true);            updateCodeHelp();        }        else if (ae.getActionCommand().equals("showPreview"))        {            initPreview();            previewDialog.setVisible(true);            updatePreview();        }        else if (ae.getActionCommand().equals("showEntry"))        {            showEntry();        }        else if (ae.getActionCommand().equalsIgnoreCase("close"))        {            hide();        }        else if (ae.getActionCommand().equalsIgnoreCase("apply"))        {            saveInfo();        }    }