2005/02/21
Hi I'm aki
There are my OpenSource Java codes.(some of them are junk or not implemented)
I'm sorry ,I didn't release internatinal version software yet. one day I'd like to introduce them here.
Thank you for Java2Html. it's very easy and suitable for me.
If you can read Japanese,you can see my software here. Enjoy Java
org.jpn.xucker.audiotowma9
org.jpn.xucker.audiotowma9.AudioToWma9Executer
org.jpn.xucker.audiotowma9.AudioToWma9Wrapper
org.jpn.xucker.commons.audio
org.jpn.xucker.commons.audio.AudioClipAudioPlayer
org.jpn.xucker.commons.audio.AudioStopper
org.jpn.xucker.commons.audio.FileAudioPlayer
org.jpn.xucker.commons.audio.InputStreamAudioPlayer
org.jpn.xucker.commons.audio.JavaSoundAudioPlayer
org.jpn.xucker.commons.audio.ThreadJavaSoundAudioPlayer
org.jpn.xucker.commons.audio.TimerAudioStopper
org.jpn.xucker.commons.audio.word
org.jpn.xucker.commons.audio.word.AbstractWordPlayer
org.jpn.xucker.commons.audio.word.FreeTTSWordPlayer
org.jpn.xucker.commons.audio.word.LocalFileAlphabetDirWordFinder
org.jpn.xucker.commons.audio.word.LocalFilePlainWordFinder
org.jpn.xucker.commons.audio.word.LocalFilePlainWordPlayer
org.jpn.xucker.commons.audio.word.LocalFileWordFinder
org.jpn.xucker.commons.audio.word.LocalFileWordPlayer
org.jpn.xucker.commons.audio.word.MutchWordPlaySystem
org.jpn.xucker.commons.audio.word.WordPlayer
org.jpn.xucker.commons.audio.word.WordPlaySystem
org.jpn.xucker.commons.audio.word.ZipFileWordPlayer
org.jpn.xucker.commons.google
org.jpn.xucker.commons.google.Channel
org.jpn.xucker.commons.google.GoogleAdSenseChannelParser
org.jpn.xucker.commons.io
org.jpn.xucker.commons.io.LineSeparatorChangeInputStream
org.jpn.xucker.commons.io.LineSeparatorCountInputStream
org.jpn.xucker.commons.io.WordCountInputStream
org.jpn.xucker.commons.ipod
org.jpn.xucker.commons.ipod.DoubleLineTextPopper
org.jpn.xucker.commons.ipod.MenuMaker
org.jpn.xucker.commons.ipod.PrevNextMenu
org.jpn.xucker.commons.ipod.SrtConverter
org.jpn.xucker.commons.ipod.TextConverter
org.jpn.xucker.commons.ipod.TextConvertTest
org.jpn.xucker.commons.ipod.TextPopper
org.jpn.xucker.commons.ipod.TextUtil
org.jpn.xucker.commons.property
org.jpn.xucker.commons.property.StatusChangeListener
org.jpn.xucker.commons.property.StatusChangeMonitor
org.jpn.xucker.commons.swt.series
org.jpn.xucker.commons.swt.series.FileListTypeMenu
org.jpn.xucker.commons.swt.series.PropertyMenuListener
org.jpn.xucker.commons.swt.series.ResultData
org.jpn.xucker.commons.swt.series.ResultDialog
org.jpn.xucker.commons.swt.series.fls
org.jpn.xucker.commons.swt.series.fls.FileListStandard
org.jpn.xucker.commons.swt.series.fls.Sample
org.jpn.xucker.commons.swt.series.wfs
org.jpn.xucker.commons.swt.series.wfs.WrapperExecuter
org.jpn.xucker.commons.swt.series.wfs.WrapperFileStandard
org.jpn.xucker.commons.swt.series.wfs.WrapperFileStandardSettingDialog
org.jpn.xucker.commons.swt.ui
org.jpn.xucker.commons.swt.ui.CopyTable
org.jpn.xucker.commons.swt.ui.FileDirChoicer
org.jpn.xucker.commons.swt.ui.FileListImage
org.jpn.xucker.commons.swt.ui.FileListImageStatusChangeListener
org.jpn.xucker.commons.swt.ui.FileListTable
org.jpn.xucker.commons.swt.ui.FileStatusChangeEvent
org.jpn.xucker.commons.swt.ui.FileStatusChangeListener
org.jpn.xucker.commons.swt.ui.FileStatusChanger
org.jpn.xucker.commons.swt.ui.GroupCheckTreeContoler
org.jpn.xucker.commons.swt.ui.ImageCanvas
org.jpn.xucker.commons.swt.ui.MenuItemContainer
org.jpn.xucker.commons.swt.ui.MenuItemContainerImp
org.jpn.xucker.commons.swt.ui.OkCancelDialog
org.jpn.xucker.commons.swt.ui.OkCancelDialogListener
org.jpn.xucker.commons.swt.ui.SWTBasicFileApplication
org.jpn.xucker.commons.swt.ui.SWTFileNoFoundtAction
org.jpn.xucker.commons.swt.ui.SWTStatusChangedMonitor
org.jpn.xucker.commons.swt.ui.tree
org.jpn.xucker.commons.swt.ui.tree.TreeBuilder
org.jpn.xucker.commons.swt.ui.tree.TreeObject
org.jpn.xucker.commons.undo
org.jpn.xucker.commons.undo.AbstractCommand
org.jpn.xucker.commons.undo.Addable
org.jpn.xucker.commons.undo.AddCommand
org.jpn.xucker.commons.undo.Command
org.jpn.xucker.commons.undo.CommandControl
org.jpn.xucker.commons.undo.Deletable
org.jpn.xucker.commons.undo.DeleteCommand
org.jpn.xucker.commons.undo.UndoCommand
org.jpn.xucker.commons.util
org.jpn.xucker.commons.util.AbstractBasicFileApplication
org.jpn.xucker.commons.util.ApplicationProperties
org.jpn.xucker.commons.util.ApplicationUtil
org.jpn.xucker.commons.util.ClipboardUtil
org.jpn.xucker.commons.util.FileNotFoundAction
org.jpn.xucker.commons.util.FileProperties
org.jpn.xucker.commons.util.IOClassLoader
org.jpn.xucker.commons.util.TagUtil
org.jpn.xucker.commons.util.WildCard
org.jpn.xucker.commons.util._FilePreference
org.jpn.xucker.dualsubmit
org.jpn.xucker.dualsubmit.ClipboardTextListener
org.jpn.xucker.dualsubmit.ClipboardTextMonitor
org.jpn.xucker.dualsubmit.ClipboardTextMonitorImp
org.jpn.xucker.dualsubmit.DefaultApplication
org.jpn.xucker.dualsubmit.DualSubmit
org.jpn.xucker.dualsubmit.DualSubmitBrowser
org.jpn.xucker.dualsubmit.DualSubmitBrowserImp
org.jpn.xucker.dualsubmit.DualSubmitMenu
org.jpn.xucker.dualsubmit.DualSubmitMenuImp
org.jpn.xucker.dualsubmit.DualSubmitPlugin
org.jpn.xucker.dualsubmit.DualSubmitPluginImp
org.jpn.xucker.dualsubmit.DualSubmitPluginLoader
org.jpn.xucker.dualsubmit.DualSubmitPluginLoaderImp
org.jpn.xucker.dualsubmit.DualSubmitPreference
org.jpn.xucker.dualsubmit.LoopControler
org.jpn.xucker.dualsubmit.SimpleWindowCloser
org.jpn.xucker.dualsubmit.StringValidator
org.jpn.xucker.dualsubmit.validator
org.jpn.xucker.dualsubmit.validator.AlphabetAndHyphenValidator
org.jpn.xucker.dualsubmit.validator.AlphabetValidator
org.jpn.xucker.dualsubmit.validator.AndValidator
org.jpn.xucker.dualsubmit.validator.NoLineSeparatorValidator
org.jpn.xucker.dualsubmit.validator.NotValidator
org.jpn.xucker.dualsubmit.validator.NoWhiteSpaceValidator
org.jpn.xucker.dualsubmit.validator.OrValidator
org.jpn.xucker.english
org.jpn.xucker.english.Util
org.jpn.xucker.findsame
org.jpn.xucker.findsame.CompositeList
org.jpn.xucker.findsame.CompositeListItem
org.jpn.xucker.findsame.CompositePixelList
org.jpn.xucker.findsame.Error
org.jpn.xucker.findsame.FileUtil
org.jpn.xucker.findsame.FindSameEachOtherMain
org.jpn.xucker.findsame.FindSameFileMain
org.jpn.xucker.findsame.FindSameFolderMain
org.jpn.xucker.findsame.MD5Util
org.jpn.xucker.findsame.Result
org.jpn.xucker.findsame.ResultList
org.jpn.xucker.freemind
org.jpn.xucker.freemind.FreeMindUtils
org.jpn.xucker.freemind.Map
org.jpn.xucker.freemind.Node
org.jpn.xucker.imagemarker
org.jpn.xucker.imagemarker.GUIProperties
org.jpn.xucker.imagemarker.ImageMarker
org.jpn.xucker.linkcheck
org.jpn.xucker.linkcheck.LinkChecker
org.jpn.xucker.mp3
org.jpn.xucker.mp3.MP3JavaSoundAudioPlayer
org.jpn.xucker.optipngwrapper
org.jpn.xucker.optipngwrapper.OptiPNGExecuter
org.jpn.xucker.optipngwrapper.OptiPngWrap
org.jpn.xucker.optipngwrapper.ResultData
org.jpn.xucker.optipngwrapper.ResultDialog
org.jpn.xucker.phonixSplit
org.jpn.xucker.phonixSplit.PhonixSplit
org.jpn.xucker.phonixSplit.PhonixSplitCanvas
org.jpn.xucker.phonixSplit.QuestionControl
org.jpn.xucker.phonixSplit.QuestionFolder
org.jpn.xucker.playdict
org.jpn.xucker.playdict.DictPreference
org.jpn.xucker.playdict.PlayDictMain
org.jpn.xucker.playdict.SoundWord
org.jpn.xucker.repeatrecorder
org.jpn.xucker.repeatrecorder.ControledObject
org.jpn.xucker.repeatrecorder.RepeatRecorder
org.jpn.xucker.repeatrecorder.RepeatRecorderMenu
org.jpn.xucker.returncode
org.jpn.xucker.returncode.ReturnCodeChecker
org.jpn.xucker.returncode.ReturnCodeMain
org.jpn.xucker.rssCreator
org.jpn.xucker.rssCreator.main
org.jpn.xucker.snacksoundtoolkit
org.jpn.xucker.snacksoundtoolkit.ESPS
org.jpn.xucker.snacksoundtoolkit.ESPSParser
org.jpn.xucker.snacksoundtoolkit.PitchCanvas
org.jpn.xucker.srtipod
org.jpn.xucker.srtipod.main
org.jpn.xucker.srtipod.SrtIPodMain
org.jpn.xucker.subconverter
org.jpn.xucker.subconverter.SubConverter
org.jpn.xucker.subplayer
org.jpn.xucker.subplayer.ImageCanvas
org.jpn.xucker.subplayer.Mark
org.jpn.xucker.subplayer.MarkControler
org.jpn.xucker.subplayer.SubMainMenu
org.jpn.xucker.subplayer.SubPlayFileUpdater
org.jpn.xucker.subplayer.SubPlayFileXmlDialog
org.jpn.xucker.subplayer.SubPlayFileXmlObject
org.jpn.xucker.subplayer.SubPlayMain
org.jpn.xucker.subplayer.SubPlayPreferenceXmlObject
org.jpn.xucker.subtitle
org.jpn.xucker.subtitle.StandardSubObject
org.jpn.xucker.subtitle.SubUtils
org.jpn.xucker.subtitle.spumux
org.jpn.xucker.subtitle.spumux.Action
org.jpn.xucker.subtitle.spumux.Button
org.jpn.xucker.subtitle.spumux.Spu
org.jpn.xucker.subtitle.spumux.Spumux
org.jpn.xucker.subtitle.spumux.SpumuxParser
org.jpn.xucker.subtitle.spumux.Textsub
org.jpn.xucker.subtitle.srt
org.jpn.xucker.subtitle.srt.SRTList
org.jpn.xucker.subtitle.srt.SRTObject
org.jpn.xucker.subtitle.srt.SRTParser
org.jpn.xucker.subtitle.srt.TimeData
org.jpn.xucker.subtitle.sub
org.jpn.xucker.subtitle.sub.SUBList
org.jpn.xucker.subtitle.sub.SUBObject
org.jpn.xucker.subtitle.sub.SUBParser
org.jpn.xucker.subtitle.sub.TextObject
org.jpn.xucker.subtitle.sub2
org.jpn.xucker.subtitle.sub2.CommentObject
org.jpn.xucker.subtitle.sub2.SUBObject
org.jpn.xucker.subtitle.sub2.SUBParser
org.jpn.xucker.tab2tree
org.jpn.xucker.tab2tree.Main
org.jpn.xucker.tab2tree.StringTreeUtils
org.jpn.xucker.taiyaku
org.jpn.xucker.taiyaku.TaiyakuData
org.jpn.xucker.taiyaku.TaiyakuParser
org.jpn.xucker.treetext
org.jpn.xucker.treetext.main
org.jpn.xucker.treetext.TreeText
org.jpn.xucker.wavconvert
org.jpn.xucker.wavconvert.AudioFormat
org.jpn.xucker.wavconvert.SoxExecuter
org.jpn.xucker.wavconvert.SoxWrapper
org.jpn.xucker.wmatopcm
org.jpn.xucker.wmatopcm.WmaToPcmExecuter
org.jpn.xucker.wmatopcm.WmaToPcmWrapper
org.jpn.xucker.wordcounter
org.jpn.xucker.wordcounter.WordCountData
org.jpn.xucker.wordcounter.WordCountMain
org.jpn.xucker.wordcounter.WordCountMenu
org.jpn.xucker.xs.aegis
org.jpn.xucker.xs.aegis.Action
org.jpn.xucker.xs.aegis.Block
org.jpn.xucker.xs.aegis.Domain
org.jpn.xucker.xs.aegis.Query
org.jpn.xucker.xs.aegis.QueryList

FindSameFolderMain.java
/*
 * Created on 2004/07/10
 * Author aki@www.xucker.jpn.org
 * License Apache2.0 or Common Public License
 */
package org.jpn.xucker.findsame;

import java.io.File;
import java.io.IOException;
import java.util.Arrays;
import java.util.Hashtable;
import java.util.Vector;

import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.DirectoryDialog;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.MenuItem;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.TabFolder;
import org.eclipse.swt.widgets.TabItem;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.TableItem;

/**
 
 *  
 */
public class FindSameFolderMain implements SelectionListener {

    Shell shell;

    Table table;

    Table resultTable;

    Label resultLabel;

    Menu popMenu;

    Image okImage;

    Image ngImage;

    Image yetImage;

    Hashtable rootHash;

    Hashtable errorHash;

    Label rootLabel;

    /**
     @param args
     @param shell
     */
    public FindSameFolderMain(String[] args, Shell shell) {
        Image icon = new Image(Display.getCurrent(), FindSameFolderMain.class.getClassLoader()
                .getResourceAsStream(
                        "org/jpn/xucker/findsame/resource/green.png"));
        shell.setImage(icon);
        initImage();
        errorHash = new Hashtable();
        this.shell = shell;
        shell.setText("FindSame:フォルダー単位比べる");
        //shell.setBounds(0,0,400,330);
        shell.setLayout(new FillLayout(SWT.VERTICAL));

        TabFolder tab = new TabFolder(shell, SWT.NULL);
        tab.addSelectionListener(this);
        TabItem folderTab = new TabItem(tab, SWT.NULL);
        folderTab.setText("フォルダー選択");
        Composite panel = new Composite(tab, SWT.NULL);
        panel.setLayout(new GridLayout());
        folderTab.setControl(panel);
        Composite topPanel = new Composite(panel, SWT.NULL);
        rootLabel = new Label(topPanel, SWT.BORDER);
        rootLabel.setSize(40020);
        Button rootButton = new Button(topPanel, SWT.NULL);
        rootButton.setBounds(40504020);
        rootButton.setText("選択");
        rootButton.addSelectionListener(this);
        
        
        Button refreshButton = new Button(topPanel, SWT.NULL);
        refreshButton.setBounds(44508020);
        refreshButton.setText("再読み込み");
        refreshButton.addSelectionListener(this);

        table = new Table(panel, SWT.FULL_SELECTION);
        TableColumn tc = new TableColumn(table, SWT.NULL);
        tc.setWidth(480);

        GridData gdata = new GridData();
        gdata.horizontalAlignment = GridData.FILL;
        gdata.verticalAlignment = GridData.FILL;
        gdata.widthHint = 500;
        gdata.heightHint = 300;
        table.setLayoutData(gdata);

        //centerPanel.setLayout(new GridLayout());

        TabItem resultTab = new TabItem(tab, SWT.NULL);
        
        resultTab.setText("結果詳細");

        Composite resultPanel = new Composite(tab, SWT.NULL);
        resultPanel.setLayout(new GridLayout());

        resultLabel = new Label(resultPanel, SWT.NULL);
        GridData gdata2 = new GridData();
        gdata2.widthHint = 400;
        resultLabel.setLayoutData(gdata2);

        table.setLayoutData(gdata);

        resultTable = new Table(resultPanel, SWT.NULL);

        GridData gdata3 = new GridData();
        gdata3.widthHint = 370;
        gdata3.heightHint = 200;
        resultTable.setLayoutData(gdata3);
        resultTab.setControl(resultPanel);

        popMenu = new Menu(shell, SWT.POP_UP);
        MenuItem mitem = new MenuItem(popMenu, SWT.PUSH);
        mitem.setText("フォルダーの追加");
        mitem.addSelectionListener(this);

        MenuItem mitem2 = new MenuItem(popMenu, SWT.PUSH);
        mitem2.setText("フォルダー以下を追加");
        mitem2.addSelectionListener(this);

        MenuItem sep = new MenuItem(popMenu, SWT.SEPARATOR);

        MenuItem mitem3 = new MenuItem(popMenu, SWT.PUSH);
        mitem3.setText("選択項目を削除");
        mitem3.addSelectionListener(this);
        
        MenuItem mitem4 = new MenuItem(popMenu, SWT.PUSH);
        mitem4.setText("すべての項目を削除");
        mitem4.addSelectionListener(this);

        table.setMenu(popMenu);
        //test

        Button exec = new Button(panel, SWT.NULL);
        exec.setText("比べる");
        exec.addSelectionListener(this);

        //execSetRoot("C:\\tmp\\media\\base");

       // addFolder(new File("C:\\tmp\\media\\ok1"));
        //addFolder(new File("C:\\tmp\\media\\ok2"));
        //addFolder(new File("C:\\tmp\\media\\ng1"));
        //addFolder(new File("C:\\tmp\\media\\ng2"));
    }

    /**
     *  
     */
    private void initImage() {
        okImage = new Image(Display.getCurrent(), FindSameFolderMain.class.getClassLoader()
                .getResourceAsStream(
                        "org/jpn/xucker/findsame/resource/ok.png"));
        ngImage = new Image(Display.getCurrent(), FindSameFolderMain.class.getClassLoader()
                .getResourceAsStream(
                        "org/jpn/xucker/findsame/resource/ng.png"));
        yetImage = new Image(Display.getCurrent(), FindSameFolderMain.class.getClassLoader()
                .getResourceAsStream(
                        "org/jpn/xucker/findsame/resource/yet.png"));

    }

    public void doSetRoot() {
        DirectoryDialog dialog = new DirectoryDialog(shell);
        String dir = dialog.open();
        if (dir != null) {
            execSetRoot(dir);
        }
    }
    
    public void doRefresh() {
        String dir = rootLabel.getText();
        if (!dir.equals("")) {
            execSetRoot(dir);
        }
    }

    public void execSetRoot(String dir) {
        rootLabel.setText(dir);
        loadRootHash(new File(dir));
    }

    public void loadRootHash(File folder) {
        rootHash = new Hashtable();
        if (folder.isDirectory()) {
            String list[] = folder.list();
            if(list!=null){
            for (int i = 0; i < list.length; i++) {
                pushMD5(folder, new File(folder, list[i]));
            }
            }
        }
    }

    public void checkFolder(TableItem item) {
        File destFolder = new File(item.getText());
        Vector errorList = new Vector();
        //check & add log.
        String rootKeys[] (String[]) rootHash.keySet().toArray(
                new String[rootHash.size()]);
        Arrays.sort(rootKeys);

        for (int i = 0; i < rootKeys.length; i++) {
            File destFile = new File(destFolder, rootKeys[i]);
            if (!destFile.exists()) {
                errorList.addElement(new Error(Error.NOT_FOUND_DEST,
                        rootKeys[i]));
            else {

                try {
                    String newMD5 = MD5Util.toMD5(destFile);
                    if (!newMD5.equals((StringrootHash.get(rootKeys[i]))) {
                        errorList.add(new Error(Error.MD5, rootKeys[i]));
                    }
                catch (IOException e) {
                    // TODO Auto-generated catch block
                    errorList.add(new Error(Error.MD5, rootKeys[i]));
                    e.printStackTrace();
                }

            }
        }
        Error[] errors = (Error[]) errorList
                .toArray(new Error[errorList.size()]);
        errorHash.put(destFolder.getAbsolutePath(), errors);
        //setresult icon
        if (errors.length > 0) {
            item.setImage(ngImage);
        else {
            item.setImage(okImage);
        }
    }

    public void pushMD5(File root, File file) {
        if (file.isDirectory()) {
            String list[] = file.list();
            if(list!=null){
            for (int i = 0; i < list.length; i++) {
                pushMD5(root, new File(file, list[i]));
            }
            }

        else {
            try {
                String md5 = MD5Util.toMD5(file);
                String path = parsePath(root, file);
                //System.out.println(path + "," + md5);
                rootHash.put(path, md5);
            catch (IOException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }
    }

    /**
     @param root
     @param file
     @return
     */
    private String parsePath(File root, File file) {
        String rootPath = root.getAbsolutePath();
        if (!rootPath.endsWith(System.getProperty("file.separator"))) {
            rootPath += System.getProperty("file.separator");
        }
        String newPath = file.getAbsolutePath();
        if (!newPath.startsWith(rootPath)) {
            throw new RuntimeException("wrong path mixed " + rootPath + ","
                    + newPath);
        }
        return newPath.substring(rootPath.length());
    }

    public void doAddFolder() {
        DirectoryDialog dialog = new DirectoryDialog(shell);
        String dir = dialog.open();
        if (dir != null) {
            addFolder(new File(dir));
        }
    }

    /**
     @param file
     */
    private void addFolder(File file) {
        TableItem tableItem = new TableItem(table, SWT.NULL);
        tableItem.setImage(yetImage);

        tableItem.setText(file.getAbsolutePath());

    }

    public void doDeleteFolder() {
        int select[] = table.getSelectionIndices();
        table.remove(select);
    }
    
    public void doDeleteAll() {
        int select[] = table.getSelectionIndices();
        table.removeAll();
    }

    public void doAddMultiFolder() {
        DirectoryDialog dialog = new DirectoryDialog(shell);
        String dir = dialog.open();
        if (dir != null) {
            File file=new File(dir);
            if(file.isDirectory()){
                String list[]=file.list();
                if(list!=null){
                for(int i=0;i<list.length;i++){
                    File tmp=new File(file,list[i]);
                    if(tmp.isDirectory()){
                        addFolder(tmp);
                    }
                    
                }
                }
            }
        }
    }

    public static void main(String[] args) {
        Display display = new Display();
        Shell shell = new Shell(display);

        FindSameFolderMain button = new FindSameFolderMain(args, shell);

        shell.pack();
        shell.open();

        while (!shell.isDisposed()) {
            if (!display.readAndDispatch()) {
                display.sleep();
            }
        }
        display.dispose();
    }

    /*
     * (non-Javadoc)
     
     * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
     */
    public void widgetSelected(SelectionEvent item) {
        if (item.getSource() instanceof MenuItem) {
            MenuItem menuItem = (MenuItemitem.getSource();
            //System.out.println(menuItem.getText());
            if ("フォルダーの追加".equals(menuItem.getText())) {
                doAddFolder();
            else if ("フォルダー以下を追加".equals(menuItem.getText())) {
                doAddMultiFolder();
            else if ("選択項目を削除".equals(menuItem.getText())) {
                doDeleteFolder();
            }else if ("すべての項目を削除".equals(menuItem.getText())) {
                doDeleteAll();
            }
            
            
            
            
        else if (item.getSource() instanceof Button) {
            Button bt = (Buttonitem.getSource();
            if (bt.getText().equals("比べる")) {
                doCheck();
            else if (bt.getText().equals("選択")) {
                doSetRoot();
            }
            else if (bt.getText().equals("再読み込み")) {
                doRefresh();
            }
            
        else if (item.getSource() instanceof TabFolder) {

            TabFolder tab = (TabFolderitem.getSource();
            int index = tab.getSelectionIndex();
            if (index == 1) {
                showResult();
            }
        }
    }

    /**
     *  
     */
    private void showResult() {

        TableItem items[] = table.getSelection();

        resultTable.removeAll();
        if (items.length > 0) {
            resultLabel.setText(items[0].getText());
           // System.out.println(items[0].getText());
            Error[] errors = (Error[]) errorHash.get(items[0].getText());
            resultLabel.redraw();
            if (errors != null && errors.length > 0) {
                for (int i = 0; i < errors.length; i++) {
                    TableItem ti = new TableItem(resultTable, SWT.NULL);
                    if (errors[i].getType() == Error.MD5) {
                        ti.setText("内容が違います:" + errors[i].getPath());
                    else if (errors[i].getType() == Error.NOT_FOUND_DEST) {
                        ti.setText("ファイルがありません:" + errors[i].getPath());
                    }
                }
            }
        else {
            resultLabel.setText("");
        }

    }

    

    /**
     *  
     */
    private void doCheck() {
        TableItem items[] = table.getItems();
        for (int i = 0; i < items.length; i++) {
            checkFolder(items[i]);
        }
        //shell.redraw();
    }

    /*
     * (non-Javadoc)
     
     * @see org.eclipse.swt.events.SelectionListener#widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent)
     */
    public void widgetDefaultSelected(SelectionEvent arg0) {

    }

}